Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Priyanka Dhingra
Web Content in custom Portlet
17. April 2012 21:01
Antwort

Priyanka Dhingra

Rang: Liferay Master

Nachrichten: 501

Eintrittsdatum: 19. Dezember 2011

Neue Beiträge

When my custom portlet is displaying the web content using the following code

JournalArticle article = JournalArticleLocalServiceUtil
.getArticle(themeDisplay.getScopeGroupId(), articleId);
content = article.getContentByLocale(themeDisplay
.getLanguageId());
it is appending
]]>


Can anybody help , and reason for this appending, plus removing this.
Thanks and regards
Priyanka
Prashant Deshpande
RE: Web Content in custom Portlet
18. April 2012 00:10
Antwort

Prashant Deshpande

Rang: New Member

Nachrichten: 17

Eintrittsdatum: 17. Juni 2010

Neue Beiträge

Files are added to database in
Method "updateFileEntry" of "com.liferay.portlet.documentlibrary.action.EditFileEntryAction".

As following
fileEntry = DLAppServiceUtil.addFileEntry(
repositoryId, folderId, sourceFileName, contentType, title,
description, changeLog, inputStream, size, serviceContext);

So, Try to update same file object set its extension and mime/type using
fileEntry is object of type "com.liferay.portlet.documentlibrary.model.DLFileEntry"

setExtension(String extension);
setMimeType(String mimeType);

update entry using "com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil" update method
Roshan Qureshi
RE: Web Content in custom Portlet
18. April 2012 00:40
Antwort

Roshan Qureshi

Rang: Regular Member

Nachrichten: 144

Eintrittsdatum: 24. August 2010

Neue Beiträge

Can you put jsp code here which is used to display this.
Priyanka Dhingra
RE: Web Content in custom Portlet
18. April 2012 02:58
Antwort

Priyanka Dhingra

Rang: Liferay Master

Nachrichten: 501

Eintrittsdatum: 19. Dezember 2011

Neue Beiträge

Hi,
update entry using "com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil" update method

I am not using this for Document Library or any mime content, just wanted WEB CONTENT.

and thanks for replying...

@Roshan this code is in my view.JSP only besides this i used
1<%=content%>

ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest
.getAttribute(com.liferay.portal.kernel.util.WebKeys.THEME_DISPLAY);
and gave articleId as some constant according to my web content
to display the content.

Thanks
-Priyanka
Amit Doshi
RE: Web Content in custom Portlet
19. April 2012 03:00
Antwort

Amit Doshi

Rang: Liferay Master

Nachrichten: 549

Eintrittsdatum: 29. Dezember 2010

Neue Beiträge

Hi Priyanka,

I am doing the same thing in theme and it is working fine for me.

Here is the code for the same.

you can change it according to your requirement in the Class Format.

1
2#set ($footerContactInfoURLTitle = "contact-info-in-footer")
3        #set ($contactInfoArticle = $journalArticleLocalService.getLatestArticleByUrlTitle($themeDisplay.getScopeGroupId(),$footerContactInfoURLTitle, 0))
4        $journalContentUtil.getContent($group_id,$contactInfoArticle.getArticleId() ,null,$locale.toString(),$theme_display)


Hope it helps.

Thanks & Regards,
Amit Doshi
Priyanka Dhingra
RE: Web Content in custom Portlet
19. April 2012 03:29
Antwort

Priyanka Dhingra

Rang: Liferay Master

Nachrichten: 501

Eintrittsdatum: 19. Dezember 2011

Neue Beiträge

using the <liferay-ui:journal:article> i am able to solve this
Thanks & Regards
-Priyanka