An error occurred while processing the template.
Java method "com.liferay.portal.kernel.util.DateUtil_IW.parseDate(String, String, Locale)" threw an exception when invoked on com.liferay.portal.kernel.util.DateUtil_IW object "com.liferay.portal.kernel.util.DateUtil_IW@1896968d"; see cause exception in the Java stack trace.

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign date_obj = dateUtil.parseDate...  [in template "20155#20195#4966910" at line 191, column 49]
----
1<#-- 
2  ~ Copyright (c) 2020 AXA Group Operations Spain S.A. 
3
4  ~ Licensed under the AXA Group Operations Spain S.A. License (the "License"); 
5  ~ you may not use this file except in compliance with the License. 
6  ~ A copy of the License can be found in the LICENSE.TXT file distributed 
7  ~ together with this file. 
8
9  ~ Unless required by applicable law or agreed to in writing, software 
10  ~ distributed under the License is distributed on an "AS IS" BASIS, 
11  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
12  ~ See the License for the specific language governing permissions and 
13  ~ limitations under the License. 
14  --> 
15 
16<#-- Check first if the asset publisher has entries --> 
17<#if entries?has_content> 
18<#-- create the content URL--> 
19    <#attempt> 
20        <#assign currentLiveGroup = themeDisplay.getScopeGroup() /> 
21        <#if currentLiveGroup.isStagingGroup() > 
22            <#assign currentLiveGroup = currentLiveGroup.getLiveGroup() /> 
23        </#if> 
24        <#assign contentDisplayLayoutFriendlyURL = currentLiveGroup.getExpandoBridge().getAttribute("contentDisplayLayoutFriendlyURL") /> 
25        <#assign layoutLocalService = serviceLocator.findService('com.liferay.portal.kernel.service.LayoutLocalService') /> 
26        <#assign targetLayout = layoutLocalService.getFriendlyURLLayout(themeDisplay.getScopeGroupId(), false, contentDisplayLayoutFriendlyURL) /> 
27        <#assign targetPortletInstanceId = targetLayout.getLayoutType().getPortletIds()[0] > 
28        <#assign baseDetailURL = portalUtil.getLayoutURL(targetLayout, themeDisplay) + "/-/asset_publisher/" + targetPortletInstanceId[targetPortletInstanceId?last_index_of('_')+1..] + "/content"> 
29        <#recover> 
30            <#assign baseDetailURL = "" /> 
31    </#attempt> 
32 
33<#-- LinkToPage preference will determine if the "All Insights" button should be displayed or not --> 
34    <#assign portletPreferences = renderRequest.getPreferences() /> 
35    <#assign preferenceNames = portletPreferences.getNames() /> 
36    <#assign linkToPage = portletPreferences.getValue("portletSetupLinkToLayoutUuid", "") /> 
37    <#assign isLinkToPageConfigured = linkToPage?? && linkToPage?has_content && linkToPage != "" /> 
38 
39<#-- Getting asset pusblisher category configuration local services--> 
40    <#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") /> 
41    <#assign SAXReader = serviceLocator.findService("com.liferay.portal.kernel.xml.SAXReader")> 
42    <#assign vocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService") /> 
43    <#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") /> 
44    <#assign categoryPropertiesLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryPropertyLocalService") /> 
45    <#assign assetPublisherConfVocabularyId = themeDisplay.getPortletDisplay().getPortletSetup().getValue("categoryVocabulary", "") /> 
46<#-- Translated Labels  --> 
47    <#assign insightsTitle = axaimTranslate("content.insights.list.home.title") /> 
48    <#assign articleLink = axaimTranslate("content.insights.list.articlelink") /> 
49    <#assign videoArticleLink = axaimTranslate("content.insights.list.articlelink.video") /> 
50<#-- Categroy Color--> 
51    <#assign currentCategoryDefaultColor = 'grey' /> 
52    <#assign currentCategoryColor = currentCategoryDefaultColor /> 
53<#-- AP Vocabulary Configuration --> 
54    <#attempt> 
55        <#assign assetPublisherVocabularyExists = false /> 
56        <#if assetPublisherConfVocabularyId?has_content> 
57            <#assign assetPublisherVocabularyName = vocabularyLocalService.getVocabulary(getterUtil.getLong(assetPublisherConfVocabularyId)).getName() /> 
58            <#assign assetPublisherVocabulary = vocabularyLocalService.getGroupVocabulary(themeDisplay.getCompany().getGroup().getGroupId(), assetPublisherVocabularyName) /> 
59            <#assign assetPublisherVocabularyExists = true /> 
60        </#if> 
61        <#recover> 
62        <#-- do nothing --> 
63    </#attempt> 
64 
65    <div class="insights-home"> 
66        <h3 class="insights-list-title typo28">${insightsTitle}</h3> 
67        <div class="insights-list-list"> 
68            <#list entries as curEntry> 
69                <#assign assetRenderer = curEntry.getAssetRenderer() /> 
70                <#assign className = assetRenderer.getClassName() /> 
71                <#if className == "com.liferay.journal.model.JournalArticle"> 
72 
73                    <#assign isCorruptAsset = false /> 
74                    <#assign currentCategory = '' /> 
75 
76                    <#if assetPublisherVocabularyExists> 
77                        <#attempt> 
78                            <#assign articleCategories = assetCategoryLocalService.getCategories(getterUtil.getLong(curEntry.getClassNameId()),getterUtil.getLong(curEntry.getClassPK()) ) /> 
79                            <#list articleCategories as category> 
80                                <#if category.getVocabularyId() == getterUtil.getLong(assetPublisherConfVocabularyId)> 
81                                    <#assign currentCategory = category /> 
82                                </#if> 
83                            </#list> 
84                            <#if currentCategory?has_content && categoryPropertiesLocalService.getCategoryProperty(currentCategory.getCategoryId(), "css-color")?has_content> 
85                                <#assign currentCategoryColor = categoryPropertiesLocalService.getCategoryProperty(currentCategory.getCategoryId(), "css-color").getValue() /> 
86                            <#else> 
87                                <#assign currentCategoryColor = currentCategoryDefaultColor /> 
88                            </#if> 
89                            <#recover> 
90                            <#-- do nothing --> 
91                        </#attempt> 
92                    </#if> 
93 
94                <#-- Getting the insight card information --> 
95                    <#attempt> 
96                        <#assign urlTitle = assetRenderer.getUrlTitle() /> 
97                        <#assign groupId = assetRenderer.getGroupId() /> 
98                        <#assign viewURL = baseDetailURL + "/" + urlTitle + "/" + groupId /> 
99                        <#if assetLinkBehavior != "showFullContent"> 
100                            <#assign viewURL = assetRenderer.getURLViewInContext(renderRequest, renderResponse, viewURL) /> 
101                        </#if> 
102                        <#recover> 
103                            <#assign isCorruptAsset = true /> 
104                    </#attempt> 
105 
106                <#-- Dont waste time and resources if the asset is a corrupt one :) --> 
107                    <#if !isCorruptAsset> 
108                        <#attempt > 
109                            <#assign curArticle = journalArticleLocalService.getLatestArticle(curEntry.getClassPK()) /> 
110                            <#assign docArticle = SAXReader.read(curArticle.getContentByLocale(themeDisplay.getLanguageId())) > 
111                            <#assign rootDoc = docArticle.getRootElement()> 
112 
113                        <#-- Specific Insight display fields --> 
114                            <#assign insightBanner = '' /> 
115                            <#assign insightDateContent = '' /> 
116                            <#assign insightTitle = '' /> 
117                            <#assign insightSummary = '' /> 
118                            <#assign insightLinkLabel = '' /> 
119                            <#assign isVideoInsight = false /> 
120                            <#assign insightReadingTime =  '' /> 
121 
122                        <#-- Checking which insight template is used  --> 
123                            <#if rootDoc.selectSingleNode("dynamic-element[@name='Insights_title']")?has_content > 
124                            <#-- Is a NEW Insight template --> 
125                                <#assign insightDateContent = rootDoc.selectSingleNode("dynamic-element[@name='Insights_date']/dynamic-content").getText() /> 
126                                <#assign insightTitle = rootDoc.selectSingleNode("dynamic-element[@name='Insights_title']/dynamic-content").getText() /> 
127                                <#if rootDoc.selectSingleNode("dynamic-element[@name='Reading_time']/dynamic-content")?has_content > 
128                                    <#assign insightReadingTime =  rootDoc.selectSingleNode("dynamic-element[@name='Reading_time']/dynamic-content").getText() /> 
129                                </#if> 
130                                <#assign isVideoInsight = rootDoc.selectSingleNode("dynamic-element[@name='Video_insights']/dynamic-content").getText() /> 
131                                <#if isVideoInsight?has_content && getterUtil.getBoolean(isVideoInsight)> 
132                                    <#assign insightLinkLabel = videoArticleLink /> 
133                                <#else> 
134                                    <#assign insightLinkLabel = articleLink /> 
135                                </#if> 
136                            <#else > 
137                            <#-- Is an OLD Insight template --> 
138                                <#assign insightDateContent = rootDoc.selectSingleNode("dynamic-element[@name='date']/dynamic-content").getText() /> 
139                                <#assign insightTitle = curEntry.getTitle(locale) /> 
140                                <#assign isVideoInsight = false /> 
141                                <#assign insightLinkLabel = articleLink /> 
142                            </#if> 
143 
144                            <#if rootDoc.selectSingleNode("dynamic-element[@name='banner']/dynamic-content")?has_content> 
145                                <#assign insightBanner = rootDoc.selectSingleNode("dynamic-element[@name='banner']/dynamic-content").getText() /> 
146                            <#else> 
147                                <#assign insightBanner = rootDoc.selectSingleNode("dynamic-element[@name='Banner']/dynamic-content").getText() /> 
148                            </#if> 
149                            <#assign insightSummary = curEntry.getSummary(locale) /> 
150                            <#recover> 
151                        </#attempt> 
152 
153                    <#-- This contains each insight preview card--> 
154                        <a class="card-image gh-hmb-insight-card" href="${viewURL}" title="${insightLinkLabel}"> 
155                            <#-- This IF snippet contains the insight banner image and its badge--> 
156                            <#if  insightBanner?has_content> 
157                                <div class="card-img gh-hmb-insight-card-image" style="background-image:url('${insightBanner}');" 
158                                     title="${insightLinkLabel}"> 
159                                    <#if currentCategory?has_content> 
160                                        <span class="label label-${currentCategoryColor} gh-hmb-insight-card-category"> 
161                                            ${currentCategory.getTitle(themeDisplay.getLanguageId())} 
162                                        </span> 
163                                    </#if> 
164                                    <#if isVideoInsight?has_content && getterUtil.getBoolean(isVideoInsight)> 
165                                        <span class="label-video axaim-icon-play"> 
166                                        </span> 
167                                    </#if> 
168                                </div> 
169                            <#else> 
170                                <div class="card-img" title="${insightLinkLabel}"> 
171                                    <#if currentCategory?has_content> 
172                                        <span class="label label-${currentCategoryColor}"> 
173                                            ${currentCategory.getTitle(themeDisplay.getLanguageId())} 
174                                        </span> 
175                                    </#if> 
176                                </div> 
177                            </#if> 
178                            <#-- This DIV contains all the insight info of each insight card (Date, title, summary....) --> 
179                            <div class="card-textBlock"> 
180                                <#-- Insight metainfo --> 
181                                <div class="card-metainfo"> 
182                                    <#-- Insight date --> 
183                                    <#if insightDateContent??> 
184                                        <span class="card-date"> 
185                                          <span class="icon-wrapper"> 
186                                            <svg viewBox="0 0 16 16" class="icon-calendar" fill="none" stroke-width="1.5" stroke="current-color"> 
187                                              <path vector-effect="non-scaling-stroke" d="M12.66 2.54H15v12.09H1V2.33h2.33M6.45 2.33h3.1M4.89 4.66V0M11.13 4.66V0M1 7.77h14"/> 
188                                            </svg> 
189                                          </span> 
190                                          <time class="gh-hmb-insight-card-date typo14"> 
191                                                <#assign date_obj = dateUtil.parseDate("yyyy-MM-dd",insightDateContent,locale)> 
192                                              <#setting locale=locale> 
193                                              ${date_obj?date?string.long} 
194                                          </time> 
195                                        </span> 
196                                    </#if> 
197                                    <#-- Insight reading time --> 
198                                    <#if insightReadingTime?has_content> 
199                                        <span class="card-reading-time typo14"> 
200                                          <span class="icon-wrapper"> 
201                                            <svg viewBox="0 0 16 16" class="icon-time" stroke="current-color"> 
202                                              <path vector-effect="non-scaling-stroke" d="M7.992 0C12.416 0 16 3.584 16 8s-3.584 8-8.008 8C3.576 16 0 12.416 0 8s3.576-8 7.992-8zM8 1.6A6.398 6.398 0 001.6 8c0 3.536 2.864 6.4 6.4 6.4 3.536 0 6.4-2.864 6.4-6.4 0-3.536-2.864-6.4-6.4-6.4zM8.25 4v4.016L12 10.06l-.625.941L7 8.59V4h1.25z"/> 
203                                            </svg> 
204                                          </span> 
205                                          <span class="reading-time-value">${insightReadingTime}</span> 
206                                          <span class="reading-time-label">${axaimTranslate("content.insight.minuteread")} </span> 
207                                        </span> 
208                                    </#if> 
209                                </div> 
210                                <#-- Insight card title --> 
211                                <h3 class="card-title gh-hmb-insight-card-title typo24"> 
212                                    ${htmlUtil.escape(insightTitle)} 
213                                </h3> 
214                                <#-- This code block conatains the summary part of the insisght card --> 
215                                <#if (insightSummary?has_content)> 
216                                    <p class="card-abstract gh-hmb-insight-card-summary typo16"> 
217                                        <#assign insightSummary=htmlUtil.escape(insightSummary)> 
218                                        <#if insightSummary?length &lt; 200> 
219                                            ${insightSummary} 
220                                        <#else> 
221                                            ${insightSummary?substring(0,199)} ... 
222                                        </#if> 
223                                    </p> 
224                                </#if> 
225                            </div> 
226                        </a> 
227                    </#if> 
228                </#if> 
229            </#list> 
230        </div> 
231        <#if isLinkToPageConfigured > 
232            <#assign findAllButtonText = axaimTranslate("content.insights.list.home.allbutton") /> 
233            <a class="button large cobalt gh-hmb-insight-all-insights" title="${findAllButtonText}" href="${currentURL}">${findAllButtonText}</a> 
234        </#if> 
235    </div> 
236</#if> 
237 
238<!-- Label Translation method --> 
239<#function axaimTranslate labelText> 
240    <#if serviceLocator.findService("com.axa.im.wcm.labeltranslation.service.LabelTranslationLocalService")??> 
241        <#assign languageService = serviceLocator.findService("com.axa.im.wcm.labeltranslation.service.LabelTranslationLocalService") /> 
242        <#assign translated = languageService.getLabelTranslation(labelText, locale, companyId) /> 
243    <#else> 
244        <#assign translated = labelText /> 
245    </#if> 
246    <#return translated /> 
247</#function>