Last active
August 29, 2015 14:14
-
-
Save evaldeslacasa/3975e4a55cc1f67685cc to your computer and use it in GitHub Desktop.
Retrieve Web Content article in HTML - Liferay 6.1.1 CE. To retrieve the HTML of a web content added in the Site Scope... which is based on a template and structure from Global Scope
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected String retrieveHTMLContent(ThemeDisplay themeDisplay) throws SystemException, PortalException{ | |
String structureId="MY_STRUCTURE_ID"; | |
String templateId = "MY_TEMPLATE_ID"; | |
Company company = CompanyLocalServiceUtil.getCompanyByMx(PropsUtil.get(PropsKeys.COMPANY_DEFAULT_WEB_ID)); | |
long globalGroupId = company.getGroup().getGroupId(); | |
long groupId = themeDisplay.getLayout().getGroupId(); | |
JournalStructure rememberMe = JournalStructureLocalServiceUtil.getStructure(globalGroupId,structureId); | |
JournalArticle rememberMeContent = | |
JournalArticleLocalServiceUtil.getStructureArticles(groupId, structureId).get(0); | |
String articleId = rememberMeContent.getArticleId(); | |
String content = JournalContentUtil. | |
getContent(groupId, articleId, templateId, themeDisplay.getLocale().toString(), themeDisplay); | |
return content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment