【发布时间】:2014-06-10 13:14:51
【问题描述】:
我正在尝试将类别添加到新创建的文章中。我的代码在这里:
ServiceContext serviceContext = ServiceContextFactory.getInstance(
JournalArticle.class.getName(),
actionRequest
);
article = JournalArticleLocalServiceUtil.addArticle(
ImporterConstants.IMPORTER_ID,
ImporterConstants.GROUP_ID,
ImporterConstants.DOC_FOLDER_ID,
titleMap,
descMap,
content,
structureID,
templateID,
serviceContext
);
AssetEntry ae = AssetEntryLocalServiceUtil.fetchEntry(
JournalArticle.class.getName(),
article.getResourcePrimKey()
); //returns AssetEntry
AssetEntryLocalServiceUtil.addAssetCategoryAssetEntry(48183, ae);
文章创建没有问题,但是当我尝试调用时
AssetEntryLocalServiceUtil.addAssetCategoryAssetEntry(48183, ae)
或
AssetCategoryLocalServiceUtil.addAssetEntryAssetCategory(ae.getEntryId(), 48183)
它不会带来任何结果,并且表assetentries_assetcategories 没有任何变化。编号 48183 是 categoryidfrom 表 `assetcategory。
你能告诉我哪里有问题吗? PS:我使用的是Liferay Portal Community Edition 6.2.0 CE GA1
谢谢
【问题讨论】:
标签: liferay-6