Publicador de continguts

S'ha produït un error mentre es processava la plantilla.
The following has evaluated to null or missing:
==> imagen.imagenalt  [in template "20116#20152#45008" at line 41, column 25]

----
Tip: It's the step after the last dot that caused this error, not those before it.
----
Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----

----
FTL stack trace ("~" means nesting-related):
	- Failed at: ${imagen.imagenalt.getData()}  [in template "20116#20152#45008" at line 41, column 23]
----
1<!-- SERVICES --> 
2<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")> 
3<#assign layoutLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService")> 
4<#assign assetLinkLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetLinkLocalService") /> 
5<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") /> 
6<#assign dDMStructureLocalService = serviceLocator.findService("com.liferay.dynamic.data.mapping.service.DDMStructureLocalService") /> 
7<#assign serviceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext()> 
8 
9<!-- VARIABLES --> 
10<#assign articleId = .vars['reserved-article-id'].data > 
11<#assign articleTitle = .vars['reserved-article-title'].data > 
12<#assign journalArticle = journalArticleLocalService.getArticle(articleGroupId, articleId) > 
13<#assign articlePK = journalArticle.getResourcePrimKey() > 
14<#assign themeDisplay = serviceContext.getThemeDisplay() /> 
15<#assign idTitulo = 0 > 
16 
17<#assign document = saxReaderUtil.read(journalArticle.getContentByLocale(locale)) > 
18<#assign rootElement = document.getRootElement() > 
19<#assign publicoPrivado = saxReaderUtil.createXPath("dynamic-element[@name='publicoPrivado']/dynamic-content").selectSingleNode(rootElement).getStringValue() > 
20<#assign themeDisplay = serviceContext.getThemeDisplay() /> 
21<#assign link = themeDisplay.getPortalURL() + themeDisplay.getURLCurrent()> 
22 
23 
24 
25<div class="container-publicaciones"> 
26 
27            <div id="cabecera_impresion" style="display:none"> 
28                <div><img src="/o/ThemePortalAbsentismo/images/company_logo.png" style="width:140px !important;height:80px !important;"></div> 
29                <div>${link}</div> 
30                <hr style="border-top: 2px solid #000000;"/> 
31                <br> 
32            </div> 
33 
34 
35    <div class="container"> 
36        <div class="col-sm-8 col-md-8"> 
37            <h2 class="titulo-buenas-practicas"> 
38                ${titulo.getData()} 
39            </h2> 
40             
41            <img alt="${imagen.imagenalt.getData()}" title="${imagen.imagentitle.getData()}" class="imagen-buenas-practicas"  src="${imagen.getData()}"> 
42             
43                <!--INICIO DEL COMPONENTE COMPARTIR E IMPRIMIR-->      
44    <div class="container-col-iconos">	 
45        <p> 
46            <#assign contadorGuia = ""> 
47            <@macrosFreemakerMutual.compartirAbsentismo contadorGuia link articleTitle/> 
48        	<div class="compartirEnlace col-xs-4 col-sm-4 col-md-4 container-icono-guias print" onclick="imprimir()"></div> 
49    	</p> 
50    	</br> 
51    </div> 
52         
53    <script>															 
54    	var mostrar = 0; 
55    	function compartir(){ 
56    		if(mostrar == 0){ 
57    			$("#compartir").show(); 
58    			mostrar = 1; 
59    		}else{ 
60    			$("#compartir").hide(); 
61    			mostrar = 0; 
62
63
64    	function imprimir(){ 
65    			window.print(); 
66
67    </script> 
68    <!--FIN DEL COMPONENTE COMPARTIR E IMPRIMIR--> 
69 
70             
71 
72            <div class="contenido-buenas-practicas"> 
73                ${entradilla.getData()} 
74                ${desarrolloContenido.getData()} 
75                ${autor.getData()} 
76            </div> 
77        </div> 
78        <div class="col-sm-4 col-md-4"> 
79            <div class="documentos-relacionados buenas-practicas-docs"> 
80                    <div class="listado-documentos"> 
81                        <#if tituloDocumentoRelacionado?has_content> 
82                            <div class="titulo-documentos"> 
83                                    <@liferay.language key='mcmutual.acciones.documentosRelacionados' />    
84                            </div> 
85                        	<#list tituloDocumentoRelacionado.getSiblings() as cur_tituloDocumentoRelacionado> 
86                                <div class="col-xs-12 col-sm-12 col-md-12"> 
87                            	    <div class="col-xs-2 col-sm-2 col-md-2 icono"> 
88                            	        <img alt="Icono documento" title="Icono documento" src="/documents/884597/0/icono_documento.png/0be11f66-3f5d-646d-c3a1-18a5ab3793da?t=1534771288311"/> 
89                            	    </div> 
90                    		         <#if cur_tituloDocumentoRelacionado.docprivado?has_content> 
91                        		        <div class="col-xs-9 col-sm-9 col-md-9 enlace"> 
92                                            <#assign docPrivado = cur_tituloDocumentoRelacionado.docprivado.getData() > 
93                                            <p> 
94                                                <a href="${cur_tituloDocumentoRelacionado.linkDocumentoRelacionado.getData()}">${cur_tituloDocumentoRelacionado.getData()}</a> 
95                                            </p> 
96                                            
97                                        </div> 
98                                    </#if> 
99                                     <#if docPrivado == '["false"]' > 
100                                            <div class="col-xs-1 col-sm-1 col-md-1 candadito" > 
101                                            </div> 
102                                        </#if> 
103                        		</div> 
104                        	</#list> 
105                        </#if> 
106                    </div> 
107            </div> 
108        </div> 
109    </div> 
110</div> 
111<!--RELATED ASSETS--> 
112 
113<div class="container-conts-relacionados"> 
114    <div class="container"> 
115        <#assign journalArticleAssetEntry = assetEntryLocalService.getEntry("com.liferay.journal.model.JournalArticle", articlePK) /> 
116        <#assign journalArticleAssetEntryId = journalArticleAssetEntry.getEntryId() /> 
117        <#assign journalArticleRelatedLinks = assetLinkLocalService.getDirectLinks(journalArticleAssetEntryId) /> 
118     
119         <#assign articleStructureId = journalArticle.getDDMStructure().getStructureKey()> 
120     
121        <#assign related_articles = []> 
122         
123        <#assign related_articles = journalArticleLocalService.getArticlesByStructureId(groupId, articleStructureId, -1, -1, null)> 
124         
125        <!-- quitar el articulo actual para que no salga como relacionado --> 
126        <#assign related_articles_others = []> 
127        <#list related_articles as related_entry> 
128           <#if !validator.equals(related_entry.getArticleId(), articleId) > 
129                <#assign related_articles_others = related_articles_others + [related_entry]> 
130            </#if> 
131        </#list> 
132        <#assign related_articles_size = related_articles_others?size> 
133 
134 
135            <div class="col-sm-12 col-md-12"> 
136                <div class="titulo-otros-conts-relacionados"> 
137                    <@liferay.language key="mcMutual.mantenteAlDia.OtrasPublicaciones"/> 
138					<#attempt> 
139						<#assign layout=layoutLocalService.getLayout(groupId,false,themeDisplay.getLayout().getParentLayoutId())>${layout.getName(locale)} 
140					<#recover> 
141							 
142					</#attempt> 
143                </div> 
144            </div> 
145             
146            <#assign _rand = 0.36 > 
147            <#assign numElementosMostrar = 3 > 
148            <#assign inicio = rand(0, (related_articles_size-numElementosMostrar)) > 
149            <#assign fin = inicio + (numElementosMostrar - 1) > 
150 
151             
152            <#list related_articles_others[inicio..fin] as related_article> 
153                <div class="col-sm-4 col-md-4 caja-cont-relacionado"> 
154                    <#assign title = related_article.getTitle(locale)> 
155                    <#assign url="/-/"+related_article.getUrlTitle()> 
156                     
157                    <#assign document = saxReaderUtil.read(related_article.getContentByLocale(locale)) > 
158                    <#assign rootElement = document.getRootElement() > 
159                    <#assign titulo = saxReaderUtil.createXPath("dynamic-element[@name='titulo']/dynamic-content").selectSingleNode(rootElement).getStringValue() > 
160                    <#assign imagen = saxReaderUtil.createXPath("dynamic-element[@name='imagen']/dynamic-content").selectSingleNode(rootElement).getStringValue() > 
161                     
162                     <#if saxReaderUtil.createXPath("dynamic-element[@name='imagen']/dynamic-element[@name='imagenalt']/dynamic-content").selectSingleNode(rootElement) ?? > 
163                <#assign imagenalt = saxReaderUtil.createXPath("dynamic-element[@name='imagen']/dynamic-element[@name='imagenalt']/dynamic-content").selectSingleNode(rootElement).getStringValue() > 
164            <#else> 
165                <#assign imagenalt = "" > 
166             </#if>  
167              
168              <#if saxReaderUtil.createXPath("dynamic-element[@name='imagen']/dynamic-element[@name='imagentitle']/dynamic-content").selectSingleNode(rootElement) ?? > 
169               
170                 <#assign imagentitle = saxReaderUtil.createXPath("dynamic-element[@name='imagen']/dynamic-element[@name='imagentitle']/dynamic-content").selectSingleNode(rootElement).getStringValue() > 
171             <#else> 
172                <#assign imagentitle = "" > 
173             </#if> 
174                                 
175                    <img alt="${imagenalt}" title="${imagentitle}" src="${imagen}"> 
176                    <div class="nombre-listado-mantente-al-dia"> 
177						<#attempt> 
178							<#assign layout=layoutLocalService.getLayout(groupId,false,themeDisplay.getLayout().getParentLayoutId())> 
179							${layout.getName(locale)} 
180						<#recover> 
181								 
182						</#attempt> 
183                    </div> 
184                     
185                     <span style="display:none" class="titulo-mantente-dia"> 
186                        ${titulo} 
187                     </span> 
188                      
189                    <a  href="${url}"> 
190                        <div class="titulo-listado-mantente-al-dia" id="titulo-listado-mantente-al-dia${idTitulo}"> 
191                        </div> 
192                    </a> 
193                </div> 
194                <#assign idTitulo = idTitulo + 1 > 
195            </#list> 
196        </div> 
197    </div> 
198</div> 
199 
200<script> 
201 
202var titulos = document.getElementsByClassName("titulo-mantente-dia"); 
203for(var i=0; i <= titulos.length; i++){ 
204    var titulo = document.getElementById("titulo-listado-mantente-al-dia"+i); 
205    if(titulos[i].innerHTML != null){ 
206        var cadenaTitulo = titulos[i].innerHTML; 
207        if(cadenaTitulo.length > 95){ 
208            for(var j=1; j <= titulos[i].innerHTML.length; j++){ 
209                if(titulos[i].innerHTML.charAt(j)==" " && j <=95){ 
210                    titulo.innerHTML = titulos[i].innerHTML.substr(0, j); 
211                    titulo.innerHTML += "..."; 
212
213
214        }else{ 
215            document.getElementById("titulo-listado-mantente-al-dia"+i).innerHTML = titulos[i].innerHTML; 
216
217
218
219 
220</script> 
221 
222<#function rand min max> 
223  <#local now = .now?long?c /> 
224  <#local randomNum = _rand + ("0." + now?substring(now?length-1) + now?substring(now?length-2))?number /> 
225  <#if (randomNum > 1)> 
226    <#assign _rand = randomNum % 1 /> 
227  <#else> 
228    <#assign _rand = randomNum /> 
229  </#if> 
230  <#return (min + ((max - min) * _rand))?round /> 
231</#function>