Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
Not Me
Journal Content and Velocity - VM - Template
29 de julio de 2008 9:06
Respuesta

Not Me

Ranking: Junior Member

Mensajes: 90

Fecha de incorporación: 27 de mayo de 2008

Mensajes recientes

Hi guys,

I am trying to get all the articles (for now) using Templates.

I found this two interesting articles in the wiki:
Journal Internal API and
[url=http://www.liferay.com/web/guest/community/wiki/-/wiki/1071674/Journal+Template+(Velocity)]Journal Template (Velocity) but I can't find a way to get all the articles.

I downloaded the bundle, and opened all the Journal Templates of the guest community, but the only one who handle articles were processed using XSL, and not VM.


I tryied to use the following code:
1#set ($targetPortletID = "56")
2#foreach ($article in $articles)
3    #set ($articleUrl = "/web/guest/news/-/journal_content/" + $targetPortletID + "/" + $article.groupId +  "/" + $article.articleId)
4    <h3>$article.title</h3>
5    <span>$article.userName</span>
6    <p>$article.description</p>
7    <a href="${articleUrl}">Read More...</a>
8#end


Does anyone know how to actually set the "$articles" using velocity?

Thanks in advance,
Mariano.
Not Me
RE: Journal Content and Velocity - VM - Template
31 de julio de 2008 15:08
Respuesta

Not Me

Ranking: Junior Member

Mensajes: 90

Fecha de incorporación: 27 de mayo de 2008

Mensajes recientes

Hi guys,

Unfortunately I didn't find the answer, but just in case you are trying to do the same, I encourage you to use the Asset Publisher.

We changed it adding a FriendlyURLMapper and took the advantage of the paging. The paging a feature hard to do with the API provided to use the Journal Template whether you are using VM or XSL as a Language Type.

Hope it helps,

Mariano.
Roberto Tellado
RE: Journal Content and Velocity - VM - Template
15 de febrero de 2010 5:04
Respuesta

Roberto Tellado

Ranking: Regular Member

Mensajes: 244

Fecha de incorporación: 15 de septiembre de 2009

Mensajes recientes

Hi,

You can access to the articles with a services. JournalArticleLocalService.

#set ($longGroupId = $getterUtil.getLong($groupId))
#set ($servieArticles= $serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalServiceUtil"))
#set ($articles = $servieArticles.getXXXXXX())


I hope to help you.

Bye.