留言板

Duplicate JournalArticle

Maximiliano Chiesa,修改在11 年前。

Duplicate JournalArticle

Junior Member 帖子: 47 加入日期: 12-7-20 最近的帖子
Hi!

I inserted a Journal Article using the Asset Publisher portlet. This JournalArticle has two different categories. The problem that I'm having is that when I retrieve all the JournalArticles from the database this JournalArticle that I inserted is duplicate (different ID, same title and content), so I don't know if when you insert a JournalArticle with two categories it inserts it inserts its two times (one time for each category).

Is this ok or I'm doing something wrong?

This is how I'm getting the Journals from the database:

DynamicQuery query = DynamicQueryFactoryUtil.forClass(JournalArticle.class,PortalClassLoaderUtil.getClassLoader());
List<JournalArticle> assetEntries = JournalArticleLocalServiceUtil.dynamicQuery(query);


Thanks in adavance!
thumbnail
Harish Kumar,修改在11 年前。

RE: Duplicate JournalArticle

Expert 帖子: 483 加入日期: 10-7-31 最近的帖子
Hi Maximiliano

Only one record is created in DB no matter how many categories you are associating with a web content. May be your inserting it in duplicate.
you can assign multiple categories to a web content in one go.

multiple entries are added to assetentries_assetcategories table only to maintain the mapping.

For getting the journal articles you should use JournalArticleLocalServiceUtil class.

HTH