Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
nicolas saubi
velocity theme and journalArticle recovery
October 28, 2009 1:12 AM
Answer

nicolas saubi

Rank: Junior Member

Posts: 43

Join Date: October 28, 2009

Recent Posts

Version : Liferay 5.2.3

Hello there,

I'm trying to get a
1JournalArticle
from my
1portal_normal.vm
as follows :


 1
 2#set($groupUtil = $serviceLocator.findService("com.liferay.portal.service.GroupLocalServiceUtil"))
 3
 4## recover from liferay-look-and-feel.xml the "communaute" parameter
 5#set($footerGroup = $groupUtil.getGroup($company_id, $theme_settings.getProperty("communaute")))
 6
 7#set($footerGroupID_Long = $footerGroup.getGroupId())
 8
 9## recover from liferay-look-and-feel.xml the ID of the JournalArcticle we want to display
10#set($journalArticleId_String = $theme_settings.getProperty("article-id"))
11
12#set($myJournalArticle_JA = $contentUtil.getLatestArticle($footerGroupID_Long,$journalArticleId_String))
13#set($myJournalArticleContent_String = $myJournalArticle_JA.getContent())
14$myJournalArticleContent_String


Fact is nothing appears and no errors in logs. It seems $myJournalArticleContent_String is just empty, when the article has been created and approved in the liferay portal. We can display it using a Journal portlet, but not with this part of code, don't know why.



If you have any explanations, feel free to help emoticon
Thanks
Wilson Man
RE: velocity theme and journalArticle recovery
October 28, 2009 3:55 PM
Answer

Wilson Man

LIFERAY STAFF

Rank: Liferay Master

Posts: 580

Join Date: June 21, 2006

Recent Posts

you may want to print out all your variables and see which one isn't valid.

also, I don't think contentUtil is available to you. You may want to try $journalContentUtil
Archi Madhu
RE: velocity theme and journalArticle recovery
June 30, 2010 12:33 AM
Answer

Archi Madhu

Rank: Regular Member

Posts: 240

Join Date: March 24, 2008

Recent Posts

Hi Nicolas,

This might help you

http://www.liferay.com/community/forums/-/message_boards/message/1324019/maximized?p_p_auth=txRLEBZ7



Cheers,
Archi