Une erreur s'est produite lors du traitement du gabarit.
The following has evaluated to null or missing:
==> serviceLocator  [in template "20155#20195#5890910" at line 16, column 31]

----
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 layoutLocalService = serviceL...  [in template "20155#20195#5890910" at line 16, column 1]
----
1<#-- 
2  ~ Copyright (c) 2018 AXA Shared Services Spain S.A. 
3
4  ~ Licensed under the AXA Shared Services Spain S.A. License (the "License"); you 
5  ~ 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<#assign layoutLocalService = serviceLocator.findService('com.liferay.portal.kernel.service.LayoutLocalService') /> 
17<#assign layoutSetLocalService = serviceLocator.findService('com.liferay.portal.kernel.service.LayoutSetLocalService') /> 
18<#assign portalUtil = staticUtil["com.liferay.portal.kernel.util.PortalUtil"] /> 
19<#attempt> 
20    <#assign themeDisplay = request['theme-display'] /> 
21    <#assign scopeGroupId = themeDisplay['scope-group-id'] /> 
22    <#assign requestCurrentCompleteUrl = request["attributes"].CURRENT_COMPLETE_URL /> 
23    <#recover> 
24        <#assign scopeGroupId = groupId /> 
25        <#assign requestCurrentCompleteUrl = "" /> 
26</#attempt> 
27 
28<#assign imageMimeTypes = ["image/bmp", "image/gif", "image/jpeg", "image/png", "image/tiff", "image/x-ms-bmp", "image/x-tiff"] /> 
29 
30<#assign HTTP_PROTOCOL  = "http://" /> 
31<#assign HTTPS_PROTOCOL = "https://" /> 
32<#assign DEFAULT_PORT   = "80" /> 
33<#assign PORT_DELIMITER = ":" /> 
34 
35<#assign promotion = "${htmlUtil.escape(Promotion.getData())}" /> 
36<#assign text = "${htmlUtil.escape(Promotion.Text.getData())}" /> 
37<#assign buttonText = "${htmlUtil.escape(Promotion.ButtonText.getData())}" /> 
38<#assign image = "${htmlUtil.escape(Promotion.Image.getData())}" /> 
39 
40<#-- promotionBoxStyle --> 
41<#assign promotionBackgroundImg = "" /> 
42 
43<#-- Image field --> 
44<#if image?has_content && image!="" > 
45 
46<#-- Checks if the image field actually contains an image --> 
47    <#assign parts = image?split("/") /> 
48    <#assign groupId = parts[2]?number /> 
49    <#assign uuId = parts[5] /> 
50 
51    <#if uuId?contains("?") > 
52        <#assign uuId = uuId?substring(0, parts[5]?index_of("?")) /> 
53    </#if> 
54 
55    <#assign dlFileEntryService = serviceLocator.findService('com.liferay.document.library.kernel.service.DLFileEntryService') /> 
56    <#attempt > 
57        <#assign file = dlFileEntryService.getFileEntryByUuidAndGroupId(uuId, groupId) /> 
58        <#assign mimeType = file.getMimeType() /> 
59        <#assign isImage = imageMimeTypes?seq_contains(mimeType) /> 
60 
61        <#if isImage > 
62            <#assign promotionBackgroundImg = "background-image: url(${image});" /> 
63        </#if> 
64        <#recover> 
65        <h1>recovering....</h1> 
66        <#-- Do nothing --> 
67    </#attempt> 
68</#if> 
69 
70<#-- Button link can be a Link To Page, an External Link or an Internal Document Link --> 
71<#assign linkUrl = "" /> 
72<#assign has_link = false /> 
73 
74<#if Promotion.type_link?? > 
75 
76<#-- Gets the type of the link and checks if there is valid content in that type corresponding field --> 
77    <#assign type_link = Promotion.type_link.getData()> 
78    <#assign has_page = type_link == "link_to_page" && Promotion.link_to_page?has_content && Promotion.link_to_page.getData()!="" /> 
79    <#assign has_ext = type_link == "link_extern" && Promotion.link?has_content && Promotion.link.getData()!="" /> 
80    <#assign has_doc = type_link == "document_library" && Promotion.link_to_document?has_content && Promotion.link_to_document.getData()!="" /> 
81    <#assign has_link = buttonText?has_content && buttonText!="" && (has_page || has_ext || has_doc) /> 
82<#-- The button is added only if there is valid button text and the link is correct --> 
83    <#if has_link > 
84 
85    <#-- Link To Page --> 
86        <#if has_page > 
87 
88        <#-- Retrieves the Link To Page content in the form [layoutId]@[pageType]@[groupId] i.e. "348@public@9246542" --> 
89            <#assign linkData = Promotion.link_to_page.data /> 
90            <#assign linkArray = linkData?split("@") /> 
91 
92        <#-- Splits the Link To Page content in its three parameters --> 
93            <#assign linkGroupId = linkArray[2]?number /> 
94            <#assign linkIsPrivate = (linkArray[1] == "private") /> 
95            <#assign linkLayoutId = linkArray[0]?number /> 
96 
97        <#-- Checks the source of the asset (same or different site) and if the page was accessed via virtual host --> 
98            <#assign currentGroupId = scopeGroupId?number /> 
99            <#assign currentCompleteUrl = requestCurrentCompleteUrl /> 
100 
101        <#-- If the page was accesed via Virtual Host and the link points to a page from another site, 
102             the Link URL needs to be built from scratch and not just use the given friendly URL. --> 
103            <#attempt > 
104                <#if linkGroupId != currentGroupId && !currentCompleteUrl?contains("/web/") > 
105 
106                <#-- Gets the Page Friendly URL to be appended to the base URL--> 
107                    <#assign linkToPageLayout = layoutLocalService.getLayout(linkGroupId, linkIsPrivate, linkLayoutId) /> 
108                    <#assign linkToPageFriendlyUrl = linkToPageLayout.getFriendlyURL(locale) /> 
109 
110                <#-- Gets the Virtual Hostname via the LayoutSet, and the Server Port --> 
111                    <#assign linkToPageLayoutSet = layoutSetLocalService.getLayoutSet(linkGroupId, linkIsPrivate) /> 
112                    <#assign linkToPageVirtualHostname = linkToPageLayoutSet.getVirtualHostname() /> 
113                    <#assign serverPort = request["server-port"] /> 
114 
115                <#-- Forms the link URL from the Protocol, the virtual hostname, the port and the friendly URL of the page --> 
116                    <#if currentCompleteUrl?contains(HTTPS_PROTOCOL) > 
117                        <#assign urlProtocol = HTTPS_PROTOCOL /> 
118                    <#else> 
119                        <#assign urlProtocol = HTTP_PROTOCOL /> 
120                    </#if> 
121 
122                    <#if serverPort != DEFAULT_PORT > 
123                        <#assign urlPort = PORT_DELIMITER + serverPort /> 
124                    <#else> 
125                        <#assign urlPort = "" /> 
126                    </#if> 
127 
128                    <#assign linkUrl = urlProtocol + linkToPageVirtualHostname + urlPort + linkToPageFriendlyUrl /> 
129 
130                <#-- In any other case, the URL is the friendly URL of the page --> 
131                <#else> 
132                    <#assign linkUrl = "${Promotion.link_to_page.getFriendlyUrl()}" /> 
133                </#if> 
134                <#recover> 
135                    <#assign linkUrl = "" /> 
136                    <#assign has_link = false /> 
137            </#attempt> 
138 
139        <#-- External link --> 
140        <#elseif has_ext > 
141            <#assign linkUrl = "${htmlUtil.escape(Promotion.link.getData())}" /> 
142 
143        <#-- Internal document link --> 
144        <#elseif has_doc > 
145            <#assign linkUrl = "${Promotion.link_to_document.getData()}" /> 
146        </#if> 
147    </#if> 
148</#if> 
149 
150 
151<div id="promotion_${randomNamespace}" class="promotion promotion-image promotion-hero" 
152     style="${promotionBackgroundImg}"> 
153    <div class="animation-overlay"></div> 
154    <div class="promotion-100"></div> 
155    <div class="container"> 
156        <div class="promotion__content promotion-100"> 
157            <div class="promotion-text-wrapper"> 
158                <h2 class="promotion__title typo78"> 
159                    <#if has_link > 
160                        <a href="${linkUrl}" target="_self" title="${promotion}"> 
161                    </#if> 
162                    ${promotion} 
163                    <#if has_link > 
164                        </a> 
165                    </#if> 
166                </h2> 
167                <#if text?has_content && text!="" > 
168                    <p class="promotion__abstract typo20">${text}</p> 
169                </#if> 
170            </div> 
171                <#if has_link > 
172                    <a class="button large danger" href="${linkUrl}" target="_self">${buttonText}</a> 
173                </#if> 
174        </div> 
175    </div> 
176</div> 

A simple addition makes all the difference

Multi-asset investing can help investors easily tackle and benefit from the uncertainty and complexity of today’s financial system – but not all multi-asset funds are created equal.

With ever more options in today’s global marketplace, is it time to brighten up the prospects of your multi-asset portfolio?

Une erreur s'est produite lors du traitement du gabarit.
The following has evaluated to null or missing:
==> serviceLocator  [in template "20155#20195#5890918" at line 29, column 47]

----
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 journalArticleLocalService = ...  [in template "20155#20195#5890918" at line 29, column 9]
----
1<#-- 
2  ~ Copyright (c) 2018 AXA Shared Services Spain S.A. 
3
4  ~ Licensed under the AXA Shared Services Spain S.A. License (the "License"); you 
5  ~ 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<#if entries?has_content> 
17    <#assign size = entries?size> 
18    <#assign navClass = ""> 
19 
20    <#if size  == 2> 
21        <#assign navClass = "two-promotions"> 
22    <#elseif size  == 3> 
23        <#assign navClass = "three-promotions"> 
24    <#elseif size == 4> 
25        <#assign navClass = "four-promotions"> 
26    </#if> 
27 
28    <div class="promotions-nav ${navClass}"> 
29        <#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") /> 
30        <#assign SAXReader = serviceLocator.findService("com.liferay.portal.kernel.xml.SAXReader") /> 
31        <#assign layoutLocalService = serviceLocator.findService('com.liferay.portal.kernel.service.LayoutLocalService') /> 
32        <#assign fileEntry = serviceLocator.findService('com.liferay.document.library.kernel.service.DLFileEntryService') /> 
33        <#assign imageMimeTypes = ["image/bmp", "image/gif", "image/jpeg", "image/png", "image/tiff", "image/x-ms-bmp", "image/x-tiff"] /> 
34        <#list entries as curEntry> 
35        <#-- The navigation-banner must have at most 4 items --> 
36            <#if (curEntry_index >= 4)> 
37                <#break> 
38            </#if> 
39        <#-- Configures the localization of the entry --> 
40            <#assign assetRenderer = curEntry.getAssetRenderer() /> 
41            <#assign className = assetRenderer.getClassName() /> 
42            <#assign has_link = false /> 
43 
44            <#if className == "com.liferay.journal.model.JournalArticle"> 
45                <#assign curArticle = journalArticleLocalService.getLatestArticle(curEntry.getClassPK()) /> 
46                <#assign docArticle = SAXReader.read(curArticle.getContentByLocale(themeDisplay.getLanguageId())) > 
47                <#assign rootDoc = docArticle.getRootElement()> 
48 
49                <#assign availableLocales = rootDoc.attribute("available-locales").getText() /> 
50                <#assign defaultLocale = rootDoc.attribute("default-locale").getText() /> 
51                <#if (availableLocales?contains(locale)) > 
52                    <#assign curLocale = locale /> 
53                <#else> 
54                    <#assign curLocale = defaultLocale /> 
55                </#if> 
56 
57                <#assign promotionPath = "dynamic-element[@name='Promotion']/dynamic-content[@language-id='${curLocale}']" /> 
58                <#assign textPath = "dynamic-element[@name='Promotion']/dynamic-element[@name='Text']/dynamic-content[@language-id='${curLocale}']" /> 
59                <#assign linkTypePath = "dynamic-element[@name='Promotion']/dynamic-element[@name='type_link']/dynamic-content[@language-id='${curLocale}']" /> 
60                <#assign buttonTextPath = "dynamic-element[@name='Promotion']/dynamic-element[@name='ButtonText']/dynamic-content[@language-id='${curLocale}']" /> 
61                <#assign linkToPagePath = "dynamic-element[@name='Promotion']/dynamic-element[@name='link_to_page']/dynamic-content[@language-id='${curLocale}']" /> 
62                <#assign externalLinkPath = "dynamic-element[@name='Promotion']/dynamic-element[@name='link']/dynamic-content[@language-id='${curLocale}']" /> 
63                <#assign internalDocumentLinkPath = "dynamic-element[@name='Promotion']/dynamic-element[@name='link_to_document']/dynamic-content[@language-id='${curLocale}']" /> 
64                <#assign imagePath = "dynamic-element[@name='Promotion']/dynamic-element[@name='Image']/dynamic-content[@language-id='${curLocale}']" /> 
65 
66                <#assign promotionContent = rootDoc.selectSingleNode(promotionPath).getText() /> 
67                <#assign textContent = rootDoc.selectSingleNode(textPath).getText() /> 
68                <#assign buttonTextContent = rootDoc.selectSingleNode(buttonTextPath).getText() /> 
69                <#assign imageContent = rootDoc.selectSingleNode(imagePath).getText() /> 
70 
71            <#-- Button link can be a Link To Page, an External Link or an Internal Document Link --> 
72                <#assign linkUrl = "" /> 
73 
74                <#if rootDoc.selectSingleNode(linkTypePath)?? > 
75                    <#assign linkTypeContent = rootDoc.selectSingleNode(linkTypePath).getText() /> 
76                <#else> 
77                    <#assign linkTypeContent = "" /> 
78                </#if> 
79                <#if rootDoc.selectSingleNode(linkToPagePath)?? > 
80                    <#assign linkToPageContent = rootDoc.selectSingleNode(linkToPagePath).getText() /> 
81                <#else> 
82                    <#assign linkToPageContent = "" /> 
83                </#if> 
84                <#if rootDoc.selectSingleNode(externalLinkPath)?? > 
85                    <#assign externalLinkContent = rootDoc.selectSingleNode(externalLinkPath).getText() /> 
86                <#else> 
87                    <#assign externalLinkContent = "" /> 
88                </#if> 
89                <#if rootDoc.selectSingleNode(internalDocumentLinkPath)?? > 
90                    <#assign internalDocumentLinkContent = rootDoc.selectSingleNode(internalDocumentLinkPath).getText() /> 
91                <#else> 
92                    <#assign internalDocumentLinkContent = "" /> 
93                </#if> 
94 
95            <#-- Background image --> 
96                <#assign backgroundStyle="" /> 
97                <#assign promoClass = "" /> 
98                <#assign isImage = imageContent?has_content && imageContent != ""/> 
99                <#if isImage> 
100                <#-- Checks the if the image field actually contains an image --> 
101                    <#assign parts = imageContent?split("/") /> 
102                    <#assign groupId = parts[2]?number /> 
103                    <#assign uuId = parts[5] /> 
104 
105                    <#if uuId?contains("?") > 
106                        <#assign uuId = uuId?substring(0, parts[5]?index_of("?")) /> 
107                    </#if> 
108 
109                    <#assign file=fileEntry.getFileEntryByUuidAndGroupId(uuId, groupId) /> 
110                    <#assign mimeType = file.getMimeType() /> 
111                    <#assign isImage = imageMimeTypes?seq_contains(mimeType) /> 
112 
113                    <#if isImage > 
114                        <#assign backgroundStyle="background-image: url(${imageContent});" /> 
115                        <#assign promoClass = "promotion-image gh-promo-image-${curEntry_index}" /> 
116                    </#if> 
117                </#if> 
118 
119                <#assign has_page = linkTypeContent == "link_to_page" && linkToPageContent != "" /> 
120                <#assign has_ext = linkTypeContent == "link_extern" && externalLinkContent != "" /> 
121                <#assign has_doc = linkTypeContent == "document_library" && internalDocumentLinkContent != "" /> 
122                <#assign has_link = buttonTextContent?has_content && buttonTextContent!="" && (has_page || has_ext || has_doc) /> 
123            <#--hotfix in order to open any link in the same page, before it was like the commented <#assign target = "BLA BLA" /> below--> 
124                <#assign target = "_self" /> 
125 
126                <#if buttonTextContent != "" && (has_page || has_ext || has_doc)> 
127 
128                    <#if has_page> 
129                    <#-- Retrieves the Link To Page content in the form [layoutId]@[pageType]@[groupId] i.e. "348@public@9246542" --> 
130                        <#assign linkToPageString = rootDoc.selectSingleNode(linkToPagePath).getText() /> 
131                        <#assign linkToPageArray = linkToPageString?split("@") /> 
132 
133                    <#-- Splits the Link To Page content in the three parameters for the getLayout method --> 
134                        <#assign linkToPageGroupId = linkToPageArray[2]?number /> 
135                        <#assign linkToPageIsPrivate = (linkToPageArray[1] == "private") /> 
136                        <#assign linkToPageLayoutId = linkToPageArray[0]?number /> 
137 
138                    <#-- obtains the LinkToPage url depending on the source of the asset (same or different site) --> 
139                        <#attempt > 
140                            <#if curEntry.getGroupId() != themeDisplay.getSiteGroupId() > 
141 
142                            <#-- Gets the Page Friendly URL to be appended to the base URL--> 
143                                <#assign linkToPageLayout = layoutLocalService.getLayout(linkToPageGroupId, linkToPageIsPrivate, linkToPageLayoutId) /> 
144                                <#assign linkToPageFriendlyUrl = linkToPageLayout.getFriendlyURL(locale) /> 
145 
146                            <#-- Base URL in case current URL with Backoffice --> 
147                                <#if currentURL?contains("/web/") > 
148                                    <#assign linkToPageGroup = groupLocalServiceUtil.getGroup(linkToPageGroupId) /> 
149                                    <#assign groupFriendlyUrl = portalUtil.getGroupFriendlyURL(linkToPageGroup, linkToPageIsPrivate, themeDisplay) /> 
150                                    <#assign layoutFriendlyUrl = groupFriendlyUrl + linkToPageFriendlyUrl /> 
151 
152                                <#-- Base URL in case current URL with Virtual Host --> 
153                                <#else> 
154                                    <#assign linkToPageLayoutSet = layoutSetLocalService.getLayoutSet(linkToPageGroupId, linkToPageIsPrivate) /> 
155                                    <#assign linkToPageVirtualHostname = linkToPageLayoutSet.getVirtualHostname() /> 
156 
157                                    <#if request.getProtocol()?contains("HTTPS") > 
158                                        <#assign protocol = "https://" /> 
159                                    <#else> 
160                                        <#assign protocol = "http://" /> 
161                                    </#if> 
162 
163                                    <#assign urlPort = "" /> 
164                                    <#assign serverPort = request.getServerPort() /> 
165 
166                                    <#if serverPort != 80 > 
167                                        <#assign urlPort = ":" + serverPort?string /> 
168                                    </#if> 
169 
170                                    <#assign layoutFriendlyUrl = protocol + linkToPageVirtualHostname + urlPort + linkToPageFriendlyUrl /> 
171                                </#if> 
172                            <#else> 
173                                <#assign linkToPageLayout = layoutLocalService.getLayout(linkToPageGroupId, linkToPageIsPrivate, linkToPageLayoutId) /> 
174                                <#assign layoutFriendlyUrl = portalUtil.getLayoutFriendlyURL(linkToPageLayout, themeDisplay) /> 
175                            </#if> 
176 
177                            <#assign linkUrl = "${layoutFriendlyUrl}" /> 
178 
179                            <#recover> 
180                                <#assign linkUrl = "" /> 
181                                <#assign has_link = false /> 
182                        </#attempt> 
183                    <#elseif has_ext> 
184                        <#assign linkUrl = "${externalLinkContent}" /> 
185                    <#elseif has_doc> 
186                        <#assign linkUrl = "${internalDocumentLinkContent}" /> 
187                    </#if> 
188                </#if> 
189            </#if> 
190 
191            <#-- If the promotions does not have the link configured, the box will be shown --> 
192            <#if has_link > 
193                <a href="${linkUrl}" class="promotion ${promoClass} gh-promotion-item" style="${backgroundStyle}"> 
194            <#else> 
195                <div class="promotion ${promoClass} gh-promotion-item" style="${backgroundStyle}"> 
196            </#if> 
197                    <div class="promotion-100"></div> 
198                    <div class="container"> 
199                        <div class="promotion__content promotion-100"> 
200                            <h2 class="promotion__title gh-promotion-title-${curEntry_index}">${promotionContent}</h2> 
201                            <p class="promotion__abstract gh-promotion-text-${curEntry_index}">${textContent}</p> 
202                        <#if has_link > 
203                            <button class="button danger gh-promotion-button-${curEntry_index}">${buttonTextContent}</button> 
204                        </#if> 
205                        </div> 
206                    </div> 
207            <#if has_link > 
208                </a> 
209            <#else> 
210                </div/ 
211            </#if> 
212        </#list> 
213    </div> 
214</#if> 

Whatever investors are looking for, multi-asset funds can help bring together investment opportunities from around the world and across asset classes to help meet specific outcomes:

  • Reach investment goals

    like capital accumulation

  • Help navigate

    uncertain markets

  • Make investing

    simpler and easier

What is AXA WF Global Optimal Income?

AXA WF Global Optimal Income is a total return fund which aims to capture global growth while mitigating economic and market unknowns

 

Reasons to invest

Capture global growth through long-term conviction

To help generate growth over the long term, we hold convictions at two levels:

  • Asset allocation. We combine quantitative inputs with qualitative insight from AXA IM’s multi-expert model 
  • Security selection. Our security selection is unconstrained, letting us invest in companies where we see the highest potential  

Use flexibility to navigate evolving market conditions

To capture investment ideas wherever they arise in a rigorous portfolio construction framework, we have a 0-100% equity exposure across a broad investment universe: global equities, sovereign and corporate bonds, emerging markets, G10 currencies, volatility and cash. 

 

Three-tiered approach to risk mitigation

To help investors manage the unknowns inherent in today’s financial system, we use a three-tiered risk management approach:
Structurally, we build a well-diversified portfolio for long-term risk mitigation
Tactically,  we use our flexible allocation to plan for known events that may create market stress
Opportunistically, we use liquid hedging strategies to prepare for unknown events and volatile market conditions

Une erreur s'est produite lors du traitement du gabarit.
The following has evaluated to null or missing:
==> serviceLocator  [in template "20155#20195#20839" at line 34, column 43]

----
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 journalArticleLocalService = ...  [in template "20155#20195#20839" at line 34, column 5]
----
1<#-- 
2  ~ Copyright (c) 2018 AXA Shared Services Spain S.A. 
3
4  ~ Licensed under the AXA Shared Services Spain S.A. License (the "License"); you 
5  ~ 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    <#-- Getting asset pusblisher category configuration local services--> 
34    <#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") /> 
35    <#assign SAXReader = serviceLocator.findService("com.liferay.portal.kernel.xml.SAXReader")> 
36    <#assign vocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService") /> 
37    <#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") /> 
38    <#assign categoryPropertiesLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryPropertyLocalService") /> 
39    <#assign assetPublisherConfVocabularyId = themeDisplay.getPortletDisplay().getPortletSetup().getValue("categoryVocabulary", "") /> 
40    <#-- Translated Labels  --> 
41    <#assign assetCountLabel = axaimTranslate("content.insights.number-results") /> 
42    <#assign articleLink = axaimTranslate("content.insights.list.articlelink") /> 
43    <#assign videoArticleLink = axaimTranslate("content.insights.list.articlelink.video") /> 
44    <#-- Categroy Color--> 
45    <#assign currentCategoryDefaultColor = 'grey' /> 
46    <#assign currentCategoryColor = currentCategoryDefaultColor /> 
47    <#-- Total Asset Count --> 
48    <#attempt> 
49        <#assign totalAssetCount = renderRequest.getAttribute("totalAssetCount") /> 
50        <#recover> 
51            <#assign totalAssetCount = "" /> 
52    </#attempt> 
53 
54    <div class="insights-list"> 
55        <#-- Insight List total count title --> 
56        <#if totalAssetCount?has_content> 
57            <h3 class="insights-list-title typo28"> 
58                ${totalAssetCount} ${assetCountLabel} 
59            </h3> 
60        </#if> 
61 
62        <#attempt> 
63            <#assign assetPublisherVocabularyExists = false /> 
64            <#if assetPublisherConfVocabularyId?has_content> 
65                <#assign assetPublisherVocabularyName = vocabularyLocalService.getVocabulary(getterUtil.getLong(assetPublisherConfVocabularyId)).getName() /> 
66                <#assign assetPublisherVocabulary = vocabularyLocalService.getGroupVocabulary(themeDisplay.getCompany().getGroup().getGroupId(), assetPublisherVocabularyName) /> 
67                <#assign assetPublisherVocabularyExists = true /> 
68            </#if> 
69            <#recover> 
70            <#-- do nothing --> 
71        </#attempt> 
72 
73        <div class="insights-list-list"> 
74            <#list entries as curEntry> 
75                <#assign assetRenderer = curEntry.getAssetRenderer() /> 
76                <#assign className = assetRenderer.getClassName() /> 
77                <#if className == "com.liferay.journal.model.JournalArticle"> 
78 
79                    <#assign isCorruptAsset = false /> 
80                    <#assign currentCategory = '' /> 
81 
82                    <#if assetPublisherVocabularyExists> 
83                        <#attempt> 
84                            <#assign articleCategories = assetCategoryLocalService.getCategories(getterUtil.getLong(curEntry.getClassNameId()),getterUtil.getLong(curEntry.getClassPK()) ) /> 
85                            <#list articleCategories as category> 
86                                <#if category.getVocabularyId() == getterUtil.getLong(assetPublisherConfVocabularyId)> 
87                                    <#assign currentCategory = category /> 
88                                </#if> 
89                            </#list> 
90                            <#if currentCategory?has_content && categoryPropertiesLocalService.getCategoryProperties()?has_content && categoryPropertiesLocalService.getCategoryProperty(currentCategory.getCategoryId(), "css-color")?has_content> 
91                                <#assign currentCategoryColor = categoryPropertiesLocalService.getCategoryProperty(currentCategory.getCategoryId(), "css-color").getValue() /> 
92                            <#else> 
93                                <#assign currentCategoryColor = currentCategoryDefaultColor /> 
94                            </#if> 
95                        <#recover> 
96                            <#assign currentCategoryColor = currentCategoryDefaultColor /> 
97                            <#-- do nothing --> 
98                        </#attempt> 
99                    </#if> 
100 
101                <#-- Getting the insight card information --> 
102                    <#attempt> 
103                        <#assign urlTitle = assetRenderer.getUrlTitle() /> 
104                        <#assign groupId = assetRenderer.getGroupId() /> 
105                        <#assign viewURL = baseDetailURL + "/" + urlTitle + "/" + groupId /> 
106                        <#if assetLinkBehavior != "showFullContent"> 
107                            <#assign viewURL = assetRenderer.getURLViewInContext(renderRequest, renderResponse, viewURL) /> 
108                        </#if> 
109                        <#recover> 
110                            <#assign isCorruptAsset = true /> 
111                    </#attempt> 
112 
113                <#-- Dont waste time and resources if the asset is a corrupt one :) --> 
114                    <#if !isCorruptAsset> 
115                        <#attempt > 
116                            <#assign curArticle = journalArticleLocalService.getLatestArticle(curEntry.getClassPK()) /> 
117                            <#assign docArticle = SAXReader.read(curArticle.getContentByLocale(themeDisplay.getLanguageId())) > 
118                            <#assign rootDoc = docArticle.getRootElement()> 
119 
120                        <#-- Specific Insight disaply fields --> 
121                            <#assign insightBanner = '' /> 
122                            <#assign insightDateContent = '' /> 
123                            <#assign insightTitle = '' /> 
124                            <#assign insightSummary = '' /> 
125                            <#assign insightLinkLabel = '' /> 
126                            <#assign isVideoInsight = false /> 
127 
128                        <#-- Checking which insight template is used  --> 
129                            <#if rootDoc.selectSingleNode("dynamic-element[@name='Insights_title']")?has_content > 
130                            <#-- Is a NEW Insight template --> 
131                                <#assign insightDateContent = rootDoc.selectSingleNode("dynamic-element[@name='Insights_date']/dynamic-content").getText() /> 
132                                <#assign insightTitle = rootDoc.selectSingleNode("dynamic-element[@name='Insights_title']/dynamic-content").getText() /> 
133                                <#assign isVideoInsight = rootDoc.selectSingleNode("dynamic-element[@name='Video_insights']/dynamic-content").getText() /> 
134                                <#if isVideoInsight?has_content && getterUtil.getBoolean(isVideoInsight)> 
135                                    <#assign insightLinkLabel = videoArticleLink /> 
136                                <#else> 
137                                    <#assign insightLinkLabel = articleLink /> 
138                                </#if> 
139                            <#else > 
140                            <#-- Is an OLD Insight template --> 
141                                <#assign insightDateContent = rootDoc.selectSingleNode("dynamic-element[@name='date']/dynamic-content").getText() /> 
142                                <#assign insightTitle = curEntry.getTitle(locale) /> 
143                                <#assign isVideoInsight = false /> 
144                                <#assign insightLinkLabel = articleLink /> 
145                            </#if> 
146 
147                            <#if rootDoc.selectSingleNode("dynamic-element[@name='banner']/dynamic-content")?has_content> 
148                                <#assign insightBanner = rootDoc.selectSingleNode("dynamic-element[@name='banner']/dynamic-content").getText() /> 
149                            <#else> 
150                                <#assign insightBanner = rootDoc.selectSingleNode("dynamic-element[@name='Banner']/dynamic-content").getText() /> 
151                            </#if> 
152                            <#assign insightSummary = curEntry.getSummary(locale) /> 
153                            <#recover> 
154                        </#attempt> 
155 
156 
157                        <#-- This contains each insight preview card --> 
158                        <a class="card-image" href="${viewURL}" title="${insightLinkLabel}"> 
159                            <#-- This IF snippet contains the insight banner image and its badge--> 
160                            <#if  insightBanner?has_content> 
161                                <div class="card-img" style="background-image:url('${insightBanner}');" 
162                                     title="${insightLinkLabel}"> 
163                                    <#if currentCategory?has_content> 
164                                        <span class="label label-${currentCategoryColor}"> 
165                                            ${currentCategory.getTitle(themeDisplay.getLanguageId())} 
166                                        </span> 
167                                    </#if> 
168                                    <#if isVideoInsight?has_content && getterUtil.getBoolean(isVideoInsight)> 
169                                        <span class="label-video axaim-icon-play"> 
170                                        </span> 
171                                    </#if> 
172                                </div> 
173                            <#else> 
174                                <div class="card-img" title="${insightLinkLabel}"> 
175                                    <#if currentCategory?has_content> 
176                                        <span class="label label-${currentCategoryColor}"> 
177                                            ${currentCategory.getTitle(themeDisplay.getLanguageId())} 
178                                        </span> 
179                                    </#if> 
180                                </div> 
181                            </#if> 
182                            <#-- This DIV contains all the insight info of each insight card (Date, title, summary....) --> 
183                            <div class="card-textBlock"> 
184                            <#-- Insight date --> 
185                                <p class="card-date typo14"> 
186                                   <#if insightDateContent??> 
187                                       <#assign date_obj = dateUtil.parseDate("yyyy-MM-dd",insightDateContent,locale)> 
188                                       <#setting locale=locale> 
189                                       ${date_obj?date?string.long} 
190                                   </#if> 
191                                </p> 
192                                <#-- Insight card title --> 
193                                <h3 class="card-title typo24"> 
194                                    ${htmlUtil.escape(insightTitle)} 
195                                </h3> 
196                                <#-- This code block conatains the summary part of the insisght card --> 
197                                <#if (insightSummary?has_content)> 
198                                    <p class="card-abstract typo16"> 
199                                        <#assign insightSummary=htmlUtil.escape(insightSummary)> 
200                                        <#if insightSummary?length &lt; 200> 
201                                            ${insightSummary} 
202                                        <#else> 
203                                            ${insightSummary?substring(0,199)} ... 
204                                        </#if> 
205                                    </p> 
206                                </#if> 
207                            </div> 
208                        </a> 
209                    </#if> 
210                </#if> 
211            </#list> 
212        </div> 
213    </div> 
214</#if> 
215 
216 
217 
218<!-- Label Translation method --> 
219<#function axaimTranslate labelText> 
220    <#if serviceLocator.findService("com.axa.im.wcm.labeltranslation.service.LabelTranslationLocalService")??> 
221        <#assign languageService = serviceLocator.findService("com.axa.im.wcm.labeltranslation.service.LabelTranslationLocalService") /> 
222        <#assign translated = languageService.getLabelTranslation(labelText, locale, companyId) /> 
223    <#else> 
224        <#assign translated = labelText /> 
225    </#if> 
226    <#return translated /> 
227</#function>