I'm 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's category.
I know that it's possible with Liferay 6, but can I do this in version 5?
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);