Si è verificato un errore nell'elaborarazione del modello.
The following has evaluated to null or missing:
==> journalArticleLocalService.fetchLatestArticle(relatedAssetEntry.classPK)  [in template "20101#20127#35063" at line 204, column 90]

----
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: #assign relatedJournalArticle = journ...  [in template "20101#20127#35063" at line 204, column 57]
----
1<#-- 
2LargoConsumo ~ Thread solutions ~ 2019 
3@baxtheman 
4journal template / full content article 
5/// 
6see https://bitbucket.org/threadsolutions/largoconsumo-liferay-7.2/issues/18/gestione-stati-campo-testo-e-pulsanti-web 
7--> 
8 
9 
10<#setting date_format="dd/MM/yyyy"> 
11<#setting locale = 'it_IT'> 
12 
13<#assign ARTICLEID = .vars['reserved-article-id'].data /> 
14<#assign ARTICLEURL = themeDisplay.getURLPortal() + '/-/' + .vars['reserved-article-url-title'].data /> 
15<#assign SMALLIMAGEURL = .vars['reserved-article-small-image-url'].data /> 
16<#assign TITLE = .vars['reserved-article-title'].data /> 
17<#assign DISPLAYDATE = .vars['reserved-article-display-date'].data?date('EEE, dd MMM yyyy HH:mm:ss Z') /> 
18<#assign ISCORPORATE = getterUtil.getBoolean(CORPORATE.getData()) /> 
19<#assign TAGS = .vars['reserved-article-asset-tag-names'].data?replace(',', ', ') /> 
20 
21<#assign ISPDF = PDF.data?has_content /> 
22 
23<#assign SHOW_FULL_ABSTRACT = (FULL_ABSTRACT??)?then(getterUtil.getBoolean(FULL_ABSTRACT.getData()),false) /> 
24<#if (SUMMARY.data?length > 300 && !SHOW_FULL_ABSTRACT)> 
25	<#assign ABSTRACT = SUMMARY.data?substring(0,300) + "..." /> 
26<#else> 
27	<#assign ABSTRACT = SUMMARY.data /> 
28</#if> 
29 
30<#assign CONTENT = (HTML.data?has_content)?then(HTML.data,SUMMARY.data) /> 
31<#assign WOWBOOKURL = '/DOCUMENTI/articoli/index.html?file=' /> 
32<#assign PDFURL = WOWBOOKURL + '/c/portal/createpdf?articleId=${ARTICLEID}&groupId=${articleGroupId}#book/' /> 
33 
34<#assign ISGUEST = themeDisplay?? && !themeDisplay.isSignedIn() /> 
35<#assign ISSIGNIN = themeDisplay?? && themeDisplay.isSignedIn() /> 
36<#assign ISPAYWALL = getterUtil.getBoolean(PAYWALL.data) /> 
37<#assign ISFREE = !ISPAYWALL /> 
38<#assign ISSUBSCRIBER = permissionChecker.isOmniadmin() || portletPermission.contains(permissionChecker,'com_thread_largoconsumo_login_register','SUBSCRIPTION') /> 
39 
40<@liferay_util["html-top"]> 
41	<meta property="og:title" content="${TITLE}"> 
42	<meta property="og:description" content="${SUMMARY.getData()?replace("(?s)<[^>]*>(\\s*<[^>]*>)*", " ", "r")}"> 
43	<#if SMALLIMAGEURL??> 
44		<meta property="og:image" content="${SMALLIMAGEURL}"> 
45	</#if> 
46</@> 
47 
48<@assettics_util["event"] 
49	action="view" 
50	category="article" 
51	label=TITLE 
52/> 
53 
54<#assign CSSTRACKLEAD = "" /> 
55<#assign TRACKLEAD = false /> 
56<#assign SHOWCHECKBOX = false /> 
57<#assign LEADMESSAGE = "" /> 
58<#assign campaignsArticle = campaignArticleService.getByJournalArticleAndEnabled(themeDisplay.getCompanyId(), themeDisplay.getScopeGroupId(), ARTICLEID?number, true) /> 
59<#if (campaignsArticle?size > 0) > 
60	<#assign CAMPAIGN = campaignsArticle[0] /> 
61	<#if ISSUBSCRIBER > 
62		<#assign LEADMESSAGE = CAMPAIGN.messageSubscribed /> 
63	<#else> 
64		<#assign LEADMESSAGE = CAMPAIGN.messageRegistered /> 
65	</#if> 
66	<#assign CSSTRACKLEAD = " trackLead " /> 
67	<#assign TRACKLEAD = true /> 
68	<#assign campaignsUser = campaignUserService.getByUser(themeDisplay.getCompanyId(), themeDisplay.getScopeGroupId(), themeDisplay.getUserId()) /> 
69	<#if (campaignsUser?size == 0) > 
70		<#assign SHOWCHECKBOX = true /> 
71	</#if> 
72</#if> 
73 
74 
75<article class="article"> 
76 
77	<header> 
78		<div class="article__heading b-block d-md-flex justify-content-between align-items-top"> 
79			<div class="text h4"> 
80				<strong>${DISPLAYDATE?date}</strong><br> 
81				${(REFERENCE?? && REFERENCE.data?has_content)?then(REFERENCE.getData(), '')} 
82				${(TYPE?? && TYPE.data?has_content)?then('- ' +  TYPE.getData(), '')} 
83				${ISCORPORATE?then(" di comunicazione d'Impresa", "")} 
84				<#if (START_PAGE?? && START_PAGE.data?has_content)> 
85					<#if (START_PAGE.data?length > 3)> 
86						- ${START_PAGE.getData()} 
87					<#else> 
88						- pagina ${START_PAGE.getData()} 
89					</#if> 
90				</#if> 
91				<#if (LENGTH?? && LENGTH.data?has_content)> 
92					<#if (LENGTH.data?length > 3)> 
93						- ${LENGTH.getData()} 
94					<#else> 
95						<#if (LENGTH.getData() == '1')> 
96							- ${LENGTH.getData()} pagina 
97						<#else> 
98							- ${LENGTH.getData()} pagine 
99						</#if> 
100					</#if> 
101				</#if> 
102				${(AUTHOR?? && AUTHOR.data?has_content)?then('- ' + AUTHOR.getData(), '')} 
103			</div> 
104			<div class="socials-share socials-share--circle mt-3 mt-sm-0 pl-0 pl-md-3"> 
105				<@liferay_social_bookmarks["bookmarks"] 
106					className="com.liferay.journal.model.JournalArticle" 
107					classPK=ARTICLEID?number 
108					displayStyle="inline" 
109					title=TITLE 
110					types="twitter,facebook,linkedin" 
111					url=ARTICLEURL 
112				/> 
113			</div> 
114		</div> 
115 
116		<div class="d-block d-sm-flex justify-content-between align-items-center"> 
117			<#if SUBTITLE.data?has_content> 
118				<span class="lc-tag lc-tag-primary mb-0 ${ISCORPORATE?then('corporate', '')}"> 
119					${SUBTITLE.getData()} 
120				</span> 
121			</#if> 
122		</div> 
123	</header> 
124 
125	<section class="mt-3"> 
126		<h1> 
127			${TITLE} 
128		</h1> 
129 
130		<div class="content mt-5"> 
131			<#if SMALLIMAGEURL?has_content> 
132				<img class="article__image" alt="${TITLE}" src="${SMALLIMAGEURL}" /> 
133			</#if> 
134 
135			<#-- gestione testo --> 
136			<div class="text"> 
137				<#if ISGUEST || TRACKLEAD> 
138					${ABSTRACT} 
139				<#elseif ISSIGNIN && ISFREE> 
140					${CONTENT} 
141				<#elseif !ISSUBSCRIBER && ISPAYWALL> 
142					${ABSTRACT} 
143				<#elseif ISSUBSCRIBER> 
144					${CONTENT} 
145				</#if> 
146			</div> 
147 
148			<#if SHOWCHECKBOX > 
149				<div id="trackLeadCheckbox" style="clear:both"> 
150					<input type="checkbox" id="chkTrackLead"> ${LEADMESSAGE} 
151				</div> 
152			</#if> 
153			<#-- gestione azione --> 
154			<div id="action" <#if SHOWCHECKBOX > style="display:none" </#if> > 
155				<#if ISGUEST> 
156					<div class="mt-5 text-right"> 
157						<a href="/c/portal/login" class="btn btn-primary"> 
158							Accedi per continuare... 
159						</a> 
160					</div> 
161				<#elseif !ISSUBSCRIBER && ISPAYWALL> 
162					<div class="mt-5 text-right"> 
163						<a href="/c/portal/login" class="btn btn-primary"> 
164							Sottoscrivi l'abbonamento per continuare... 
165						</a> 
166					</div> 
167				<#elseif ISPDF > 
168					<div class="mt-5 text-right"> 
169						<a target="_blank" href="${PDFURL}" class="btn btn-primary ${CSSTRACKLEAD}"> 
170							<@clay["icon"] symbol="web-content" /> 
171							Leggi l'articolo completo in PDF 
172						</a> 
173					</div> 
174				<#elseif TRACKLEAD > 
175					<div class="mt-5 text-right"> 
176						<a target="_blank" href="#" class="btn btn-primary ${CSSTRACKLEAD}"> 
177							<@clay["icon"] symbol="web-content" /> 
178							Leggi tutto 
179						</a> 
180					</div> 
181				</#if> 
182			</div> 
183 
184		</div> 
185	</section> 
186 
187	<footer class="mt-5"> 
188 
189		<#if serviceLocator??> 
190			<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") /> 
191			<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") /> 
192			<#assign assetLinkLocalServiceUtil = serviceLocator.findService("com.liferay.asset.kernel.service.AssetLinkLocalService") /> 
193			<#assign journalArticle = journalArticleLocalService.getArticle(articleGroupId,ARTICLEID) /> 
194			<#assign assetEntry = assetEntryLocalService.getEntry("com.liferay.journal.model.JournalArticle", journalArticle.resourcePrimKey) /> 
195			<#assign assetLinks = assetLinkLocalServiceUtil.getDirectLinks(assetEntry.getEntryId()) /> 
196			<#if assetLinks?has_content> 
197				<section> 
198					<div class="heading-decorated"> 
199						<h2 class="portlet-title-text">Informazioni a corredo</h2> 
200					</div> 
201					<ul class="asset-links mt-3 mb-0 h3"> 
202						<#list assetLinks as assetLink> 
203							<#assign relatedAssetEntry = assetEntryLocalService.getAssetEntry(assetLink.entryId2) /> 
204							<#assign relatedJournalArticle = journalArticleLocalService.fetchLatestArticle(relatedAssetEntry.classPK) /> 
205							<li> 
206								<#assign docXml = saxReaderUtil.read(relatedJournalArticle.getContent()) /> 
207								<#assign pdf = docXml.valueOf("//dynamic-element[@name='PDF']/dynamic-content/text()") /> 
208								<#assign relatedTitle = relatedJournalArticle.title?replace("(?s)<[^>]*>(\\s*<[^>]*>)*", " ", "r") /> 
209								<#if (relatedJournalArticle.getDDMStructureKey() == "299426" && pdf == '')> 
210									${relatedJournalArticle.title} 
211								<#else> 
212									<a href="/-/${relatedJournalArticle.urlTitle}">${relatedTitle}</a> 
213								</#if> 
214							</li> 
215						</#list> 
216					</ul> 
217				</section> 
218			</#if> 
219 
220			<#assign assetVocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService") /> 
221			<#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") /> 
222			<#assign assetVocabulary = assetVocabularyLocalService.fetchGroupVocabulary(articleGroupId, "Argomenti") /> 
223			<#assign assetCategories = assetEntry.categories /> 
224			<#if assetCategories?has_content> 
225				<section class="justify-content-start align-items-start row no-gutters"> 
226					<div class="heading-decorated"> 
227						<h2 class="portlet-title-text">Argomenti</h2> 
228					</div> 
229					<div class="col mt-3"> 
230						<ul class="list-inline mb-0"> 
231							<#list assetCategories as assetCategory> 
232								<#if assetCategory.vocabularyId = assetVocabulary.vocabularyId> 
233									<#assign categoryUrl = '/percorsi/-/categoria/' + assetCategory.name?replace(' ','-')?url('utf-8') + '/' + assetCategory.categoryId + '?p_r_p_categoryId=' + assetCategory.categoryId /> 
234									<li class="list-inline-item"> 
235										<span class="lc-tag"><a href="${categoryUrl}">${assetCategory.name}</a></span> 
236									</li> 
237								</#if> 
238							</#list> 
239						</ul> 
240					</div> 
241				</section> 
242			</#if> 
243		</#if> 
244		 
245		<#if TAGS?has_content > 
246			<section class="justify-content-start align-items-start row no-gutters border-top mt-3"> 
247				<div class="title col-12 col-md-auto mb-2 mb-md-0 mr-3"> 
248					Citati in questo articolo: 
249				</div> 
250				<div class="col"> 
251					${TAGS} 
252				</div> 
253			</section> 
254		</#if> 
255	</footer> 
256 
257 
258</article> 
259 
260<@liferay_aui.script use="liferay-navigation-interaction"> 
261	var A=AUI(); 
262	var _item = A.one(".trackLead"); 
263	if (_item) { 
264		_item.on('click',function(e) { 
265			Liferay.Service( 
266				'/lead.campaignuser/create-articolo-utente', 
267
268					companyId: ${themeDisplay.getCompanyId()}, 
269					groupId: ${themeDisplay.getScopeGroupId()}, 
270					campaignId: ${(CAMPAIGN??)?then(CAMPAIGN.campaignId, '""')}, 
271					campaignArticleId: ${(CAMPAIGN??)?then(CAMPAIGN.campaignArticleId, '""')}, 
272					userId: ${themeDisplay.getUserId()} 
273				}, 
274				function(obj) { 
275					console.log(obj); 
276
277			); 
278		}); 
279	} else { 
280		console.log("nessun oggetto trovato"); 
281
282 
283	var _item = A.one("#trackLeadCheckbox"); 
284	if (_item) { 
285		_item.on('change',function(e) { 
286			console.log("click"); 
287			A.one("#trackLeadCheckbox").hide(); 
288			A.one("#action").show(); 
289		}); 
290	} else { 
291		console.log("nessuna checkbox trovata"); 
292
293 
294</@>