An error occurred while processing the template.
Expression totalAssetCount is undefined on line 34, column 7 in 20155#20195#20839.
1<#-- Check first if the asset publisher has entries --> 
2<#if entries?has_content> 
3<#-- create the content URL--> 
4    <#attempt> 
5        <#assign currentLiveGroup = themeDisplay.getScopeGroup() /> 
6        <#if currentLiveGroup.isStagingGroup() > 
7            <#assign currentLiveGroup = currentLiveGroup.getLiveGroup() /> 
8        </#if> 
9        <#assign contentDisplayLayoutFriendlyURL = currentLiveGroup.getExpandoBridge().getAttribute("contentDisplayLayoutFriendlyURL") /> 
10        <#assign layoutLocalService = serviceLocator.findService("com.liferay.portal.service.LayoutLocalService") /> 
11        <#assign targetLayout = layoutLocalService.getFriendlyURLLayout(themeDisplay.getScopeGroupId(), false, contentDisplayLayoutFriendlyURL) /> 
12        <#assign baseDetailURL = portalUtil.getLayoutURL(targetLayout, themeDisplay) + "/-/asset_publisher/" + targetLayout.getLayoutType().getPortletIds()[0][13..] + "/content"> 
13        <#recover> 
14            <#assign baseDetailURL = "" /> 
15    </#attempt> 
16 
17<#-- Getting asset pusblisher category configuration local services--> 
18    <#assign journaArticleLocalService = serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService")> 
19    <#assign SAXReader = serviceLocator.findService("com.liferay.portal.kernel.xml.SAXReader")> 
20    <#assign vocabularyLocalService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetVocabularyLocalService") /> 
21    <#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetCategoryLocalService") /> 
22    <#assign categoryPropertiesLocalService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetCategoryPropertyLocalService") /> 
23    <#assign assetPublisherConfVocabularyId = themeDisplay.getPortletDisplay().getPortletSetup().getValue("categoryVocabulary", "") /> 
24<#-- Translated Labels  --> 
25    <#assign assetCountLabel = axaimTranslate("content.insights.number-results") /> 
26    <#assign articleLink = axaimTranslate("content.insights.list.articlelink") /> 
27    <#assign videoArticleLink = axaimTranslate("content.insights.list.articlelink.video") /> 
28<#-- Categroy Color--> 
29    <#assign currentCategoryDefaultColor = 'grey-dark' /> 
30 
31<#-- Insight List total count title --> 
32<article class="filters__available"> 
33    <h3 class="filters__available__title"> 
34    ${totalAssetCount} ${assetCountLabel} 
35    </h3> 
36</article> 
37 
38    <#attempt> 
39        <#assign assetPublisherVocabularyExists = false /> 
40        <#if assetPublisherConfVocabularyId?has_content> 
41            <#assign assetPublisherVocabularyName = vocabularyLocalService.getVocabulary(getterUtil.getLong(assetPublisherConfVocabularyId)).getName() /> 
42            <#assign assetPublisherVocabulary = vocabularyLocalService.getGroupVocabulary(themeDisplay.getCompany().getGroup().getGroupId(), assetPublisherVocabularyName) /> 
43            <#assign assetPublisherVocabularyExists = true /> 
44        </#if> 
45        <#recover> 
46        <#-- do nothing --> 
47    </#attempt> 
48 
49 
50<div class="axaim-insights-list-container"> 
51    <#list entries as curEntry> 
52        <#assign assetRenderer = curEntry.getAssetRenderer() /> 
53        <#assign className = assetRenderer.getClassName() /> 
54        <#if className == "com.liferay.portlet.journal.model.JournalArticle"> 
55 
56            <#assign isCorruptAsset = false /> 
57            <#assign currentCategory = '' /> 
58 
59            <#if assetPublisherVocabularyExists> 
60                <#attempt> 
61                    <#assign articleCategories = assetCategoryLocalService.getCategories(getterUtil.getLong(curEntry.getClassNameId()),getterUtil.getLong(curEntry.getClassPK()) ) /> 
62                    <#list articleCategories as category> 
63                        <#if category.getVocabularyId() == getterUtil.getLong(assetPublisherConfVocabularyId)> 
64                            <#assign currentCategory = category /> 
65                        </#if> 
66                    </#list> 
67                    <#if currentCategory?has_content && categoryPropertiesLocalService.getCategoryProperty(currentCategory.getCategoryId(), "css-color")?has_content> 
68                        <#assign currentCategoryColor = categoryPropertiesLocalService.getCategoryProperty(currentCategory.getCategoryId(), "css-color").getValue() /> 
69                    <#else> 
70                        <#assign currentCategoryColor = currentCategoryDefaultColor /> 
71                    </#if> 
72                    <#recover> 
73                    <#-- do nothing --> 
74                </#attempt> 
75            </#if> 
76 
77        <#-- Getting the insight card information --> 
78            <#attempt> 
79                <#assign urlTitle = assetRenderer.getUrlTitle() /> 
80                <#assign groupId = assetRenderer.getGroupId() /> 
81                <#assign viewURL = baseDetailURL + "/" + urlTitle + "/" + groupId /> 
82                <#if assetLinkBehavior != "showFullContent"> 
83                    <#assign viewURL = assetRenderer.getURLViewInContext(renderRequest, renderResponse, viewURL) /> 
84                </#if> 
85                <#recover> 
86                    <#assign isCorruptAsset = true /> 
87            </#attempt> 
88 
89        <#-- Dont waste time and resources if the asset is a corrupt one :) --> 
90            <#if !isCorruptAsset> 
91                <#attempt > 
92                    <#assign curArticle = journaArticleLocalService.getLatestArticle(curEntry.getClassPK()) /> 
93                    <#assign docArticle = SAXReader.read(curArticle.getContentByLocale(themeDisplay.getLanguageId())) > 
94                    <#assign rootDoc = docArticle.getRootElement()> 
95 
96                <#-- Specific Insight disaply fields --> 
97                    <#assign insightBanner = '' /> 
98                    <#assign insightDateContent = '' /> 
99                    <#assign insightDate = 0 /> 
100                    <#assign insightTitle = '' /> 
101                    <#assign insightSummary = '' /> 
102                    <#assign insightLinkLabel = '' /> 
103                    <#assign isVideoInsight = false /> 
104 
105                <#-- Checking which insight template is used  --> 
106                    <#if rootDoc.selectSingleNode("dynamic-element[@name='Insights_title']")?has_content > 
107                    <#-- Is a NEW Insight template --> 
108                        <#assign insightDateContent = rootDoc.selectSingleNode("dynamic-element[@name='Insights_date']/dynamic-content").getText() /> 
109                        <#assign insightDate = getterUtil.getLong(insightDateContent) /> 
110                        <#assign insightTitle = rootDoc.selectSingleNode("dynamic-element[@name='Insights_title']/dynamic-content").getText() /> 
111                        <#assign isVideoInsight = rootDoc.selectSingleNode("dynamic-element[@name='Video_insights']/dynamic-content").getText() /> 
112                        <#if isVideoInsight?has_content && getterUtil.getBoolean(isVideoInsight)> 
113                            <#assign insightLinkLabel = videoArticleLink /> 
114                        <#else> 
115                            <#assign insightLinkLabel = articleLink /> 
116                        </#if> 
117                    <#else > 
118                    <#-- Is an OLD Insight template --> 
119                        <#assign insightDateContent = rootDoc.selectSingleNode("dynamic-element[@name='date']/dynamic-content").getText() /> 
120                        <#assign insightTitle = curEntry.getTitle(locale) /> 
121                        <#assign isVideoInsight = false /> 
122                        <#assign insightLinkLabel = articleLink /> 
123                    </#if> 
124 
125                    <#if rootDoc.selectSingleNode("dynamic-element[@name='banner']/dynamic-content")?has_content> 
126                        <#assign insightBanner = rootDoc.selectSingleNode("dynamic-element[@name='banner']/dynamic-content").getText() /> 
127                    <#else> 
128                        <#assign insightBanner = rootDoc.selectSingleNode("dynamic-element[@name='Banner']/dynamic-content").getText() /> 
129                    </#if> 
130                    <#assign insightDate = getterUtil.getLong(insightDateContent) /> 
131                    <#assign insightSummary = curEntry.getSummary(locale) /> 
132                    <#recover> 
133                </#attempt> 
134 
135            <#-- This contains each insight preview card--> 
136                <div class="axaim-insights-list-item"> 
137                    <a href="${viewURL}" title="${insightLinkLabel}"> 
138                    <#-- This IF snippet contains the insight banner image and its badge--> 
139                        <#if  insightBanner?has_content> 
140                            <div class="axaim-insights-banner" style="background-image:url('${insightBanner}');" 
141                                 title="${insightLinkLabel}"> 
142                                <#if currentCategory?has_content> 
143                                    <span class="badge badge--${currentCategoryColor}">${currentCategory.getTitle(themeDisplay.getLanguageId())}</span> 
144                                </#if> 
145                            </div> 
146                        <#else> 
147                            <div class="axaim-insights-banner-default"> 
148                                <#if currentCategory?has_content> 
149                                    <span class="badge badge--${currentCategoryColor}">${currentCategory.getTitle(themeDisplay.getLanguageId())}</span> 
150                                </#if> 
151                            </div> 
152                        </#if> 
153                    <#-- This DIV contains all the insight info of each insight card (Date, title, summary....) --> 
154                        <div class="axaim-insights-list-info"> 
155                            <#if (insightDate?has_content && insightDate > 0)> 
156                                <p class="axaim-insights-list-date"> 
157                                    <#assign date_DateObj = dateUtil.newDate(insightDate)> 
158                                    <#setting date_format="long"> 
159                                    <#setting locale=locale> 
160                                    ${date_DateObj?date} 
161                                </p> 
162                            </#if> 
163 
164                        <#-- Insight card title --> 
165                            <h5 class="axaim-insights-list-title"> 
166                            ${htmlUtil.escape(insightTitle)} 
167                            </h5> 
168                        <#-- This code bblock conatains the summary part of the insisght card --> 
169                            <#if (insightSummary?has_content)> 
170                                <p class="axaim-insights-list-abstract"> 
171                                    <#assign insightSummary=htmlUtil.escape(insightSummary)> 
172                                    <#if insightSummary?length &lt; 200> 
173                                    ${insightSummary} 
174                                    <#else> 
175                                    ${insightSummary?substring(0,199)} ... 
176                                    </#if> 
177                                </p> 
178                            </#if> 
179                        <#-- This block contains the bottom link to read more or watch video --> 
180                            <div class="btn-small bg-color--cobalt-75"> 
181                                <p class="btn-label">${insightLinkLabel} 
182                                    <#if isVideoInsight?has_content && getterUtil.getBoolean(isVideoInsight)> 
183                                        <span class="icon-play-circle"/> 
184                                    <#else> 
185                                        <span class="axaim-icon-arrow-right"/> 
186                                    </#if> 
187                                </p> 
188                            </div> 
189                        </div> 
190                    </a> 
191                </div> 
192            </#if> 
193        </#if> 
194    </#list> 
195</div> 
196</#if> 
197 
198<#function axaimTranslate labelText> 
199    <#if serviceLocator.findService("axa-im-wcm-funds-center-portlet", "com.axa.im.wcm.fundscenter.service.LabelTranslationLocalService")??> 
200        <#assign languageService = serviceLocator.findService("axa-im-wcm-funds-center-portlet", "com.axa.im.wcm.fundscenter.service.LabelTranslationLocalService") /> 
201        <#assign translated = languageService.getLabelTranslation(labelText, locale, companyId) /> 
202    <#else> 
203        <#assign translated = labelText /> 
204    </#if> 
205    <#return translated /> 
206</#function>