Getting a category of articles in Liferay 5

I am using Liferay 5, and I developed a portlet that lists some articles (using the JournalArticle class). The problem is that I cannot get the article category.

I know this is possible with Liferay 6, but can I do this in version 5?

+4
source share
1 answer

Liferay 5.2:

 String className = JournalArticle.class.getName(); long classPK = 12345l; // This is the id of your article boolean folksonomy = false; // Use true for retrieving tags, false for retrieving categories List<TagsEntry> categories = TagsEntryLocalServiceUtil.getEntries(className, classPK, false); 

Liferay 6.0:

 List<AssetCategory> categories = AssetCategoryLocalServiceUtil.getCategories(className, classPK); 
+1
source

Source: https://habr.com/ru/post/1387246/


All Articles