Navegación por categorías

Se ha producido un error al procesar la plantilla.
Java method "com.sun.proxy.$Proxy89.getAssetCategory(long)" threw an exception when invoked on com.sun.proxy.$Proxy89 object "com.liferay.portlet.asset.service.impl.AssetCategoryLocalServiceImpl@6cad14a8"; see cause exception in the Java stack trace.

----
FTL stack trace ("~" means nesting-related):
	- Failed at: category = assetCategoryService.getAs...  [in template "646115#646149#789919" at line 50, column 22]
	- Reached through: #assign-container  [in template "646115#646149#789919" at line 50, column 13]
----
1<#assign ParamUtil = staticUtil["com.liferay.portal.kernel.util.ParamUtil"] 
2         assetCategoryService =  serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") 
3         categoryId =ParamUtil.getLong(renderRequest,"categoryId", 0) 
4         maxLoop = 100 
5         PropsUtil = staticUtil["com.liferay.portal.kernel.util.PropsUtil"] 
6         portalVocabularyId = PropsUtil.get("medio.ambiente.vocabulary.id") 
7         layoutLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService") 
8         assetCategoryPropertyService =  serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryPropertyLocalService") 
9         journalArticleService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") 
10         SAXReaderUtil = staticUtil["com.liferay.portal.kernel.xml.SAXReaderUtil"] 
11         PortletURLFactoryUtil = staticUtil["com.liferay.portal.kernel.portlet.PortletURLFactoryUtil"] 
12         PortletRequest = staticUtil["javax.portlet.PortletRequest"] 
13/> 
14 
15<#if (categoryId <= 0) > 
16     
17    <#if entries?has_content> 
18	    <#foreach vocabulary in entries> 
19	    	<#if vocabulary.getVocabularyId()+"" == portalVocabularyId> 
20	    	    <#foreach aCategory in vocabulary.getCategories()> 
21	    	        <#assign aCategory = aCategory/> 
22	    	        <#break> 
23	    	    </#foreach> 
24	    	    <#list 1..maxLoop as i> 
25	    	        <#list 1..maxLoop as j> 
26	    	            <#if aCategory.getParentCategory()?has_content> 
27	    	                <#assign aCategory = aCategory.getParentCategory()/> 
28	    	            <#else> 
29	        	            <#assign categoryId = aCategory.getCategoryId()/> 
30	                   </#if>   
31	                   <#break> 
32	    	        </#list> 
33	    	        <#if (categoryId > 0) > 
34	    	            <#break> 
35	    	        </#if> 
36	    	    </#list> 
37	    	</#if> 
38	    </#foreach> 
39	 </#if> 
40     
41</#if> 
42 
43<nav aria-label="breadcrumb"> 
44    <ol class="breadcrumb"> 
45        <li class="breadcrumb-title"><span>${languageUtil.get(locale,"medio.ambiente.breadcrumb-title")}</span></li> 
46        <li class="breadcrumb-item"><a href="http://www.asturias.es">${languageUtil.get(locale,"medio.ambiente.breadcrumb-asturias")}</a></li> 
47         
48        <#if (categoryId > 0) > 
49 
50            <#assign category = assetCategoryService.getAssetCategory(categoryId) 
51            		 breadCrumbContent = "" 
52            		 categoryAncestors = category.getAncestors()/> 
53                      
54            <#if categoryAncestors?has_content> 
55                <#foreach categoryAncestor in categoryAncestors> 
56                 
57                    <#assign detailPage = "general" 
58							         layoutDetail = layoutLocalService.getFriendlyURLLayout(themeDisplay.getScopeGroupId(), false, "/"+detailPage) /> 
59							            	 		  
60				    		<#-- obtener el contenido de la categoría hija --> 
61		                    <#if assetCategoryPropertyService.getCategoryProperty(categoryAncestor.getCategoryId(),"idContenido") ? has_content > 
62		                    	<#assign contentIdProperty = assetCategoryPropertyService.getCategoryProperty(categoryAncestor.getCategoryId(),"idContenido") 
63		                        		 contentId = contentIdProperty.getValue()/> 
64		                       <#if contentId ? has_content> 
65		                       		<#assign journalArticleSub = journalArticleService.getLatestArticle(groupId,contentId)/> 
66		                                         
67		                            <#if journalArticleSub?has_content> 
68		                                   <#-- obtener el contenido de la categoría actual --> 
69		                                              
70		                                   <#assign document = SAXReaderUtil.read(journalArticleSub.getContentByLocale(locale)) 
71		                                                     paginaDetalleNode =  document.selectSingleNode("/root/dynamic-element[@name='paginaDetalle']/dynamic-content") 
72		                                            /> 
73		                                   <#if paginaDetalleNode?has_content && paginaDetalleNode.getText()?has_content> 
74							        			<#assign  pageDetail = paginaDetalleNode.getText()/> 
75							        			<#if (pageDetail?index_of("@")>0)> 
76							                		<#assign pageDetailPosition = (pageDetail?index_of("@")-1) 
77					                         					 pageDetail = pageDetail[0..pageDetailPosition] 
78					                          					 layoutDetail = layoutLocalService.getLayout(themeDisplay.getScopeGroupId(),false,pageDetail?number) 
79							                      	/> 
80							                      	 
81							                     </#if> 
82											</#if> 
83							                                     
84		                              </#if> 
85		                        </#if> 
86		                    </#if> 
87				    		<#assign categoryUrl = PortletURLFactoryUtil.create(request, "com_liferay_asset_categories_navigation_web_portlet_AssetCategoriesNavigationPortlet", layoutDetail.getPlid(), PortletRequest.RENDER_PHASE)/> 
88				    		${categoryUrl.setParameter("categoryId",categoryAncestor.getCategoryId()+"")} 
89                	 
90                	<#if categoryAncestor.isRootCategory()> 
91                		<#assign breadCrumbContent = "<li class='breadcrumb-item'><a href='/inicio'>"+languageUtil.get(locale,"medio.ambiente.breadcrumb-portal")+" </a> </li>"+breadCrumbContent/> 
92                	<#else> 
93                    	<#assign breadCrumbContent = "<li class='breadcrumb-item'><a href='"+categoryUrl+"'>"+categoryAncestor.getName()+" </a> </li>"+breadCrumbContent/> 
94                    </#if> 
95                 
96                </#foreach> 
97                 
98                ${breadCrumbContent} 
99                 
100            </#if> 
101            <li class="breadcrumb-item active">${category.getTitle(locale)}</li> 
102        </#if> 
103    </ol> 
104</nav> 
105 
106<script type="text/javascript"> 
107	$( document ).ready(function() { 
108		 if(typeof ga !== "undefined") { 
109		 <#if category ? has_content> 
110		 	var pageName = '${category.getName()}'; 
111		 <#else> 
112		 	var pageName = location.pathname; 
113		 </#if> 
114			     ga( 'send', 'pageview', { 
115				    'page': pageName, 
116				    'title': pageName 
117				} ); 
118
119	}); 
120</script> 

Navegación por categorías