Outras atualidades - ecompras
An error occurred while processing the template.
Java method "com.liferay.portal.json.JSONFactoryImpl.createJSONObject(String)" threw an exception when invoked on com.liferay.portal.json.JSONFactoryImpl object "com.liferay.portal.json.JSONFactoryImpl@329df838"; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: jsonDataDocument = jsonFactoryUtil.cr... [in template "20099#20135#1954068" in macro "asset_entries_include" at line 26, column 7] - Reached through: #assign-container [in template "20099#20135#1954068" in macro "asset_entries_include" at line 5, column 5] - Reached through: @asset_entries_include assetEntryCont... [in template "20099#20135#1954068" at line 57, column 7] ----
1</a>
2<div class="mf-noticias mf-noticias__outras-publicacoes">
3
4 <#macro asset_entries_include assetEntryContext>
5 <#assign
6
7 <#-- Needed in order to get the url -->
8 dlAppService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppService")
9 dlUtil = serviceLocator.findService("com.liferay.document.library.kernel.util.DLUtil")
10
11 <#-- Get access to the journal article context and content -->
12 renderer = assetEntryContext.getAssetRenderer()
13 journalArticle = renderer.getArticle()
14 document = saxReaderUtil.read(journalArticle.getContent())
15 rootElement = document.getRootElement()
16
17 <#-- Get custom web content structure fields -->
18 xPathSelectorDocument = saxReaderUtil.createXPath("dynamic-element[@name='documentoNoticia']")
19 documentSrc = xPathSelectorDocument.selectSingleNode(rootElement)
20
21 <#-- Get custom web content structure fields -->
22 xPathSelectorImage = saxReaderUtil.createXPath("dynamic-element[@name='imagemNoticia']")
23 imageSrc = xPathSelectorImage.selectSingleNode(rootElement)
24
25 <#-- Get groupId and uuid -->
26 jsonDataDocument = jsonFactoryUtil.createJSONObject(documentSrc.getStringValue())
27 documentGroupId = getterUtil.getInteger(jsonDataDocument.get('groupId'))
28 documentUuid = getterUtil.getString(jsonDataDocument.get('uuid'))
29
30 <#-- Get fileEntryId from the document -->
31 dlFileEntryUtil = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService")
32 documentFileEntry = dlFileEntryUtil.getDLFileEntryByUuidAndGroupId(documentUuid,documentGroupId)
33 documentFileEntryId = documentFileEntry.getFileEntryId()
34
35 <#-- Get entry categories list-->
36 entryCategories = assetEntryContext.getCategories()
37
38 <#-- Get Vocabulary Service-->
39 assetVocabularyService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")
40
41 />
42
43
44
45 <#-- To get the context of viewUrl in order to open on configured content display page -->
46 <#assign viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, assetEntryContext) />
47
48 <#if assetLinkBehavior != "showFullContent">
49 <#assign viewURL = renderer.getURLViewInContext(renderRequest, renderResponse, viewURL) />
50 </#if>
51
52 </#macro>
53
54 <#if entries?has_content>
55 <#list entries as curEntry>
56
57 <@asset_entries_include assetEntryContext=curEntry />
58
59 <div class="mf-noticias__item mf-noticias__item--list bottom-gap">
60 <div class="row">
61 <div class="col-md-12">
62 <div class="row">
63 <div class="col-md-12">
64 <span class="mf-noticias__category bottom-gap">
65
66
67 <#list entryCategories as category>
68 <#assign vocabulary = assetVocabularyService.getVocabulary(category.vocabularyId) />
69
70 <#if vocabulary.getTitle(locale) == "Categorias da Página de Início" >
71 ${category.getTitle(locale)}
72 </#if>
73 </#list>
74 </span>
75 </div>
76 <#-- Create urlDocument -->
77 <#if documentFileEntryId?? && documentFileEntryId!=0>
78 <#assign
79 documentFileEntry = dlAppService.getFileEntry(documentFileEntryId)
80
81 <#-- Download url -->
82 urlDocument = dlUtil.getDownloadURL(documentFileEntry, documentFileEntry.getFileVersion(), themeDisplay, null)
83
84 <#-- Preview url -->
85 urlDocumentPreview = dlUtil.getPreviewURL(documentFileEntry, documentFileEntry.getFileVersion(), themeDisplay, "")
86 />
87 <#else>
88 <#assign urlDocument = "#">
89 </#if>
90 <div class="col-md-12">
91 <a href="${urlDocumentPreview}" target="_blank" class="mf-link mf-color--gray">
92 <p class="mf-noticias__text mf-noticias__text--normal">
93 ${curEntry.getTitle(locale)} <i class="fa icon-file-alt"></i>
94 </p>
95 </a>
96 </div>
97 </div>
98 </div>
99 </div>
100 </div>
101
102 </#list>
103 </#if>
104
105
106
107</div>
— 20 Items per Page