フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Manish Kumar Jaiswal
how to get structure Name within Templet via velocity
2013/02/12 5:51
答え

Manish Kumar Jaiswal

ランク: Regular Member

投稿: 133

参加年月日: 2008/11/25

最近の投稿

Is there a way to get structure Name within Template via velocity ?

Regards
Manish
Gnaniyar Zubair
RE: how to get structure Name within Templet via velocity
2013/02/12 6:21
答え

Gnaniyar Zubair

ランク: Liferay Master

投稿: 603

参加年月日: 2007/12/19

最近の投稿

You can get it through service locator:

#set ($journalStructureService = $serviceLocator.findService('com.liferay.portlet.journal.service.JournalStructureLocalService'))
James Falkner
RE: how to get structure Name within Templet via velocity
2013/02/12 7:05
答え

James Falkner

LIFERAY STAFF

ランク: Liferay Legend

投稿: 1222

参加年月日: 2010/09/17

最近の投稿

Manish Kumar Jaiswal:
Is there a way to get structure Name within Template via velocity ?

Regards
Manish


This may also work

1#set ($groupId = $getterUtil.getLong($groupId))
2#set ($journalArticleLocalService = $serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService"))
3#set ($journalStructureLocalService = $serviceLocator.findService("com.liferay.portlet.journal.service.JournalStructureLocalService"))
4#set ($curArticle = $journalArticleLocalService.getArticle($groupId, $reserved-article-id.data))
5#set ($curArticleStructure = $journalStructureLocalService.getStructure($groupId, $curArticle.getStructureId()))
6#set ($curArticleStructureName = $curArticleStructure.getName())