Visor de contenido web
Subscripción al boletín de novedades del portal
Desde aquí puede consultar el boletín de novedades del Portal de Dades Obertes y del Portal de Transparencia de la Generalitat. Así mismo, si lo quiere recibir por correo electrónico, desde los enlaces que encontrará más abajo puede dar de alta o cancelar su suscripción. Si ya se ha subscrito y quiere modificar su dirección electrónica, se tendrá que dar de baja y hacer una alta nueva.
Boletines
« Atrás
21 de diciembre de 2020 a 2 de febrero de 2021
Se ha producido un error al procesar la plantilla.
Method public static com.liferay.portlet.journal.model.JournalArticle com.liferay.portlet.journal.service.JournalArticleLocalServiceUtil.getArticle(long,java.lang.String) throws com.liferay.portal.kernel.exception.PortalException,com.liferay.portal.kernel.exception.SystemException threw an exception
1<#-- Get ThemeDisplay object, instead of the available $themeDisplay map -->
2<#assign serviceContext = staticUtil["com.liferay.portal.service.ServiceContextThreadLocal"].getServiceContext() />
3<#assign httpServletRequest = serviceContext.getRequest() />
4<#assign objThemeDisplay = httpServletRequest.getAttribute("THEME_DISPLAY") />
5
6<#-- Llamadas al ServiceLocator -->
7<#assign journalArticleLocalService = staticUtil["com.liferay.portlet.journal.service.JournalArticleLocalServiceUtil"] />
8
9<#-- Host -->
10<#assign protocol = "https://" />
11<#assign host = protocol + objThemeDisplay.serverName />
12
13<#-- Nos guardamos la url actual -->
14<#assign current_url = objThemeDisplay.getURLCurrent() />
15<#assign friendly_url = objThemeDisplay.getLayout().getFriendlyURL() />
16
17<#-- Article -->
18<#assign articleId = "${.vars['reserved-article-id'].data}" />
19<#assign article = journalArticleLocalService.getArticle(getterUtil.getLong(objThemeDisplay.getScopeGroupId()),articleId) />
20
21<#-- Plantilla que se utilizará para el envío del correo -->
22<#assign preferencesTemplateId = "170063662" />
23
24
25<#-- STYLE -->
26
27
28<style type="text/css">
29 #content .portlet-asset-publisher.newsletter h2{color:#000000 !important;font-size: 1.8em !important;}
30 #content .portlet-asset-publisher.newsletter h3{font-size: 1.5em !important; margin: 20px 0 5px 0!important;}
31 #content .portlet-asset-publisher.newsletter h4 {font-size: 1.3em;}
32 #content .portlet-asset-publisher.newsletter .journal-content-article .webContent .noticias h4:before {display: inline-block;content: '';width: 5px;height: 5px;background: #146362;margin-right: 5px;}
33 #content .portlet-asset-publisher.newsletter a{color: #146362!important;text-decoration: underline !important; font-weight: bold;}
34 #content .portlet-asset-publisher.newsletter .asset-full-content{background: none; padding: 0;}
35 #content .portlet-asset-publisher.newsletter .journal-content-article .webContent{width: 100%;font-size: 1.1em; color: #000 !important;}
36 #content .portlet-asset-publisher.newsletter .journal-content-article .webContent p {margin: 0;}
37 #content .portlet-asset-publisher.newsletter .journal-content-article .webContent ul li {padding: 0px 10px 0px 40px; background-position-y: 5px; }
38 #content .portlet-asset-publisher.newsletter .journal-content-article .webContent ul li:before {width: 5px; height: 5px;}
39 #content .portlet-asset-publisher.newsletter .journal-content-article .webContent .noticias {margin-left:25px;}
40 #content .portlet-asset-publisher.newsletter .journal-content-article .webContent .noticias .texto {margin:5px 0;}
41 #content .portlet-asset-publisher.newsletter .journal-content-article .webContent .noticias .noticia {border-bottom: 1px solid lightgrey; padding-bottom: 5px;}
42 #content .journal-content-article .webContent .noticias li h4 { font-size: 1.2em; }
43
44</style>
45
46
47<#-- Pintamos el contenido -->
48
49
50<#-- TÍTULO DEL CONTENIDO -->
51<#assign article_title = "${.vars['reserved-article-title'].data}" />
52
53<div class="webContent">
54 <#if article_title?? && article_title!="" >
55 <p class="header10">${article_title}</p>
56 </#if>
57
58 <#if GvaOberta.getData()?? >
59 <h2>
60 <#if locale == "ca_ES" >
61 Novetats del Portal de Transparència de la Generalitat - GVA Oberta
62 <#else>
63 Novedades del Portal de Transparencia de la Generalitat - GVA Oberta
64 </#if>
65 </h2>
66
67 <div class="noticias">
68 ${GvaOberta.getData()}
69 </div>
70 </#if>
71 <#assign noticias = NoticiaDadesObertes.getSiblings() />
72
73 <#assign numNoticias = 0 />
74 <#list noticias as noticia>
75 <#if noticia.getData()?has_content >
76 <#assign numNoticias = numNoticias + 1 />
77 </#if>
78 </#list>
79
80 <#if numNoticias gt 0 >
81 <hr>
82
83 <h2>
84 <#if locale == "ca_ES" >
85 Novetats del Portal de Dades Obertes de la Generalitat
86 <#else>
87 Novedades del Portal de Dades Obertes de la Generalitat
88 </#if>
89 </h2>
90
91 <div class="noticias">
92 <#list noticias as noticia>
93 <#if noticia.getData()?has_content >
94 <div class="noticia">
95 <a href="${noticia.Enlace.getData()}" target="_blank" title="Enlace a ${noticia.getData()}">
96 <div class="texto">${noticia.getData()}</div>
97 <div style="clear:both;"></div>
98 </a>
99 </div>
100 </#if>
101 </#list>
102
103
104 <#-- IMAGENES -->
105
106 <#assign imagenes = Imagenes.getSiblings() />
107 <#assign numImagenes = 0 />
108
109 <#list imagenes as imagen>
110 <#if imagen.getData()?has_content >
111 <#assign numImagenes = numImagenes + 1 />
112 </#if>
113 </#list>
114
115 <#if numImagenes gt 0 >
116 <br><br>
117 <div class="noticia">
118 <#assign widthCalculado = 100 / numImagenes />
119 <#list imagenes as imagen>
120 <a href="${imagen.EnlaceImagen.getData()}" target="_blank" title="">
121 <img src="${imagen.getData()}" alt="" width="${widthCalculado}%"/>
122 </a>
123 </#list>
124 </div>
125 </#if>
126 </div>
127 </#if>
128</div>
129
130
131
132<#-- COMPROBAR SI EL USUARIO ES USUARIO AVANZADO O ADMINISTRADOR DE LIFERAY -->
133
134
135<#assign isRoleNewsletter = false />
136<#assign isAdmin = false />
137<#if objThemeDisplay.isSignedIn() >
138 <#assign rService = staticUtil["com.liferay.portal.service.UserGroupRoleLocalServiceUtil"] />
139 <#assign userId = getterUtil.getLong(objThemeDisplay.userId) />
140 <#assign usrRoles = rService.getUserGroupRoles( userId, groupId ) />
141
142 <#if permissionChecker.isOmniadmin() >
143 <#assign isAdmin = true />
144 </#if>
145
146 <#list usrRoles as usrRole >
147 <#if usrRole.getRole().getName() == "Usuario avanzado" >
148 <#assign isRoleNewsletter = true />
149 </#if>
150 </#list>
151</#if>
152
153
154
155<#-- BOTON ENVIAR CORREO -->
156
157
158<#if isRoleNewsletter || isAdmin >
159 <hr><hr>
160 <h2>Formulario de envío</h2>
161
162 <form method="post" style="border: 1px solid #D3D3D3; margin: 10px; padding: 10px; border-radius: 5px;" >
163 <input type="hidden" name="submit" value="Submitted"/>
164 <p>
165 <label style="float:left">Email Origen(*) :</label>
166 <input style="margin-left: 5px; width: 70%;" type="text" name="form_email_origen" value="miralles_ros@gva.es"/>
167 </p>
168 <div style="clear:both;"></div>
169 <p>
170 <label style="float:left">Asunto(*) :</label>
171 <input style="margin-left: 5px; width: 70%;" type="text" name="form_email_asunto" value="${article_title}"/>
172 </p>
173 <div style="clear:both;"></div>
174 <p>
175 <label style="float:left">Email Destino(*) :</label>
176 <input style="margin-left: 5px; width: 70%;" type="text" name="form_email_destino" value="novetats_portaltransparencia@listserv.gva.es"/>
177 </p>
178 <div style="clear:both;"></div>
179
180 <p>
181 <input class="botonEnviar" type="submit" value="<@liferay.language key='enviar' />"/>
182 </p>
183 </form>
184</#if>
185
186
187<#-- ENVIAMOS EL CORREO -->
188
189
190<#assign isSubmitted = paramUtil.getString(httpServletRequest, "submit")/>
191<#assign emailEnviado = false />
192
193<#if isSubmitted?? && isSubmitted?has_content >
194 <#assign email_origen = paramUtil.getString(httpServletRequest, "form_email_origen") />
195 <#assign email_envio = paramUtil.getString(httpServletRequest, "form_email_destino")/>
196 <#assign asuntoMensaje = paramUtil.getString(httpServletRequest, "form_email_asunto") />
197
198
199 <#-- Cogemos el cuerpo del mensaje desde un contenido WEB -->
200
201
202 <#-- Comprobamos que el email de envío esté cumplimentado -->
203 <#if email_envio?? && email_envio!="" >
204
205 <#-- Get the article content with current template -->
206
207 <#assign articleContent = journalArticleLocalService.getArticleContent(article, preferencesTemplateId, "", "ca_ES", objThemeDisplay) +
208 "<table border='0' cellpadding='0' cellspacing='0' width='100%'><tbody><tr><td><p> </p><hr><p> </p></td></tr></tbody></table>" + journalArticleLocalService.getArticleContent(article, preferencesTemplateId, "","es_ES", objThemeDisplay) />
209
210 <#assign cuerpoMensaje = articleContent />
211
212
213 <#-- Remplazamos todos los href relativos -->
214
215 <#assign orig='href="/' />
216 <#assign dest='href="' />
217 <#assign dest = dest + host + "/" />
218 <#assign cuerpoMensaje = cuerpoMensaje?replace(orig, dest) />
219
220 <#assign orig='href="/' />
221 <#assign dest='href="' />
222 <#assign dest = dest + host + "/" />
223 <#assign cuerpoMensaje = cuerpoMensaje?replace(orig, dest) />
224
225 <#assign orig='src="/' />
226 <#assign dest='src="' />
227 <#assign dest = dest + host + "/">
228 <#assign cuerpoMensaje = cuerpoMensaje?replace(orig, dest) />
229
230 <#assign orig='src="/' />
231 <#assign dest='src="' />
232 <#assign dest = dest + host + "/">
233 <#assign cuerpoMensaje = cuerpoMensaje?replace(orig, dest) />
234
235 <#-- Configuración de la extensión de la URL con los parámetros de seguimiento de Google Analytics -->
236 <#if OmitirSeguimientoGoogleAnalytics.getData() != "true" >
237 <#assign now = .now />
238 <#assign secondURL = now?string("ss") />
239 <#assign minuteURL = now?string("mm") />
240 <#assign hourURL = now?string("HH") />
241 <#assign dayURL = now?string("dd") />
242 <#assign monthURL = now?string("MM") />
243 <#assign yearURL = now?string("yyyy") />
244 <#assign dateURL = yearURL + '_' + monthURL + '_' + dayURL + '_' + hourURL + '_' + minuteURL + '_' + secondURL />
245
246 <#assign nombreLista = email_envio />
247 <#if email_envio?contains('@') >
248 <#assign index = email_envio?index_of('@') />
249 <#assign nombreLista = email_envio?substring(0, index) />
250 </#if>
251 <#assign parametrosAnalytics = "utm_medium=email&utm_source=newsletter_" />
252 <#assign parametrosAnalytics = parametrosAnalytics + nombreLista + "&utm_campaign=" />
253 <#assign parametrosAnalytics = parametrosAnalytics + dateURL />
254
255 <#assign orig="gvaatributosgvaanalyticsgva" />
256 <#assign dest=parametrosAnalytics />
257 <#assign cuerpoMensaje = cuerpoMensaje?replace(orig, dest) />
258
259 <#assign orig='href="#' />
260 <#assign dest='href="' />
261 <#assign dest= dest + host + friendly_url />
262 <#assign dest= dest + "?" + parametrosAnalytics />
263 <#assign cuerpoMensaje = cuerpoMensaje?replace(orig, dest) />
264 <#else>
265 <#assign orig='href="#' />
266 <#assign dest='href="' />
267 <#assign dest= dest + host + friendly_url />
268 <#assign cuerpoMensaje = cuerpoMensaje?replace(orig, dest) />
269 </#if>
270
271
272 <#-- Realizamos el envío del mensaje -->
273
274
275 <#assign mailService = staticUtil["com.liferay.mail.service.MailServiceUtil"] />
276 <#assign mailMessage = objectUtil("com.liferay.portal.kernel.mail.MailMessage") />
277
278 <#assign from = objectUtil("javax.mail.internet.InternetAddress")/>
279 <#assign VOID = from.setAddress(email_origen) />
280
281 <#assign to = objectUtil("javax.mail.internet.InternetAddress")/>
282 <#assign VOID = to.setAddress(email_envio) />
283
284 <#assign VOID = mailMessage.setBody(cuerpoMensaje) />
285 <#assign VOID = mailMessage.setSubject(asuntoMensaje) />
286 <#assign VOID = mailMessage.setHTMLFormat(true) />
287
288 <#assign VOID = mailMessage.setFrom(from) />
289 <#assign VOID = mailMessage.setTo(to) />
290
291 ${mailService.sendEmail(mailMessage)}
292
293 <#assign emailEnviado = true />
294
295 <#-- Así evitamos que al hacer un refresh se vuelva a enviar el correo -->
296 <script>
297 window.location.href="${current_url}";
298 </script>
299 </#if>
300</#if>
301
302
303<#-- EXPANDO TABLES -->
304
305
306<#assign expandoTable = staticUtil["com.liferay.portlet.expando.service.ExpandoTableLocalServiceUtil"] />
307<#assign expandoRow = staticUtil["com.liferay.portlet.expando.service.ExpandoRowLocalServiceUtil"] />
308<#assign expandoColumn =staticUtil["com.liferay.portlet.expando.service.ExpandoColumnLocalServiceUtil"] />
309<#assign expandoValue = staticUtil["com.liferay.portlet.expando.service.ExpandoValueLocalServiceUtil"] />
310
311<#assign expandoTableName = "Newsletter-${article.getArticleId()}" />
312<#-- Comprobamos si ya está la tabla -->
313<#attempt>
314 <#assign table = expandoTable.getTable(companyId, article.getClassNameId(), expandoTableName) />
315<#recover>
316 <#assign table = expandoTable.addTable(companyId, article.getClassNameId(), expandoTableName) />
317</#attempt>
318
319<#assign tableId = table.getTableId() />
320
321<#-- comprobamos si ya están creadas las columnas -->
322<#attempt>
323 <#assign columnFechaEnvio = expandoColumn.getColumn(tableId, "FechaEnvio") />
324<#recover>
325 <#assign columnFechaEnvio = expandoColumn.addColumn(tableId, "FechaEnvio", 15) />
326</#attempt>
327
328<#attempt>
329 <#assign columnEmailEnvio = expandoColumn.getColumn(tableId, "EmailEnvio") />
330<#recover>
331 <#assign columnEmailEnvio = expandoColumn.addColumn(tableId, "EmailEnvio", 15) />
332</#attempt>
333
334
335<#assign rowsCount = expandoRow.getRowsCount(tableId) />
336
337<#if emailEnviado >
338 <#-- creamos una fila -->
339 <#assign newRow = expandoRow.addRow(tableId,rowsCount ) />
340
341 <#-- insertamos los valores actuales en la nueva fila -->
342 <#assign fechaActual = .now?string['EEEE, dd MMMM yyyy HH:mm:ss']/>
343 <#assign valueFecha = expandoValue.addValue(article.getClassNameId(), tableId, columnFechaEnvio.getColumnId(), rowsCount, fechaActual) />
344 <#assign valueEmail = expandoValue.addValue(article.getClassNameId(), tableId, columnEmailEnvio.getColumnId(), rowsCount, email_envio) />
345
346 <#-- Volvemos a contar las filas -->
347 <#assign rowsCount = expandoRow.getRowsCount(tableId) />
348</#if>
349
350<#if isRoleNewsletter || isAdmin >
351 <#if rowsCount?? && (rowsCount gt 0) >
352
353 <hr><hr>
354 <h2>Histórico de envíos</h2>
355
356 <table border="0" cellpadding="0" cellspacing="0" width="80%" align="center"><tbody>
357 <tr>
358 <th>Número envío</th>
359 <th>Fecha Envio</th>
360 <th>Email Envio</th>
361 </tr>
362 <#assign rows = expandoRow.getRows(tableId,0,rowsCount) />
363
364 <#list rowsCount..0 as i >
365 <#list rows as row>
366 <#if i?int == row.getClassPK()?int>
367 <#attempt>
368 <#assign valueFecha = expandoValue.getValue(columnFechaEnvio.getColumnId(), row.getRowId()) />
369 <#recover>
370 <#assign valueFecha = "" />
371 </#attempt>
372
373 <#attempt>
374 <#assign valueEmail = expandoValue.getValue(columnEmailEnvio.getColumnId(), row.getRowId()) />
375 <#recover>
376 <#assign valueEmail = "" />
377 </#attempt>
378
379 <#if valueFecha?? && valueFecha != "" >
380 <#assign valueFechaData = valueFecha />
381 <#assign valueEmailData = valueEmail />
382 <#else>
383 <#assign valueFechaData = "" />
384 <#assign valueEmailData = "" />
385 </#if>
386
387 <tr>
388 <td>
389 ${row.getClassPK()}
390 </td>
391 <td>
392 ${valueFechaData.data}
393 </td>
394 <td>
395 ${valueEmailData.data}
396 </td>
397 </tr>
398
399 <#break>
400 </#if>
401 </#list>
402 </#list>
403 </tbody></table>
404 </#if>
405</#if>