Fórum

Get Journal Article by ID Problem

Oriol Mesia, modificado 10 Anos atrás.

Get Journal Article by ID Problem

Junior Member Postagens: 64 Data de Entrada: 04/04/13 Postagens Recentes
Hi,

I have a stupid problem, I don't know how to solve It, hope that someone could help me...

I'm getting all the JA in the view of a portlet I created...

List<JournalArticle> articles = JournalArticleLocalServiceUtil.getArticles();


I make a selection of these articles and I store the Id's of that selected Journal Articles. I store all that JA Id's in a Database.

<aui:select label="<%= segment %>" name="<%= segment %>" multiple="true">
<%
for (int j = 0; j < articles.size(); j++) {
String title = articles.get(j).getTitle();
String idTitle = articles.get(j).getArticleId();


Now I want to read all of these articleIds one by one and retrieve the JA again...

long groupId = themeDisplay.getScopeGroupId();
String jaId = contents[j];
JournalArticle art = JournalArticleLocalServiceUtil.getArticle(groupId, jaId);


It works well but.. I can't get the title and the content of that JA..
art.getTitle();


And Also I don't know now how to get the equivalent AssetEntry.


Does someone knows how I can solve this??


Thank you in advance,
Oriol
thumbnail
Antoine Comble, modificado 10 Anos atrás.

RE: Get Journal Article by ID Problem

Regular Member Postagens: 232 Data de Entrada: 07/09/12 Postagens Recentes
Hi Oriol,

To retrieve assetentry linked to your journal article id :


AssetRendererFactoryRegistryUtil.getAssetRendererFactoryByClassName(JournalArticle.class.getName()).getAssetEntry(JournalArticle.class.getName(), id);


For your other problem, i'm looking for.

Regards,

Antoine
John Carter, modificado 10 Anos atrás.

RE: Get Journal Article by ID Problem

Junior Member Postagens: 53 Data de Entrada: 18/10/12 Postagens Recentes
Oriol Mesia:
Hi,

I have a stupid problem, I don't know how to solve It, hope that someone could help me...

I'm getting all the JA in the view of a portlet I created...

List<JournalArticle> articles = JournalArticleLocalServiceUtil.getArticles();


I make a selection of these articles and I store the Id's of that selected Journal Articles. I store all that JA Id's in a Database.

<aui:select label="<%= segment %>" name="<%= segment %>" multiple="true">
<%
for (int j = 0; j < articles.size(); j++) {
String title = articles.get(j).getTitle();
String idTitle = articles.get(j).getArticleId();


Now I want to read all of these articleIds one by one and retrieve the JA again...

long groupId = themeDisplay.getScopeGroupId();
String jaId = contents[j];
JournalArticle art = JournalArticleLocalServiceUtil.getArticle(groupId, jaId);


It works well but.. I can't get the title and the content of that JA..
art.getTitle();


And Also I don't know now how to get the equivalent AssetEntry.


Does someone knows how I can solve this??


Thank you in advance,
Oriol


Hi Oriol,
If you are working with the LR6.1.X then you have to use locale as the title and content saved in the form of xml on the basis of locale use,

art.getTitle(LocaleUtil.getDefault())
thumbnail
Ramkumar Chandran, modificado 10 Anos atrás.

RE: Get Journal Article by ID Problem

Junior Member Postagens: 28 Data de Entrada: 15/11/11 Postagens Recentes
if do u avoid versioning problem in journal article?

bcoz when i edit a journal article, it is named as 2.0 something like that... so when i retrieve journal article title i will get two or more depends upon number of versions availble in db?