Navegador por categorías personalizado

Se ha producido un error al procesar la plantilla.
Java method "com.sun.proxy.$Proxy454.getLatestArticle(long, String)" threw an exception when invoked on com.sun.proxy.$Proxy454 object "com.liferay.journal.service.impl.JournalArticleLocalServiceImpl@30f57027"; see cause exception in the Java stack trace.

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign journalArticleSub = journalAr...  [in template "49203#49237#1326004" at line 124, column 41]
----
1<#assign ParamUtil = staticUtil["com.liferay.portal.kernel.util.ParamUtil"] 
2		PortletURLFactoryUtil = staticUtil["com.liferay.portal.kernel.portlet.PortletURLFactoryUtil"] 
3		PortletRequest = staticUtil["javax.portlet.PortletRequest"] 
4		assetCategoryService =  serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") 
5		assetCategoryPropertyService =  serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryPropertyLocalService") 
6		journalArticleService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") 
7		layoutLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService") 
8		maxLoop = 100 
9		PropsUtil = staticUtil["com.liferay.portal.kernel.util.PropsUtil"] 
10		juventudVocabularyId = PropsUtil.get("juventud.vocabulary.id") 
11		SAXReaderUtil = staticUtil["com.liferay.portal.kernel.xml.SAXReaderUtil"] 
12		title =  ParamUtil.getString(request,"title", "") 
13		imageId = ParamUtil.getString(request,"imageId","") 
14		HtmlUtil = staticUtil["com.liferay.portal.kernel.util.HtmlUtil"] 
15/> 
16 
17<#if entries ? has_content> 
18    <#list entries as category> 
19        <#assign categoryId = category.getCategoryId()/> 
20    </#list> 
21</#if> 
22 
23<#if (categoryId <= 0) > 
24     
25    <#if entries?has_content> 
26	    <#foreach vocabulary in entries> 
27	    	<#if vocabulary.getVocabularyId()+"" == juventudVocabularyId> 
28	    	    <#foreach aCategory in vocabulary.getCategories()> 
29	    	        <#assign aCategory = aCategory/> 
30	    	        <#break> 
31	    	    </#foreach> 
32	    	    <#list 1..maxLoop as i> 
33	    	        <#list 1..maxLoop as j> 
34	    	            <#if aCategory.getParentCategory()?has_content> 
35	    	                <#assign aCategory = aCategory.getParentCategory()/> 
36	    	            <#else> 
37	        	            <#assign categoryId = aCategory.getCategoryId()/> 
38	                   </#if>   
39	                   <#break> 
40	    	        </#list> 
41	    	        <#if (categoryId > 0) > 
42	    	            <#break> 
43	    	        </#if> 
44	    	    </#list> 
45	    	</#if> 
46	    </#foreach> 
47	 </#if> 
48     
49</#if> 
50 
51<nav aria-label="breadcrumb"> 
52    <ol class="breadcrumb"> 
53        <li class="breadcrumb-title"><span>${languageUtil.get(locale,"juventud.breadcrumb-title")}</span></li> 
54        <li class="breadcrumb-item"><a href="http://www.asturias.es">${languageUtil.get(locale,"juventud.breadcrumb-asturias")}</a></li> 
55        <#if (categoryId > 0) > 
56 
57            <#assign category = assetCategoryService.getAssetCategory(categoryId) 
58                     categoryAncestors = category.getAncestors() 
59                     breadCrumbContent = ""/> 
60                      
61            <#if categoryAncestors?has_content> 
62                <#foreach categoryAncestor in categoryAncestors> 
63                    <#-- obtener el contenido de la categoría hija --> 
64                    <#assign hideCategory = false/> 
65                     
66			        <#if assetCategoryPropertyService.getCategoryProperty(categoryAncestor.getCategoryId(),"idContenido") ? has_content > 
67			        	<#assign contentIdProperty = assetCategoryPropertyService.getCategoryProperty(categoryAncestor.getCategoryId(),"idContenido")/> 
68			            <#assign contentId = contentIdProperty.getValue()/> 
69			            <#if contentId ? has_content> 
70			            	<#assign journalArticleSub = journalArticleService.getLatestArticle(groupId,contentId)/> 
71			        		 
72			        		<#if journalArticleSub?has_content> 
73				        		<#-- obtener el contenido de la categoría actual --> 
74				                <#assign document = SAXReaderUtil.read(journalArticleSub.getContentByLocale(locale)) 
75                        		 	pageDetailNode =  document.selectSingleNode("/root/dynamic-element[@name='paginaDetalle']/dynamic-content")                        		 	 
76                        		 	/> 
77                        		 <#if document.selectSingleNode("/root/dynamic-element[@name='visibleMigas']/dynamic-content")?has_content> 
78                        		 	<#assign visibleMigasNode =  document.selectSingleNode("/root/dynamic-element[@name='visibleMigas']/dynamic-content")  
79                        		 		visibleMigas =  visibleMigasNode.getText() 
80                        		 			 hideCategory = visibleMigas != "1"/> 
81                        		 </#if> 
82				        	</#if> 
83			 	        </#if> 
84			    	  
85			    	  
86				    	 <#if pageDetailNode?has_content && pageDetailNode.getText()?has_content> 
87			        		<#assign  pageDetail = pageDetailNode.getText()/> 
88			        		<#if (pageDetail?index_of("@")>0)> 
89		                		<#assign pageDetailPosition = (pageDetail?index_of("@")-1) 
90		                         	pageDetail = pageDetail[0..pageDetailPosition] 
91		                          	layoutDetail = layoutLocalService.getLayout(themeDisplay.getScopeGroupId(),false,pageDetail?number) 
92		                      	/> 
93		                	</#if> 
94			            <#else> 
95			            	<#assign detailPage = "general" 
96			            	 		 layoutDetail = layoutLocalService.getFriendlyURLLayout(themeDisplay.getScopeGroupId(), false, "/"+detailPage) /> 
97			            </#if> 
98			             
99			            <#assign categoryUrl = PortletURLFactoryUtil.create(request, "com_liferay_asset_categories_navigation_web_portlet_AssetCategoriesNavigationPortlet", layoutDetail.getPlid(), PortletRequest.RENDER_PHASE)    /> 
100	                    ${categoryUrl.setParameter("categoryId",categoryAncestor.getCategoryId()+"")} 
101	                 
102	                	<#if !(hideCategory?has_content && hideCategory)> 
103	                		<#if categoryAncestor.isRootCategory()> 
104		                		<#assign breadCrumbContent = "<li class='breadcrumb-item'><a href='/inicio'>"+categoryAncestor.getName()+" </a> </li>"+breadCrumbContent/> 
105		                	<#else> 
106		                    	<#assign breadCrumbContent = "<li class='breadcrumb-item'><a href='"+categoryUrl+"'>"+categoryAncestor.getName()+" </a> </li>"+breadCrumbContent/> 
107		                    </#if>                    	 
108	                    </#if> 
109                	</#if> 
110                 
111                </#foreach> 
112                 
113                ${breadCrumbContent} 
114                 
115            </#if> 
116             
117             
118            <#assign hideCategory = false/> 
119                     
120			        <#if assetCategoryPropertyService.getCategoryProperty(category.getCategoryId(),"idContenido") ? has_content > 
121			        	<#assign contentIdProperty = assetCategoryPropertyService.getCategoryProperty(category.getCategoryId(),"idContenido")/> 
122			            <#assign contentId = contentIdProperty.getValue()/> 
123			            <#if contentId ? has_content> 
124			            	<#assign journalArticleSub = journalArticleService.getLatestArticle(groupId,contentId)/> 
125			        		 
126			        		<#if journalArticleSub?has_content> 
127				        		<#-- obtener el contenido de la categoría actual --> 
128				                <#assign document = SAXReaderUtil.read(journalArticleSub.getContentByLocale(locale)) 
129                        		 	pageDetailNode =  document.selectSingleNode("/root/dynamic-element[@name='paginaDetalle']/dynamic-content")                        		 	 
130                        		 	/> 
131                        		 <#if document.selectSingleNode("/root/dynamic-element[@name='visibleMigas']/dynamic-content")?has_content> 
132                        		 	<#assign visibleMigasNode =  document.selectSingleNode("/root/dynamic-element[@name='visibleMigas']/dynamic-content")  
133                        		 		visibleMigas =  visibleMigasNode.getText() 
134                        		 			 hideCategory = visibleMigas != "1"/> 
135                        		 </#if> 
136				        	</#if> 
137			 	        </#if> 
138			    	  
139			    	  
140				    	 <#if pageDetailNode?has_content && pageDetailNode.getText()?has_content> 
141			        		<#assign  pageDetail = pageDetailNode.getText()/> 
142			        		<#if (pageDetail?index_of("@")>0)> 
143		                		<#assign pageDetailPosition = (pageDetail?index_of("@")-1) 
144		                         	pageDetail = pageDetail[0..pageDetailPosition] 
145		                          	layoutDetail = layoutLocalService.getLayout(themeDisplay.getScopeGroupId(),false,pageDetail?number) 
146		                      	/> 
147		                	</#if> 
148			            <#else> 
149			            	<#assign detailPage = "general" 
150			            	 		 layoutDetail = layoutLocalService.getFriendlyURLLayout(themeDisplay.getScopeGroupId(), false, "/"+detailPage) /> 
151			            </#if> 
152			             
153			            <#assign categoryUrl = PortletURLFactoryUtil.create(request, "com_liferay_asset_categories_navigation_web_portlet_AssetCategoriesNavigationPortlet", layoutDetail.getPlid(), PortletRequest.RENDER_PHASE)    /> 
154	                    ${categoryUrl.setParameter("categoryId",category.getCategoryId()+"")} 
155	                 
156	                	<#if !(hideCategory?has_content && hideCategory)> 
157	                		<#if category.isRootCategory()> 
158		                		<#if title?has_content && title!=category.getTitle(locale)> 
159		                			<li class="breadcrumb-item"><a href="/inicio">${category.getTitle(locale)}</a></li> 
160		                		<#else> 
161		                			<li class="breadcrumb-item active">${category.getTitle(locale)}</li> 
162		                		</#if>  
163		                	<#else> 
164		                    	<#if title?has_content && title!=category.getTitle(locale)>		                    		 
165		                			<li class="breadcrumb-item"><a href="${categoryUrl}<#if imageId ? has_content>?imageId=${imageId}&title=${HtmlUtil.escapeURL(category.getTitle(locale))}</#if>">${category.getTitle(locale)}</a></li> 
166		                		<#else> 
167		                			<li class="breadcrumb-item active">${category.getTitle(locale)}</li> 
168		                		</#if>  
169		                    </#if>                    	 
170	                    </#if> 
171	        </#if>	         
172        </#if> 
173         
174         <#if title ? has_content && title!=category.getTitle(locale)> 
175        	<li class="breadcrumb-item active">${title}</li>  
176        </#if> 
177    </ol> 
178</nav> 
179 
180<script type="text/javascript"> 
181	$( document ).ready(function() { 
182		 if(typeof ga !== "undefined") { 
183		 	 var privacyCookie = getPortalPrivacyCookie('juventud_privacyPolicy'); 
184       
185            if (privacyCookie  && privacyCookie == 1) { 
186				 <#if title ? has_content> 
187				 	var pageName = '${title}'; 
188				 <#elseif category ? has_content> 
189				 	var pageName = '${category.getName()}'; 
190				 <#else> 
191				 	var pageName = location.pathname; 
192				 </#if> 
193					     ga( 'send', 'pageview', { 
194						    'page': pageName, 
195						    'title': pageName 
196						} ); 
197
198
199	}); 
200</script> 

Navegador por categorías personalizado