Home_test
Atrás Home_test
Se ha producido un error al procesar la plantilla.
The following has evaluated to null or missing: ==> journalArticleLocalServiceUtil.fetchLatestArticle(classPK) [in template "20115#20151#34654" at line 24, column 76] ---- Tip: If the failing expression is known to 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: #assign article = journalArticleLocal... [in template "20115#20151#34654" at line 24, column 57] ----
1<#assign journalArticleLocalServiceUtil = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
2<#assign dlAppService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppService") />
3<#assign serviceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext()>
4
5<#assign groupLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.GroupLocalService")/>
6<#assign group = groupLocalService.getGroup(groupId)/>
7<#assign groupFriendlyURL = group.getFriendlyURL() />
8<#assign themeDisplay = serviceContext.getThemeDisplay() />
9<#assign friendlyURL = group.getPathFriendlyURL(false,themeDisplay) + groupFriendlyURL />
10
11
12<section class="mj-section">
13 <div class="gridContainer">
14
15 <#-- IMPRIME DATOS DE CONTENIDOS PRINCIPALES -->
16 <#if ContenidosPrincipales.getSiblings()?has_content>
17 <div class="row">
18 <div class="evr-tiles" aria-label="Noticias">
19 <#list ContenidosPrincipales.getSiblings() as cur_ContenidosPrincipales>
20 <#--- JSON datos --->
21 <#assign jsonObject = jsonFactoryUtil.createJSONObject(cur_ContenidosPrincipales.getData()) />
22 <#assign classPK = jsonObject.getLong("classPK")/>
23 <#if classPK!=0>
24 <#assign article = journalArticleLocalServiceUtil.fetchLatestArticle(classPK) />
25 <#assign mayView = permissionChecker.hasPermission(article.getGroupId(), "com.liferay.journal.model.JournalArticle", article.getResourcePrimKey(), "VIEW")/>
26
27 <#if mayView>
28 <div class="col-md-4 col-sm-12">
29 <#-- FORMATO XML -> FORMATO HTML -->
30 <#assign aArticleXML = saxReaderUtil.read(article.getContent()) >
31 <#assign contentImagen = aArticleXML.valueOf("//dynamic-element[@name='Imagenes']/dynamic-content/text()")/>
32 <#-- Debemos obtener el uuid y groupId de la imagen -->
33 <#assign aArticleXMLString =jsonFactoryUtil.createJSONObject(contentImagen)>
34 <div class="evr-tiles-link mj-home-news__container">
35 <div class="mj-home-news mj-home-news--inline" aria-label="${customSanitizerUtil.sanitizedField(themeDisplay.getLayout(), themeDisplay.getUserId(), article.getTitle(themeDisplay.getLocale()))? replace('"', "")}">
36
37 <#assign pictureAttributesKeyValue = {} />
38 <#assign imgAttributesKeyValue = { "class": "mj-home-news__img aspect-ratio-item-center-middle aspect-ratio-item-fluid", "alt": aArticleXMLString.getString("alt") } />
39 <#assign imgHtml = customAmImageUtil.createAMImageByFileEntryId(aArticleXMLString.getString("fileEntryId"),600,pictureAttributesKeyValue,imgAttributesKeyValue)/>
40 <div class="aspect-ratio aspect-ratio-16-to-9">
41 ${imgHtml}
42 </div>
43 <div class="mj-home-news__description">
44 <a href="${friendlyURL}/-/${article.getUrlTitle()}">
45 <h2 class="mj-home-news__title">${customSanitizerUtil.sanitizedField(themeDisplay.getLayout(), themeDisplay.getUserId(), article.getTitle(themeDisplay.getLocale()))}</h2>
46 </a>
47 <span class="mj-home-news__date">${customDateFormatUtil.setCustomDateFormat(themeDisplay,article.displayDate?date)}</span>
48
49 <p class="mj-home-news__txt">
50 <#assign titleEscape = customSanitizerUtil.sanitizedField(themeDisplay.getLayout(), themeDisplay.getUserId(), article.getTitle(themeDisplay.getLocale())) />
51 <a href="${friendlyURL}/-/${article.getUrlTitle()}" class="mj-shortcouts__link" title="${htmlUtil.escape(titleEscape)}">LEER </a>
52 </p>
53
54 </div>
55 </div>
56 </div>
57 </div>
58 </#if>
59 </#if>
60 </#list>
61 </div>
62 </div>
63 </#if>
64 </div>
65
66<#--- ENLACE PAGINA NOTICIAS --->
67 <div class="mj-home-news__subtitle">
68 <a href="${EnlaceVerMas.EnlacePaginaNoticias.getFriendlyUrl()}" class="mj-home-news__link mj-home-news__link--more">${customSanitizerUtil.sanitizedField(themeDisplay.getLayout(), themeDisplay.getUserId(), EnlaceVerMas.getData()?upper_case)}</a>
69 </div>
70
71</section>
72
73<section class="mj-section mj-section--white mj-section--main">
74 <div class="mj-shortcouts" aria-label="Servicios destacados">
75
76 <#--- ENLACES PAGINAS --->
77 <#if Titulo.getSiblings()?has_content>
78 <#list Titulo.getSiblings() as cur_Titulo>
79 <div class="mj-shortcouts__box">
80 <div class="mj-shortcouts__title">
81 <h2 class="mj-shortcouts__description">${customSanitizerUtil.sanitizedField(themeDisplay.getLayout(), themeDisplay.getUserId(), cur_Titulo.getData()?upper_case)}</h2>
82 </div>
83 <div class="mj-shortcouts__more">
84 <#if cur_Titulo.EnlaceAPagina.getFriendlyUrl()?has_content>
85 <a href="${cur_Titulo.EnlaceAPagina.getFriendlyUrl()}" class="mj-shortcouts__link" title="${customSanitizerUtil.sanitizedField(themeDisplay.getLayout(), themeDisplay.getUserId(), cur_Titulo.getData())}">VER MÁS</a>
86 <#else>
87 <a href="${customSanitizerUtil.sanitizedField(themeDisplay.getLayout(), themeDisplay.getUserId(), cur_Titulo.EnlaceExterno.getData())}" class="mj-shortcouts__link" title="${customSanitizerUtil.sanitizedField(themeDisplay.getLayout(), themeDisplay.getUserId(), cur_Titulo.getData())}">VER MÁS</a>
88 </#if>
89 </div>
90 </div>
91 </#list>
92 </#if>
93 </div>
94</section>