Fórumok

Duplicate JournalArticle

Maximiliano Chiesa, módosítva 11 év-val korábban

Duplicate JournalArticle

Junior Member Bejegyzések: 47 Csatlakozás dátuma: 2012.07.20. Legújabb bejegyzések
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, módosítva 11 év-val korábban

RE: Duplicate JournalArticle

Expert Bejegyzések: 483 Csatlakozás dátuma: 2010.07.31. Legújabb bejegyzések
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