COMPARTILHAR
Um erro ocorreu enquanto processava o modelo.
The following has evaluated to null or missing: ==> assetRenderer.getArticle [in template "30648863014451#20119#32863" at line 16, column 46] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign docXml = saxReaderUtil.read(a... [in template "30648863014451#20119#32863" at line 16, column 9] ----
1<#assign AssetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") />
2<#assign JournalFolderLocalService = serviceLocator.findService("com.liferay.journal.service.JournalFolderLocalService") />
3<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
4<#assign LayoutLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService") />
5
6<#assign portletTitle = htmlUtil.escape(portletDisplay.getTitle()) />
7<div class="col-md-9 col-md-offset-1 my-5">
8 <h3 class="portlet-title-text portlet-title-editable mb-4">${layout.getName(locale)}</h3>
9
10 <#if entries?has_content>
11 <ul class="rich-summary adt list-group list-group-flush text-break">
12 <#list entries as curEntry>
13 <#assign entry = AssetEntryLocalService.getEntry(curEntry.getClassName(), curEntry.getClassPK()) />
14 <#assign assetRenderer = entry.getAssetRenderer() />
15 <#assign journalArticle = assetRenderer.getAssetObject() />
16 <#assign docXml = saxReaderUtil.read(assetRenderer.getArticle().getContent()) />
17 <#assign entryTitle = htmlUtil.escape(assetRenderer.getTitle(locale)) />
18 <#assign viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, assetRenderer, entry, true)?keep_before("?redirect=") />
19 <#assign cleanedViewURL = cleanUrl(viewURL?keep_after('content/')?keep_before('?p_r_p_assetEntryId')) />
20 <#assign dateFormat = "dd 'de' MMMM 'de' yyyy" />
21 <#assign displayDate = dateUtil.getDate(journalArticle.getDisplayDate(), dateFormat, locale) />
22 <#assign displayDateLowerCase = displayDate?lower_case />
23 <#assign chamada = docXml.valueOf("//dynamic-element[@field-reference='call']/dynamic-content[@language-id='${locale}']/text()") />
24 <#assign has_image = false />
25 <#if journalArticle.isSmallImage()>
26 <#if journalArticle.getSmallImageURL()?has_content>
27 <#assign capa_url = journalArticle.getSmallImageURL() />
28 <#assign has_image = true />
29 <#else>
30 <#assign capa_url = "/image/journal/article?img_id=" + journalArticle.getSmallImageId() />
31 <#assign has_image = true />
32 </#if>
33 </#if>
34 <li
35 class="list-group-item"
36 data-class-pk="${curEntry.getClassPK()}"
37 data-class-name="${curEntry.getClassName()}"
38 >
39 <div class="row align-items-center">
40 <div class="col">
41 <div class="float-right">
42 <@getEditIcon />
43 </div>
44
45 <h4 class="entry-title">
46 <#if viewURL?contains("asset_publisher")>
47 <#assign contextURL = cleanUrl(viewURL?keep_after('content/')?keep_before('?p_r_p_assetEntryId')) />
48 <#else>
49 <#assign contextURL = viewURL />
50 </#if>
51 <a class="entry-link" href="${contextURL}">${entryTitle}</a>
52 </h4>
53
54 <div class="asset-content">
55 <div class="asset-summary pt-1">
56 <#if chamada?has_content>
57 <p>${chamada}</p>
58 <#else>
59 <#assign docXml = saxReaderUtil.read(journalArticle.getContent()) />
60 <#assign xmlValue = docXml.valueOf("//dynamic-element[@type='rich_text']/dynamic-content[@language-id='${locale}']/text()")?replace('<[^>]+>','','r')?trim />
61 <p>${xmlValue?replace('<[^>]+>', '', 'r')?replace(' ', '', 'r')?truncate_w(137, "")}...</p>
62 </#if>
63 </div>
64 </div>
65 </div>
66 </div>
67 </li>
68 </#list>
69 </ul>
70 <#else>
71 <#if !themeDisplay.isSignedIn()>
72 ${renderRequest.setAttribute("PORTLET_CONFIGURATOR_VISIBILITY", true)}
73 </#if>
74
75 <div class="alert alert-info">
76 <@liferay_ui["message"] key="there-are-no-results" />
77 </div>
78 </#if>
79</div>
80
81<#macro getEditIcon>
82 <#if assetRenderer.hasEditPermission(themeDisplay.getPermissionChecker())>
83 <#assign editPortletURL = assetRenderer.getURLEdit(renderRequest, renderResponse, windowStateFactory.getWindowState("NORMAL"), themeDisplay.getURLCurrent())!"" />
84 <#if validator.isNotNull(editPortletURL)>
85 <#assign title = languageUtil.format(locale, "edit-x", entryTitle, false) />
86 <@liferay_ui["icon"] cssClass="icon-monospaced visible-interaction" icon="pencil" markupView="lexicon" message=title url=editPortletURL.toString() />
87 </#if>
88 </#if>
89</#macro>
90<#function cleanUrl url>
91 <!-- Mapeamento de substituições -->
92 <#assign replacements = {
93 "%C3%A0": "a", "%C3%A1": "a", "%C3%A2": "a", "%C3%A3": "a",
94 "%C3%A7": "c", "%C3%A9": "e", "%C3%AA": "e", "%C3%AD": "i",
95 "%C3%B3": "o", "%C3%B4": "o", "%C3%B5": "o", "%C3%BA": "u",
96 "%C3%BC": "u", "%C3%B1": "n", "%C2%B0": "", "%C2%B4": "",
97 "%E2%80%99": "'", "%E2%80%9C": "\"", "%E2%80%9D": "\"",
98 "%E2%80%93": "-", "%E2%80%94": "--", "´": "",
99 "%C2%B4": "'", "%C2%B8": ""
100 } />
101
102 <!-- Substituições diretas dos caracteres -->
103 <#assign cleanedUrl = url />
104 <#list replacements?keys as key>
105 <#assign cleanedUrl = cleanedUrl?replace(key, replacements[key]) />
106 </#list>
107
108 <!-- Substituição de ponto por hífen -->
109 <#assign cleanedUrl = cleanedUrl?replace(".", "-") />
110
111 <!-- Remover tudo após 'p_r_p' -->
112 <#assign cleanedUrl = cleanedUrl?keep_before('?p_r_p') />
113
114 <!-- Construção da URL final em minúsculas -->
115 <#assign finalUrl = themeDisplay.getURLPortal() + "/" + cleanedUrl?lower_case />
116
117 <#return finalUrl />
118</#function>
— 5 Itens por página