掲示板

How to get Team User

thumbnail
9年前 に saleem khan によって更新されました。

How to get Team User

Junior Member 投稿: 71 参加年月日: 13/11/16 最新の投稿
Hi,
I am trying to get users associated to the team based on the teamId, I am unable to find any api for it .

Regards,
Saleem Khan
thumbnail
9年前 に Andew Jardine によって更新されました。

RE: How to get Team User

Liferay Legend 投稿: 2416 参加年月日: 10/12/22 最新の投稿
Hi Saleem,

It might be that there is no API for that feature. There are a couple of other options for you though --

1. You could write a dynamic query referencing the Users_Teams table to get the list of users for your team ID, and then joining it with the User_ table to get the details for the user records.

2. You could write a service wrapper hook extending the TeamLocalServiceWrapper class and then provide your own definition that would accomplish the same thing (probably using a dynamic query anyway -- so maybe it's not actually two, but the second is a convenience method for reusability emoticon
thumbnail
9年前 に saleem khan によって更新されました。

RE: How to get Team User

Junior Member 投稿: 71 参加年月日: 13/11/16 最新の投稿
Hi,
Can u put the sample code for the first method
thumbnail
9年前 に Sreeraj AV によって更新されました。

RE: How to get Team User (回答)

Regular Member 投稿: 239 参加年月日: 10/04/27 最新の投稿
Code is already available with Liferay portal.. Refer the following liferay files..

1. \tomcat-6.0.29\webapps\ROOT\html\portlet\communities\edit_team_assignments.jsp
2. \tomcat-6.0.29\webapps\ROOT\html\portlet\enterprise_admin\user_search_results_database.jspf

				LinkedHashMap userParams = new LinkedHashMap();
				userParams.put("usersTeams", team.getTeamId());
				
				List<user> users = UserLocalServiceUtil.search(PortalUtil.getDefaultCompanyId(), null, true, userParams, QueryUtil.ALL_POS, QueryUtil.ALL_POS, new UserFirstNameComparator());
				</user>


saleem khan:
Hi,
Can u put the sample code for the first method
thumbnail
9年前 に saleem khan によって更新されました。

RE: How to get Team User (回答)

Junior Member 投稿: 71 参加年月日: 13/11/16 最新の投稿
Hi,
have tried what u said and its working and one thing is that ,in one place u have put wrong parameter instead of true it should be zero, for me it worked this way
and thanks a lot for the solution
List<user> users = UserLocalServiceUtil.search(PortalUtil.getDefaultCompanyId(), null, 0, userParams, QueryUtil.ALL_POS, QueryUtil.ALL_POS, new UserFirstNameComparator());</user>
thumbnail
9年前 に Sreeraj AV によって更新されました。

RE: How to get Team User

Regular Member 投稿: 239 参加年月日: 10/04/27 最新の投稿
hmm.. emoticon I use LR 6.0 EE, may be your LR version has different parameter set.