Foros de discusión

No AssetCategoryLocalServiceUtil.getGroupCategory ??

thumbnail
Tom Mahy, modificado hace 12 años.

No AssetCategoryLocalServiceUtil.getGroupCategory ??

Regular Member Mensajes: 103 Fecha de incorporación: 11/05/11 Mensajes recientes
Hi,

Im trying to retrieve all categories attached to a site.

However i cannot find the API for it.

for Tags you can use AssetTagLocalServiceUtil.getGroupTags(groupId),
but this doesnt seem to exist for AssetCategoryLocalServiceUtil.

am i missing something ?

Regards,
Tom Mahy
thumbnail
Thiago Leão Moreira, modificado hace 12 años.

RE: No AssetCategoryLocalServiceUtil.getGroupCategory ??

Liferay Legend Mensajes: 1449 Fecha de incorporación: 10/10/07 Mensajes recientes
This seems to be right in Liferay 6, which version are you working with?
thumbnail
Mayur Patel, modificado hace 12 años.

RE: No AssetCategoryLocalServiceUtil.getGroupCategory ?? (Respuesta)

Expert Mensajes: 358 Fecha de incorporación: 17/11/10 Mensajes recientes
Hi Tom,

yes you are correct, you cant retrieve all categories like AssetCategoryLocalServiceUtil.getGroupCategory ()

you can get groupvocabularies by passing particular vocabulary name and on the basis of that you can get all categories.
AssetVocabulary vocabulary2 = AssetVocabularyLocalServiceUtil.getGroupVocabularies(themeDisplay.getScopeGroupId(), "Topic");

you can refer to this link ,
http://www.liferay.com/community/forums/-/message_boards/message/10618889

Hope this helps

Regards,
Mayur Patel
thumbnail
Tom Mahy, modificado hace 12 años.

RE: No AssetCategoryLocalServiceUtil.getGroupCategory ??

Regular Member Mensajes: 103 Fecha de incorporación: 11/05/11 Mensajes recientes
Ok, thanks.

Since i don't need to filter on topics i decided to write my own service with a custom sql query.

Thank you.
thumbnail
Mayur Patel, modificado hace 12 años.

RE: No AssetCategoryLocalServiceUtil.getGroupCategory ??

Expert Mensajes: 358 Fecha de incorporación: 17/11/10 Mensajes recientes
Hi Tom,

Thanks for your reply and i think its not possible to solve it by using Dynamic query as well,
hoping that your problem will be solved by using custom sql query

Its good, If you can share your feedback when you will solve your problem emoticon

Thanks,
Mayur Patel
thumbnail
Tom Mahy, modificado hace 12 años.

RE: No AssetCategoryLocalServiceUtil.getGroupCategory ??

Regular Member Mensajes: 103 Fecha de incorporación: 11/05/11 Mensajes recientes
Hi,

the query im using is :

SELECT DISTINCT AssetCategory.categoryId, AssetCategory.name, Group_.groupId 
			FROM ((AssetEntry left join Group_ on Group_.classPK = AssetEntry.classPK) left join AssetEntries_AssetCategories on AssetEntry.entryId = AssetEntries_AssetCategories.entryId) left join AssetCategory on AssetCategory.categoryId = AssetEntries_AssetCategories.categoryId  
			WHERE AssetCategory.categoryId IS NOT NULL AND Group_.groupId = ? 


This will return a list of categories links to a groupId, ie the site.


Regards,
Tom mahy