Foren

Portlet creation

thumbnail
Charu Babbar, geändert vor 12 Jahren.

Portlet creation

Regular Member Beiträge: 167 Beitrittsdatum: 13.09.11 Neueste Beiträge
Hi,

I am making one portlet then In this portlet view.jsp, I wants to include journal_content (view.jsp) in it. and wants to use the article.getTitle() method of this jsp in new portlet view.jsp. How Can I do this.
thumbnail
Ravi Kumar Gupta, geändert vor 12 Jahren.

RE: Portlet creation

Liferay Legend Beiträge: 1302 Beitrittsdatum: 24.06.09 Neueste Beiträge
Actually view.jsp of new portlet can try accessing the classes/methods as they are used in journal_content.. import proper classes and you should be able to do it.
thumbnail
Sagar A Vyas, geändert vor 12 Jahren.

RE: Portlet creation

Liferay Master Beiträge: 679 Beitrittsdatum: 17.04.09 Neueste Beiträge
Charu Babbar:
Hi,

I am making one portlet then In this portlet view.jsp, I wants to include journal_content (view.jsp) in it. and wants to use the article.getTitle() method of this jsp in new portlet view.jsp. How Can I do this.


Hi Charu,

If you want content in you jsp page then you can do something like below.


JournalArticle article = JournalArticleLocalServiceUtil.getLatestArticleByUrlTitle(themeDisplay.getScopeGroupId(),"content-name", 0);

String content = JournalContentUtil.getContent(group_id,article.getArticleId() ,null,locale.toString(),theme_display)


"content-name" = in this case you need to give web content name here which you can put on any property file to make it more dynamic.

Note :
Dont forgot to import respective class in your jsp ;)

Hope this help emoticon

Thanks,
Sagar Vyas