Si è verificato un errore nell'elaborarazione del modello.
The following has evaluated to null or missing: ==> result.getJSONObject("data").getJSONObject("response") [in template "1315478#1315513#3520318" at line 45, column 21] ---- 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 docs = result.getJSONObject("... [in template "1315478#1315513#3520318" at line 45, column 5] ----
1<#import "_TEMPLATE_CONTEXT_/1315478/1331017/23609/1656602" as d40>
2
3<#assign
4 SuggestoRecommenderServiceAPI = serviceLocator.findService("eu.suggesto.servicecs.service.SuggestoRecommenderLocalService")
5 SuggestoMkspAPI = serviceLocator.findService("eu.suggesto.suggestogui.service.SuggestoGuiLocalService")
6 LocaleUtil = staticUtil["com.liferay.portal.kernel.util.LocaleUtil"]
7 jsort = jsonFactoryUtil.createJSONArray()
8 jsort1 = jsonFactoryUtil.createJSONObject()
9
10 indexLayoutId = 320
11 letter = themeDisplay.getLayout().nameCurrentValue?lower_case!"a"
12 def_locale = LocaleUtil.fromLanguageId("it_IT")
13 expDate = .now?string("yyyy") + .now?string("MM") + .now?string("dd") + .now?string("hh") + .now?string("mm") + .now?string("ss")
14 serviceName = "0:esatlcuneo"
15 numItems = 1000
16 numPag = 1
17 skipItems = 0
18 structureKeys = "(1365076 OR 1332941 OR 1332945 OR 1332909 OR 1332933 OR 1332901)"
19 expirationDates = "[${expDate} TO *]"
20 z = jsort1.put("localized_title_${locale}_sortable", "ASC")
21 z = jsort.put(jsort1)
22 sortOrder = jsort.toString()
23/>
24
25<#assign qry>
26{
27 "query": {
28 "bool": {
29 "must": [
30 {
31 "query_string": {
32 "query": "head:true AND status:0 AND ddmStructureKey:${structureKeys} AND expirationDate:${expirationDates} AND localized_title_${locale}_sortable:${letter}*"
33 }
34 }
35 ]
36 }
37 },
38 "_source": ["articleId", "groupId", "localized_title_${locale}_sortable"]
39}
40</#assign>
41
42<#assign result = SuggestoRecommenderServiceAPI.search("0", serviceName, "", qry, sortOrder, skipItems, numItems)>
43
44<section id="${d40.portletNamespace}" class="tw:mt-70">
45 <#assign docs = result.getJSONObject("data").getJSONObject("response").getJSONArray("docs")>
46
47 <div class="container">
48 <h1 class="mb-5">
49 <span class="text-uppercase">Indice</span>
50 (lettera <span class="font-weight-bold text-uppercase">${letter}</span>), ${docs.length()} voci
51 - lingua: <span class="font-weight-bold text-uppercase">${locale?keep_before("_")}</span>
52 </h1>
53
54 <div class="mb-5">
55 <#list d40.getChildLayouts(indexLayoutId) as cLayout>
56 <#if layout.plid == cLayout.plid>
57 <span class="font-weight-bold text-uppercase mr-2">
58 ${cLayout.nameCurrentValue}
59 </span>
60 <#else>
61 <a href="${cLayout.nameCurrentValue}" class="text-primary text-uppercase mr-2">
62 <u>${cLayout.nameCurrentValue}</u>
63 </a>
64 </#if>
65 </#list>
66 </div>
67
68 <#if (docs.length() > 0)>
69 <div class="row">
70 <#list 0..docs.length()-1 as i>
71 <div class="col-12 col-lg-6">
72 <#assign
73 doc = docs.getJSONObject(i)
74 viewUrl = SuggestoMkspAPI.getArticleUrl(groupId, "", doc.articleId, locale, def_locale, "/det")
75 />
76
77 <a href="${viewUrl}" class="d-block text-capitalize text-primary tw:underline mb-4">
78 <#if locale == "it_IT">
79 ${doc.localized_title_it_IT_sortable}
80 </#if>
81
82 <#if locale == "en_US">
83 ${doc.localized_title_en_US_sortable}
84 </#if>
85
86 <#if locale == "de_DE">
87 ${doc.localized_title_de_DE_sortable}
88 </#if>
89
90 <#if locale == "fr_FR">
91 ${doc.localized_title_fr_FR_sortable}
92 </#if>
93 </a>
94 </div>
95 </#list>
96 </div>
97 </#if>
98 </div>
99</section>