Publicador de contenidos

Se ha producido un error al procesar la plantilla.
Java method "com.sun.proxy.$Proxy911.getArticleContent(com.liferay.journal.model.JournalArticle, String, String, String, com.liferay.portal.kernel.portlet.PortletRequestModel, com.liferay.portal.kernel.theme.ThemeDisplay)" threw an exception when invoked on com.sun.proxy.$Proxy911 object "com.liferay.journal.service.impl.JournalArticleLocalServiceImpl@2a47f8d2"; see cause exception in the Java stack trace.

----
FTL stack trace ("~" means nesting-related):
	- Failed at: ${journalArticleLocalService.getArtic...  [in template "10112#522485#8158021" at line 191, column 65]
----
1<#assign liferay_ui = taglibLiferayHash["/META-INF/liferay-ui.tld"] /> 
2 
3<#-- ---------- UPV/EHU  -------- --> 
4<#-- UPV/EHU 15 enero no se puede ignorar el parámetro category-id porque las noticias de campusa están filtradas por categoria (noticias, fotonoticias) y por lo tanto no funciona la páginación --> 
5<#-- por ello se pasa a utilizar la configuración manual selectionStyle = dynamic / manual parámetro que en campusa siempre es false --> 
6<#-- tras este cambio se elimina toda la lógica relacionada con esto sin que afecte a la propiedad de la categoría category-color --> 
7<#assign itemNumber = 0 /> 
8 
9<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") /> 
10 
11<#-- Identifica si es el tema campusa --> 
12<#assign isCampusaTheme = getterUtil.getBoolean(themeDisplay.getPathThemeRoot()?contains("campusa")) /> 
13 
14 
15<#assign urlcurrent = themeDisplay.getURLCurrent() /> 
16<#assign itemNumber = 0 /> 
17<#assign isnothome = (  
18					 ( ( ( (getterUtil.getBoolean(urlcurrent?contains("campusa/"))) && (!getterUtil.getBoolean(urlcurrent?ends_with("campusa/"))) ) || 
19					 ( (getterUtil.getBoolean(urlcurrent?contains("campusa-magazine/"))) && (!getterUtil.getBoolean(urlcurrent?ends_with("campusa-magazine/"))) ) ) && 
20					 (!getterUtil.getBoolean(urlcurrent?contains("campusa-magazine/home"))) )|| 
21					 (getterUtil.getBoolean(urlcurrent?contains("/-/"))) 
22					  
23					 ) /> 
24<#assign isnotfirstpage = getterUtil.getBoolean(urlcurrent?contains("_cur")) /> 
25<#assign isfirstpage = getterUtil.getBoolean(urlcurrent?contains("_cur=1")) /> 
26 
27<#if ((isnothome || isnotfirstpage) && isCampusaTheme)> 
28	<#assign itemNumber = 1 /> 
29</#if> 
30 <#-- para que al volver a la home después de haber paginado se mantenga el item-0--> 
31<#if ((!isnothome && isfirstpage) && isCampusaTheme)> 
32	<#assign itemNumber = 0 /> 
33</#if> 
34 
35 <#if isCampusaTheme> 
36	<div class="container" > 
37	<div class="asset-list asset-list-highlight thumbnails row"> 
38 <#else> 
39	<div class="asset-list asset-list-highlight thumbnails"> 
40</#if> 
41<#-- ---------- UPV/EHU - UPV/EHU ---------- --> 
42    <#list entries as entry> 
43 
44		<#assign entry = entry /> 
45		 
46		<#assign assetRenderer = entry.getAssetRenderer() /> 
47		 
48		<#assign entryTitle = htmlUtil.escape(assetRenderer.getTitle(locale)) /> 
49			 
50		<#assign viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, entry) /> 
51 
52		<#-- ---------- UPV/EHU  -------- --> 
53		<#-- Si la URL para mostrar el contenido completo es de la parte publica del sitio web guest se quita de la URL --> 
54		<#assign guestPublicSiteURL = "/web/guest" /> 
55		<#if viewURL?contains(guestPublicSiteURL) > 
56				<#assign viewURL = viewURL?replace(guestPublicSiteURL, "") /> 
57		</#if> 
58		 
59		 
60		<#assign journalArticle = assetRenderer.getArticle() /> 
61		 
62		<#assign layoutUuid = journalArticle.getLayoutUuid() /> 
63		 
64		<#if layoutUuid?? && !validator.isBlank(layoutUuid)> 
65			<#assign urlViewContext = assetRenderer.getURLViewInContext(renderRequest, renderResponse, viewURL) /> 
66			<#assign viewURL = urlViewContext /> 
67		</#if> 
68		 
69		<#-- no se puede mantener la condición de arriba porque ahora el de la home se supone que tb es dinámico y empezará siempre por 1. (líneas 13-24)--> 
70		<#-- se utiliza lo añadido en las líneas 26-39 --> 
71		<#if isCampusaTheme> 
72			<#-- Para que la primera noticia que no es destacada no salga con span 12 miramos que no contenga la categoría "Destacadas" --> 
73			<#assign destacado = false /> 
74			<#assign categories = entry.getCategories() /> 
75			<#list categories as articleCategory> 
76				<#assign categoryId = articleCategory.getCategoryId()/> 
77				<#-- <#if (categoryId == 9280519) || (categoryId == 11743613) > --> <#-- Categorías "Destacadas" en INT -->  
78				<#-- <#if (categoryId == 363644) || (categoryId == 1379717) > -->  <#-- Categorías "Destacadas" en DEV --> 
79				<#if (categoryId == 11792428) || (categoryId == 11634291) > <#-- Categorías "Destacadas" en PROD --> 
80					<#assign destacado = true /> 
81				</#if> 
82			</#list> 
83			 
84			<#if itemNumber == 0 && destacado == true > 
85				<div class="asset-highlight item-${itemNumber} col-12" >			 
86			<#else>  
87				<div class="asset-highlight item-${itemNumber} col-12 col-md-6" > 
88			 </#if>   
89		<#else>     
90			<div class="asset-highlight item-${itemNumber}" > 
91		</#if> 
92		 
93		<div class="lfr-meta-actions asset-actions"> 
94			<@getEditIcon /> 
95		</div> 
96 
97			<#-- Si el publicador muestra solo contenidos, se muestra cada contenido con la plantilla highlight correspondiente al tipo del contenido si existe dicha plantilla, sino aparece mensaje de error --> 
98			 
99			<#assign 
100				dLFileEntryLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService") 
101				journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") 
102				ddmStructureLocalService = serviceLocator.findService("com.liferay.dynamic.data.mapping.service.DDMStructureLocalService") 
103				ddmFieldLocalServiceUtil = serviceLocator.findService("com.liferay.dynamic.data.mapping.service.DDMFieldLocalService")			 
104			/> 
105			 
106			<#assign  
107				ref = "" 
108				urlTitle = ""			 
109			/> 
110			 
111			 
112			<#assign journalArticleClass = "com.liferay.journal.model.JournalArticle" /> 
113			<#assign ddmTemplateKey = 0 /> 
114			 
115			<#if assetRenderer.getClassName() == journalArticleClass > 
116							 
117				<#assign journalArticle = assetRenderer.getArticle() /> 
118				<#assign structure = ddmStructureLocalService.fetchStructure(entry.getClassTypeId()) />  
119				<#assign ddmFormValues = ddmFieldLocalServiceUtil.getDDMFormValues(structure.getDDMForm(), journalArticle.getId())/> 
120				<#assign ddmFormFieldValuesMap = ddmFormValues.getDDMFormFieldValuesMap(true)> 
121				<#assign structureName = structure.getName("eu_ES") /> 
122				 
123				<#-- Si existe la estructura/tipo de contenido --> 
124				<#if structure?? >  
125					 
126					<#assign templateName = "Highlight" /> 
127					<#assign ddmTemplates = structure.getTemplates() /> 
128					<#-- ---------- Si la estructura/tipo de contenido tiene asociadas plantillas/visualizaciones --> 
129					<#assign isOutStanding = false /> 
130					<#if (ddmTemplates??)> 
131						<#list ddmTemplates as ddmTemplate> 
132							<#-- Si la plantilla/visualizacion es de tipo destacado --> 
133							<#if ddmTemplate.getName()?contains(templateName)> 
134								<#assign ddmTemplateKeyStr = ddmTemplate.getTemplateKey()/> 
135								<#assign ddmTemplateKey = getterUtil.getLongStrict(ddmTemplateKeyStr)/>     
136							</#if>     
137							<#if structure.getName()?contains("Outstanding")> 
138								 <#assign isOutStanding = true /> 
139							 </#if>     
140						</#list> 
141					</#if>                         
142					<#if (ddmTemplateKey != 0)> 
143						 
144						<#list ddmFormFieldValuesMap as key,ddmFormFieldValues> 
145							<#list ddmFormFieldValues as ddmFormFieldValue> 
146					 
147							  <#if ddmFormFieldValue.getValue()?? && ddmFormFieldValue.getValue().getString(locale)?has_content> 
148								  <#if structureName == "Nabarmentzekoa"> 
149										<#if ddmFormFieldValue.getName()=="ehuoutstandinglink"> 
150											<#assign ref = ddmFormFieldValue.getValue().getString(locale)/> 
151										</#if> 
152										<#if ddmFormFieldValue.getName()=="ehuoutstandinglinktitle"> 
153											<#assign urlTitle = ddmFormFieldValue.getValue().getString(locale)/> 
154										</#if> 
155							 
156										<#assign protocol = "http"> 
157										<#if request?? && request?contains("https")> 
158											<#assign protocol = "https"> 
159										</#if> 
160										<#assign refProtocol = "http"> 
161										<#if ref?? && ref?contains("https")> 
162											<#assign refProtocol = "https"> 
163										</#if> 
164																					 
165										<#if (refProtocol??)> 
166											<#if ref?contains(refProtocol)> 
167												<#assign viewURL = ref/> 
168											<#else> 
169												<#assign viewURL = refProtocol + "://" + ref/> 
170											</#if> 
171										<#else> 
172											<#assign viewURL =  protocol + "://" + ref/> 
173										</#if> 
174								 
175									</#if>   											 
176								</#if> 
177							</#list> 
178						</#list> 
179								 
180						<#-- Pintamos el article -->	 
181						<div class="box">	 
182							<#assign assetObject = assetRenderer.getAssetObject()/> 
183							<#-- Si la URL tiene title lo pintamosntamos --> 
184							<#if !validator.isBlank(urlTitle)> 
185								<a href="${viewURL}" title="${urlTitle}"> 
186							<#else> 
187								<a href="${viewURL}"> 
188							</#if> 
189							 
190							<#if journalArticleLocalService.fetchJournalArticle(assetObject.getId())??> 
191								${journalArticleLocalService.getArticleContent(assetObject, ddmTemplateKeyStr,"VIEW", locale, null, themeDisplay)}	 
192							</#if>							 
193							</a> 
194						</div> 
195					<#else>     
196						<div class="alert alert-error"> ${structure.getNameCurrentValue()} <@liferay.language key="ehu.error.structure-has-no-highlight-template-select-another-template" /></div> 
197					</#if>     
198					 
199					<@getMetadataField fieldName="tags" /> 
200 
201					<@getMetadataField fieldName="create-date" /> 
202 
203					<@getMetadataField fieldName="view-count" /> 
204 
205					<@getMetadataField fieldName="author" /> 
206 
207					<@getRatings /> 
208 
209					<@getRelatedAssets /> 
210 
211					<@getDiscussion /> 
212				</#if> 
213				<#assign itemNumber = itemNumber + 1 />      
214					 
215			<#-- ---------- UPV/EHU - UPV/EHU ---------- -->         
216			<#else> 
217					<h3 class="asset-title"> 
218						<#if assetRenderer?? && assetRenderer.getIconPath??> 
219							<a href="${viewURL}"><img alt="" src="${assetRenderer.getIconPath(renderRequest)}" />${entryTitle}</a> 
220						</#if> 
221					</h3> 
222 
223					<@getMetadataField fieldName="tags" /> 
224					<@getMetadataField fieldName="create-date" /> 
225					<@getMetadataField fieldName="view-count" /> 
226 
227					<div class="asset-content"> 
228							<@getSocialBookmarks /> 
229 
230							<div class="asset-summary"> 
231									<@getMetadataField fieldName="author" /> 
232 
233									${htmlUtil.escape(assetRenderer.getSummary(renderRequest,renderResponse))} 
234 
235									<a href="${viewURL}"><@liferay.language key="read-more" /><span class="sr-only"><@liferay.language key="about" />${entryTitle}</span> &raquo;</a> 
236							</div> 
237 
238							<@getRatings /> 
239 
240							<@getRelatedAssets /> 
241 
242							<@getDiscussion /> 
243					</div> 
244			</#if> 
245			 
246		</div> 
247    </#list> 
248</div> 
249 <#if isCampusaTheme> 
250	</div> 
251 </#if>    
252<#-- ---------- UPV/EHU ---------- -->   
253<#-- ---------- UPV/EHU - UPV/EHU ---------- -->   
254 
255<#macro getDiscussion> 
256	<#if enableComments??> 
257		<#if assetRenderer?? && assetRenderer.getDiscussionPath()?? && (enableComments == "true")> 
258			<br /> 
259	 
260			<#assign discussionURL = renderResponse.createActionURL() /> 
261	 
262			${discussionURL.setParameter("struts_action", "/asset_publisher/" + assetRenderer.getDiscussionPath())} 
263	 
264			<@liferay_ui["discussion"] 
265				className=entry.getClassName() 
266				classPK=entry.getClassPK() 
267				formAction=discussionURL?string 
268				formName="fm" + entry.getClassPK() 
269				ratingsEnabled=enableCommentRatings == "true" 
270				redirect=portalUtil.getCurrentURL(request) 
271				userId=assetRenderer.getUserId() 
272			/> 
273		</#if> 
274	</#if> 
275</#macro> 
276 
277<#macro getEditIcon> 
278	<#if assetRenderer.hasEditPermission(themeDisplay.getPermissionChecker())> 
279		<#assign editPortletURL = assetRenderer.getURLEdit(renderRequest, renderResponse, windowStateFactory.getWindowState("NORMAL"), themeDisplay.getURLCurrent())!"" /> 
280 
281		<#if validator.isNotNull(editPortletURL)> 
282			<#assign title = languageUtil.format(locale, "edit-x", entryTitle) /> 
283 
284			<@liferay_ui["icon"] 
285				image="edit" 
286				message=title 
287				url=editPortletURL.toString() 
288			/> 
289		</#if> 
290	</#if> 
291</#macro> 
292 
293<#macro getFlagsIcon> 
294	<#if enableFlags??> 
295		<#if enableFlags == "true"> 
296			<@liferay_ui["flags"] 
297				className=entry.getClassName() 
298				classPK=entry.getClassPK() 
299				contentTitle=entry.getTitle(locale) 
300				label=false 
301				reportedUserId=entry.getUserId() 
302			/> 
303		</#if> 
304	</#if> 
305</#macro> 
306 
307<#macro getMetadataField 
308	fieldName 
309
310	<#if stringUtil.split(metadataFields)?seq_contains(fieldName)> 
311		<span class="metadata-entry metadata-"${fieldName}"> 
312			<#assign dateFormat = "dd MMM yyyy - HH:mm:ss" /> 
313 
314			<#if fieldName == "author"> 
315				${portalUtil.getUserName(assetRenderer.getUserId(), assetRenderer.getUserName())} 
316			<#elseif fieldName == "categories"> 
317				<@liferay_ui["asset-categories-summary"] 
318					className=entry.getClassName() 
319					classPK=entry.getClassPK() 
320					portletURL=renderResponse.createRenderURL() 
321				/> 
322			<#elseif fieldName == "create-date"> 
323				${dateUtil.getDate(entry.getCreateDate(), dateFormat, locale)} 
324			<#elseif fieldName == "expiration-date"> 
325				${dateUtil.getDate(entry.getExpirationDate(), dateFormat, locale)} 
326			<#elseif fieldName == "modified-date"> 
327				${dateUtil.getDate(entry.getModifiedDate(), dateFormat, locale)} 
328			<#elseif fieldName == "priority"> 
329				${entry.getPriority()} 
330			<#elseif fieldName == "publish-date"> 
331				${dateUtil.getDate(entry.getPublishDate(), dateFormat, locale)} 
332			<#elseif fieldName == "tags"> 
333				<@liferay_ui["asset-tags-summary"] 
334					className=entry.getClassName() 
335					classPK=entry.getClassPK() 
336					portletURL=renderResponse.createRenderURL() 
337				/> 
338			<#elseif fieldName == "view-count"> 
339				<@liferay_ui["icon"] 
340					image="history" 
341				/> 
342 
343				${entry.getViewCount()} <@liferay.language key="views" /> 
344			</#if> 
345		</span> 
346	</#if> 
347</#macro> 
348 
349<#macro getPrintIcon> 
350	<#if enablePrint??> 
351		<#if enablePrint == "true" > 
352			<#assign printURL = renderResponse.createRenderURL() /> 
353	 
354			${printURL.setParameter("struts_action", "/asset_publisher/view_content")} 
355			${printURL.setParameter("assetEntryId", entry.getEntryId()?string)} 
356			${printURL.setParameter("viewMode", "print")} 
357			${printURL.setParameter("type", entry.getAssetRendererFactory().getType())} 
358	 
359			<#if (validator.isNotNull(assetRenderer.getUrlTitle()))> 
360				<#if (assetRenderer.getGroupId() != themeDisplay.getScopeGroupId())> 
361					${printURL.setParameter("groupId", assetRenderer.getGroupId()?string)} 
362				</#if> 
363	 
364				${printURL.setParameter("urlTitle", assetRenderer.getUrlTitle())} 
365			</#if> 
366	 
367			${printURL.setWindowState("pop_up")} 
368	 
369			<@liferay_ui["icon"] 
370				image="print" 
371				message="print" 
372				url="javascript:Liferay.Util.openWindow({id:'" + renderResponse.getNamespace() + "printAsset', title: '" + languageUtil.format(locale, "print-x-x", ["sr-only", entryTitle]) + "', uri: '" + htmlUtil.escapeURL(printURL.toString()) + "'});" 
373			/> 
374		</#if> 
375	</#if> 
376</#macro> 
377 
378<#macro getRatings> 
379	<#if enableRatings??> 
380		<#if (enableRatings == "true")> 
381			<div class="asset-ratings"> 
382				<@liferay_ui["ratings"] 
383					className=entry.getClassName() 
384					classPK=entry.getClassPK() 
385				/> 
386			</div> 
387		</#if> 
388	</#if> 
389</#macro> 
390 
391<#macro getRelatedAssets> 
392	<#if enableRelatedAssets??> 
393		<#if enableRelatedAssets == "true"> 
394			<liferay-asset:asset-links 
395			assetEntryId="<%= (entry != null) ? entry.getEntryId() : 0 %>" 
396			className="<%= entry.getClassName() %>" 
397			classPK="<%= entry.getClassPK() %>" 
398			/>		 
399		</#if> 
400	</#if> 
401</#macro> 
402 
403<#macro getSocialBookmarks> 
404	<#if enableSocialBookmarks??> 
405		<#if enableSocialBookmarks?has_content && enableSocialBookmarks == "true"> 
406			<@liferay_ui["social-bookmarks"] 
407				displayStyle="${socialBookmarksDisplayStyle}" 
408				target="_blank" 
409				title=entry.getTitle(locale) 
410				url=viewURL 
411			/> 
412		</#if> 
413	</#if> 
414</#macro> 
415 
416<#-- ---------- UPV/EHU  -------- --> 
417 
418<#-- Mostrar la categoria campusa de nivel mas profundo (si es categoria hija de otra categoria se muestra el color y el titulo de la categoria hija) con el color de fondo indicado en la propiedad "category-color" --> 
419<#macro getCampusaCategory> 
420    <#if serviceLocator??> 
421        <#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")/> 
422        <#assign articleResourcePrimKey = assetRenderer.getArticle().getResourcePrimKey()/>  
423        <#assign articleCategories = assetCategoryLocalService.getCategories("com.liferay.portlet.journal.model.JournalArticle",articleResourcePrimKey)/> 
424        <#assign assetCategoryPropertiesLocalService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetCategoryPropertyLocalService")> 
425        <#list articleCategories as articleCategory> 
426            <#assign articleCategory = articleCategory /> 
427            <#assign categoryTitle = articleCategory.getTitle(locale,false)/> 
428            <#assign categoryId = articleCategory.getCategoryId()/> 
429            <#assign parentCategoryId = articleCategory.getParentCategoryId()/> 
430            <#assign childCategoriesCount = assetCategoryLocalService.getChildCategoriesCount(categoryId)/> 
431            <#-- Se muestra la categoria si: 
432                - la categoria no tiene categoria padre ni categorias hija 
433                - la categoria tiene categoria padre (independientemente de si esta chequeada o no) --> 
434            <#if ( (parentCategoryId == 0) && (childCategoriesCount == 0) || (parentCategoryId != 0) ) > 
435                <#-- Si la categoria tiene propiedad category-color --> 
436                <#if (validator.isNotNull(assetCategoryPropertiesLocalService.getCategoryProperty(categoryId,"category-color"))) > 
437                    <#assign categoryColorProperty = assetCategoryPropertiesLocalService.getCategoryProperty(categoryId,"category-color")> 
438                    <#assign categoryColor = categoryColorProperty.getValue()/> 
439                    <#-- Si la propiedad tiene valor distinto de vacio-->     
440                    <#if (categoryColor != '')> 
441                        <span style="background-color:#${categoryColor};">${categoryTitle}</span> 
442                    </#if>      
443                </#if>     
444            <#-- Se muestra la categoria si tiene categorias hija y ninguna esta asociada al contenido -->  
445            <#elseif (childCategoriesCount != 0) > 
446                <#assign childCategorySelected = getterUtil.getBoolean("false") /> 
447                <#assign childCategories = assetCategoryLocalService.getChildCategories(categoryId) /> 
448                <#-- Se recorren las categorias hija --> 
449                <#list childCategories as childCategory >  
450                    <#assign childCategoryId = childCategory.getCategoryId() /> 
451                    <#-- Se recorren las categorias asociadas al contenido --> 
452                    <#list articleCategories as articleCategory>                
453                        <#assign contentCategoryId = articleCategory.getCategoryId() /> 
454                        <#-- Si alguna de las categorias hija es alguna de las asociadas al contenido, se muestra la categoria  --> 
455                        <#if (childCategoryId == contentCategoryId)> 
456                            <#assign childCategorySelected = getterUtil.getBoolean("true") /> 
457                        </#if> 
458                    </#list> 
459                 </#list> 
460                 <#-- Si ninguna de las categorias hija esta asociada al contenido se muestra la categoria padre asociada al contenido --> 
461                 <#if (!childCategorySelected)> 
462                    <#-- Si la categoria tiene propiedad category-color --> 
463                    <#if (validator.isNotNull(assetCategoryPropertiesLocalService.getCategoryProperty(categoryId,"category-color"))) > 
464                        <#assign categoryColorProperty = assetCategoryPropertiesLocalService.getCategoryProperty(categoryId,"category-color")> 
465                        <#assign categoryColor = categoryColorProperty.getValue()/> 
466                        <#-- Si la propiedad tiene valor distinto de vacio-->     
467                        <#if (categoryColor != '')> 
468                            <span style="background-color:#${categoryColor};">${categoryTitle}</span> 
469                        </#if>      
470                    </#if> 
471                 </#if>         
472            </#if>                               
473        </#list> 
474    </#if> 
475</#macro> 
476<#-- ---------- UPV/EHU - UPV/EHU -------- --> 

Noticias y Eventos

Se ha producido un error al procesar la plantilla.
Java method "com.sun.proxy.$Proxy911.getArticleContent(com.liferay.journal.model.JournalArticle, String, String, String, com.liferay.portal.kernel.portlet.PortletRequestModel, com.liferay.portal.kernel.theme.ThemeDisplay)" threw an exception when invoked on com.sun.proxy.$Proxy911 object "com.liferay.journal.service.impl.JournalArticleLocalServiceImpl@2a47f8d2"; see cause exception in the Java stack trace.

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign articleContent = journalArtic...  [in template "10112#522485#8158018" at line 154, column 41]
----
1<#assign liferay_ui = taglibLiferayHash["/META-INF/liferay-ui.tld"] /> 
2 
3<#-- Identificador de contenido dentro del publicador. Por defecto empieza en 0, excepto si hay filtrado por categoria o si se ignora el parametro compartido "categoryId", lo que supone no destacar el primer contenido del listado --> 
4<#assign itemNumber = 0 /> 
5 
6<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") /> 
7<#assign ddmStructureLocalService = serviceLocator.findService("com.liferay.dynamic.data.mapping.service.DDMStructureLocalService") /> 
8<#assign ddmFieldLocalServiceUtil = serviceLocator.findService("com.liferay.dynamic.data.mapping.service.DDMFieldLocalService")	/> 
9 
10<ul class="asset-list asset-list-summary"> 
11 
12    <#list entries as entry> 
13 
14	<#assign entry = entry /> 
15	 
16	<#assign assetRenderer = entry.getAssetRenderer() /> 
17	 
18	<#assign entryTitle = htmlUtil.escape(assetRenderer.getTitle(locale)) /> 
19		 
20	<#assign viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, entry) /> 
21	 
22	<#--- Si el contenido web tiene página de visualización (página detalle) se hará uso de la friendly URL---> 
23	<#if assetRenderer?has_content && assetRenderer.getArticle??> 
24		<#assign journalArticle = assetRenderer.getArticle() /> 
25		<#if journalArticle?has_content> 
26			<#assign layoutUuid = journalArticle.getLayoutUuid() /> 
27			<#if layoutUuid?has_content > 
28				<#assign urlViewContext = assetRenderer.getURLViewInContext(renderRequest, renderResponse, viewURL) /> 
29				<#assign viewURL = urlViewContext /> 
30			</#if>  
31		</#if> 
32	</#if> 
33	 
34	 
35	 
36	<#-- Si la URL para mostrar el contenido completo es de la parte publica del sitio web guest se quita de la URL --> 
37	<#assign guestPublicSiteURL = "/web/guest" /> 
38	<#if viewURL?contains(guestPublicSiteURL) > 
39			<#assign viewURL = viewURL?replace(guestPublicSiteURL, "") /> 
40	</#if> 
41	 
42	<li class="asset-summary item-${itemNumber}"> 
43		<div class="lfr-meta-actions asset-actions"> 
44			<@getEditIcon /> 
45		</div> 
46 
47		<#-- Si el publicador muestra solo contenidos, se muestra cada contenido con la plantilla summary correspondiente al tipo del contenido si existe dicha plantilla, sino aparece mensaje de error --> 
48		 
49		<#assign journalArticleClass = "com.liferay.journal.model.JournalArticle" /> 
50		<#assign ddmTemplateKey = 0 /> 
51		 
52		<#if assetRenderer.getClassName() == journalArticleClass > 
53			<#assign journalArticle = assetRenderer.getArticle() /> 
54			<#assign ddmStructure = journalArticle.getDDMStructure() /> 
55			<#assign ddmFormValues = ddmFieldLocalServiceUtil.getDDMFormValues(ddmStructure.getDDMForm(), journalArticle.getId())/>															 
56			<#assign ddmFormFieldValuesMap = ddmFormValues.getDDMFormFieldValuesMap(true)> 
57			<#assign structureName = ddmStructure.getName() />			 
58					 
59			<#-- Si existe la estructura/tipo de contenido --> 
60			<#if ddmStructure?? >  
61				<#assign templateName = "Summary" /> 
62				<#assign ddmTemplates = ddmStructure.getTemplates() /> 
63				 
64				<#-- ---------- Si la estructura/tipo de contenido tiene asociadas plantillas/visualizaciones --> 
65				<#assign isCall = false /> 
66				<#assign isOutStanding = false /> 
67				<#assign isHelp = false /> 
68				 
69				<#if (ddmTemplates??)>                                
70					<#list ddmTemplates as ddmTemplate>                                    
71						<#-- Si la plantilla/visualizacion es de tipo resumen --> 
72						<#if ddmTemplate.getName()?contains("Summary") || ddmTemplate.getName()?contains("Laburpena") || ddmTemplate.getName()?contains("Resumen") > 
73							<#assign ddmTemplateKeyStr = ddmTemplate.getTemplateKey()/> 
74							<#assign ddmTemplateKey = getterUtil.getLongStrict(ddmTemplateKeyStr)/>     
75						</#if>     
76						 
77						<#if structureName?contains("Call")> 
78							<#assign isCall = true /> 
79						<#elseif structureName?contains("Outstanding")> 
80							<#assign isOutStanding = true />										 
81						<#elseif structureName?contains("Subvention")> 
82							<#assign isHelp = true />		 
83						</#if>    
84					</#list> 
85				</#if> <#-- ddmTemplate --> 
86							 
87				<#-- Si existe la plantilla de nombre Summary --> 
88				<#if (ddmTemplateKey != 0)> 
89					<#if isCall> 
90								 
91						<#assign infoStateUrl = '' /> 
92						<#assign provisionalStateUrl = '' /> 
93						<#assign finalStateUrl = '' /> 
94						<#assign ref = '' />									 
95 
96						<#list ddmFormFieldValuesMap as key,ddmFormFieldValues>										 
97							<#list ddmFormFieldValues as ddmFormFieldValue>														 
98								<#if ddmFormFieldValue.getName()=="ehuinfostateurl" && ddmFormFieldValue.getValue()?? && ddmFormFieldValue.getValue().getString(locale)?has_content> 
99									<#assign infoStateUrl = ddmFormFieldValue.getValue().getString(locale) /> 
100								</#if>	 
101											 
102								<#if ddmFormFieldValue.getName()=="ehuprovisionalstateurl" && ddmFormFieldValue.getValue()?? && ddmFormFieldValue.getValue().getString(locale)?has_content> 
103									<#assign provisionalStateUrl = ddmFormFieldValue.getValue().getString(locale) /> 
104								</#if>	 
105											 
106								<#if ddmFormFieldValue.getName()=="ehufinalstateurl" && ddmFormFieldValue.getValue()?? && ddmFormFieldValue.getValue().getString(locale)?has_content> 
107									<#assign finalStateUrl = ddmFormFieldValue.getValue().getString(locale) /> 
108								</#if>	 
109										 
110							</#list>										 
111						</#list>																		 
112									 
113																											 
114						<#if infoStateUrl?? && !validator.isBlank(infoStateUrl)> 
115							<#assign ref = infoStateUrl />  
116						</#if><#--  infoUrl --> 
117						 
118						<#if provisionalStateUrl?? && !validator.isBlank(provisionalStateUrl)> 
119							<#assign ref = provisionalStateUrl />  
120						</#if><#--  provisionalUrl --> 
121						 
122						<#if finalStateUrl?? && !validator.isBlank(finalStateUrl)> 
123							<#assign ref = finalStateUrl />  
124						</#if><#--  finalUrl --> 
125 
126						<#assign protocol = "http"> 
127						<#if request?? && request?contains("https")> 
128							<#assign protocol = "https"> 
129						</#if> 
130						<#assign refProtocol = "http"> 
131						<#if ref?? && ref?contains("https")> 
132							<#assign refProtocol = "https"> 
133						</#if> 
134						 
135						<#if ref?? && !validator.isBlank( ref )> 
136							<#if refProtocol??> 
137								<#if ref?contains( refProtocol )> 
138									<#assign viewURL = ref/> 
139								<#else> 
140									<#assign viewURL = refProtocol + "://" + ref/> 
141								</#if> 
142							<#else> 
143								<#assign viewURL =  protocol + "://" + ref/> 
144							</#if> <#-- refProtocol --> 
145						</#if> <#-- ref --> 
146 
147					</#if><#-- if call --> 
148								 
149					<#assign assetObject = assetRenderer.getAssetObject()/> 
150					<#if !isOutStanding > 
151						<a href="${viewURL}"> 
152					</#if><#-- if isOutStanding -->	  
153		 
154					<#assign articleContent = journalArticleLocalService.getArticleContent(assetObject, ddmTemplateKeyStr,"VIEW", locale, null, themeDisplay) > 
155									 
156					<#-- Se controla que exista el article --> 
157					<#if journalArticleLocalService.fetchDisplayArticle(assetObject.getGroupId(),journalArticle.getArticleId())?? >     
158										 
159										 
160						<#-- Cambio para que el nombre del link en el publicador no sea demasiado grande y salte error de accesibilidad en informe del ministerio. 
161							En los contenidos Ayuda pintamos ahora solo el título para no pintar un texto demasiado largo en el link. El resto lo pintamos tras cerrar el link --> 
162						<#if isHelp>			 
163							<#assign ehutitle = '' /> 
164											 
165							<#list ddmFormFieldValuesMap as key,ddmFormFieldValues>														 
166								<#list ddmFormFieldValues as ddmFormFieldValue>											 
167									 
168									<#if ddmFormFieldValue.getName()=="ehutitle" && ddmFormFieldValue.getValue()?? && ddmFormFieldValue.getValue().getString(locale)?has_content> 
169										<#assign ehutitle = ddmFormFieldValue.getValue().getString(locale) /> 
170									</#if>	 
171								</#list> 
172							</#list>		 
173																				 
174							${ehutitle}												 
175											 
176						<#else> 
177							${articleContent}											 
178						</#if> <#-- if help -->	  
179										  
180					</#if> <#-- if fetchDisplayArticle -->	  
181										 
182					<#if !isOutStanding > 
183						</a> 
184						<#if isHelp> 
185							${articleContent} 
186						</#if>	 
187					</#if><#-- if isOutStanding -->	  
188								    
189				<#-- Si NO existe la plantilla de nombre Summary mensaje de error --> 
190				<#else>     
191					<div class="alert alert-error"> ${ddmStructure.getNameCurrentValue()} <@liferay.language key="ehu.error.structure-has-no-summary-template-select-another-template" /></div> 
192				</#if>     
193							 
194				<@getMetadataField fieldName="tags" /> 
195 
196				<@getMetadataField fieldName="create-date" /> 
197 
198				<@getMetadataField fieldName="view-count" /> 
199 
200				<@getMetadataField fieldName="author" /> 
201 
202				<@getRatings /> 
203 
204				<@getRelatedAssets /> 
205 
206				<@getDiscussion /> 
207			</#if> <#-- si existe la estructura -->  
208			<#assign itemNumber = itemNumber + 1 />      
209		 
210		<#-- si no es un journalArticleClass--> 
211		<#else> 
212			<h3 class="asset-title"> 
213				<#if assetRenderer?has_content && assetRenderer.getIconPath?has_content>         
214					<a href="${viewURL}"><img alt="" src="${assetRenderer.getIconPath(renderRequest)}" />${entryTitle}</a> 
215				</#if> 
216			</h3> 
217 
218			<@getMetadataField fieldName="tags" /> 
219 
220			<@getMetadataField fieldName="create-date" /> 
221 
222			<@getMetadataField fieldName="view-count" /> 
223 
224			<div class="asset-content"> 
225					<@getSocialBookmarks /> 
226 
227					<div class="asset-summary"> 
228							<@getMetadataField fieldName="author" /> 
229	 
230							${htmlUtil.escape(assetRenderer.getSummary(renderRequest, renderResponse))} 
231							 
232							<a href="${viewURL}"><@liferay.language key="read-more" /><span class="sr-only"><@liferay.language key="about" />${entryTitle}</span> &raquo;</a> 
233					</div> 
234 
235					<@getRatings /> 
236 
237					<@getRelatedAssets /> 
238 
239					<@getDiscussion /> 
240			</div> 
241		</#if> 
242		 
243	</li> 
244    </#list> 
245</ul> 
246 
247<#macro getDiscussion > 
248	<#if enableComments??> 
249		<#if assetRenderer?? &&  assetRenderer.getDiscussionPath()?? && (enableComments == "true")> 
250			<br /> 
251	 
252			<#assign discussionURL = renderResponse.createActionURL() /> 
253	 
254			${discussionURL.setParameter("struts_action", "/asset_publisher/" + assetRenderer.getDiscussionPath())} 
255	 
256			<@liferay_ui["discussion"] 
257				className=entry.getClassName() 
258				classPK=entry.getClassPK() 
259				formAction=discussionURL?string 
260				formName="fm" + entry.getClassPK() 
261				ratingsEnabled=enableCommentRatings == "true" 
262				redirect=portalUtil.getCurrentURL(request) 
263				userId=assetRenderer.getUserId() 
264			/> 
265		</#if> 
266	</#if> 
267</#macro> 
268 
269<#macro getEditIcon> 
270	<#if assetRenderer.hasEditPermission(themeDisplay.getPermissionChecker())> 
271		<#assign editPortletURL = assetRenderer.getURLEdit(renderRequest, renderResponse, windowStateFactory.getWindowState("NORMAL"), themeDisplay.getURLCurrent())!"" /> 
272 
273		<#if validator.isNotNull(editPortletURL)> 
274			<#assign title = languageUtil.format(locale, "edit-x", entryTitle) /> 
275 
276			<@liferay_ui["icon"] 
277				image="edit" 
278				message=title 
279				url=editPortletURL.toString() 
280			/> 
281		</#if> 
282	</#if> 
283</#macro> 
284 
285<#macro getFlagsIcon> 
286	<#if enableFlags??> 
287		<#if enableFlags == "true"> 
288			<@liferay_ui["flags"] 
289				className=entry.getClassName() 
290				classPK=entry.getClassPK() 
291				contentTitle=entry.getTitle(locale) 
292				label=false 
293				reportedUserId=entry.getUserId() 
294			/> 
295		</#if> 
296	</#if> 
297</#macro> 
298 
299<#macro getMetadataField 
300	fieldName 
301
302	<#if stringUtil.split(metadataFields)?seq_contains(fieldName)> 
303		<span class="metadata-entry metadata-${fieldName}"> 
304			<#assign dateFormat = "dd MMM yyyy - HH:mm:ss" /> 
305 
306			<#if fieldName == "author"> 
307				${portalUtil.getUserName(assetRenderer.getUserId(), assetRenderer.getUserName())} 
308			<#elseif fieldName == "categories"> 
309				<@liferay_ui["asset-categories-summary"] 
310					className=entry.getClassName() 
311					classPK=entry.getClassPK() 
312					portletURL=renderResponse.createRenderURL() 
313				/> 
314			<#elseif fieldName == "create-date"> 
315				${dateUtil.getDate(entry.getCreateDate(), dateFormat, locale)} 
316			<#elseif fieldName == "expiration-date"> 
317				${dateUtil.getDate(entry.getExpirationDate(), dateFormat, locale)} 
318			<#elseif fieldName == "modified-date"> 
319				${dateUtil.getDate(entry.getModifiedDate(), dateFormat, locale)} 
320			<#elseif fieldName == "priority"> 
321				${entry.getPriority()} 
322			<#elseif fieldName == "publish-date"> 
323				${dateUtil.getDate(entry.getPublishDate(), dateFormat, locale)} 
324			<#elseif fieldName == "tags"> 
325				<@liferay_ui["asset-tags-summary"] 
326					className=entry.getClassName() 
327					classPK=entry.getClassPK() 
328					portletURL=renderResponse.createRenderURL() 
329				/> 
330			<#elseif fieldName == "view-count"> 
331				<@liferay_ui["icon"] 
332					image="history" 
333				/> 
334 
335				${entry.getViewCount()} <@liferay.language key="views" /> 
336			</#if> 
337		</span> 
338	</#if> 
339</#macro> 
340 
341<#macro getPrintIcon> 
342	<#if enablePrint??> 
343		<#if enablePrint == "true" > 
344			<#assign printURL = renderResponse.createRenderURL() /> 
345	 
346			${printURL.setParameter("struts_action", "/asset_publisher/view_content")} 
347			${printURL.setParameter("assetEntryId", entry.getEntryId()?string)} 
348			${printURL.setParameter("viewMode", "print")} 
349			${printURL.setParameter("type", entry.getAssetRendererFactory().getType())} 
350	 
351			<#if (validator.isNotNull(assetRenderer.getUrlTitle()))> 
352				<#if (assetRenderer.getGroupId() != themeDisplay.getScopeGroupId())> 
353					${printURL.setParameter("groupId", assetRenderer.getGroupId()?string)} 
354				</#if> 
355	 
356				${printURL.setParameter("urlTitle", assetRenderer.getUrlTitle())} 
357			</#if> 
358	 
359			${printURL.setWindowState("pop_up")} 
360	 
361			<@liferay_ui["icon"] 
362				image="print" 
363				message="print" 
364				url="javascript:Liferay.Util.openWindow({id:'" + renderResponse.getNamespace() + "printAsset', title: '" + languageUtil.format(locale, "print-x-x", ["sr-only", entryTitle]) + "', uri: '" + htmlUtil.escapeURL(printURL.toString()) + "'});" 
365			/> 
366		</#if> 
367	</#if> 
368</#macro> 
369 
370<#macro getRatings> 
371	<#if enableRatings??> 
372		<#if (enableRatings == "true")> 
373			<div class="asset-ratings"> 
374				<@liferay_ui["ratings"] 
375					className=entry.getClassName() 
376					classPK=entry.getClassPK() 
377				/> 
378			</div> 
379		</#if> 
380	</#if> 
381</#macro> 
382 
383<#macro getRelatedAssets> 
384	<#if enableRelatedAssets??> 
385		<#if assetEntry?? && enableRelatedAssets == "true"> 
386			    <@liferay_ui["asset-links"] 
387				    assetEntryId=entry.getEntryId()/> 
388		</#if> 
389	</#if> 
390</#macro> 
391 
392<#macro getSocialBookmarks> 
393	<#if enableSocialBookmarks??> 
394		<#if enableSocialBookmarks?has_content && enableSocialBookmarks == "true"> 
395			<@liferay_ui["social-bookmarks"] 
396				displayStyle="${socialBookmarksDisplayStyle}" 
397				target="_blank" 
398				title=entry.getTitle(locale) 
399				url=viewURL 
400			/> 
401		</#if> 
402	</#if> 
403</#macro>