Fórumok

Fetching stucture Contents

Ghulam Abbas, módosítva 9 év-val korábban

Fetching stucture Contents

New Member Bejegyzés: 1 Csatlakozás dátuma: 2014.08.26. Legújabb bejegyzések
Hi,

Need help if any one experienced this case, I created a structure and template for contents. Now in my search portlet I have article ID and GroupId and I used JournalLocalServiceUtil to get the contents but Its not returning any content, while it works fine for those contents which are not created using structure.

any one knows how to fetch a structure base content? I am using below code for the now and its its not returning content.


JournalArticle article = JournalArticleServiceUtil.getArticle(groupId,articalId);


Thanks
Abbas
thumbnail
Pankaj Kathiriya, módosítva 9 év-val korábban

RE: Fetching stucture Contents

Liferay Master Bejegyzések: 722 Csatlakozás dátuma: 2010.08.05. Legújabb bejegyzések
When you use structure-template while creating web-content, in order to fetch content you can any of below API method:

JournalArticleLocalServiceUtil.getArticleContent(long groupId,
		java.lang.String articleId, java.lang.String viewMode,
		java.lang.String templateId, java.lang.String languageId,
		com.liferay.portal.theme.ThemeDisplay themeDisplay);

or 

JournalContentUtil.getContent(
		long groupId, String articleId, String templateId, String viewMode,
		String languageId, String xmlRequest) 

JournalContentUtil.getContent(
		long groupId, String articleId, String templateId, String viewMode,
		String languageId, ThemeDisplay themeDisplay)


HTH
thumbnail
Ghulam Shabbir, módosítva 9 év-val korábban

RE: Fetching stucture Contents

New Member Bejegyzések: 21 Csatlakozás dátuma: 2014.02.10. Legújabb bejegyzések
Thanks Pankaj, But this returns the whole content after rendering in the form of string . I need Journal article object in which i can display text and image according to custom design. For example in search if such content appears , I need to show to detail of content on searchDetail jsp where I need the control on Journal article object.

Thanks,
thumbnail
Tanweer Ahmed ., módosítva 1 év-val korábban

RE: Fetching stucture Contents

Expert Bejegyzések: 322 Csatlakozás dátuma: 2010.03.11. Legújabb bejegyzések
Hi Ghulam,

When you use Remote Services API you must have the required permission.

You can try the LocalService version of the code which does not require Permission checks.

JournalArticleLocalServiceUtil.getArticle(groupId, articleId)


Regards,
Tanweer.
thumbnail
Ghulam Abbas, módosítva 9 év-val korábban

RE: Fetching stucture Contents

New Member Bejegyzések: 5 Csatlakozás dátuma: 2014.08.26. Legújabb bejegyzések
Hi Tanveer,


This code works fine with normal contents created with out any custom structure, but it does't return content that was created with some custom structure.

Regards,
Abbas
Virat sen, módosítva 9 év-val korábban

RE: Fetching stucture Contents

Junior Member Bejegyzések: 57 Csatlakozás dátuma: 2013.07.21. Legújabb bejegyzések
Ghulam Abbas:
Hi Tanveer,


This code works fine with normal contents created with out any custom structure, but it does't return content that was created with some custom structure.

Regards,
Abbas



Hi Gulam,

Use a bean to store the value.

And then use that bean(getter methods) to display the data using some UI design(HTML Templates) at per your requirement.

Thanks !!