掲示板

Getting all users reporting to a manager

11年前 に Gaurav Sharma によって更新されました。

Getting all users reporting to a manager

Junior Member 投稿: 39 参加年月日: 12/11/01 最新の投稿
I've created a tree hierarchy of users by using the "Organization" feature of Liferay CE. So, there is a "Company "org. under which there is a "Sales Team" org. Under that, there is a "Sales Managers" org. There is a user assigned to the "Sales Managers" org. Under the "Sales Managers" org., there is a "Salesmen" org. and that has users assigned as well.

So, to summarize:

Company->Sales->Sales Managers->Salesmen

I'd like to display all "salesmen" when the "Sales Manager" logs in. What would be the best way to do this?
thumbnail
11年前 に Barrie Selack によって更新されました。

RE: Getting all users reporting to a manager (回答)

New Member 投稿: 3 参加年月日: 10/06/11 最新の投稿
UserLocalServiceUtil has a method to return all users in an organization.

	/**
	* Returns all the users belonging to the organization.
	*
	* @param organizationId the primary key of the organization
	* @return the users belonging to the organization
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.liferay.portal.model.user> getOrganizationUsers(
		long organizationId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getService().getOrganizationUsers(organizationId);
	}
</com.liferay.portal.model.user>
thumbnail
11年前 に Barrie Selack によって更新されました。

RE: Getting all users reporting to a manager (回答)

New Member 投稿: 3 参加年月日: 10/06/11 最新の投稿
If you want to get the organizations under another organization, you can use

	/**
	* Returns all the organizations belonging to the parent organization.
	*
	* @param companyId the primary key of the organization's company
	* @param parentOrganizationId the primary key of the organization's parent
	organization
	* @return the organizations belonging to the parent organization
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.liferay.portal.model.organization> getOrganizations(
		long companyId, long parentOrganizationId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getService().getOrganizations(companyId, parentOrganizationId);
	}
</com.liferay.portal.model.organization>


in OrganizationLocalServiceUtil