Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Daniel Niklas
Get "display page" of Article
June 25, 2012 2:26 PM
Answer

Daniel Niklas

Rank: Junior Member

Posts: 31

Join Date: November 8, 2010

Recent Posts

Hi,

how can i find the attribute "Display Page" of a journal article with the liferay api? My starting point is an AssetEntry.

Thanks in advance.
Daniel
Daniel Niklas
RE: Get "display page" of Article
July 25, 2012 12:11 AM
Answer

Daniel Niklas

Rank: Junior Member

Posts: 31

Join Date: November 8, 2010

Recent Posts

for the sake of completeness:

JournalArticle j = ...;
String displayPageArticle = j.getLayoutUuid();

Example: you can compare to current requested site page:
ThemeDisplay themeDisplay = (ThemeDisplay) request .getAttribute(WebKeys.THEME_DISPLAY);
String layoutUuid = themeDisplay.getLayout().getUuid();
if(layoutUuid.equals(displayPageArticle) {
// do somthing
}

Example: you can uses this within a dynamic query:
Criterion criterion = RestrictionsFactoryUtil.eq("layoutUuid", layoutUuid);

Daniel :-)