Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Abhi Ed
error in fetching articleID of a webcontent
December 21, 2012 8:18 AM
Answer

Abhi Ed

Rank: Regular Member

Posts: 118

Join Date: June 4, 2012

Recent Posts

I am getting error in fetching my article .The same article fetching works in terms_of_use.jsp
In my terms of use jsp I am getting web content by using this code:

<%
long groupID = Long.valueOf(themeDisplay.getScopeGroupId()) ;
String articleID = String.valueOf(JournalArticleLocalServiceUtil.getArticleByUrlTitle(themeDisplay.getScopeGroupId(),"termsandconditionswebcontent").getArticleId());

%>

<liferay-ui:journal-article groupId="<%=groupID%>" articleId="<%= articleID%>" />

But in a java class when I am trying to get the latest version of the web content I am getting the exception



My java code snippet ::::
----------------------------------------------------------------------------------------------------------------------------------------------------------------
long groupID = Long.valueOf(themeDisplay.getScopeGroupId());
String articleID = String.valueOf(JournalArticleLocalServiceUtil.getArticleByUrlTitle(themeDisplay.getScopeGroupId(),"termsandconditionswebcontent").getArticleId());
String versionLatest = Double.toString(JournalArticleLocalServiceUtil.getLatestVersion(groupID, articleID));

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
exception stack trace


No JournalArticle with the key {groupId=10162, urlTitle=termsandconditionswebcontent, status=1}
10:12:09,359 ERROR at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.getLatestArticleByUrlTitle(JournalArticleLocalServiceImpl.java:1344)
10:12:09,359 ERROR at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.getArticleByUrlTitle(JournalArticleLocalServiceImpl.java:778)
...................
.....................
No JournalArticle with the key {groupId=10162, articleId=, status=-1}




Any help people ??

Regrads Abhi
Dhrutika Vyas
RE: error in fetching articleID of a webcontent
December 21, 2012 10:03 AM
Answer

Dhrutika Vyas

Rank: Expert

Posts: 438

Join Date: February 9, 2009

Recent Posts

Hi,

Check that you have article with "termsandconditionswebcontent" exists from control panel.

Also check url title of this content in the database.Because error message says that article doesn't exists.

Regards,
Dhrutika
Abhi Ed
RE: error in fetching articleID of a webcontent
December 23, 2012 10:00 PM
Answer

Abhi Ed

Rank: Regular Member

Posts: 118

Join Date: June 4, 2012

Recent Posts

The article does exist as I am getting it earlier,as I have written in the beginning of my problem statement.

Regards Abhi
Dhrutika Vyas
RE: error in fetching articleID of a webcontent
December 27, 2012 10:25 PM
Answer

Dhrutika Vyas

Rank: Expert

Posts: 438

Join Date: February 9, 2009

Recent Posts

But I asked to cross verify. You can also check article status if it exists.

Regards,
Dhrutika
Abhi Ed
RE: error in fetching articleID of a webcontent
December 28, 2012 1:11 AM
Answer

Abhi Ed

Rank: Regular Member

Posts: 118

Join Date: June 4, 2012

Recent Posts

The problem was with groupID.Its solved.Thanks for ur time.