Fórum

Get Users with Specific Vocabulary and Category

Becas Kostas, modificado 11 Anos atrás.

Get Users with Specific Vocabulary and Category

Junior Member Postagens: 28 Data de Entrada: 30/08/12 Postagens Recentes
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.
Sanketh Iyer, modificado 9 Anos atrás.

RE: Get Users with Specific Vocabulary and Category

Junior Member Postagens: 25 Data de Entrada: 02/02/12 Postagens Recentes
Hi Becas,

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

Thanks,
Sanketh