An error occurred while processing the template.
Java method "com.sun.proxy.$Proxy1067.getArticle(long, String)" threw an exception when invoked on com.sun.proxy.$Proxy1067 object "com.liferay.journal.service.impl.JournalArticleLocalServiceImpl@54f8ed0"; see cause exception in the Java stack trace.
----
FTL stack trace ("~" means nesting-related):
- Failed at: #assign article = journalArticleLocal... [in template "20098#20124#40929" at line 70, column 1]
----
1<#-- instanceId -->
2<#assign instanceId = themeDisplay.getPortletDisplay().getId()?keep_after("INSTANCE_") />
3
4<#-- labels -->
5<#assign label_attachments = languageUtil.get(locale, "label_attachments") />
6<#assign label_see_image = languageUtil.get(locale, "label_see_image") />
7<#assign label_go_to_the_page = languageUtil.get(locale, "label_go_to_the_page") />
8<#assign label_download_attachment = languageUtil.get(locale, "label_download_attachment") />
9
10
11<#-- Service for taking Journal Article Data -->
12<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
13<#-- Service for taking object layout -->
14<#assign layoutLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService") />
15<#-- Service for taking category -->
16<#assign catLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") />
17
18<#assign dlFileEntryService = serviceLocator.findService('com.liferay.document.library.kernel.service.DLFileEntryLocalService') />
19<#assign dlAppService = serviceLocator.findService('com.liferay.document.library.kernel.service.DLAppService') />
20
21<#-- Function for escaping extra character -->
22<#function escapeExtraChar text>
23 <#return text?replace("\"",""", "r")?replace("'","’", "r")>
24</#function>
25
26<#-- Check if list have at least on element -->
27<#function atLeastOneElement list>
28 <#assign isNotEmpty = false />
29 <#if list?? && list?has_content && list.getSiblings()?has_content>
30 <#list list.getSiblings() as cur_elem>
31 <#if validator.isNotNull(cur_elem) && validator.isNotNull(cur_elem.getData()) && cur_elem.getData() != "{}">
32 <#assign isNotEmpty = true />
33 <#break>
34 </#if>
35 </#list>
36 </#if>
37 <#return isNotEmpty>
38</#function>
39<#function atLeastOneElementAtAttachmentFieldGroup list>
40 <#assign isNotEmpty = false />
41 <#if list?? && list?has_content && list.getSiblings()?has_content>
42 <#list list.getSiblings() as cur_elem>
43 <#if validator.isNotNull(cur_elem.attachment_file) && validator.isNotNull(cur_elem.attachment_file.getData()) && cur_elem.attachment_file.getData() != "{}">
44 <#assign isNotEmpty = true />
45 <#break>
46 </#if>
47 </#list>
48 </#if>
49 <#return isNotEmpty>
50</#function>
51
52<#-- Taking the label of radio button-->
53<#function getOptionLabel ddmStructure fieldSelectName optionValue>
54 <#assign optionLabel = "" />
55 <#if ddmStructure.getDDMFormField(fieldSelectName).getDDMFormFieldOptions().getOptionLabels(optionValue)??>
56 <#assign optionLabel = ddmStructure.getDDMFormField(fieldSelectName).getDDMFormFieldOptions().getOptionLabels(optionValue).getString(locale) />
57 </#if>
58 <#return optionLabel />
59</#function>
60<#-- Taking the label of checkbox -->
61<#function getCheckboxLabel ddmStructure fieldCheckboxName>
62 <#return ddmStructure.getDDMFormField(fieldCheckboxName).getLabel().getString(locale)/>
63</#function>
64<#-- Taking the label of field -->
65<#function getFieldLabel ddmStructure fieldName>
66 <#return ddmStructure.getDDMFormField(fieldName).getLabel().getString(locale)/>
67</#function>
68
69<#-- Other data associated with the item that I obtain via API -->
70<#assign article = journalArticleLocalService.getArticle( groupId, articleId ) />
71
72<#-- Article last modification date -->
73<#assign articleModifiedDateObj = article.getModifiedDate() />
74<#-- Format last modification date -->
75<#if validator.isNotNull(articleModifiedDateObj)>
76 <#assign articleModifiedDate = dateUtil.getDate(articleModifiedDateObj, "dd/MM/yyyy, hh:mm", locale) />
77</#if>
78<#-- Url Title journal article -->
79<#assign articleUrlTitle = article.getUrlTitle() />
80<#-- Primary key journal article -->
81<#assign articlePrimKey = article.resourcePrimKey/>
82<#-- Structure journal article -->
83<#assign articleStructure = article.getDDMStructure() />
84
85<#-- Functions to obtain a list of categories -->
86<#-- If the indicated character is the category prefix, it indicates that the category must not be shown on the screen, but is only used for functional purposes -->
87<#assign PREFIX_SERVICE_CATEGORY = "_" />
88<#-- I get all the categories associated with an article except those that have a prefix "_" -->
89<#function getCategoryByArticlePrimKey articlePrimKey>
90 <#assign tmp = "" />
91 <#assign articleCatNames = catLocalService.getCategories("com.liferay.journal.model.JournalArticle", getterUtil.getLong(articlePrimKey)) />
92 <#if (articleCatNames?size > 0)>
93 <#list articleCatNames as category>
94 <#if category.name?substring(0,1) != PREFIX_SERVICE_CATEGORY >
95 <#assign tmp = tmp + category.name + ", " />
96 </#if>
97 </#list>
98 <#assign tmp = tmp?keep_before_last(",") />
99 </#if>
100 <#return tmp>
101</#function>
102<#-- Variant: Returns only the list of category objects -->
103<#function getListCategoryByArticlePrimKey articlePrimKey>
104 <#assign listCategories = [] />
105 <#assign articleCat = catLocalService.getCategories("com.liferay.journal.model.JournalArticle", getterUtil.getLong(articlePrimKey)) />
106 <#if (articleCat?size > 0)>
107 <#list articleCat as category>
108 <#if category.name?substring(0,1) != PREFIX_SERVICE_CATEGORY >
109 <#assign listCategories = listCategories + [category] />
110 </#if>
111 </#list>
112 </#if>
113 <#return listCategories>
114</#function>
115
116<#-- html -->
117<section class="project-and-document-detail" vocab="https://schema.org/" typeof="WebAPI">
118 <div class="container mb-5">
119 <div class="col-12">
120 <div class="row d-block">
121 <#if (image.getData())?? && image.getData() != "">
122 <div class="article-image float-left mr-4 mb-3" style="width:220px;">
123 <a href="${image.getData()}" data-toggle="lightbox" data-type="image" title="${label_see_image}" aria-label="${label_see_image}">
124 <img alt="${image.getAttribute("alt")}" data-fileentryid="${image.getAttribute("fileEntryId")}" src="${image.getData()}" class="object-fit-cover w-100 h-100">
125 </a>
126 <p>${image.getAttribute("alt")}</p>
127 </div>
128 </#if>
129 <#if (description.getData())??>
130 <div class="text-justify" property="description">${description.getData()}<div>
131 </#if>
132 </div>
133 <#if atLeastOneElementAtAttachmentFieldGroup(attachment)>
134 <div class="row">
135 <div class="col-12">
136 <h3 class="font-weight-bold mb-4 mt-3">${label_attachments}</h3>
137 </div>
138 <div class="col-12 ml-5">
139 <#list attachment.getSiblings() as cur_attachment>
140 <div class="row mb-3">
141 <#if validator.isNotNull(cur_attachment.attachment_file) && validator.isNotNull(cur_attachment.attachment_file.getData())>
142 <a property="documentation" href="${cur_attachment.attachment_file.getData()}" class="text-body d-flex" title="${label_download_attachment}" aria-label="${label_download_attachment}">
143 <i class="icon-file-alt text-body mr-2 text-decoration-none pt-1"></i>
144 <div>
145 <p class="font-weight-semi-bold mb-1">
146 <#assign cur_attachmentJson = jsonFactoryUtil.createJSONObject(cur_attachment.attachment_file) />
147 <#assign cur_attachmentDataJson = jsonFactoryUtil.createJSONObject(cur_attachmentJson.data) />
148 ${cur_attachmentDataJson.title?keep_before("." + cur_attachmentDataJson.extension?string)}
149 </p>
150 <#if validator.isNotNull(cur_attachment.attachment_description) && validator.isNotNull(cur_attachment.attachment_description.getData())>
151 <span>${cur_attachment.attachment_description.getData()}</span>
152 </#if>
153 </div>
154 </a>
155 </#if>
156 </div>
157 </#list>
158 </div>
159 </div>
160 </#if>
161 <#if atLeastOneElement(linkToInternalPage) || atLeastOneElement(linkToExternalPage)>
162 <div class="row">
163 <div class="col-12">
164 <h3 class="font-weight-bold mb-4 mt-3">Link</h3>
165 </div>
166 <div class="col-12 ml-5">
167 <#if atLeastOneElement(linkToInternalPage) >
168 <#list linkToInternalPage.getSiblings() as cur_linkToInternalPage>
169 <#if validator.isNotNull(cur_linkToInternalPage) && validator.isNotNull(cur_linkToInternalPage.getData()) && cur_linkToInternalPage.getData() != "{}">
170 <div class="row mb-3">
171 <#assign cur_linkToInternalPageJson = jsonFactoryUtil.createJSONObject(cur_linkToInternalPage) />
172 <#assign cur_linkToInternalPageDataJson = jsonFactoryUtil.createJSONObject(cur_linkToInternalPageJson.data) />
173 <a data-senna-off="true" href="${cur_linkToInternalPage.getFriendlyUrl()}" class="text-body" title="${label_go_to_the_page}" aria-label="${label_go_to_the_page}">
174 <p><i class="icon-link text-body mr-1 text-decoration-none"></i>
175 ${cur_linkToInternalPageDataJson.title}
176 </p>
177 </a>
178 </div>
179 </#if>
180 </#list>
181 </#if>
182 <#if atLeastOneElement(linkToExternalPage)>
183 <#list linkToExternalPage.getSiblings() as cur_linkToExternalPage>
184 <#if (cur_linkToExternalPage.getData())??>
185 <div class="row mb-3 text-body">
186 <i class="icon-link text-body mr-2 text-decoration-none"></i>
187 ${cur_linkToExternalPage.getData()}
188 </div>
189 </#if>
190 </#list>
191 </#if>
192 </div>
193 </div>
194 </#if>
195 </div>
196 </div>
197</section>
198
199<script type="text/javascript">
200 $(document).off("click", '[data-toggle="lightbox"]').on("click", '[data-toggle="lightbox"]', function(event) {
201 event.preventDefault();
202 $(this).ekkoLightbox();
203 });
204</script>