Navegación por categorías

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

----
FTL stack trace ("~" means nesting-related):
	- Failed at: category = assetCategoryService.getAs...  [in template "646115#646149#789958" at line 56, column 22]
	- Reached through: #assign-container  [in template "646115#646149#789958" at line 56, column 13]
----
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         categoryId = ParamUtil.getLong(request,"categoryId", 0) 
9         title =  ParamUtil.getString(request,"title", "") 
10         maxLoop = 100 
11         PropsUtil = staticUtil["com.liferay.portal.kernel.util.PropsUtil"] 
12         portalVocabularyId = PropsUtil.get("medio.ambiente.vocabulary.id") 
13         SAXReaderUtil = staticUtil["com.liferay.portal.kernel.xml.SAXReaderUtil"] 
14         imageId = ParamUtil.getString(request,"imageId","") 
15         HtmlUtil = staticUtil["com.liferay.portal.kernel.util.HtmlUtil"] 
16/> 
17 
18<#if (categoryId <= 0) > 
19	<#assign categoryId = ParamUtil.getLong(renderRequest,"categoryId", 0)/> 
20</#if> 
21 
22<#if (categoryId <= 0) > 
23     
24    <#if entries?has_content> 
25	    <#foreach vocabulary in entries> 
26	    	<#if vocabulary.getVocabularyId()+"" == portalVocabularyId> 
27	    	    <#foreach aCategory in vocabulary.getCategories()> 
28	    	        <#assign aCategory = aCategory/> 
29	    	        <#break> 
30	    	    </#foreach> 
31	    	    <#list 1..maxLoop as i> 
32	    	        <#list 1..maxLoop as j> 
33	    	            <#if aCategory.getParentCategory()?has_content> 
34	    	                <#assign aCategory = aCategory.getParentCategory()/> 
35	    	            <#else> 
36	        	            <#assign categoryId = aCategory.getCategoryId()/> 
37	                   </#if>   
38	                   <#break> 
39	    	        </#list> 
40	    	        <#if (categoryId > 0) > 
41	    	            <#break> 
42	    	        </#if> 
43	    	    </#list> 
44	    	</#if> 
45	    </#foreach> 
46	 </#if> 
47     
48</#if> 
49 
50<nav aria-label="breadcrumb"> 
51    <ol class="breadcrumb"> 
52       <li class="breadcrumb-title"><span>${languageUtil.get(locale,"medio.ambiente.breadcrumb-title")}</span></li> 
53       <li class="breadcrumb-item"><a href="http://www.asturias.es">${languageUtil.get(locale,"medio.ambiente.breadcrumb-asturias")}</a></li>         
54        <#if (categoryId > 0) > 
55 
56            <#assign category = assetCategoryService.getAssetCategory(categoryId) 
57                     categoryAncestors = category.getAncestors() 
58                     breadCrumbContent = ""/> 
59                      
60            <#if categoryAncestors?has_content> 
61                <#foreach categoryAncestor in categoryAncestors> 
62                	 
63                	<#assign hideCategory = false/> 
64                	 
65                	 <#-- obtener el contenido de la categoría hija --> 
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.getTitle(locale)+" </a> </li>"+breadCrumbContent/> 
105		                	<#else> 
106		                    	<#assign breadCrumbContent = "<li class='breadcrumb-item'><a href='"+categoryUrl+"'>"+categoryAncestor.getTitle(locale)+" </a> </li>"+breadCrumbContent/> 
107		                    </#if>	                   		 
108	                   	</#if> 
109                	</#if> 
110                </#foreach> 
111                 
112                ${breadCrumbContent} 
113                 
114            </#if> 
115             
116            <#assign hideCategory = false/> 
117            <#if assetCategoryPropertyService.getCategoryProperty(category.getCategoryId(),"idContenido") ? has_content > 
118			        	<#assign contentIdProperty = assetCategoryPropertyService.getCategoryProperty(category.getCategoryId(),"idContenido")/> 
119			            <#assign contentId = contentIdProperty.getValue()/> 
120			            <#if contentId ? has_content> 
121			            	<#assign journalArticleSub = journalArticleService.getLatestArticle(groupId,contentId)/> 
122			        		 
123			        		<#if journalArticleSub?has_content> 
124				        		<#-- obtener el contenido de la categoría actual --> 
125				                <#assign document = SAXReaderUtil.read(journalArticleSub.getContentByLocale(locale)) 
126                        		 	pageDetailNode =  document.selectSingleNode("/root/dynamic-element[@name='paginaDetalle']/dynamic-content") 
127                        		 	/> 
128                        		 <#if document.selectSingleNode("/root/dynamic-element[@name='visibleMigas']/dynamic-content")?has_content> 
129                        		 	<#assign visibleMigasNode =  document.selectSingleNode("/root/dynamic-element[@name='visibleMigas']/dynamic-content")  
130                        		 		visibleMigas =  visibleMigasNode.getText() 
131                        		 			 hideCategory = visibleMigas != "1"/> 
132                        		 </#if> 
133				        	</#if> 
134			 	        </#if> 
135			    	  
136			    	  
137				    	 <#if pageDetailNode?has_content && pageDetailNode.getText()?has_content> 
138			        		<#assign  pageDetail = pageDetailNode.getText()/> 
139			        		<#if (pageDetail?index_of("@")>0)> 
140		                		<#assign pageDetailPosition = (pageDetail?index_of("@")-1) 
141		                         	pageDetail = pageDetail[0..pageDetailPosition] 
142		                          	layoutDetail = layoutLocalService.getLayout(themeDisplay.getScopeGroupId(),false,pageDetail?number) 
143		                      	/> 
144		                	</#if> 
145			            <#else> 
146			            	<#if category.isRootCategory()> 
147			            		<#assign detailPage = "inicio"/> 
148			            	<#else> 
149			            		<#assign detailPage = "general"/> 
150			            	</#if> 
151			            	 
152			            	<#assign layoutDetail = layoutLocalService.getFriendlyURLLayout(themeDisplay.getScopeGroupId(), false, "/"+detailPage) /> 
153			            </#if> 
154			             
155			            <#assign categoryUrl = PortletURLFactoryUtil.create(request, "com_liferay_asset_categories_navigation_web_portlet_AssetCategoriesNavigationPortlet", layoutDetail.getPlid(), PortletRequest.RENDER_PHASE)    /> 
156	                    ${categoryUrl.setParameter("categoryId",category.getCategoryId()+"")} 
157	                 
158	                	<#if !(hideCategory?has_content && hideCategory)> 
159	                		<#if category.isRootCategory()> 
160		                		<#if title?has_content> 
161		                			<li class="breadcrumb-item"><a href="/inicio">${category.getTitle(locale)}</a></li>		                		 
162		                		<#else> 
163		                			<li class="breadcrumb-item active">${category.getTitle(locale)}</li> 
164		                		</#if>  
165		                	<#else> 
166		                    	<#if title?has_content> 
167		                			<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>		                		 
168		                		<#else> 
169		                			<li class="breadcrumb-item active">${category.getTitle(locale)}</li> 
170		                		</#if>  
171		                    </#if>	                		               		 
172	                   	</#if> 
173                	</#if> 
174        </#if> 
175        <#if title ? has_content> 
176        	<li class="breadcrumb-item active">${title}</li>  
177        </#if> 
178    </ol> 
179</nav> 
180 
181<script type="text/javascript"> 
182	$( document ).ready(function() { 
183		 if(typeof ga !== "undefined") { 
184		 <#if title ? has_content> 
185		 	var pageName = '${title}'; 
186		 <#elseif category ? has_content> 
187		 	var pageName = '${category.getName()}'; 
188		 <#else> 
189		 	var pageName = location.pathname; 
190		 </#if> 
191			     ga( 'send', 'pageview', { 
192				    'page': pageName, 
193				    'title': pageName 
194				} ); 
195
196	}); 
197</script> 

Navegación por categorías

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

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign category = assetCategoryServi...  [in template "646115#646149#789961" at line 26, column 10]
----
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         categoryId = ParamUtil.getLong(request,"categoryId", 0) 
9         articleId = ParamUtil.getString(request,"articleId", "") 
10         backUrl = ParamUtil.getString(request,"redirect", "") 
11         title =  ParamUtil.getString(request,"title", "") 
12         maxLoop = 100 
13         PropsUtil = staticUtil["com.liferay.portal.kernel.util.PropsUtil"] 
14         SAXReaderUtil = staticUtil["com.liferay.portal.kernel.xml.SAXReaderUtil"] 
15         journalArticle = journalArticleService.getLatestArticle(groupId,articleId) 
16         articleContent = journalArticleService.getArticleContent(journalArticle, "","VIEW", locale, themeDisplay) 
17/> 
18 
19<#if (categoryId <= 0) > 
20	<#assign categoryId = ParamUtil.getLong(renderRequest,"categoryId", 0)/> 
21</#if> 
22 
23<#if (categoryId > 0)> 
24 
25 
26	 <#assign category = assetCategoryService.getAssetCategory(categoryId) /> 
27 
28	<div class="journal-content-article">  
29		<div class="row mb-2 show-news">  
30	    	<div class="col-md-12 ">  
31	        	<div class="taglib-header ">  
32	            	<span class="header-back-to lfr-portal-tooltip" data-title="${languageUtil.get(locale,"medio.ambiente.general.back")}">  
33	                	<a href="${backUrl}" target="_self" class=" lfr-icon-item taglib-icon">  
34	                    <span class=""><svg class="lexicon-icon lexicon-icon-angle-left" focusable="false" role="img" viewBox="0 0 512 512"><path class="lexicon-icon-outline" d="M114.106 254.607c0.22 6.936 2.972 13.811 8.272 19.11l227.222 227.221c11.026 11.058 28.94 11.058 39.999 0 11.058-11.026 11.058-28.94 0-39.999l-206.333-206.333c0 0 206.333-206.333 206.333-206.333 11.058-11.059 11.058-28.973 0-39.999-11.058-11.059-28.973-11.059-39.999 0l-227.221 227.221c-5.3 5.3-8.052 12.174-8.273 19.111z"></path></svg></span>  
35	                    <span class="taglib-text hide-accessible">${languageUtil.get(locale,"medio.ambiente.general.back")}</span> </a>  
36	                 </span> 
37	                 <h3 class="header-title"><span>${languageUtil.get(locale,"medio.ambiente.general.back")}</span> </h3>  
38	             </div> 
39	 
40				<div class="card flex-md-row mb-4 box-shadow h-md-250"> 
41				 	<div class="card-body d-flex flex-column align-items-start"> 
42                  		<h2 class="mb-0">${category.getTitle(locale)}</h2>  
43                    	<div class="plantilla-articulo plantilla-detalle-contenido"> 
44                    		${articleContent} 
45                    	</div>	                    	 
46                   	</div>                                           
47         		</div><!-- card -->  
48         		 
49	    	</div><!-- col-md-12 -->  
50		</div><!-- row -->  
51	</div>	 
52</#if>