In the News In the News

Read insights from A.T. Kearney consultants quoted in the media.
An error occurred while processing the template.
Error on line 93, column 29 in 10154#10192#LOCAL_LEADER_LIST_DEFAULT
JournalArticleLocalService.getLatestArticle(currentArticleAssetEntry.getClassPK()) is undefined.
It cannot be assigned to currentArticle
1<#-- 
2Template to declare the DOJO widget that contains the actual layout. 
3--> 
4<#assign divId = randomNamespace/> 
5 
6<#-- Javascript used to create the DOJO widget --> 
7<script type="text/javascript"> 
8    require(["web-content-templates/LeadersList", "dojo/domReady!"], function(LeadersList) { 
9	     	var localization={}; 
10			localization["contact-loc-text"]='${languageUtil.get(locale, "contact-loc-text")}';     
11			localization["bio-loc-text"]='${languageUtil.get(locale, "bio-loc-text")}'; 
12			localization["connect-loc-text"]='${languageUtil.get(locale, "connect-loc-text")}'; 
13			localization["asia-pacific"]='${languageUtil.get(locale, "asia-pacific")}'; 
14			localization["europe-middle-east-africa"]='${languageUtil.get(locale, "europe-middle-east-africa")}'; 
15			localization["americas"]='${languageUtil.get(locale, "americas")}'; 
16			localization["global"]='${languageUtil.get(locale, "global")}'; 
17	    	localization["Americas"]='${languageUtil.get(locale, "Americas")}'; 
18			localization["Global"]='${languageUtil.get(locale, "Global")}';		 
19			localization["local-leaders-loc-text"]='${languageUtil.get(locale, "local-leaders-loc-text")}'; 
20			localization["global-leaders-loc-text"]='${languageUtil.get(locale, "global-leaders-loc-text")}';	 
21 
22			 
23			var displayTitle=""; 
24			var displayName=""; 
25	        <#if (.vars["display-title"]?? && .vars["display-title"].getData()??) >         
26        		displayTitle= "${.vars["display-title"].getData()?js_string}";        	 
27	        </#if>    	       
28  		var entries =[];   
29      	entries.numberOfAuthors=0; 
30    	entries.numberOfVideos=0; 
31        <#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService")> 
32        <#assign AssetEntryLocalService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetEntryLocalService")> 
33        <#assign AssetLinkLocalService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetLinkLocalService")> 
34        <#assign CurrentJournalArticle = JournalArticleLocalService.getLatestArticle(groupId,.vars['reserved-article-id'].data)> 
35        <#assign CurrentAssetEntry = AssetEntryLocalService.getEntry("com.liferay.portlet.journal.model.JournalArticle",CurrentJournalArticle.getResourcePrimKey())> 
36        <#assign AssetLinks=AssetLinkLocalService.getDirectLinks(CurrentAssetEntry.getEntryId()) > 
37        <#if AssetLinks?has_content> 
38        <#list AssetLinks as assetLink> 
39            <#assign CurentAssetLinkEntry=AssetEntryLocalService.getEntry(assetLink.getEntryId2()) > 
40            <#assign docXml = saxReaderUtil.read(CurentAssetLinkEntry.getAssetRenderer().getArticle().getContent()) /> 
41            	var entry=[]; 
42            	entry.structureKey="${JournalArticleLocalService.getLatestArticle(CurentAssetLinkEntry.getClassPK()).getStructureId()}"; 
43            	if(entry.structureKey=="PERSON_PROFILE"){ 
44            		entry.fullName= "${docXml.valueOf("//dynamic-element[@name='full-name']/dynamic-content/text()")?js_string}"; 
45            		entry.displayName= "${docXml.valueOf("//dynamic-element[@name='display-name']/dynamic-content/text()")?js_string}"; 
46        			entry.organizationTitle= "${docXml.valueOf("//dynamic-element[@name='organization-title']/dynamic-content/text()")?js_string}"; 
47        			entry.regionData="${docXml.valueOf("//dynamic-element[@name='region']/dynamic-content/text()")?js_string}"; 
48        			entry.secondRegionData="${docXml.valueOf("//dynamic-element[@name='2nd-region']/dynamic-content/text()")?js_string}"; 
49        			entry.location="${docXml.valueOf("//dynamic-element[@name='location']/dynamic-content/text()")?js_string}";			 
50        			entry.professionalBio= "${docXml.valueOf("//dynamic-element[@name='professional-bio']/dynamic-content/text()")?js_string}"; 
51        			entry.thumbnail= "${docXml.valueOf("//dynamic-element[@name='thumbnail']/dynamic-content/text()")?js_string}"; 
52        			entry.linkedinUrl= "${docXml.valueOf("//dynamic-element[@name='linkedin-url']/dynamic-content/text()")?js_string}"; 
53        			entry.googleplusUrl= "${docXml.valueOf("//dynamic-element[@name='googleplus-url']/dynamic-content/text()")?js_string}"; 
54        			entry.twitterUrl= "${docXml.valueOf("//dynamic-element[@name='twitter-url']/dynamic-content/text()")?js_string}"; 
55        			entry.bioFriendlyUrl= "${docXml.valueOf("//dynamic-element[@name='bio-friendly-url']/dynamic-content/text()")?js_string}"; 
56        			entry.bioNewTab= "${docXml.valueOf("//dynamic-element[@name='bio-new-tab']/dynamic-content/text()")?js_string}"; 
57        			entry.profileType="LocalLeader"; 
58        			<#if request.attributes??> 
59        			entry.currentURL="${request.attributes.CURRENT_COMPLETE_URL}"; 
60        			</#if> 
61        			entry.showAuthorship=true;		 
62            		entries.push(entry); 
63            		entries.numberOfAuthors=entries.numberOfAuthors+1; 
64            	}    	 
65        </#list> 
66        </#if> 
67        
68        var useCustomAuthorOrdering = false; 
69        <#if (.vars["useCustomLocalLeaderOrdering"]?? && .vars["useCustomLocalLeaderOrdering"].getData()?? && .vars["useCustomLocalLeaderOrdering"].getData()!="") > 
70		    useCustomAuthorOrdering = ${.vars["useCustomLocalLeaderOrdering"].getData()?js_string}; 
71		</#if> 
72         
73		 //Iterate through the repeating field of author web content and add it to the entry object 
74		 <#if (.vars["localLeadershipProfileId"]?? && .vars["localLeadershipProfileId"].getData()?? && .vars["localLeadershipProfileId"].getData()!="") > 
75		     
76		    if(useCustomAuthorOrdering){ 
77    		 
78    			<#if localLeadershipProfileId.getSiblings()?has_content> 
79                	<#list localLeadershipProfileId.getSiblings() as cur_leadershipProfileId> 
80                    	 
81                        // Determine configured groupId to use for finding Journal article.  If null, default to 10192 which is normally where content is stored. 
82    					<#if (.vars["localLeaderLocation"]?? && .vars["localLeaderLocation"].getData()?? && .vars["localLeaderLocation"].getData()!="") > 
83    						<#assign currentArticleGroupId = .vars["localLeaderLocation"].getData()?number?long > 
84    					<#else> 
85    						<#assign currentArticleGroupId = 10192 > 
86    					</#if> 
87    					 
88    					<#if JournalArticleLocalService.getArticle(currentArticleGroupId,cur_leadershipProfileId.getData())??> 
89                            // Test for leadership profile ID being articleId 
90                            <#assign currentArticle = JournalArticleLocalService.getArticle(currentArticleGroupId, cur_leadershipProfileId.getData())> 
91                        <#elseif AssetEntryLocalService.getEntry(currentArticleGroupId, cur_leadershipProfileId.getData())??> 
92                            <#assign currentArticleAssetEntry = AssetEntryLocalService.getEntry(currentArticleGroupId, cur_leadershipProfileId.getData())> 
93                            <#assign currentArticle = JournalArticleLocalService.getLatestArticle(currentArticleAssetEntry.getClassPK())> 
94	                    <#else> 
95	                        console.log("Could not find article with groupId = ${currentArticleGroupId} and ${cur_leadershipProfileId.getData()} as articleId or ClassUUID"); 
96                        </#if> 
97                         
98                    	<#if (currentArticle?? && currentArticle.getContent()??)> 
99                    	 
100                        	<#assign docXml = saxReaderUtil.read(currentArticle.getContent()) /> 
101                        	 
102                    		var entry={"structureKey":"${currentArticle.getStructureId()}"}; 
103                    		 
104                    	    if (entry.structureKey=="PERSON_PROFILE") { 
105                        		entry.fullName= "${docXml.valueOf("//dynamic-element[@name='full-name']/dynamic-content/text()")?js_string}"; 
106                        		entry.displayName= "${docXml.valueOf("//dynamic-element[@name='display-name']/dynamic-content/text()")?js_string}"; 
107                    			entry.organizationTitle= "${docXml.valueOf("//dynamic-element[@name='organization-title']/dynamic-content/text()")?js_string}"; 
108                    			entry.regionData="${docXml.valueOf("//dynamic-element[@name='region']/dynamic-content/text()")?js_string}"; 
109                    			entry.secondRegionData="${docXml.valueOf("//dynamic-element[@name='2nd-region']/dynamic-content/text()")?js_string}"; 
110                    			entry.location="${docXml.valueOf("//dynamic-element[@name='location']/dynamic-content/text()")?js_string}";			 
111                    			entry.professionalBio= "${docXml.valueOf("//dynamic-element[@name='professional-bio']/dynamic-content/text()")?js_string}"; 
112                    			entry.thumbnail= "${docXml.valueOf("//dynamic-element[@name='thumbnail']/dynamic-content/text()")?js_string}"; 
113                    			entry.linkedinUrl= "${docXml.valueOf("//dynamic-element[@name='linkedin-url']/dynamic-content/text()")?js_string}"; 
114                    			entry.googleplusUrl= "${docXml.valueOf("//dynamic-element[@name='googleplus-url']/dynamic-content/text()")?js_string}"; 
115                    			entry.twitterUrl= "${docXml.valueOf("//dynamic-element[@name='twitter-url']/dynamic-content/text()")?js_string}"; 
116                    			entry.bioFriendlyUrl= "${docXml.valueOf("//dynamic-element[@name='bio-friendly-url']/dynamic-content/text()")?js_string}"; 
117                    			entry.bioNewTab= "${docXml.valueOf("//dynamic-element[@name='bio-new-tab']/dynamic-content/text()")?js_string}"; 
118                    			entry.profileType="LocalLeader"; 
119                    			 
120                    			<#if request.attributes??> 
121                    		    	entry.currentURL="${request.attributes.CURRENT_COMPLETE_URL}"; 
122                    			</#if> 
123                    			 
124                    			entry.showAuthorship=true;		 
125                        		entries.push(entry); 
126                        		entries.numberOfAuthors=entries.numberOfAuthors+1; 
127
128        	            </#if> 
129                     
130                	</#list>	 
131                	 
132                </#if> 
133			}    			 
134		</#if> 
135		 
136        console.log(entries); 
137    	new LeadersList({ 
138        	"namespace": "${divId}", 
139        	"displayTitle": displayTitle, 
140			"displayName": displayName, 
141        	"linkedEntries":      entries, 
142        	"scope": "local", 
143        	"localization":localization 
144        },"${divId}"); 
145    }); 
146</script> 
147 
148<div id="${divId}"></div>