Ocorreu um erro no processamento do modelo.
Error on line 256, column 13 in 254#294#65138
DLFileEntryLocalService.getFileEntryByUuidAndGroupId(uuid, GetterUtil.getLong(groupId)) is undefined.
It cannot be assigned to entry
1<#-- Configuration Variables --> 
2<#assign displayTags = false> <#-- Possible values are: true false --> 
3<#-- Template --> 
4 
5<#assign "Subtítulo" = Subtitulo> 
6<#assign "Texto" = Corpo_do_conteudo> 
7 
8<#assign articleTitle = .vars['reserved-article-title'].data> 
9<#assign articleID = .vars['reserved-article-id'].data> 
10<#assign articleVersion = .vars['reserved-article-version'].data> 
11 
12<#if request['theme-display']??> 
13	<#assign themeDisplay = request['theme-display'] > 
14	<#assign layout = themeDisplay['plid'] > 
15	<#assign layoutService = serviceLocator.findService("com.liferay.portal.service.LayoutLocalService") > 
16	<#assign layoutObject = layoutService.getLayout(layout?number) > 
17	 
18	<#assign portalURL = httpUtil.getProtocol(request['attributes']['CURRENT_URL']) + "https://" + getterUtil.getString(request['theme-display']['portal-url']) > 
19	<#assign mainPath = layoutObject.getFriendlyURL(locale) > 
20	<#assign currentBaseURL = portalURL + themeDisplay['path-friendly-url-public'] + layoutObject.getGroup().getFriendlyURL() + mainPath> 
21	 
22	<#assign shareURL = currentBaseURL> 
23	<#if request['attributes']['CURRENT_URL']?contains("/-/journal_content/")> 
24		<#if request['attributes']['CURRENT_URL']?contains("?")> 
25			<#assign shareURL = portalURL + request['attributes']['CURRENT_URL']?split("?")[0]> 
26		<#else> 
27			<#assign shareURL = portalURL + request['attributes']['CURRENT_URL']> 
28		</#if> 
29	</#if> 
30</#if> 
31 
32<#assign hasAnexo = Anexo?? && Anexo.getSiblings()?has_content && Anexo.getSiblings()[0].getData()?has_content> 
33<#assign hasLink = Link?? && Link.getSiblings()?has_content && Link.getSiblings()[0].getData()?has_content> 
34 
35<#assign seccaoDefault = "Relacionados"> 
36<#--  
37<#assign seccoes = ["Relacionados", "Legislação", "Perguntas frequentes"]> 
38--> 
39<#assign seccoes = ["Destaques", "Acesso rápido", "Relacionados", "Legislação", "Perguntas frequentes"]> 
40 
41<#assign LanguageUtil = staticUtil["com.liferay.portal.kernel.language.LanguageUtil"]/> 
42<#assign RelacionadosLabel = LanguageUtil.get(locale, 'seccao.relacionados')> 
43<#assign RelacionadosLabel = LanguageUtil.get(locale, 'documents')> 
44<#assign DestaquesLabel = LanguageUtil.get(locale, 'seccao.destaques')> 
45<#assign LegislacaoLabel = LanguageUtil.get(locale, 'seccao.legislacao')> 
46<#assign PerguntasFrequentesLabel = LanguageUtil.get(locale, 'seccao.perguntas.frequentes')> 
47<#assign AcessoRapidoLabel = LanguageUtil.get(locale, 'seccao.acesso.rapido')> 
48<#assign seccoesLabels = { 
49							"Relacionados": RelacionadosLabel,  
50							"Destaques": DestaquesLabel,  
51							"Acesso rápido": AcessoRapidoLabel,  
52							"Legislação": LegislacaoLabel, 
53							"Perguntas frequentes": PerguntasFrequentesLabel 
54						}> 
55<#if hasAnexo> 
56	<#assign "AnexosRelacionados" = itemsForSectionX(Anexo.getSiblings(), "SecçãoAnexo", "Relacionados", seccoes, true)> 
57	<#assign "AnexosLegislação" = itemsForSectionX(Anexo.getSiblings(), "SecçãoAnexo", "Legislação", seccoes, false)> 
58	<#assign "AnexosPerguntas frequentes" = itemsForSectionX(Anexo.getSiblings(), "SecçãoAnexo", "Perguntas frequentes", seccoes, false)> 
59	<#assign "AnexosDestaques" = itemsForSectionX(Anexo.getSiblings(), "SecçãoAnexo", "Destaques", seccoes, false)> 
60	<#assign "AnexosAcesso rápido" = itemsForSectionX(Anexo.getSiblings(), "SecçãoAnexo", "Acesso rápido", seccoes, false)> 
61</#if> 
62 
63	<#if hasLink> 
64		<#assign "LinksRelacionados" = itemsForSectionX(Link.getSiblings(), "SecçãoLink", "Relacionados", seccoes, false)> 
65		<#assign "LinksLegislação" = itemsForSectionX(Link.getSiblings(), "SecçãoLink", "Legislação", seccoes, false)> 
66		<#assign "LinksPerguntas frequentes" = itemsForSectionX(Link.getSiblings(), "SecçãoLink", "Perguntas frequentes", seccoes, false)> 
67		<#assign "LinksDestaques" = itemsForSectionX(Link.getSiblings(), "SecçãoLink", "Destaques", seccoes, true)> 
68		<#assign "LinksAcesso rápido" = itemsForSectionX(Link.getSiblings(), "SecçãoLink", "Acesso rápido", seccoes, false)> 
69		<#assign "LinksDocumentos" = itemsForSectionX(Link.getSiblings(), "SecçãoLink", "Documentos", seccoes, false)> 
70	</#if> 
71 
72<div class="hide" style="display:none !important; mso-hide:all;"> 
73    <h1 style="color:#ffffff;"> Acessibilidade </h1> 
74    <a href="#titulo"></a> 
75</div> 
76 
77<div class="container-medium inside"> 
78	<article class="article"> 
79		<header class="article-header"> 
80			<h2 id="titulo" class="title">${articleTitle}</h2> 
81			<#if request['theme-display']??> 
82				<div class="actions"> 
83					<a href="javascript:${randomNamespace}printPage();" class="print">Imprimir <div class="fa fa-print" aria-hidden="true"></div></a> 
84					<#if request['theme-display']??> 
85						<#assign portletPreferencesService = serviceLocator.findService("com.liferay.portal.service.PortletPreferencesLocalService") > 
86						<#assign portletPreferencesInLayout = portletPreferencesService.getPortletPreferencesByPlid(layout?number)> 
87						<#assign portletInstanceId = "56_INSTANCE_0000"> 
88						<#list portletPreferencesInLayout as curPortletPreferences> 
89							<#if curPortletPreferences.getPortletId()?starts_with("56")>			 
90								<#assign preferencesXML = saxReaderUtil.read(curPortletPreferences.getPreferences())> 
91								<#if preferencesXML.selectSingleNode("/portlet-preferences/preference[name[text()=\"articleId\"]]/value")??> 
92									<#assign XMLnode = preferencesXML.selectSingleNode("/portlet-preferences/preference[name[text()=\"articleId\"]]/value")> 
93									<#if XMLnode.getText() == articleID> 
94										<#assign portletInstanceId = curPortletPreferences.getPortletId()> 
95										<#break> 
96									</#if> 
97								</#if> 
98							</#if> 
99						</#list> 
100						<script> 
101							function ${randomNamespace}printPage() { 
102									if(window.location.href.indexOf("viewMode=print")>=0){ 
103										window.print(); 
104
105									else{ 
106                                        window.open('${currentBaseURL}/-/journal_content/${portletInstanceId}/${scopeGroupId}/${articleID}?p_p_state=pop_up&_${portletInstanceId}_page=1&_${portletInstanceId}_viewMode=print', '', "directories=0,height=480,left=80,location=1,menubar=1,resizable=1,scrollbars=yes,status=0,toolbar=0,top=180,width=640"); 
107
108
109						</script> 
110					</#if> 
111					<div class="share-inline"> 
112						<#assign fbPageURLToShare = "https://www.facebook.com/sharer/sharer.php"> 
113						<#assign fbPageURLToShare = httpUtil.addParameter(fbPageURLToShare, "u", shareURL)> 
114						<#assign fbPageURLToShare = httpUtil.addParameter(fbPageURLToShare, "title", articleTitle)> 
115						<#assign fbPageURLToShare = httpUtil.addParameter(fbPageURLToShare, "description", "Infarmed")> 
116						<#if hasImagem?? && hasImagem> 
117							<#assign fbPageURLToShare = httpUtil.addParameter(fbPageURLToShare, "picture", portalURL + Imagem.getSiblings()[0].getData())> 
118						<#else> 
119							<#assign fbPageURLToShare = httpUtil.addParameter(fbPageURLToShare, "picture", portalURL + "/infarmed-theme/images/infarmed-coloured.png")> 
120						</#if> 
121						<#assign twitterPageURLToShare = "https://twitter.com/intent/tweet"> 
122						<#assign twitterPageURLToShare = httpUtil.addParameter(twitterPageURLToShare, "text", articleTitle)> 
123						<#assign twitterPageURLToShare = httpUtil.addParameter(twitterPageURLToShare, "url", shareURL)> 
124						 
125						<#assign linkedinPageURLToShare = "https://www.linkedin.com/shareArticle"> 
126						<#assign linkedinPageURLToShare = httpUtil.addParameter(linkedinPageURLToShare, "mini", true)> 
127						<#assign linkedinPageURLToShare = httpUtil.addParameter(linkedinPageURLToShare, "url", shareURL)> 
128						<#assign linkedinPageURLToShare = httpUtil.addParameter(linkedinPageURLToShare, "title", articleTitle)> 
129						<#assign linkedinPageURLToShare = httpUtil.addParameter(linkedinPageURLToShare, "summary", "Infarmed")> 
130						 
131						<#assign emailToURLToShare = "mailto:?subject="> 
132						<#assign emailToURLToShare = emailToURLToShare + httpUtil.encodeURL(articleTitle, true)> <#-- Não seguiu a abordagem anterior porque o encode dos espaços fica com '+' em vez de '%20' -->						 
133						<#assign emailToURLToShare = emailToURLToShare + "&body=" + httpUtil.encodeURL(shareURL, true)> 
134						 
135						<span class="label-text"><@liferay.language key="share" /></span> 
136						<ul> 
137							<li><a href="${fbPageURLToShare}" title="Facebook" target="_blank"><div class="fa fa-facebook"></div></a></li> 
138							<li><a href="${linkedinPageURLToShare}" title="LinkedIn" target="_blank"><div class="fa fa-linkedin"></div></a></li> 
139							<li><a href="${twitterPageURLToShare}" title="Twitter" target="_blank"><div class="fa fa-twitter"></div></a></li> 
140							<li><a href="${emailToURLToShare}" title="E-mail"><div class="fa fa-envelope-o"></div></a></li> 
141						</ul> 
142					</div> 
143				</div> 
144			</#if> 
145		</header> 
146		<div class="article-content"> <#-- class limited to limit the width of the article content--> 
147			<div class="cms-editor"> 
148				<h3>${Subtítulo.getData()}</h3> 
149				<h4><strong>Para:</strong> ${Para.getData()}</h4> 
150				<h4><strong>Tipo de alerta:</strong> ${Tipo_de_alerta.getData()}</h4> 
151				 
152                <#if Contacto?? && Contacto.getSiblings()?has_content && Contacto.getSiblings()[0].getData()?has_content> 
153                    <h4><strong>Contactos</strong></h4> 
154                    <ul style="margin: 1.33em 0;"> 
155                    	<#list Contacto.getSiblings() as cur_Contacto> 
156                    		<#if cur_Contacto?? && cur_Contacto.getData()?has_content> 
157                    			<li>${cur_Contacto.getData()}</li> 
158                    		</#if> 
159                    	</#list> 
160                	</ul> 
161                </#if> 
162                				 
163                <#assign Data_Data = getterUtil.getLong(Data.getData())> 
164                 
165                <#if (Data_Data > 0)> 
166                	<#assign Data_DateObj = dateUtil.newDate(Data_Data)> 
167                 
168                	<h4>${dateUtil.getDate(Data_DateObj, "dd MMM yyyy", locale)?lower_case}</h4> 
169                </#if> 
170				${Texto.getData()} 
171			</div> 
172		</div> 
173	</article> 
174	 
175	<#if displayTags> 
176		<@drawTags/> 
177	</#if> 
178	 
179	<#if hasAnexo || hasLink> 
180		<section class="section "> 
181			<div class="columns-group "> 
182			 
183				<#list seccoes as cur_Seccao> 
184					<#if (.vars["Anexos" + cur_Seccao]?? && .vars["Anexos" + cur_Seccao]?size gt 0) && hasAnexo || (.vars["Links" + cur_Seccao]?? && .vars["Links" + cur_Seccao]?size gt 0) && hasLink> 
185						<div class="column spread-medium "> 
186							<div class="widget "> 
187								<h2 class="title-badge small "> 
188									<span class="inner ">${seccoesLabels[cur_Seccao]}</span> 
189								</h2> 
190								<ul class="list-links "> 
191									<#if .vars["Anexos" + cur_Seccao]?? && hasAnexo> 
192										<#list .vars["Anexos" + cur_Seccao] as cur_Anexo> 
193											<@drawAnexo cur_Anexo/> 
194										</#list> 
195									</#if> 
196									 
197									<#if .vars["Links" + cur_Seccao]?? && hasLink> 
198										<#list .vars["Links" + cur_Seccao] as cur_Link> 
199											<@drawLink cur_Link/> 
200										</#list> 
201									</#if> 
202								</ul> 
203							</div> 
204						</div> 
205					</#if> 
206				</#list>						 
207			</div> 
208		</section>		 
209	</#if> 
210</div> 
211 
212<#function itemsForSectionX items attributeName section allSections isDefaultSection=false> 
213	<#assign returnList = []> 
214	 
215	<#list items as cur_Item> 
216		<#if cur_Item.get(attributeName)??> 
217			<#assign cur_Item_Seccao = cur_Item.get(attributeName).getData()> 
218			<#if section == cur_Item_Seccao> 
219				<#assign returnList = returnList + [cur_Item]> 
220			<#elseif section == seccaoDefault> 
221				<#assign isInAnotherSeccao = false> 
222				<#list allSections as cur_Seccao> 
223					<#if cur_Seccao == cur_Item_Seccao> 
224						<#assign isInAnotherSeccao = true> 
225						<#break> 
226					</#if> 
227				</#list> 
228				<#if !isInAnotherSeccao> 
229					<#assign returnList = returnList + [cur_Item]> 
230				</#if> 
231			</#if> 
232		<#elseif section == seccaoDefault> 
233			<#assign returnList = returnList + [cur_Item]> 
234		</#if> 
235	</#list> 
236 
237	<#return returnList> 
238</#function> 
239 
240<#macro drawAnexo anexo> 
241    <#if !anexo.getData()?starts_with("/documents")> 
242            <li> 
243            <a href="${anexo.getData()}" target="${anexo.getData()}">${anexo.get("Nome_a_apresentar").getData()}</a> 
244        </li> 
245    <#else> 
246    <#assign GetterUtil = staticUtil["com.liferay.portal.kernel.util.GetterUtil"]/> 
247    <#assign DLFileEntryLocalService = serviceLocator.findService("com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService")> 
248	<#if anexo?? && anexo.getData()?has_content && anexo.getData() != ""> 
249	    <#assign docAttrs = anexo.getData()?split("/")> 
250	    <#assign groupId = docAttrs[2]> 
251	    <#if docAttrs[5]?index_of("?") != -1> 
252	        <#assign uuid = docAttrs[5]?substring(0, docAttrs[5]?index_of("?"))> 
253	    <#else> 
254	        <#assign uuid = docAttrs[5]> 
255	    </#if> 
256	    <#assign entry = DLFileEntryLocalService.getFileEntryByUuidAndGroupId(uuid, GetterUtil.getLong(groupId))> 
257	    <!-- <#assign anexoName = entry.getTitle()> --> 
258	    <#assign anexoDesc = entry.getDescription()> 
259		<li> 
260			<a href="${anexo.getData()}" target="_blank"> 
261	    		<#if anexo.get("Nome_a_apresentar")?? && anexo.get("Nome_a_apresentar").getData()?has_content> 
262					${anexo.get("Nome_a_apresentar").getData()} 
263			    <#else> 
264	    		    ${anexoDesc} 
265	    		</#if> 
266			</a> 
267		</li> 
268	</#if> 
269    </#if> 
270</#macro> 
271 
272<#macro drawLink link> 
273	<#assign cur_Link_URL = link.getData()> 
274	<#assign URL_target = ""> 
275	<#if !cur_Link_URL?starts_with("/") && !cur_Link_URL?contains("infarmed.pt")> 
276		<#assign URL_target = "_blank">					 
277	</#if> 
278	<#if !cur_Link_URL?starts_with("/") && !cur_Link_URL?starts_with("http")> 
279		<#assign cur_Link_URL = "http://" + cur_Link_URL> 
280	</#if> 
281 
282    <li> 
283	    <a href="${cur_Link_URL}" target="${URL_target}">${link.get("Nome_do_Link").getData()}</a> 
284	</li> 
285</#macro> 
286 
287<#macro drawTags> 
288	<#if request['theme-display']??> 
289		<#assign journalArticleService = serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService") > 
290		<#assign assetEntryService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetEntryLocalService")> 
291		<#assign assetTagService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetTagLocalService")> 
292		 
293		<#assign journalArticleObject = journalArticleService.fetchArticle(scopeGroupId?number, articleID, articleVersion?number)> 
294 
295		<#assign entryObject = assetEntryService.getEntry("com.liferay.portlet.journal.model.JournalArticle", journalArticleObject.getResourcePrimKey())> 
296		<#assign articleTags = assetTagService.getAssetEntryAssetTags(entryObject.getEntryId())> 
297				 
298		<#if articleTags?has_content> 
299			<section class="section "> 
300				<header class="section-header "> 
301					<h2 class="title "><@liferay.language key="topics" /></h2> 
302				</header> 
303				<div class="section-content "> 
304					<ul id="${randomNamespace}contentTagsList" class="topic-list contentTagsList" style="max-height:6em; overflow-y:hidden; padding-right: 10px;"> 
305						<div id="${randomNamespace}tagsCarret" class="hidden tagsCarret fa fa-caret-down fa-2x" aria-hidden="true"></div> 
306						<#list articleTags as articleTag> 
307							<#assign tagSearchURL = "?p_p_id=3&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_3_struts_action=%2Fsearch%2Fsearch&_3_assetTagNames=" + articleTag.getName()> 
308							<li><a href="${currentBaseURL}${tagSearchURL}" class="button rounded small">${articleTag.getName()}</a></li> 
309						</#list> 
310					</ul> 
311				</div> 
312			</section>		 
313 
314			<script> 
315				$(document).ready(function() { 
316					var contentTags = $("#${randomNamespace}contentTagsList"); 
317					var tagsCarrets = $("#${randomNamespace}tagsCarret"); 
318			 
319					if(contentTags.overflown()) { 
320						tagsCarrets.removeClass("hidden"); 
321
322					 
323					tagsCarrets.click(function(){ 
324						if($(this).hasClass('fa-caret-down')){ 
325							$(this).removeClass('fa-caret-down'); 
326							$(this).addClass('fa-caret-up'); 
327						} else{ 
328							$(this).removeClass('fa-caret-up'); 
329							$(this).addClass('fa-caret-down'); 
330
331						if(this.parentElement.style.maxHeight == 'none' ){ 
332							this.parentElement.style.maxHeight = '6em'; 
333						} else{ 
334							this.parentElement.style.maxHeight = 'none'; 
335
336					}); 
337				}); 
338			</script>			 
339		</#if> 
340	</#if> 
341</#macro>