Navegación por categorías

Se ha producido un error al procesar la plantilla.
The following has evaluated to null or missing:
==> category.getParentCategory()  [in template "49203#49237#1326001" at line 59, column 40]

----
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: categoria_padre = category.getParentC...  [in template "49203#49237#1326001" at line 59, column 22]
	- Reached through: #assign-container  [in template "49203#49237#1326001" 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("juventud.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,"juventud.breadcrumb-title")}</span></li> 
53        <li class="breadcrumb-item"><a href="http://www.asturias.es">${languageUtil.get(locale,"juventud.breadcrumb-asturias")}</a></li> 
54        <#if (categoryId > 0) > 
55 
56            <#assign category = assetCategoryService.getAssetCategory(categoryId) 
57                     categoryAncestors = category.getAncestors() 
58                     breadCrumbContent = "" 
59                     categoria_padre = category.getParentCategory() /> 
60                    
61            <#if categoryAncestors?has_content> 
62                <#foreach categoryAncestor in categoryAncestors> 
63                	 
64                	<#assign hideCategory = false/> 
65                	 
66                	 <#-- obtener el contenido de la categoría hija --> 
67			        <#if assetCategoryPropertyService.getCategoryProperty(categoryAncestor.getCategoryId(),"idContenido") ? has_content > 
68			        	<#assign contentIdProperty = assetCategoryPropertyService.getCategoryProperty(categoryAncestor.getCategoryId(),"idContenido")/> 
69			            <#assign contentId = contentIdProperty.getValue()/> 
70			            <#if contentId ? has_content> 
71			            	<#assign journalArticleSub = journalArticleService.getLatestArticle(groupId,contentId)/> 
72			        		 
73			        		<#if journalArticleSub?has_content> 
74				        		<#-- obtener el contenido de la categoría actual --> 
75				                <#assign document = SAXReaderUtil.read(journalArticleSub.getContentByLocale(locale)) 
76                        		 	pageDetailNode =  document.selectSingleNode("/root/dynamic-element[@name='paginaDetalle']/dynamic-content") 
77                        		 	/> 
78                        		 <#if document.selectSingleNode("/root/dynamic-element[@name='visibleMigas']/dynamic-content")?has_content> 
79                        		 	<#assign visibleMigasNode =  document.selectSingleNode("/root/dynamic-element[@name='visibleMigas']/dynamic-content")  
80                        		 		visibleMigas =  visibleMigasNode.getText() 
81                        		 			 hideCategory = visibleMigas != "1"/> 
82                        		 </#if> 
83				        	</#if> 
84			 	        </#if>			    	  
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	                   
110                	</#if> 
111                </#foreach> 
112                 
113                ${breadCrumbContent} 
114                 
115            </#if> 
116             
117            <#assign hideCategory = false/> 
118            <#if assetCategoryPropertyService.getCategoryProperty(category.getCategoryId(),"idContenido") ? has_content > 
119			        	<#assign contentIdProperty = assetCategoryPropertyService.getCategoryProperty(category.getCategoryId(),"idContenido")/> 
120			            <#assign contentId = contentIdProperty.getValue()/> 
121			            <#if contentId ? has_content> 
122			            	<#assign journalArticleSub = journalArticleService.getLatestArticle(groupId,contentId)/> 
123			        		 
124			        		<#if journalArticleSub?has_content> 
125				        		<#-- obtener el contenido de la categoría actual --> 
126				                <#assign document = SAXReaderUtil.read(journalArticleSub.getContentByLocale(locale)) 
127                        		 	pageDetailNode =  document.selectSingleNode("/root/dynamic-element[@name='paginaDetalle']/dynamic-content") 
128                        		 	/> 
129                        		 <#if document.selectSingleNode("/root/dynamic-element[@name='visibleMigas']/dynamic-content")?has_content> 
130                        		 	<#assign visibleMigasNode =  document.selectSingleNode("/root/dynamic-element[@name='visibleMigas']/dynamic-content")  
131                        		 		visibleMigas =  visibleMigasNode.getText() 
132                        		 			 hideCategory = visibleMigas != "1"/> 
133                        		 </#if> 
134				        	</#if> 
135			 	        </#if>			    	  
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			            		<#if (categoria_padre?has_content) && (categoria_padre.getTitle(locale)=="${languageUtil.get(locale,'juventud.category.informa-joven')}")> 
150					            	<#assign detailPage = "categorias-informa-joven" /> 
151					           	<#else> 
152			            			<#assign detailPage = "general"/> 
153			            		</#if> 
154			            	</#if> 
155			            	 
156			            	<#assign layoutDetail = layoutLocalService.getFriendlyURLLayout(themeDisplay.getScopeGroupId(), false, "/"+detailPage) /> 
157			            </#if> 
158			             
159			            <#assign categoryUrl = PortletURLFactoryUtil.create(request, "com_liferay_asset_categories_navigation_web_portlet_AssetCategoriesNavigationPortlet", layoutDetail.getPlid(), PortletRequest.RENDER_PHASE)    /> 
160	                    ${categoryUrl.setParameter("categoryId",category.getCategoryId()+"")} 
161	                 
162	                	<#if !(hideCategory?has_content && hideCategory)> 
163	                		<#if category.isRootCategory()> 
164		                		<#if title?has_content> 
165		                			<li class="breadcrumb-item"><a href="/inicio">${category.getTitle(locale)}</a></li>		                		 
166		                		<#else> 
167		                			<li class="breadcrumb-item active">${category.getTitle(locale)}</li> 
168		                		</#if>  
169		                	<#else> 
170		                    	<#if title?has_content> 
171		                			<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>		                		 
172		                		<#else> 
173		                			<li class="breadcrumb-item active">${category.getTitle(locale)}</li> 
174		                		</#if>  
175		                    </#if>	                		               		 
176	                   	</#if> 
177                	</#if> 
178        </#if> 
179        <#if title ? has_content> 
180        	<li class="breadcrumb-item active">${title}</li>  
181        </#if> 
182    </ol> 
183</nav> 
184 
185<script type="text/javascript"> 
186	$( document ).ready(function() { 
187		 if(typeof ga !== "undefined") { 
188		 	 var privacyCookie = getPortalPrivacyCookie('juventud_privacyPolicy'); 
189       
190            if (privacyCookie  && privacyCookie == 1) { 
191				 <#if title ? has_content> 
192				 	var pageName = '${title}'; 
193				 <#elseif category ? has_content> 
194				 	var pageName = '${category.getName()}'; 
195				 <#else> 
196				 	var pageName = location.pathname; 
197				 </#if> 
198				 ga( 'send', 'pageview', { 
199				     'page': pageName, 
200				     'title': pageName 
201				} ); 
202
203
204	}); 
205</script> 

Publicador de contenidos

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@18c576c1"; see cause exception in the Java stack trace.

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign category = assetCategoryServi...  [in template "49203#49237#1326016" at line 18, column 17]
----
1<#assign SAXReaderUtil = staticUtil["com.liferay.portal.kernel.xml.SAXReaderUtil"] 
2         journalArticleService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") 
3         assetCategoryService =  serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") 
4         assetCategoryPropertyService =  serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryPropertyLocalService") 
5         layoutLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService") 
6         PortletURLFactoryUtil = staticUtil["com.liferay.portal.kernel.portlet.PortletURLFactoryUtil"] 
7         PortletRequest = staticUtil["javax.portlet.PortletRequest"] 
8         HtmlUtil = staticUtil["com.liferay.portal.kernel.util.HtmlUtil"]        
9         assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") 
10         assetCategoryService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")  
11         ParamUtil = staticUtil["com.liferay.portal.kernel.util.ParamUtil"] 
12         curCategoryId =ParamUtil.getLong(renderRequest,"categoryId", 0) 
13        /> 
14 
15<div class="card flex-md-row mb-4 box-shadow h-md-250"> 
16  	<div class="card-body d-flex flex-column align-items-start">      
17  		      
18	   	<#assign category = assetCategoryService.getAssetCategory(curCategoryId)/>      
19	   	<#if category ? has_content > 
20	   		<h2 class="mb-0">${category.getTitle(locale)}</h2> 
21	   	<#else>     
22      		<h2 class="mb-0"><@liferay.language key="juventud.news.informa-joven" /></h2> 
23      	</#if>    
24      	 
25    	<div class="plantilla-articulo plantilla-detalle-contenido fichas-page"> 
26					         
27			<#if entries?has_content> 
28		        <ul>         
29		        	<#list entries as curEntry>   		                   
30	                	<#assign journalArticle = journalArticleService.fetchLatestArticle(curEntry.getClassPK())  
31				    		 currentUrl = renderResponse.createRenderURL() 
32			                 detailPage = "detalle-noticia" 
33	                         layoutDetail = layoutLocalService.getFriendlyURLLayout(themeDisplay.getScopeGroupId(), false, "/"+detailPage) 
34	                 		 detailUrl = PortletURLFactoryUtil.create(request, "com_liferay_asset_categories_navigation_web_portlet_AssetCategoriesNavigationPortlet", layoutDetail.getPlid(), PortletRequest.RENDER_PHASE) 
35	                 		 document = SAXReaderUtil.read(journalArticle.getContentByLocale(locale)) 
36	                 		 resumen = "" 
37	                 		 fecha = "" 
38	                 	/>                 		  
39	                	 
40	                	${detailUrl.setParameter("categoryId",curCategoryId+"")} 
41                     	${detailUrl.setParameter("articleId", journalArticle.getArticleId())} 
42				                      
43						<#if document.selectSingleNode("/root/dynamic-element[@name='fecha']/dynamic-content") ? has_content> 
44							<#assign fechaNode = document.selectSingleNode("/root/dynamic-element[@name='fecha']/dynamic-content") 
45					         	 fecha = fechaNode.getText() 
46				     		/> 
47				      	</#if> 
48						<#if document.selectSingleNode("/root/dynamic-element[@name='resumen']/dynamic-content") ? has_content> 
49							<#assign resumenNode = document.selectSingleNode("/root/dynamic-element[@name='resumen']/dynamic-content") 
50					         	 resumen = resumenNode.getText() 
51				     		/> 
52				      	</#if>	 
53				      	<#if document.selectSingleNode("/root/dynamic-element[@name='imagen']/dynamic-content") ? has_content> 
54							<#assign imagenNode = document.selectSingleNode("/root/dynamic-element[@name='imagen']/dynamic-content")	/> 
55				      	</#if>	  												 
56			                     
57						<li>	      		                 		  
58		        		    <h3 class="title">${curEntry.getTitle(locale)}</h3> 
59		        		    <div class="col-content">  
60		        		    	<#if imagenNode.getText()?? && imagenNode.getText() != "">    
61			                        <div class="col-icon"> 
62			                            <img src="${imagenNode.getText()}" alt="${languageUtil.get(locale,'juventud.category.imagen')} - ${curEntry.getTitle(locale)}" /> 
63			                        </div>     
64			                        <div class="col-summary">			                     
65			                    <#else>                                             
66			                        <div class="col-summary without-icon"> 
67			                    </#if> 
68			                            <#assign fecha_Data = getterUtil.getString(fecha)> 
69										<#if validator.isNotNull(fecha_Data)> 
70											<#assign fecha_DateObj = dateUtil.parseDate("yyyy-MM-dd", fecha_Data, locale)> 
71											<div class="date">${dateUtil.getDate(fecha_DateObj, "dd/MM/yyyy", locale)} </div> 
72										</#if>	      
73				 
74										<#assign assetEntry = assetEntryLocalService.fetchEntry("com.liferay.journal.model.JournalArticle", journalArticle.getResourcePrimKey()?number) 
75						             		 listadoCategorias = assetCategoryService.getAssetEntryAssetCategories(assetEntry.getEntryId()) 
76						             	/>											     
77	                				 
78			                            <div class="categorias-linea"><span>${languageUtil.get(locale,'juventud.news.categorias')}: </span> 
79			                                <ul>                        
80			                                	<#list listadoCategorias as currentCategory> 
81			                                		<#assign categoriasNoticiaPage = "categorias-informa-joven" 
82									                    layoutCategoriasNoticia = layoutLocalService.getFriendlyURLLayout(themeDisplay.getScopeGroupId(), false, "/"+categoriasNoticiaPage) 
83									                 	categoriasNoticiaUrl = PortletURLFactoryUtil.create(request, "com_liferay_asset_categories_navigation_web_portlet_AssetCategoriesNavigationPortlet", layoutCategoriasNoticia.getPlid(), PortletRequest.RENDER_PHASE) 
84									                 />	 
85	                    							 
86	                    							${categoriasNoticiaUrl.setParameter("categoryId",currentCategory.getCategoryId()+"")} 
87	                    							<#if (currentCategory.getTitle(locale)!="${languageUtil.get(locale,'juventud.category.te-interesa')}") && (currentCategory.getTitle(locale)!="${languageUtil.get(locale,'juventud.category.informa-joven')}")> 
88											     		<li> 
89											     			<a href="${categoriasNoticiaUrl}" 
90											     				title="${languageUtil.get(locale,'juventud.category.show-category')} - ${currentCategory.getTitle(locale)}">${currentCategory.getTitle(locale)}</a> 
91											     		</li> 
92											     	</#if>	 
93		                						</#list>  
94		                						<#-- <li><a href="/informa-joven"											     		 
95										     		title="${languageUtil.get(locale,'juventud.category.show-category')} - ${languageUtil.get(locale,'juventud.category.todos-temas')}">${languageUtil.get(locale,'juventud.category.todos-temas')}</a> 
96										     	</li>-->  
97			                                </ul> 
98			                            </div>  
99			                            		                             
100			                            <#if resumen?? && resumen != ""> 
101			                            	${resumen} 
102			                            </#if>			                             
103			                        </div>			                     
104		                    </div> 
105		                    <div class="link"> 
106		                        <a class="more-information" title="${languageUtil.get(locale,'juventud.news.read')} ${curEntry.getTitle(locale)}"  
107                     	    		href="${detailUrl}&articleId=${journalArticle.getArticleId()}&title=${HtmlUtil.escapeURL(curEntry.getTitle(locale))}&redirect=${HtmlUtil.escapeURL(currentUrl)}"> 
108		                        	${languageUtil.get(locale,'juventud.news.read-news')}</a> 
109		                    </div>		                                             
110	        			</li> 
111		        	</#list>    	 
112		    	</ul>	 
113			</#if>	 
114			 
115			<#assign programasPage = "informa-joven" 
116                layoutInforma = layoutLocalService.getFriendlyURLLayout(themeDisplay.getScopeGroupId(), false, "/"+programasPage) 
117             	informaUrl = PortletURLFactoryUtil.create(request, "com_liferay_asset_categories_navigation_web_portlet_AssetCategoriesNavigationPortlet", layoutInforma.getPlid(), PortletRequest.RENDER_PHASE) 
118             /> 
119              
120            <div class="show-more-completo"> 
121        		<a href="${informaUrl}" title="${languageUtil.get(locale,'juventud.general.see-more')} ${languageUtil.get(locale,'juventud.news.informa-joven')}">${languageUtil.get(locale,'juventud.general.more')} ${languageUtil.get(locale,'juventud.news.informa-joven')}</a> 
122        	</div>          	 
123		</div> 
124	</div>                   
125</div> 

news-search-juventud Portlet

Navegador por categorías personalizado