Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
nicolas saubi
velocity theme and journalArticle recovery
28 de octubre de 2009 1:12
Respuesta

nicolas saubi

Ranking: Junior Member

Mensajes: 43

Fecha de incorporación: 28 de octubre de 2009

Mensajes recientes

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
28 de octubre de 2009 15:55
Respuesta

Wilson Man

LIFERAY STAFF

Ranking: Liferay Master

Mensajes: 580

Fecha de incorporación: 21 de junio de 2006

Mensajes recientes

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
30 de junio de 2010 0:33
Respuesta

Archi Madhu

Ranking: Regular Member

Mensajes: 240

Fecha de incorporación: 24 de marzo de 2008

Mensajes recientes

Hi Nicolas,

This might help you

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



Cheers,
Archi