掲示板

Get Users with Specific Vocabulary and Category

11年前 に Becas Kostas によって更新されました。

Get Users with Specific Vocabulary and Category

Junior Member 投稿: 28 参加年月日: 12/08/30 最新の投稿
Hey,

I am trying to get all the users that match a specific category in my custom portlet. My implementation till now, is to iterate through the users, get the categories of the user and check if it is matching my filter.

List<user> us = new ArrayList<user>();
	for (User u:users){
		
		List<assetcategory> catu = AssetCategoryLocalServiceUtil.getCategories("com.liferay.portal.model.User",u.getUserId());
		if (catu.contains(cat)){
			us.add(u);
		}
	}
</assetcategory></user></user>


Is there any other method? For example i have tried to create an asset entry query for the users with no success.


AssetEntryQuery aeq = new AssetEntryQuery();
aeq.setClassName("com.portal.model.User");
aeq.setAnyCategoryIds(new long[]{Long.parseLong(categorization)});

List<assetentry> assets = AssetEntryServiceUtil.getEntries(aeq);
</assetentry>


The above always returns an empty list.
9年前 に Sanketh Iyer によって更新されました。

RE: Get Users with Specific Vocabulary and Category

Junior Member 投稿: 25 参加年月日: 12/02/02 最新の投稿
Hi Becas,

I have a similar requirement.
Did you find any solution?

Thanks,
Sanketh