4

我正在使用 Liferay 5,并开发了一个列出一些文章的 portlet(使用JournalArticle该类)。问题是我无法获得文章的类别。

我知道 Liferay 6 可以做到这一点,但我可以在版本 5 中做到这一点吗?

4

1 回答 1

1

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);
于 2012-01-02T14:26:41.013 回答