Foren
Web Content in custom Portlet
Priyanka Dhingra, geändert vor 12 Jahren.
Web Content in custom Portlet
Liferay Master Beiträge: 501 Beitrittsdatum: 20.12.11 Neueste 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
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, geändert vor 12 Jahren.
RE: Web Content in custom Portlet
New Member Beiträge: 16 Beitrittsdatum: 17.06.10 Neueste 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
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
Priyanka Dhingra, geändert vor 12 Jahren.
RE: Web Content in custom Portlet
Liferay Master Beiträge: 501 Beitrittsdatum: 20.12.11 Neueste Beiträge
Hi,
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
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
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
<%=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, geändert vor 12 Jahren.
RE: Web Content in custom Portlet
Liferay Master Beiträge: 550 Beitrittsdatum: 29.12.10 Neueste 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.
Hope it helps.
Thanks & Regards,
Amit Doshi
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.
#set ($footerContactInfoURLTitle = "contact-info-in-footer")
#set ($contactInfoArticle = $journalArticleLocalService.getLatestArticleByUrlTitle($themeDisplay.getScopeGroupId(),$footerContactInfoURLTitle, 0))
$journalContentUtil.getContent($group_id,$contactInfoArticle.getArticleId() ,null,$locale.toString(),$theme_display)
Hope it helps.
Thanks & Regards,
Amit Doshi
Priyanka Dhingra, geändert vor 12 Jahren.
RE: Web Content in custom Portlet
Liferay Master Beiträge: 501 Beitrittsdatum: 20.12.11 Neueste Beiträge
using the <liferay-ui:journal:article> i am able to solve this
Thanks & Regards
-Priyanka
Thanks & Regards
-Priyanka
Roshan Qureshi, geändert vor 12 Jahren.
RE: Web Content in custom Portlet
Regular Member Beiträge: 159 Beitrittsdatum: 24.08.10 Neueste Beiträge
Can you put jsp code here which is used to display this.