Vés enrere

Politicas publicas inf Inm

S'ha produït un error mentre es processava la plantilla.
Expression dynamicElement.attributeValue("name") is undefined on line 496, column 50 in 20155#20195#199144.
1<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetEntryLocalService") /> 
2<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService") /> 
3<#assign getterUtil = staticUtil["com.liferay.portal.kernel.util.GetterUtil"] /> 
4<#assign article = journalArticleLocalService.getArticle(getterUtil.getLong(groupId),.vars['reserved-article-id'].data)> 
5<#assign entry = assetEntryLocalService.getEntry('com.liferay.portlet.journal.model.JournalArticle', article.resourcePrimKey) > 
6<#assign assetCategoryPropertyLocalService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetCategoryPropertyLocalService")> 
7<#assign layoutLocalService = serviceLocator.findService("com.liferay.portal.service.LayoutLocalService")> 
8 
9<#assign serviceContext = staticUtil["com.liferay.portal.service.ServiceContextThreadLocal"].getServiceContext()> 
10<#assign themeDisplay = serviceContext.getThemeDisplay() /> 
11 
12<#assign assetEntryQueryService = objectUtil('com.liferay.portlet.asset.service.AssetEntryLocalServiceUtil')> 
13 
14 
15<#assign vocabularyIdTemaP = propsUtil.get("vocabulary.tematica.principal")?number /> 
16<#assign vocabularyIdTemaS = propsUtil.get("vocabulary.tematica.secundario")?number /> 
17<#assign vocabularyIdTipoC = propsUtil.get("vocabulary.tipo.contenido")?number /> 
18<#assign vocabularyIdTipoContenidoCategoryE = propsUtil.get("vocabulary.tipo.contenido.category.excluded") /> 
19 
20<#assign categories = entry.getCategories() /> 
21<#assign categoriesPrincipal  = getCategories(categories vocabularyIdTemaP)> 
22<#assign categoriesSecundaria = getCategories(categories vocabularyIdTemaS)> 
23 
24 
25<#assign display=""> 
26	<div class="container-fluid article-content" id="content-wrapper">	 
27		 
28		<#assign  mostar = TITLE.getSiblings()?size> 
29	    <#if TITLE.getSiblings()?has_content &&  mostar != 1>	    	 
30		    <div class="col-md-1 col-sm-1 col-xs-1"> 
31		    	<aside id='scroll-nav' class=" article-aside hidden-sm hidden-xs" style="top: 0px;"><!-- reports --> 
32		    	 
33					<ul class="scroll-list"> 
34						<li class="arrow up"><a href="#section1"><span class="fa fa-angle-up"></span></a></li>						 
35						<#assign lastSection = "1">												 
36						<#list TITLE.getSiblings() as item >	                        	                         
37	                        <li data-toggle="tooltip" data-placement="right" title="" data-original-title='${item.ORDER.getData()}.${item.getData()}' class=""><a href='#section${item.ORDER.getData()}'><span class="fa fa-circle-o"></span></a></li>	                        																 	 
38						 	<#assign lastSection = item.ORDER.getData()> 
39						</#list>						 
40						<li class="arrow down"><a href="#section${lastSection}"><span class="fa fa-angle-down"></span></a></li> 
41					</ul>			 
42				</aside><!-- /article -->			 
43			</div> 
44		</#if> 
45		 
46		<div class="col-md-8 col-sm-12 col-xs-12 cos-article">	 
47				<section class="row article" > 
48					<article class="scroll-nav__section" id="section0"> 
49					 
50						<div class="pos-sup"> 
51							<section class="date-content"> 
52									<span class="posted-on"><time datetime="${MONTH.getData()} ${YEAR.getData()}">${MONTH.getData()} ${YEAR.getData()}</time></span> 
53							</section> 
54							 
55							<#assign pathThemeImage = themeDisplay.getPathThemeImage() />  							 
56							<div class="print-action hidden-sm hidden-xs">						 
57								<span class="">  
58								<a href="javascript:print();" class=" taglib-icon">  
59									<img id="bhfa__column1__0" src="${pathThemeImage}/spacer.png"> 									 
60								</a>  
61								</span> 
62							</div> 
63							 
64						</div> 
65						<div class="titulo-content"> 
66					        	<h1 class="main-h1">${Titulo.getData()}</h1>					        	 
67					    </div> 
68						<#if Subtitol.getData()?has_content > 
69							 <div class="subtitulo-content">								 
70								<h1 class="main-h1">${Subtitol.getData()}</h1> 
71							</div> 
72						</#if> 
73 
74						<#if Autor.getSiblings()?has_content && Autor.getSiblings()[0].getData() != ""> 
75							<section class="autors clean-padding col-md-12 col-sm-12 col-xs-12"> 
76						        <#list Autor.getSiblings() as autor> 
77									<div class="autors-content"> 
78										<div class="autor">								 
79											<#if autor.Descripcio_Autor.getData()?has_content> 
80												${autor.getData()}&#44; ${autor.Descripcio_Autor.getData()} 
81											<#else> 
82												${autor.getData()} 
83											</#if>											 
84										</div> 
85									</div> 
86								</#list> 
87							</section> 
88				        </#if> 
89 
90						<#if DOCUMENT.getData()?has_content > 
91					        <section class="clean-padding col-md-12 col-sm-12 col-xs-12">                 
92								<div class="last-downloads"> 
93					     			<#assign classFile=getButtonStyles(DOCUMENT.getData())> 
94									<#assign targetFile="target=\"_blank\""/>         
95						 			<a ${targetFile} href="${DOCUMENT.getData()}" title="${TITLE.getData()}" class="btn btn-download pushtag-download"> 
96						  				<div class="text"><@liferay.language key="observatoriosocial-download"/></div>         
97						  				<div class="icon fa fa-2x ${classFile}"></div> 
98						   			</a> 
99					   			</div> 
100					         </section>         
101					    </#if>	 
102				         
103				       <#-- PREVIEW --> 
104				       <#if RESUM_PREVI??> 
105				      	<#if getterUtil.getBoolean(RESUM_PREVI.getData())>   							 
106				      		<div class="previ"> 
107					   			<h1 class="titol-previ"> 
108						       	 ${RESUM_PREVI.get("SUBTITULO_PUNTOS_CLAVE").getData()}  
109								</h1> 
110						        				         
111								<div class="microresum-previ"> 
112									${RESUM_PREVI.get("MICRORESUMEN_PUNTOS_CLAVE").getData()}  
113								</div> 
114						         
115								<div class="puntsclau-previ"> 
116						        	<@liferay.language key="observatoriosocial.puntos.clave"/> 
117						        </div>					      				       		 
118						       	<#assign style="col-md-12 col-sm-12 col-xs-12 row"> 
119						        <#if RESUM_PREVI.get("PUNTO_CLAVE_IZQ")?has_content && RESUM_PREVI.get("PUNTO_CLAVE_DER")?has_content> 
120						       	 	<#assign style="col-md-6 col-sm-6 col-xs-12 row"> 
121						       	</#if> 
122						       	<#assign i=1>						       		 	 
123								<#if RESUM_PREVI.get("PUNTO_CLAVE_IZQ")?has_content> 
124								    <ul class="${style}"> 
125								         
126								    <#list RESUM_PREVI.get("PUNTO_CLAVE_IZQ").getSiblings() as izq > 
127								       <li>							        			 
128											<div class="numberCircle">${i}</div>&nbsp;&nbsp; 
129							      			${izq.getData()} 
130							      		</li> 
131							        	<#assign i=i+1> 
132								    </#list> 
133								    </ul> 
134								</#if> 
135								<#if RESUM_PREVI.get("PUNTO_CLAVE_DER")?has_content> 
136								    <ul class="col-md-6 col-sm-6 col-xs-12 row">								         
137								       <#list RESUM_PREVI.get("PUNTO_CLAVE_DER").getSiblings() as der > 
138									        <li>							        			 
139							        			<div class="numberCircle">${i}</div>&nbsp;&nbsp; 
140							        			${der.getData()} 
141							        		</li> 
142							        		 <#assign i=i+1> 
143								        </#list> 
144								    </ul> 
145								</#if>								   
146								<#if RESUM_PREVI.get("TITULO_GRAFICO_ITEM_PREVI")?has_content> 
147								   <#list RESUM_PREVI.get("TITULO_GRAFICO_ITEM_PREVI").getSiblings() as resum > 
148										<div class="col-md-12 col-sm-12 col-xs-12 resum-previ"> 
149									    	<#if resum.get("GRAFICO_ITEM_PREVI")?has_content> 
150									    		<div class="resum-previ-text"> 
151										       		<div class="titol-resum">${resum.getData()}</div>						        		 
152										       	</div>								        
153										       	<div class="resum-previ-imatge"> 
154										       		<img src="${resum.get("GRAFICO_ITEM_PREVI").getData()}" alt="${resum.getData()}"/> 
155										       	</div>								       						        	 
156										       	<div class="text-resum"> 
157										       		${resum.get("TEXTO_GRAFICO_ITEM_PREVI").getData()} 
158										       	</div>	 
159									    	<#else> 
160									    		<div class="resum-previ-text"> 
161									        		<div class="titol-resum">${resum.getData()}</div> 
162									        	</div> 
163									        	<div class="text-resum"> 
164									        		${resum.get("TEXTO_GRAFICO_ITEM_PREVI").getData()} 
165									        	</div>	 
166									    	</#if> 
167									    </div>	 
168									</#list> 
169								</#if> 
170							</div>										         
171							<#-- TODO:: RESTA de camps de previ -->					         
172				    	</article> 
173					</section> 
174			         
175			    	<#--  INICI BOTONS VEURE TOT i VEURE RESUM  --> 
176			    	<#assign mostrarBoton = languageUtil.get(locale, "veure-tot")>		    	 
177			    	<#assign ocultarBoton = languageUtil.get(locale, "veure-resum-previ")>			    	 
178			    	 
179			    	<#if RESUM_PREVI_TEXT_BOTO_MOSTRAR??>			    		 
180				    	<#if RESUM_PREVI_TEXT_BOTO_MOSTRAR.getData()?has_content> 
181				    		<#assign mostrarBoton =	RESUM_PREVI_TEXT_BOTO_MOSTRAR.getData()> 
182				    	</#if> 
183			    	</#if> 
184			    				    			    	 
185			    	<#if RESUM_PREVI_TEXT_BOTO_OCULTAR??> 
186				    	<#if RESUM_PREVI_TEXT_BOTO_OCULTAR.getData()?has_content> 
187				    		<#assign ocultarBoton =	RESUM_PREVI_TEXT_BOTO_OCULTAR.getData()> 
188				    	</#if>		    				    	 
189				    </#if>		    				    	 
190			    	 
191					<div class="veure-tot-botons">  
192				    	<span class="boto-veure-tot" id="boto-veure-tot-header"> 
193							<a id="veure-tot-header" title="${mostrarBoton}" href="#"> 
194								${mostrarBoton} 
195							</a> 
196						</span> 
197						<span class="boto-resum-previ" id="boto-resum-previ-header"> 
198							<a id="veure-resum-previ-header" title="${ocultarBoton}" href="#"> 
199								${ocultarBoton} 
200							</a>							 
201						</span>						 
202					</div> 
203					<#--  FI BOTONS VEURE TOT i VEURE RESUM  --> 
204					<#assign display="display:none;"> 
205			</#if> 
206			</#if>	 	  
207			 
208			     
209			 
210		   <div id="article-total" style="display:none;">     
211		   <#-- - END PREVIEW -->  
212				<#assign i = 0> 
213				<#list TITLE.getSiblings() as item > 
214					<#if item.TYPE.getData() == "1" >  
215						<section class="row article" ><!-- reports --> 
216							<article class="scroll-nav__section" id="section${item.ORDER.getData()}"><!-- col-md-6 col-xs-12 --> 
217								<#if item.getData()?has_content > 
218									<#if i == 0> 
219										<h1 class="col-md-12 col-sm-12 main-h1">${item.getData()}</h1> 
220									<#else> 
221										<h1 class="col-md-12 col-sm-12 main-h1">${item.ORDER.getData()}. ${item.getData()}</h1> 
222									</#if> 
223								</#if>							 
224								<#list item.SUBTITLE.getSiblings() as subitem > 
225									<#if subitem.getData()?has_content> 
226										<h2 class="col-md-12 col-sm-12 col-xs-12">${subitem.getData()}</h2> 
227									</#if> 
228									<div class="article-contents col-md-12 col-sm-12 col-xs-12 row"> 
229										<!-- bloque 1 --> 
230										<#if subitem.IMAGE.getData()?has_content > 
231											<div class="col-md-12 col-sm-12 col-xs-12 row"> 
232												<img src="${subitem.IMAGE.getData()}" class="img-responsive image-1-columna" alt="${subitem.getData()}"/>  
233											</div> 
234										</#if> 
235										<#if subitem.CITE.getData()?has_content> 
236											<div class="col-md-12 col-sm-12 col-xs-12 row"> 
237												<cite class="col-md-12 col-sm-12 col-xs-12 cita-1-columna">${subitem.CITE.getData()}</cite> 
238											</div> 
239										</#if> 
240										<#if subitem.CONTENT.getData()?has_content> 
241											<div class="col-md-12 col-sm-12 col-xs-12 row"><p>${subitem.CONTENT.getData()}</p></div> 
242										</#if> 
243										<#if subitem.VIDEO.getData()?has_content> 
244											<div class="col-md-12 col-sm-12 col-xs-12 row"><p>${subitem.VIDEO.getData()}</p></div> 
245										</#if> 
246									</div> 
247								</#list>	 
248							</article><!-- /col-md-6 col-xs-12 --> 
249						</section> 
250					<#elseif item.TYPE.getData()== "2" > 
251						<section class="row article" ><!-- reports --> 
252							<article class="scroll-nav__section three-columns" id="section${item.ORDER.getData()}"><!-- col-md-6 col-xs-12 --> 
253								<h1 class="col-md-12 col-sm-12 main-h1">${item.ORDER.getData()}. ${item.getData()}</h1> 
254								<div class="article-contents col-md-12 col-sm-12 col-xs-12 row"> 
255									<div class="row col-md-12 col-sm-12 col-xs-12"> 
256										<#list item.SUBTITLE.getSiblings() as subitem> 
257											<div class="col-md-4 col-sm-4 col-xs-12"><!-- col-md-4 col-xs-12 --> 
258												<#if subitem.IMAGE.getData()?has_content> 
259													<img src="${subitem.IMAGE.getData()}" class="img-responsive" alt="${subitem.getData()}"/> 
260												</#if>	 
261												<#if subitem.SUBTITLE.getData()?has_content > 
262													<h2 class="header">${subitem.SUBTITLE.getData()}</h2>	 
263												</#if> 
264												<#if subitem.CONTENT.getData()?has_content > 
265													<div class="summary"><p>${subitem.CONTENT.getData()}</p></div> 
266												</#if>	 
267												<#if subitem.CITE.getData()?has_content > 
268													<cite class="cite">${subitem.CITE.getData()}</cite> 
269												</#if> 
270												<#if subitem.VIDEO.getData()?has_content > 
271													<div class="video">${subitem.VIDEO.getData()}</div> 
272												</#if> 
273											</div><!-- /col-md-4 col-xs-12 -->	 
274										</#list> 
275									</div>  
276								</div> 
277							</article> 
278						</section>					 
279					</#if> 
280					<#assign i = i+1>  
281				</#list> 
282								 		 
283				 <#if (PeuPagina.getSiblings()?size > 1) > 
284					<section class="row article peu-pagina" ><!-- reports --> 
285						<article class="scroll-nav__section" id=""><!-- col-md-6 col-xs-12 --> 
286							<#list PeuPagina.getSiblings() as cur_PeuPagina> 
287								<div class="peu-content"> 
288									<#if cur_PeuPagina.get("Num")?has_content >  
289										<p id='${cur_PeuPagina.get("Num").getData()}' class="num-peu"> 
290											${cur_PeuPagina.get("Num").getData()}. ${cur_PeuPagina.getData()} 
291											<a href="#ancora-#${cur_PeuPagina.get("Num").getData()}" class="tornar-ancora">&crarr;</a> 
292										</p> 
293									</#if> 
294								</div>	 
295							</#list> 
296						</article> 
297					</section> 
298				</#if> 
299			</div> 
300			<#if RESUM_PREVI??> 
301			<#if getterUtil.getBoolean(RESUM_PREVI.getData())>   
302				<div class="veure-tot-botons">				     
303					<span class="boto-resum-previ" id="boto-resum-previ-footer"> 
304						<a id="veure-resum-previ-footer" title="${ocultarBoton}" href="#"> 
305							${ocultarBoton} 
306						</a>						 
307					</span>						 
308				</div> 
309			</#if> 
310			</#if> 
311						 
312		</div> 
313 
314<#-- columna derecha -->			     
315<div class="col-md-3 col-sm-12 col-xs-12 columna-dreta">	 
316	<section class="row article" >			 
317	<div class="index-and-title titol-relateds"> <p class="category"><@liferay.language key="observatoriosocial.clasificacion"/> </p> </div> 
318 
319 
320	<#-- Autores -->	 
321	<#if TITULO_AUTORES_COL_DER.getData()?has_content >				 
322		<h2 class="main-h2">${TITULO_AUTORES_COL_DER.getData()}</h2> 
323 
324	<#if Autor.getSiblings()?has_content>		 
325		<#list Autor.getSiblings() as autor>			 
326			<div class="autors-content"> 
327				<div class="autor">								 
328					<#if autor.Descripcio_Autor.getData()?has_content> 
329						${autor.getData()} , ${autor.Descripcio_Autor.getData()} 
330					<#else> 
331						${autor.getData()} 
332					</#if> 
333				</div> 
334				<#if autor.Twitter.getData()?has_content>						 
335					<div class="twitter-autor"> 
336						<a class="fa fa-twitter" target="_blank" href="https://twitter.com/${autor.Twitter.getData()}" title="Twitter &#64;${autor.Twitter.getData()}">&#64;${autor.Twitter.getData()}</a> 
337					</div> 
338				</#if> 
339			</div>	 
340		</#list>				 
341	</#if>	 
342	</#if> 
343 
344	<#-- Clasificacion --> 
345	<h2 class="main-h2"><@liferay.language key="observatoriosocial.tags"/></h2> 
346		<div class="tags-content"> 
347		<#assign categoriesTags = [] /> 
348		<#assign categoriesTagsId = [] /> 
349 
350			<#list categories as category > 
351				<#assign vocabularyId = propsUtil.get("vocabulary.tags") /> 
352				<#if category.getVocabularyId() == vocabularyId?number> 
353					<#assign categoriesTags = categoriesTags + [category]>     
354					<#assign categoriesTagsId = categoriesTagsId + [category.getCategoryId()]>                  
355				</#if> 
356			</#list>  
357			 
358			<#assign i=0> 
359			<#list categoriesTags as category> 
360				<#assign enllacCategory="">					 
361				<#assign layoutCategoria = layoutLocalService.fetchLayoutByFriendlyURL(themeDisplay.getSiteGroupId(), false, "/busca-por-tag")>	 
362				<#assign enllacCategory = portalUtil.getLayoutFullURL(layoutCategoria, themeDisplay)+"?p_p_id=3&_3_struts_action=%2Fsearch%2Fsearch&_3_keywords=%22"+category.getTitle(locale)+"%22&categories="+category.getCategoryId()>					 
363				<#if i==(categoriesTags?size-1)>					 
364					<a href="${enllacCategory}" title="${category.getTitle(locale)}" >${category.getTitle(locale)}</a>					  
365				<#else> 
366					<a href="${enllacCategory}" title="${category.getTitle(locale)}" >${category.getTitle(locale)}</a>&#44; 
367				</#if> 
368				<#assign i=i+1> 
369			</#list>	 
370		</div> 
371 
372 
373		<#-- Tematicas -->	 
374		<h2 class="main-h2"><@liferay.language key="observatoriosocial.thematic"/></h2> 
375		<div class="tags-content">		 							 			 			 			 	 
376			<#assign categoriesThematics = [] /> 
377						 
378			<#list categories as category > 
379				<#if category.getVocabularyId() == vocabularyIdTemaP || category.getVocabularyId() == vocabularyIdTemaS> 
380					<#assign categoriesThematics = categoriesThematics + [category]>                    
381				</#if> 
382			</#list>  
383			 
384			<#assign i=0> 
385			<#list categoriesThematics as category> 
386				<#assign enllacCategory=""> 
387				<#assign assetCategoryProperty = assetCategoryPropertyLocalService.getCategoryProperty(category.getCategoryId(), "layout")/> 
388				<#assign layoutCategoria = layoutLocalService.fetchLayoutByFriendlyURL(themeDisplay.getSiteGroupId(), false, "/"+assetCategoryProperty.getValue())>	 
389				<#assign enllacCategory = portalUtil.getLayoutFullURL(layoutCategoria, themeDisplay)>					 
390 
391				<#if i==(categoriesThematics?size-1)>					 
392					<a href="${enllacCategory}" title="${category.getTitle(locale)}" >${category.getTitle(locale)}</a>					  
393				<#else> 
394					<a href="${enllacCategory}" title="${category.getTitle(locale)}" >${category.getTitle(locale)}</a>&#44; 
395				</#if> 
396				<#assign i=i+1> 
397			</#list>	 
398		</div>  
399	</section> 
400	 
401	<#-- documents --> 
402	<#if RELATED_DOCUMENTS.getData()?has_content> 
403		<section class="row article" >	 
404			<div class="index-and-title titol-relateds">  
405				<p class="category"> <@liferay.language key="observatoriosocial.related.documents"/> </p>  
406			</div>				 
407			<ul class="related-documents-content"> 
408			<#list RELATED_DOCUMENTS.getSiblings() as cur_RELATED_DOCUMENTS> 
409				<li class="related-document"> 
410					<a href="${cur_RELATED_DOCUMENTS.getData()}" target="_blank" > 
411						${cur_RELATED_DOCUMENTS.get("TITLE_DOC").getData()} 
412					</a> 
413				</li> 
414			</#list> 
415			</ul> 
416		</section>					 
417	</#if>		 
418 
419 
420<#-- Contenidos relacionados --> 
421<#assign assetEntryQuery = objectUtil('com.liferay.portlet.asset.service.persistence.AssetEntryQuery')>	 
422<#assign search = assetEntryQuery.setExcludeZeroViewCount(false) >			 
423<#assign search = assetEntryQuery.setOrderByCol1("priority")> 
424<#assign search = assetEntryQuery.setOrderByType1("ASC")> 
425<#assign search = assetEntryQuery.setOrderByCol2("publishDate")> 
426<#assign search = assetEntryQuery.setOrderByType2("DESC")> 
427<#assign search = assetEntryQuery.setStart(0)> 
428<#assign search = assetEntryQuery.setEnd( MAX_RELATED_ART.getData()?number + 1)> 
429 
430<#assign newAssetRelatedCategoryIds = [] /> 
431<#list categoriesTags as category >					 
432	<#assign newAssetRelatedCategoryIds = newAssetRelatedCategoryIds + [category.getCategoryId()]>   
433</#list> 
434 
435<#assign search = assetEntryQuery.setAnyCategoryIds(newAssetRelatedCategoryIds)> 
436 
437<#assign newAllAssetRelatedCategoryIds = [] /> 
438<#assign search = assetEntryQuery.setAllCategoryIds(newAllAssetRelatedCategoryIds)> 
439 
440<#assign previewAuxRelatedIds = assetEntryQuery.getNotAnyCategoryIds()> 
441<#--Quitamos la tipologia "Seccio"--> 
442 
443<#assign newNotAllAssetRelatedCategoryIds = vocabularyIdTipoContenidoCategoryE?split(",")> 
444<#assign previewAuxRelatedIds = previewAuxRelatedIds + [newNotAllAssetRelatedCategoryIds[0]?number]> 
445 
446<#-- filtre -->			 
447<#if !themeDisplay.isSignedIn()>		 
448    <#assign categoriesPreview = [] /> 
449    <#assign assetCategory = staticUtil["com.liferay.portal.kernel.util.ClassResolverUtil"].resolveByPortalClassLoader("com.liferay.portlet.asset.model.AssetCategoryModel") /> 
450    <#assign queryPreview = staticUtil["com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil"].forClass(assetCategory) />			 
451    <#assign VOID = queryPreview.add(staticUtil["com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil"].eq("name", "Preview")) />		 
452    <#assign categoriesPreview = staticUtil["com.liferay.portal.service.UserLocalServiceUtil"].dynamicQuery(queryPreview, 0, 1)> 
453     
454     <#assign categoriaPreviewId = categoriesPreview[0].getCategoryId()> 
455     <#assign previewAuxRelatedIds = previewAuxRelatedIds + [categoriaPreviewId]> 
456     
457</#if> 
458 
459<#assign search = assetEntryQuery.setNotAnyCategoryIds(previewAuxRelatedIds)> 
460 
461<#assign resultsRelateds = assetEntryQueryService.getEntries(assetEntryQuery) > 
462 
463<#-- exclude own article, if is not excluded we will exclude the last one --> 
464<#assign excluido = "false" />  
465 
466<#assign resultsRelatedsArray =[]> 
467					 
468<#list resultsRelateds as resultsRelatedsList>			 
469	<#if resultsRelatedsList.getEntryId() != entry.getEntryId()>					 
470		<#assign resultsRelatedsArray = resultsRelatedsArray + [resultsRelatedsList]> 
471	<#else> 
472		<#assign excluido = "true" />  
473	</#if> 
474</#list> 
475 
476 
477<#assign exit = 0> 
478<#if resultsRelatedsArray?has_content> 
479	<section class="row article" > 
480		<div class="index-and-title titol-relateds">  
481		<p class="category"> <@liferay.language key="observatoriosocial.related.contents"/>	</p>  
482		</div> 
483		<#list resultsRelatedsArray as x> 
484			<#assign assetRenderer = x.getAssetRenderer() >	 
485			<#assign journalArticle = assetRenderer.getArticle() /> 
486			<#assign document = saxReaderUtil.read(journalArticle.getContentByLocale(locale)) /> 
487			<#assign rootElement = document.getRootElement() /> 
488			<#assign friendlyURL = ""> 
489			<#assign viewURLRelated = ""> 
490			<#assign otro = ""> 
491				 
492			<#assign entryTitle = htmlUtil.escape(assetRenderer.getTitle(locale)) /> 
493			 
494			 
495			<#list rootElement.elements() as dynamicElement> 
496				<#if "Titulo" == dynamicElement.attributeValue("name")> 
497					<#assign entryTitle = dynamicElement.element("dynamic-content").getText() /> 
498				</#if> 
499				<#if "FRIENDLY_URL" == dynamicElement.attributeValue("name")> 
500					<#assign friendlyURL = htmlUtil.escape(dynamicElement.element("dynamic-content").getText()) />							 
501				</#if> 
502				<#if "YEAR" == dynamicElement.attributeValue("name")> 
503					<#assign year = dynamicElement.element("dynamic-content").getText() /> 
504				</#if> 
505				<#if "MONTH" == dynamicElement.attributeValue("name")> 
506					<#assign month = dynamicElement.element("dynamic-content").getText() /> 
507				</#if> 
508				<#if "GENERALCONTENT" == dynamicElement.attributeValue("name")> 
509					<#assign content = dynamicElement.element("dynamic-content").getText() /> 
510				</#if>	 
511				<#if "Otro_Enlace" == dynamicElement.attributeValue("name")> 
512					<#assign otro = dynamicElement.element("dynamic-content").getText() />			                           
513				</#if>							 
514																 
515			</#list>					 
516			 
517			<#assign viewURLRelated = getViewURL(friendlyURL, assetRenderer.getUrlTitle())>					 
518					 
519			<div class="related-article"> 
520				<div class="index-and-title"> 
521					 <#list x.getCategories() as category >												 
522						<#if category.getVocabularyId() == vocabularyIdTipoC> 
523							${category.getTitle(locale)}               
524						</#if> 
525					</#list> 
526				</div> 
527						 
528				<a href="${viewURLRelated}" title="${entryTitle}" class="pushtag">					  
529					<p class="title">${entryTitle}</p> 
530				</a> 
531				<#if month?has_content && year?has_content> 
532					<span class="posted-on">						 
533						<time datetime="${month} ${year}" >${month} ${year}</time> 
534					</span> 
535				</#if>    
536				<#if content?has_content > 
537					<div class="summary"><p>${content}</p></div> 
538				</#if> 
539			</div> 
540			<#assign exit = exit + 1> 
541				<#if exit==5> 
542			<#break> 
543			</#if>			 
544		</#list> 
545</#if> 
546</section> 
547<section class="row article"></section>	 
548</div> 
549 
550<#-- Tambien te puede interesar --> 
551<#assign assetEntryQuery2 = objectUtil('com.liferay.portlet.asset.service.persistence.AssetEntryQuery')>				 
552<#assign search = assetEntryQuery2.setExcludeZeroViewCount(false) > 
553<#assign search =  assetEntryQuery.setClassName("com.liferay.journal.model.JournalArticle")> 
554<#-- Ordenamos los resultados por el campo "prioridad" ascendente--> 
555<#assign search = assetEntryQuery2.setOrderByCol1("priority") > 
556<#assign search = assetEntryQuery2.setOrderByType1("DESC") > 
557<#-- Ordenamos los resultados por el campo "fecha de publicacion" descendente--> 
558<#assign search = assetEntryQuery2.setOrderByCol2("publishDate") > 
559<#assign search = assetEntryQuery2.setOrderByType2("ASC") > 
560<#assign search = assetEntryQuery2.setStart(0) > 
561<#assign search = assetEntryQuery2.setEnd(10)> 
562 
563<#assign newAllAssetInterestingCategoryIds = []> 
564<#list categoriesPrincipal as p > 
565    <#assign newAllAssetInterestingCategoryIds = newAllAssetInterestingCategoryIds + [p.getCategoryId()] > 
566</#list> 
567 
568<#list categoriesSecundaria as s > 
569    <#assign newAllAssetInterestingCategoryIds = newAllAssetInterestingCategoryIds + [s.getCategoryId()] > 
570</#list> 
571 
572 
573<#assign search = assetEntryQuery2.setAllCategoryIds(newAllAssetInterestingCategoryIds)> 
574 
575<#assign previewAuxInterestingIds = assetEntryQuery2.getNotAnyCategoryIds()> 
576<#--Quitamos la tipologia "Seccio"--> 
577 
578<#assign newNotAllAssetInterestingCategoryIds = vocabularyIdTipoContenidoCategoryE?split(",")> 
579<#assign previewAuxInterestingIds = previewAuxInterestingIds + [newNotAllAssetInterestingCategoryIds[0]?number]> 
580 
581<#-- filtre -->			 
582<#if !themeDisplay.isSignedIn()>		 
583    <#assign categoriesPreview = [] /> 
584    <#assign assetCategory = staticUtil["com.liferay.portal.kernel.util.ClassResolverUtil"].resolveByPortalClassLoader("com.liferay.portlet.asset.model.AssetCategoryModel") /> 
585    <#assign queryPreview = staticUtil["com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil"].forClass(assetCategory) />			 
586    <#assign VOID = queryPreview.add(staticUtil["com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil"].eq("name", "Preview")) />		 
587    <#assign categoriesPreview = staticUtil["com.liferay.portal.service.UserLocalServiceUtil"].dynamicQuery(queryPreview, 0, 1)> 
588     
589     <#assign categoriaPreviewId = categoriesPreview[0].getCategoryId()> 
590     <#assign previewAuxInterestingIds = previewAuxInterestingIds + [categoriaPreviewId]> 
591     
592</#if> 
593 
594<#assign search = assetEntryQuery2.setNotAnyCategoryIds(previewAuxInterestingIds)> 
595 
596<#assign resultsInteresting = assetEntryQueryService.getEntries(assetEntryQuery2) > 
597 
598<#assign resultsInterestingArray = []> 
599 
600<#list resultsInteresting as resultsInterestingList> 
601   <#if resultsInterestingList.getEntryId() != entry.getEntryId() > 							 
602	  <#assign resultsInterestingArray = resultsInterestingArray + [resultsInterestingList]>  
603   </#if> 
604</#list> 
605 
606<#if resultsInterestingArray?size<3 > 
607			 
608	<#assign newAllAssetInterestingCategoryIds2 = []>	 
609 
610	<#list categoriesPrincipal as p > 
611		<#assign newAllAssetInterestingCategoryIds2 =newAllAssetInterestingCategoryIds2 + [p.getCategoryId()] > 
612	</#list> 
613 
614	<#assign search = assetEntryQuery2.setAllCategoryIds(newAllAssetInterestingCategoryIds2) > 
615	 
616	<#assign resultsInteresting2 = assetEntryQueryService.getEntries(assetEntryQuery2) >	 
617	 
618	<#list resultsInteresting2 as lista> 
619		<#assign val = resultsInterestingArray?seq_contains(lista)?string("y", "n")>		 
620		<#if lista.getEntryId() != entry.getEntryId() && val?contains("n")> 
621			<#assign resultsInterestingArray = resultsInterestingArray + [lista]>  
622		</#if>	 
623	</#list>	 
624	 
625</#if> 
626 
627<#if resultsInterestingArray?has_content>	 
628<section class="col-md-12 col-sm-12 col-xs-12 row section-article-relateds" style="margin-top: 30px;"> 
629	<h1 class="main-h1"><@liferay.language key="observatoriosocial.interesting.contents"/></h1> 
630<section class="row summary_list_observatori">		 
631 
632<#assign exit = 0> 
633<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService")/> 
634<#assign JA=JournalArticleLocalService.getArticle(getterUtil.getLong(groupId), getterUtil.getString(.vars['reserved-article-id'].data))/> 
635 
636 
637<#list resultsInterestingArray as x> 
638 
639	<#assign tituloInteresting  = "" > 
640	<#assign imagenInteresting  = "" > 
641	<#assign contentInteresting = "" > 
642	<#assign yearInteresting    = "" > 
643	<#assign monthInteresting   = "" > 
644	<#assign friendlyUrlInteresting   = "" >															 
645	<#assign otherlinkInteresting   = "" > 
646	<#assign otherlinkInterestingNodes = []> 
647	<#assign otherlinkInterestingOnClick   = "" > 
648	<#assign otro   = "" > 
649 
650	<#assign assetRenderer = x.getAssetRenderer() >						 
651	<#assign articleInteresting = assetRenderer.getArticle() /> 
652	<#assign document = saxReaderUtil.read(articleInteresting.getContentByLocale(locale)) /> 
653	 
654	<#assign rootElement = document.getRootElement() /> 
655	 
656	<#list rootElement.elements() as dynamicElement> 
657		<#if "Titulo" == dynamicElement.attributeValue("name")> 
658			<#assign tituloInteresting = htmlUtil.escape(dynamicElement.element("dynamic-content").getText()) /> 
659		</#if> 
660		<#if "GENERALIMAGE" == dynamicElement.attributeValue("name")> 
661			<#assign imagenInteresting = htmlUtil.escape(dynamicElement.element("dynamic-content").getText()) /> 
662		</#if> 
663		<#if "GENERALCONTENT" == dynamicElement.attributeValue("name")> 
664			<#assign contentInteresting = dynamicElement.element("dynamic-content").getText() /> 
665		</#if>			 
666		<#if "YEAR" == dynamicElement.attributeValue("name")> 
667			<#assign yearInteresting = htmlUtil.escape(dynamicElement.element("dynamic-content").getText()) /> 
668		</#if> 
669		<#if "MONTH" == dynamicElement.attributeValue("name")> 
670			<#assign monthInteresting = htmlUtil.escape(dynamicElement.element("dynamic-content").getText()) /> 
671		</#if> 
672		<#if "FRIENDLY_URL" == dynamicElement.attributeValue("name")>							 
673			<#assign friendlyUrlInteresting = htmlUtil.escape(dynamicElement.element("dynamic-content").getText()) />							 
674		</#if>   
675		 
676		<#if "DOCUMENT" == dynamicElement.attributeValue("name")> 
677			<#assign documentInteresting = dynamicElement.element("dynamic-content").getText() /> 
678		</#if>	 
679		<#if "Otro_Enlace" == dynamicElement.attributeValue("name")> 
680			<#assign otro = dynamicElement.element("dynamic-content").getText() /> 
681			<#assign onclick = getSingleValue(otro,dynamicElement, "onclick") />                 
682		</#if>						 
683	</#list> 
684	 
685	<#assign viewURLInteresting = getViewURL(friendlyUrlInteresting, assetRenderer.getUrlTitle())> 
686   	<#if contentInteresting?has_content> 
687    <div class="col-md-4 col-sm-4 col-xs-12"> 
688		 
689		<#assign categoriesInteresting = x.getCategories() /> 
690		<#list categoriesInteresting as category >										   
691			<#if category.getVocabularyId() == vocabularyIdTipoC> 
692				<p class="category">${category.getTitle(locale)}</p>                 
693			</#if>							 
694		</#list>		 
695				 
696		<a href="${viewURLInteresting}" title="${tituloInteresting}" class="pushtag"> 
697			<img src="${imagenInteresting}" alt="${tituloInteresting}"/> 
698		</a> 
699 
700		<a href="${viewURLInteresting}" title="${tituloInteresting}" class="pushtag" > 
701			<h2 class="header">${tituloInteresting}</h2> 
702		</a> 
703						 
704	 
705	<div class="tags-and-date">					 
706		<#list categoriesInteresting as category >			 
707			<#if category.getVocabularyId() == vocabularyIdTemaP> 
708				<#assign enllacCategory=""> 
709				<#assign assetCategoryProperty = assetCategoryPropertyLocalService.getCategoryProperty(category.getCategoryId(), "layout")/> 
710				<#assign layoutCategoria = layoutLocalService.fetchLayoutByFriendlyURL(themeDisplay.getSiteGroupId(), false, "/"+assetCategoryProperty.getValue())>	 
711				<#assign enllacCategory = portalUtil.getLayoutFullURL(layoutCategoria, themeDisplay)>  
712				<span class="tags"> 
713					<a href="${enllacCategory}" title="${category.getTitle(locale)}" >${category.getTitle(locale)}</a> 
714				</span> 
715			</#if> 
716		</#list> 
717		 
718		<#list categoriesSecundaria as category> 
719			<#assign enllacCategory=""> 
720			<#assign assetCategoryProperty = assetCategoryPropertyLocalService.getCategoryProperty(category.getCategoryId(), "layout")/> 
721			<#assign layoutCategoria = layoutLocalService.fetchLayoutByFriendlyURL(themeDisplay.getSiteGroupId(), false, "/"+assetCategoryProperty.getValue())>	 
722			<#assign enllacCategory = portalUtil.getLayoutFullURL(layoutCategoria, themeDisplay)> 
723			<span class="tags"> 
724				<a href="${enllacCategory}" title="${category.getTitle(locale)}" >${category.getTitle(locale)}</a> 
725			</span>  
726		</#list>	 
727 
728		<#if monthInteresting?has_content && yearInteresting?has_content> 
729			<span class="posted-on">						 
730				<time datetime="${monthInteresting} ${yearInteresting}">${monthInteresting} ${yearInteresting}></time> 
731			</span> 
732		</#if> 
733	</div> 
734	<p class="summary">${contentInteresting}</p>		 
735	</div> 
736	<#assign exit = exit + 1> 
737   </#if> 
738   <#if exit==3> 
739	<#break> 
740   </#if> 
741</#list> 
742</section> 
743 
744</section> 
745</#if> 
746<div class="article-final"></div> 
747</div> 
748 
749<#function getViewURL friendlyURL urlTitle > 
750 
751	<#assign viewURLFinal = ""> 
752	 
753	<#if !(friendlyURL?contains("http") || friendlyURL?contains("https")) && friendlyURL != "">						 
754		<#assign viewURLFinal = "/" + friendlyURL >					 
755	<#elseif friendlyURL?contains("http") || friendlyURL?contains("https")>					 
756		<#assign viewURLFinal = friendlyURL > 
757	<#else>							 
758		<#assign viewURLFinal = urlTitle > 
759	</#if> 
760	 
761	<#return viewURLFinal> 
762	 
763</#function> 
764 
765<#function getAutor autor dynamicElement> 
766	<#assign autorComplete=""> 
767	<#if autor?has_content> 
768	    <#assign autorList = dynamicElement.selectNodes("dynamic-element[@name='Descripcio_Autor']") /> 
769		<#if (autorList?has_content) > 
770			<#if (autorList?size>0) > 
771				<#list autorList as curr_autor> 
772					<#assign descripcio_autor = curr_autor.selectNodes("dynamic-content")[0].getData() /> 
773				    <#if descripcio_autor?has_content> 
774				    	<#assign autorComplete =autorComplete + autor + "," + descripcio_autor + ";">			 
775					<#else> 
776						<#assign autorComplete =autorComplete + autor +";"> 
777					</#if> 
778				</#list> 
779			</#if> 
780		</#if> 
781	</#if>  
782	<#return autorComplete> 
783</#function> 
784 
785<#function getAssetLinksDossierNumber assetLinks> 
786	<#assign dossierNumber=""> 
787	<#list assetLinks as assetLinkAux > 
788        	<#assign assetEnryIdLinked = assetLinkAux.getEntryId2()> 
789			<#assign assetEntryLinked = assetEntryLocalService.getEntry(assetEnryIdLinked)> 
790			<#assign categoriesLink = assetEntryLinked.getCategories()> 
791			<#assign isDossier = "false"> 
792			 
793			<#list  categoriesLink as categoryLink >				 
794				<#assign dosierCategoryId = PropsUtil.get("categoria.dossier.id")?number> 
795				<#if categoryLink.getCategoryId()==dosierCategoryId > 
796					<#assign isDossier = "true" > 
797				</#if>				 
798			</#list> 
799			<#if isDossier=="true" > 
800				<#assign dossierNumber =getArticleFieldValue(assetEntryLinked,"NUMBER",locale.toString()) >				 
801			 </#if> 
802        </#list> 
803	<#return dossierNumber> 
804</#function> 
805 
806 
807<#function getAssetLinksDossierURL assetLinks> 
808	<#assign dossierUrl=""> 
809	<#list assetLinks as assetLinkAux > 
810        	<#assign assetEnryIdLinked = assetLinkAux.getEntryId2()> 
811			<#assign assetEntryLinked = assetEntryLocalService.getEntry(assetEnryIdLinked)> 
812			<#assign categoriesLink = assetEntryLinked.getCategories()> 
813			<#assign isDossier = "false"> 
814			 
815			<#list  categoriesLink as categoryLink >				 
816				<#assign dosierCategoryId = PropsUtil.get("categoria.dossier.id")?number> 
817				<#if categoryLink.getCategoryId()==dosierCategoryId > 
818					<#assign isDossier = "true" > 
819				</#if>				 
820			</#list> 
821			<#if isDossier=="true" >				 
822				<#assign dossierUrl = AssetPublisherHelperImpl.getAssetViewURL(liferayPortletRequest, liferayPortletResponse, assetEntryLinked, viewInContext) >			 </#if> 
823        </#list> 
824	<#return dossierUrl> 
825</#function> 
826 
827<#function getCategories categories vocabularyId> 
828	<#assign categoriesList = []> 
829	<#list categories as category > 
830		<#if category.getVocabularyId()== vocabularyId> 
831			<#assign categoriesList = categoriesList + [category]> 
832		</#if>  
833	</#list> 
834	<#return categoriesList /> 
835</#function> 
836 
837 
838<#function printDivSizeCol numElements> 
839	 <#if numElements?number%2 == 0> 
840		<#return "<div class='col-md-6 col-sm-6 col-xs-12'>">	 
841	<#else> 
842		<#return  "<div class='col-md-4 col-sm-4 col-xs-12'>"> 
843	</#if>  
844</#function> 
845 
846<#function printDivSizeCol2 numElements>	  
847	<#if numElements?has_content> 
848		<#if numElements?number == 1 || numElements?number == 0>   
849			<#return "<div class='col-md-7 col-sm-7 col-xs-12'>"> 
850		<#elseif numElements?number%6 == 0> 
851			<#return "<div class='col-md-4 col-sm-4 col-xs-12'>"> 
852		<#elseif numElements?number%2 == 0> 
853			<#return "<div class='col-md-6 col-sm-6 col-xs-12'>">	 
854		<#else> 
855			<#return "<div class='col-md-4 col-sm-4 col-xs-12'>"> 
856		</#if> 
857	<#else> 
858		<#return "<div class='col-md-7 col-sm-7 col-xs-12'>"> 
859	</#if> 
860</#function> 
861 
862<#function getStringValue2levels otro dynamicElement field1 field2 > 
863	<#assign res=""> 
864	<#if otro?has_content>	     
865	    <#assign res=dynamicElement.selectSingleNode("/root/dynamic-element[@name='" 
866	     + field1+ "']/dynamic-element[@name='"+field2+"']/dynamic-content")[0].getText() /> 
867	      
868	</#if>  
869	<#return res> 
870</#function> 
871 
872<#function getSingleValue element dynamicElement fieldname> 
873	<#assign res=""> 
874	<#if element?has_content> 
875	    <#assign elementList = dynamicElement.selectNodes("dynamic-element[@name='"+fieldname+"']") /> 
876		<#if (elementList?has_content) > 
877			<#if (elementList?size>0) > 
878				<#list elementList as curr_element> 
879					<#assign cur_value = curr_element.selectNodes("dynamic-content")[0].getData() /> 
880				    <#if cur_value?has_content> 
881				    	<#assign res =res + cur_value>			 
882					</#if> 
883				</#list> 
884			</#if> 
885		</#if> 
886	</#if>  
887	<#return res> 
888</#function> 
889 
890 
891<#function getNumberValue3levels dynamicElement field1 field2 field3> 
892	<#assign res=0> 
893	<#if dynamicElement?has_content>	     
894	    <#assign res=dynamicElement.selectSingleNode("/root/dynamic-element[@name='" 
895	     + field1+ "']/dynamic-element[@name='"+field2+"']/dynamic-element[@name='"+field3+"']/dynamic-content").getText() />			 
896	</#if>  
897	<#return res?number> 
898</#function> 
899 
900<#function getButtonStyles document> 
901	<#assign classFile="fa-file-o"> 
902	<#if document?contains(".pdf")> 
903		<#assign classFile="fa-file-pdf-o"/>					     
904	<#elseif document?contains(".xls") || document?contains(".xlsx")> 
905		<#assign classFile="fa-file-excel-o"/>					     
906	<#elseif document?contains(".doc") || document?contains(".docx")> 
907		<#assign classFile="fa-file-word-o"/>					  
908	</#if>	 
909	<#return classFile> 
910</#function> 
911 
912<script type="text/javascript"> 
913	$( document ).ready(function() { 
914	 
915			$("#boto-resum-previ-footer").hide(); 
916			$("#boto-resum-previ-header").hide(); 
917			$("#scroll-nav").hide(); 
918			$("#article-total").show(); 
919			<#if RESUM_PREVI??> 
920			<#if getterUtil.getBoolean(RESUM_PREVI.getData())> 
921				$("#article-total").hide();				 
922			<#else> 
923				$("#article-total").show(); 
924				$("#scroll-nav").show(); 
925			</#if> 
926			</#if>		 
927			 
928									 
929			$("#veure-tot-header").click(function(event) { 
930			$("#boto-resum-previ-footer").show(); 
931			$("#boto-veure-tot-header").hide(); 
932			$("#boto-resum-previ-header").show(); 
933			$("#article-total").show(); 
934			$("#scroll-nav").show();									 
935			scrollNav(); 
936			event.preventDefault(); 
937		}); 
938									 
939		$("#veure-resum-previ-header").click(function(event) { 
940			$("#boto-resum-previ-footer").hide(); 
941			$("#boto-veure-tot-header").show(); 
942			$("#boto-resum-previ-header").hide(); 
943			$("#article-total").hide(); 
944			$("#scroll-nav").hide();											 
945			event.preventDefault(); 
946		}); 
947									 
948		$("#veure-resum-previ-footer").click(function(event) { 
949			$("#boto-veure-tot-header").show(); 
950			$("#boto-resum-previ-header").hide(); 
951			$("#boto-resum-previ-footer").hide();									 
952			$("#article-total").hide(); 
953			$("#scroll-nav").hide(); 
954			$(window).scrollTop(0); 
955			event.preventDefault(); 
956		}); 
957	 
958		$('.cos-article a[href^="#"]').each(function() { 
959			  $(this).addClass( "ancora" ); 
960			  $(this).attr("id","ancora-"+$(this).attr("href")); 
961		}); 
962		 
963		$(".tornar-ancora").click(function(event){ 
964			var idElement = $(this).attr("href"); 
965			$('.ancora').each(function() { 
966				if(idElement == "#"+$(this).attr("id")){ 
967					 $('html, body').animate({ 
968					        scrollTop: $(this).offset().top-80 
969					    }, 500); 
970
971			}); 
972			event.preventDefault(); 
973		});	 
974	}); 
975</script>