¿Quieres ser parte de la familia Nuestro Tiempo?

The following has evaluated to null or missing:
==> authorJson.classPK [in template "10136#10174#53980896" at line 35, 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 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 authorId = authorJson.classPK [in template "10136#10174#53980896" at line 35, column 5]
----
1<#-- Obtener los servicios necesarios -->
2<#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") />
3<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
4<#assign assetVocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService") />
5<#assign assetDisplayPageFriendlyURLProvider = serviceLocator.findService("com.liferay.asset.display.page.portlet.AssetDisplayPageFriendlyURLProvider") />
6<#assign ddmStructureLocalService = serviceLocator.findService("com.liferay.dynamic.data.mapping.service.DDMStructureLocalService") />
7
8
9<#-- Obtener el art�culo actual -->
10<#assign groupId = themeDisplay.getScopeGroupId() />
11<#assign journalArticle = journalArticleLocalService.getArticle(groupId, .vars['reserved-article-id'].data) />
12<#assign currentArticleId = .vars['reserved-article-id'].data />
13<#assign resourcePrimKey = journalArticle.getResourcePrimKey() />
14<#assign structureKey = journalArticle.getDDMStructureKey() />
15 <#assign ddmStructureId = journalArticle.getDDMStructureId() />
16
17<#-- Obtener el autor del art�culo actual -->
18<#assign aArticleXML = saxReaderUtil.read(journalArticle.getContentByLocale(locale)) />
19<#assign authorNodes = aArticleXML.selectNodes("//dynamic-element[@name='autor']/dynamic-content") />
20<#assign authorId = "" />
21<#assign authorTitle = "" />
22
23<#assign categoriesList = assetCategoryLocalService.getCategories("com.liferay.journal.model.JournalArticle", journalArticle.getResourcePrimKey()) />
24<#assign vocabularyTopicName = "Topic" />
25
26 <#list categoriesList as category>
27 <#assign categoryVocabulary = assetVocabularyLocalService.getAssetVocabulary(category.getVocabularyId()) />
28 <#if categoryVocabulary.getName() == vocabularyTopicName>
29 <#assign categorySearch = category.getTitle(locale)/>
30 </#if>
31 </#list>
32
33<#if authorNodes?has_content>
34 <#assign authorJson = authorNodes[0].getText()?eval />
35 <#assign authorId = authorJson.classPK />
36 <#assign authorTitle = authorJson.title />
37</#if>
38
39<#-- Buscar art�culos del mismo autor y estructura -->
40<#assign relatedArticles = [] />
41<#if authorId?has_content>
42<#if _webContentsUtil??>
43<#assign allArticles = _webContentsUtil.getAllArticles(groupId, ddmStructureId, currentArticleId) />
44<#else>
45<#assign allArticles = journalArticleLocalService.getArticlesByStructureId(groupId, ddmStructureId, 0, 10, null) />
46</#if>
47 <#list allArticles as article>
48 <#if article.getResourcePrimKey() != resourcePrimKey && !article.isInTrash() && article.getStatus() == 0>
49 <#assign articleXML = saxReaderUtil.read(article.getContentByLocale(locale)) />
50
51 <#assign articleAuthorNodes = articleXML.selectNodes("//dynamic-element[@name='autor']/dynamic-content") />
52 <#if articleAuthorNodes?has_content>
53 <#assign articleAuthorJson = articleAuthorNodes[0].getText()?eval />
54 <#if articleAuthorJson.classPK == authorId>
55 <#assign relatedArticles = relatedArticles + [article] />
56 </#if>
57 </#if>
58 </#if>
59 </#list>
60 <#assign relatedArticles = relatedArticles?sort_by("modifiedDate")?reverse />
61 <#if relatedArticles?size gt 5>
62 <#assign relatedArticles = relatedArticles[0..4] />
63 </#if>
64</#if>
65
66<#if relatedArticles?has_content>
67 <div class="container">
68 <div class="row">
69 <#list relatedArticles as curArticle>
70 <#-- Manejo de error para obtener la URL del art�culo -->
71 <#assign viewURL = curArticle.getUrlTitle() />
72 <#if !viewURL?has_content>
73 <#assign viewURL = "/" />
74 </#if>
75
76 <#assign curArticleXML = saxReaderUtil.read(curArticle.getContentByLocale(locale)) />
77 <#assign title = curArticle.getTitle(locale) />
78 <#assign tituloDestacado = curArticleXML.valueOf("//dynamic-element[@name='tituloDestacado']/dynamic-content") />
79 <#assign imagenArticulo = curArticleXML.valueOf("//dynamic-element[@name='imagen']/dynamic-content/text()") />
80 <#assign detalle = curArticleXML.valueOf("//dynamic-element[@name='detalle']/dynamic-content") />
81 <#-- Featured Image of the Article -->
82 <#assign featuredImage = curArticle.getArticleImageURL(themeDisplay)!""/>
83
84 <#assign categoriesList = assetCategoryLocalService.getCategories("com.liferay.journal.model.JournalArticle", curArticle.getResourcePrimKey())/>
85 <#assign vocabularyTemaName = "Tema" />
86 <#assign vocabularyNRevistaName = "N� de revista" />
87
88 <#if categoriesList?has_content>
89 <#list categoriesList as category>
90 <#assign categoryVocabulary = assetVocabularyLocalService.getAssetVocabulary(category.getVocabularyId()) />
91 <#if categoryVocabulary.getName() == vocabularyTopicName>
92 <#if categorySearch == category.getTitle(locale)>
93 <div class="col-md">
94 <article class="article article-review">
95 <figure class="media">
96 <picture>
97 <#-- show featuredImage if set. -->
98 <#if featuredImage?has_content>
99 <img src="${featuredImage}" />
100 <#else>
101 <#if imagenArticulo?? && imagenArticulo?has_content>
102 <#attempt>
103 <#assign jsonObject = imagenArticulo?eval/>
104 <#assign entryUuid = jsonObject.uuid />
105 <#assign entryGroupId = getterUtil.getLong(jsonObject.groupId) />
106 <#assign entryAlt = jsonObject.alt />
107 <#assign dlFileEntryLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService") />
108 <#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService")>
109 <#assign dlFileEntry = dlFileEntryLocalService.getDLFileEntryByUuidAndGroupId(entryUuid, entryGroupId) />
110 <#assign assetEntry = assetEntryLocalService.getEntry("com.liferay.document.library.kernel.model.DLFileEntry", dlFileEntry.fileEntryId) />
111 <#assign assetRenderer = assetEntry.assetRenderer />
112 <#assign imagen = assetRenderer.getURLDownload(themeDisplay) />
113 <img alt="${entryAlt}" data-fileentryid="${dlFileEntry.fileEntryId}" src="${imagen}" />
114 <#recover>
115 </#attempt>
116 </#if>
117 </#if>
118 </picture>
119 </figure>
120
121 <p class="author">
122 <a title=${authorTitle}>${authorTitle}</a>
123 </p>
124
125 <#-- No es necesario para rese�as
126 <p class="kicker">
127 <#if categoriesList?has_content>
128 <#list categoriesList as category>
129 <#assign categoryVocabulary = assetVocabularyLocalService.getAssetVocabulary(category.getVocabularyId()) />
130 <#if categoryVocabulary.getName() == vocabularyTemaName || categoryVocabulary.getName() == vocabularyNRevistaName>
131 <a title="${category.getTitle(locale)}">${category.getTitle(locale)}</a>
132 </#if>
133 </#list>
134 </#if>
135 </p>
136 -->
137
138 <h2 class="title title-standard">
139 <a href="${viewURL}" title="${title}">${title}</a>
140 </h2>
141
142 <#-- No es necesario para rese�as
143 <p class="meta">
144 <#assign fecha = dateUtil.getDate(curArticle.getDisplayDate(), "d 'de' MMMM 'de' yyyy", locale) />
145 <#if fecha?has_content>
146 <span>${fecha}</span>
147 </#if>
148
149 <#assign tiempo = "" />
150 <#if detalle?has_content>
151 <#assign content = detalle?trim />
152 <#if content != "">
153 <#assign contentCount = content?replace("<[^>]+>", "", "r")?word_list?size />
154 <#if contentCount gt 0>
155 <#assign minutesValue = (contentCount/200)?round />
156 <#if minutesValue == 0>
157 <#assign tiempo = "Unos segundos" />
158 <#elseif minutesValue == 1>
159 <#assign tiempo = minutesValue + " minuto" />
160 <#else>
161 <#assign tiempo = minutesValue + " minutos" />
162 </#if>
163 </#if>
164 </#if>
165 </#if>
166 <#if tiempo?? && tiempo != "">
167 <span><i class="fa fa-regular fa-clock"></i> ${tiempo}</span>
168 </#if>
169 </p>
170 -->
171
172
173 </article>
174 </div>
175 </#if>
176 </#if>
177
178 </#list>
179 </#if>
180
181
182 </#list>
183 </div>
184 </div>
185<#else>
186 <#-- No se encontraron relacionados -->
187 <div class="text"><p>No se han encontrado articulos relacionados</p></div>
188</#if>
189
190<style>
191/* default image size TODO: fix in theme, this is a temporal workaround. */
192.nuestro-tiempo .article.article-review .media{
193 height: initial;
194}
195</style>
Siempre estamos buscando buenos colaboradores para la revista. Si tienes una buena historia, queremos escucharte.