Produciuse un erro ao procesar o modelo.
Java method "com.sun.proxy.$Proxy1215.getArticleByUrlTitle(long, String)" threw an exception when invoked on com.sun.proxy.$Proxy1215 object "com.once.comun.serviceWrapper.journal.service.JournalServiceWrapper@1ddb3bfa"; see cause exception in the Java stack trace.
----
FTL stack trace ("~" means nesting-related):
- Failed at: #assign journalArticle = journalArtic... [in template "20192#20219#TPL_ASISOMOS_DETALLE_NOTICIA" in macro "compartir_rrss" at line 180, column 5]
- Reached through: @compartir_rrss [in template "20192#20219#TPL_ASISOMOS_DETALLE_NOTICIA" at line 145, column 13]
----
1<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
2
3<#assign
4 asisomosService = serviceLocator.findService("com.once.welgso.asisomos.service.api.AsiSomosService")
5 journalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")
6 asisomosGroupId = asisomosService.getGroupId(request)!groupId
7 URLdetalleArt = ""
8 canonicalURL = ""
9/>
10
11<#-- 1. Obtenemos el ID del artículo de forma segura -->
12<#assign journalArticleId = (.vars['reserved-article-id'].data)!"" />
13
14<#if journalArticleId != "">
15 <#attempt>
16 <#-- 2. Obtenemos el objeto artículo completo para sacar su ResourcePrimKey -->
17 <#assign articleObj = journalService.getArticle(asisomosGroupId, journalArticleId) />
18 <#assign resourcePrimKey = articleObj.getResourcePrimKey() />
19
20 <#-- 3. Llamamos a tu función del Service con el PrimKey real -->
21 <#assign revistaArticulo = asisomosService.getRevistaFromArticulo(resourcePrimKey)! />
22
23 <#if revistaArticulo?has_content>
24 <#-- 4. Construimos la URL -->
25 <#assign URLdetalleArt = "/w/" + articleObj.getUrlTitle() + "?revista=" + revistaArticulo.getArticleId() />
26 <#assign canonicalURL = themeDisplay.getPortalURL() + URLdetalleArt />
27
28 <#-- 5. Inyectamos la lógica en el HEAD -->
29 <@liferay_util["html-top"]>
30 <link rel="canonical" id="canonical-asisomos" href="${canonicalURL}">
31 <script>
32 (function() {
33 var targetURL = "${canonicalURL}";
34 if (!window.location.href.includes('revista=')) {
35 window.location.replace(targetURL);
36 }
37 var canonicals = document.querySelectorAll('link[rel="canonical"]');
38 canonicals.forEach(function(el) {
39 if (el.id !== 'canonical-asisomos') {
40 el.parentNode.removeChild(el);
41 }
42 });
43 })();
44 </script>
45 </@>
46 </#if>
47 <#recover>
48 <#-- Si falla la obtención del objeto o el servicio, la página carga normal sin redirect -->
49 </#attempt>
50</#if>
51
52<#function trimAfterImageExt url>
53 <#assign lc = url?lower_case>
54 <#assign exts = [".jpeg", ".jpg", ".png"]>
55 <#assign cut = -1>
56
57 <#list exts as ext>
58 <#assign idx = lc?last_index_of(ext)>
59 <#if (idx != -1) && ((idx + ext?length) > cut)>
60 <#assign cut = idx + ext?length>
61 </#if>
62 </#list>
63
64 <#if (cut != -1)>
65 <#return url?substring(0, cut)>
66 <#else>
67 <#return url>
68 </#if>
69</#function>
70
71
72<#assign urlSEO = themeDisplay.getPortalURL() + URLdetalleArt />
73<#assign titleSEO = htmlUtil.escape(title.getData()) />
74<#assign descripcionOG = "" />
75<#assign imageSEO = image.getData() />
76<#assign altSEO = htmlUtil.escape(title.getData()) />
77
78<#if (thumbnail.getData()?? && thumbnail.getData() != "")>
79 <#assign imageSEO = thumbnail.getData() />
80 <#assign altSEO = htmlUtil.escape(thumbnail.getAttribute("alt")) />
81<#elseif (image.getAttribute("alt")?? & image.getAttribute("alt") != "")>
82 <#assign altSEO = htmlUtil.escape(image.getAttribute("alt")) />
83</#if>
84
85<#if Seo?? >
86 <#if (Seo.TituloOG.getData())?? && Seo.TituloOG.getData() != "">
87 <#assign titleSEO = htmlUtil.escape(Seo.TituloOG.getData()) />
88 </#if>
89 <#if (Seo.DescripcionOG.getData())?? && Seo.DescripcionOG.getData() != "">
90 <#assign descripcionOG = htmlUtil.escape(Seo.DescripcionOG.getData()) />
91 </#if>
92
93 <#if (Seo.ImagenOG.getData())?? && Seo.ImagenOG.getData() != "">
94 <#assign imageSEO = trimAfterImageExt(Seo.ImagenOG.getData())>
95 <#if (Seo.ImagenOG.getAttribute("alt"))?? && Seo.ImagenOG.getAttribute("alt") != "">
96 <#assign altSEO = htmlUtil.escape(Seo.ImagenOG.getAttribute("alt")) />
97 </#if>
98 </#if>
99</#if>
100
101<@liferay_util["html-top"]>
102 <meta property="og:type" content="article" />
103 <meta property="og:url" content="${urlSEO}"/>
104 <meta property="og:title" content="${titleSEO}" />
105 <meta property="og:description" content="${descripcionOG}" />
106 <meta property="og:image" content="${imageSEO}" />
107 <meta property="og:image:alt" content="${altSEO}" />
108 <meta name="twitter:title" content="${titleSEO}" />
109 <meta name="twitter:description" content="${descripcionOG}" />
110 <meta name="twitter:card" content="summary_large_image" />
111 <meta name="twitter:image" content="${imageSEO}" />
112 <meta itemprop="image" content="${imageSEO}" />
113</@>
114
115<div class="justify-content-center container-fluid container-fluid-max-xl px-lg-4 px-xl-0">
116 <div class="asisomos_detallenoticia col-12 col-xs-12 col-sm-12 col-md-12 col-lg-11 col-xl-10 m-auto px-0">
117 <div class="img_asisomos_detallenoticia">
118 <div class="img_asisomos_detallenoticia_img m-auto px-xl-4 col-12 columna-ancho-1000">
119 <#if image.getData()?? && image.getData() != "">
120 <img class="img-fluid" title="${image.getAttribute("alt")}" alt="${image.getAttribute("alt")}" data-fileentryid="${image.getAttribute("fileEntryId")}" src="${image.getData()}" />
121 <#if pieDeFoto.getData()?? && pieDeFoto.getData() != "">
122 <figcaption class="p-2 d-block text-center">${pieDeFoto.getData()}</figcaption>
123 </#if>
124 </#if>
125 </div>
126 <div class="text-left col-12 px-0 px-xl-4 columna-ancho-1000 m-auto">
127 <div class="titulo_asisomos_detallenoticia pt-4">
128 <h2>${title.getData()}</h2>
129 </div>
130 <div class="subtitulo_asisomos_detallenoticia pt-3">
131 <h3>${subtitle.getData()}</h3>
132 </div>
133 <div class="contenido_asisomos_detallenoticia">
134 ${Entradilla.getData()}
135
136 ${content.getData()}
137 </div>
138 </div>
139
140 </div>
141 </div>
142
143 <div class="asisomos-detallenoticia-content-tools d-flex justify-content-center">
144 <div class="asisomos-detallenoticia-content-tools-share">
145 <@compartir_rrss/>
146 </div>
147 </div>
148
149 <#assign userLocalService = serviceLocator.findService('com.liferay.portal.kernel.service.UserLocalService') />
150 <#assign author_id = .vars['reserved-article-author-id'].data?number>
151 <#assign author_user = userLocalService.getUserById(author_id)/>
152 <#assign author_image = author_user.getPortraitURL(themeDisplay)/>
153 <#if FIRMA??>
154 <div class="row col-12 col-xs-12 col-sm-12 col-md-12 col-lg-10 col-xl-8 m-auto">
155 <div class="col-2 col-sm-3 col-md-4 justify-content-center">
156 <div class="lineautor_asisomos_detallenoticiaizq"> </div>
157 </div>
158 <div class="autor_asisomos_detallenoticia d-flex flex-column justify-content-center text-center col-8 col-sm-6 col-md-4">
159 <span class="imguser_asisomos_detallenoticia">
160 <#if FIRMA.ImagenAutor.getData()?? && FIRMA.ImagenAutor.getData() != "">
161 <img title="${FIRMA.ImagenAutor.getAttribute("alt")}" alt="${FIRMA.ImagenAutor.getAttribute("alt")}" data-fileentryid="${FIRMA.ImagenAutor.getAttribute("fileEntryId")}" src="${FIRMA.ImagenAutor.getData()}" />
162 </#if>
163 <#if FIRMA.Autor.getData()?? && FIRMA.Autor.getData() != "">
164 <span class="pt-3"><div class="h3">${FIRMA.Autor.getData()}</div></span>
165 </#if>
166 <#if FIRMA.CargoRevista.getData()?? && FIRMA.CargoRevista.getData() != "">
167 <span class=""><div class="h4">${FIRMA.CargoRevista.getData()}</div></span>
168 </#if>
169 </span>
170 </div>
171 <div class="col-2 col-sm-3 col-md-4 justify-content-center">
172 <div class="lineautor_asisomos_detallenoticiader"> </div>
173 </div>
174 </div>
175 </#if>
176</div>
177
178<#macro compartir_rrss>
179 <#assign journalArticleUtil = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
180 <#assign journalArticle = journalArticleUtil.getArticleByUrlTitle(themeDisplay.getCompanyGroupId(), "rrss_compartir")>
181 <@liferay_journal["journal-article"]
182 articleId=journalArticle.getArticleId()
183 ddmTemplateKey="GLOBAL_RRSS_SHARE"
184 groupId=journalArticle.getGroupId()
185 />
186</#macro>
187
188<style>
189@media screen and (max-width: 768px) {
190 .contenido_asisomos_detallenoticia p {
191 text-align: left !important;
192 }
193 }
194.titulo_asisomos_detallenoticia h2 {
195 font-weight: 800;
196}
197
198.subtitulo_asisomos_detallenoticia h3 {
199 font-weight: 100;
200 color: #124e83;
201 font-size: 1.6rem;
202}
203
204@media (min-width: 1000px) and (max-width: 1500px) {
205 .columna-ancho-1000{
206 flex: 0 0 83.33333%;
207 max-width: 90.33333%;
208 }
209}
210strong{
211 font-weight: 800;
212}
213
214.contenido_asisomos_detallenoticia img{
215 margin:auto !important;
216 padding: 0 1rem;
217 height: unset !important;
218}
219.img_asisomos_detallenoticia_img {
220 img {
221 max-height:80vh;
222 object-fit:contain;
223 margin:auto;
224 }
225}
226
227
228@media screen and (max-width: 768px) {
229 .img_asisomos_detallenoticia img {
230 object-fit: cover !important;
231 }
232 .img_asisomos_detallenoticia_img {
233 img {
234 width: 100vw;
235 margin: 0 -55px;
236 max-width: unset !important;
237 }
238 .contenido_asisomos_detallenoticia p {
239 text-align: left !important;
240 }
241}
242</style>