掲示板

Duplicate JournalArticle

11年前 に Maximiliano Chiesa によって更新されました。

Duplicate JournalArticle

Junior Member 投稿: 47 参加年月日: 12/07/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
11年前 に Harish Kumar によって更新されました。

RE: Duplicate JournalArticle

Expert 投稿: 483 参加年月日: 10/07/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