2011-12-20 45 views
4

我使用的是Liferay 5,並且我開發了一個列出一些文章的portlet(使用JournalArticle類)。問題是我無法獲得文章的類別。在Liferay中獲取文章的類別5

我知道Liferay 6有可能,但我可以在版本5中做到這一點嗎?

+0

出於興趣,你怎麼做它的Liferay 6? – Jonny 2011-12-21 16:45:41

回答

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); 
相關問題