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#36734" at line 28, 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#36734" at line 28, 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             
10<!-- VARIABLES --> 
11<#assign articleId = .vars['reserved-article-id'].data > 
12<#assign articleTitle = .vars['reserved-article-title'].data > 
13<#assign journalArticle = journalArticleLocalService.getArticle(articleGroupId, articleId) > 
14<#assign articlePK = journalArticle.getResourcePrimKey() > 
15<#assign themeDisplay = serviceContext.getThemeDisplay() /> 
16<#assign idTitulo = 0 > 
17 
18 
19<div class="container-casos-exito"> 
20    <div class="container"> 
21        <div class="col-xs-12 col-sm-8 col-md-8"> 
22            <#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")> 
23            <#assign AssetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService")> 
24            <h2 class="titulo-buenas-practicas"> 
25                ${titulo.getData()} 
26            </h2> 
27            <!-- <img src="${icono.getData()}"> --> 
28            <img alt="${imagen.imagenalt.getData()}" title="${imagen.imagentitle.getData()}" src="${imagen.getData()}"> 
29             
30             <#if entradilla.getData()?has_content> 
31                <div class="entradilla-buenas-practicas"> 
32                    ${entradilla.getData()} 
33                </div> 
34            </#if> 
35             
36            <div class="contenido-buenas-practicas"> 
37                ${desarrolloContenido.getData()} 
38            </div> 
39        </div> 
40        <div class="col-xs-12 col-sm-4 col-md-4"> 
41            <div class="documentos-relacionados buenas-practicas-docs"> 
42                <div class="listado-documentos"> 
43                    <#if tituloDocumentoRelacionado?has_content> 
44                        <div class="titulo-documentos"> 
45                                <@liferay.language key='mcmutual.acciones.documentosRelacionados' />    
46                        </div> 
47                    	<#list tituloDocumentoRelacionado.getSiblings() as cur_tituloDocumentoRelacionado> 
48                            <div class="col-xs-12 col-sm-12 col-md-12"> 
49                        	    <div class="col-xs-12 col-sm-12 col-md-12"> 
50                            	    <div class="col-xs-2 col-sm-2 col-md-2 icono"> 
51                            	        <img alt="Icono documento" title="Icono documento" src="/documents/884597/0/icono_documento.png/0be11f66-3f5d-646d-c3a1-18a5ab3793da?t=1534764088311"/> 
52                            	    </div> 
53                    		        <div class="col-xs-9 col-sm-9 col-md-9 enlace"> 
54                                        <#assign docPrivado = cur_tituloDocumentoRelacionado.docprivado.getData() > 
55                                        <p> 
56                                            <a href="${cur_tituloDocumentoRelacionado.linkDocumentoRelacionado.getData()}">${cur_tituloDocumentoRelacionado.getData()}</a> 
57                                        </p> 
58                                        
59                                    </div> 
60                                     <#if docPrivado == '["false"]' > 
61                                            <div class="col-xs-1 col-sm-1 col-md-1 candadito" > 
62                                            </div> 
63                                        </#if> 
64                        		</div> 
65                    		</div> 
66                    	</#list> 
67                    </#if> 
68                </div> 
69            </div> 
70        </div> 
71    </div> 
72</div> 
73 
74<!--RELATED ASSETS--> 
75<div class="container-conts-relacionados"> 
76    <div class="container"> 
77        <#assign journalArticleAssetEntry = assetEntryLocalService.getEntry("com.liferay.journal.model.JournalArticle", articlePK) /> 
78        <#assign journalArticleAssetEntryId = journalArticleAssetEntry.getEntryId() /> 
79        <#assign journalArticleRelatedLinks = assetLinkLocalService.getDirectLinks(journalArticleAssetEntryId) /> 
80     
81        <#assign articleStructureId = journalArticle.getDDMStructure().getStructureKey()> 
82        <#assign related_articles = []> 
83        <#list journalArticleRelatedLinks as related_entry> 
84            <#assign relatedAssetEntryId = related_entry.getEntryId2() /> 
85            <#assign relatedAssetEntry = assetEntryLocalService.getEntry(relatedAssetEntryId) /> 
86             
87             
88            <#if validator.equals(relatedAssetEntry.getClassName(), "com.liferay.journal.model.JournalArticle") > 
89                <#assign relatedAssetEntryPrimKey = relatedAssetEntry.getClassPK() /> 
90                <#assign relatedArticle = journalArticleLocalService.getLatestArticle(relatedAssetEntryPrimKey) /> 
91                <#assign related_articles = related_articles + [relatedArticle]> 
92            </#if> 
93        </#list> 
94        <div class="col-xs-12 col-sm-12 col-md-12"> 
95            <div class="titulo-otros-conts-relacionados"> 
96                <@liferay.language key="mcMutual.mantenteAlDia.casosExito.OtrasPublicaciones"/> 
97				<#attempt> 
98					<#assign layout=layoutLocalService.getLayout(groupId,false,themeDisplay.getLayout().getParentLayoutId())>${layout.getName(locale)} 
99				<#recover> 
100							 
101				</#attempt> 
102            </div> 
103        </div>   
104         
105        <#list related_articles as related_article> 
106                <div class="col-xs-12 col-sm-4 col-md-4 caja-cont-relacionado"> 
107                <#assign title = related_article.getTitle(locale)> 
108                <#assign url="/-/"+related_article.getUrlTitle()> 
109                 
110                <#assign document = saxReaderUtil.read(related_article.getContentByLocale(locale)) > 
111                <#assign rootElement = document.getRootElement() > 
112                <#assign titulo = saxReaderUtil.createXPath("dynamic-element[@name='titulo']/dynamic-content").selectSingleNode(rootElement).getStringValue() > 
113                <#assign imagen = saxReaderUtil.createXPath("dynamic-element[@name='imagen']/dynamic-content").selectSingleNode(rootElement).getStringValue() > 
114                 
115                 <#if saxReaderUtil.createXPath("dynamic-element[@name='imagen']/dynamic-element[@name='imagenalt']/dynamic-content").selectSingleNode(rootElement) ?? > 
116                <#assign imagenalt = saxReaderUtil.createXPath("dynamic-element[@name='imagen']/dynamic-element[@name='imagenalt']/dynamic-content").selectSingleNode(rootElement).getStringValue() > 
117            <#else> 
118                <#assign imagenalt = "" > 
119             </#if>  
120              
121              <#if saxReaderUtil.createXPath("dynamic-element[@name='imagen']/dynamic-element[@name='imagentitle']/dynamic-content").selectSingleNode(rootElement) ?? > 
122               
123                 <#assign imagentitle = saxReaderUtil.createXPath("dynamic-element[@name='imagen']/dynamic-element[@name='imagentitle']/dynamic-content").selectSingleNode(rootElement).getStringValue() > 
124             <#else> 
125                <#assign imagentitle = "" > 
126             </#if> 
127                     
128                <img alt="${imagenalt}" title="${imagentitle}" src="${imagen}"> 
129                <div class="nombre-listado-mantente-al-dia"> 
130					<#attempt> 
131						<#assign layout=layoutLocalService.getLayout(groupId,false,themeDisplay.getLayout().getParentLayoutId())> 
132						<p>${layout.getName(locale)}</p> 
133					<#recover> 
134							 
135					</#attempt> 
136                </div> 
137                 
138                 <span style="display:none" class="titulo-mantente-dia"> 
139                    ${titulo} 
140                </span> 
141                 
142                <a  href="${url}"> 
143                    <div class="titulo-listado-mantente-al-dia" id="titulo-listado-mantente-al-dia${idTitulo}"> 
144     
145                    </div> 
146                </a> 
147            </div> 
148            <#assign idTitulo = idTitulo + 1 > 
149        </#list> 
150    </div> 
151</div> 
152 
153<script> 
154 
155var titulos = document.getElementsByClassName("titulo-mantente-dia"); 
156for(var i=0; i <= titulos.length; i++){ 
157    var titulo = document.getElementById("titulo-listado-mantente-al-dia"+i); 
158    if(titulos[i] != null){ 
159        var cadenaTitulo = titulos[i].innerHTML; 
160        if(cadenaTitulo.length > 95){ 
161            for(var j=1; j <= titulos[i].innerHTML.length; j++){ 
162                if(titulos[i].innerHTML.charAt(j)==" " && j <=95){ 
163                    titulo.innerHTML = titulos[i].innerHTML.substr(0, j); 
164                    titulo.innerHTML += "..."; 
165
166
167        }else{ 
168            document.getElementById("titulo-listado-mantente-al-dia"+i).innerHTML = titulos[i].innerHTML; 
169
170
171
172 
173</script>