Um erro ocorreu enquanto processava o modelo.
Error on line 23, column 1 in 20155#20195#54116
catLocalService.getCategories("com.liferay.portlet.journal.model.JournalArticle", currentArticleResourcePrimKey) is undefined.
It cannot be assigned to categoriesList
1<#-- Retrieve the published date meta data field of the web content --> 
2<#assign displaydate = .vars['reserved-article-display-date'].data> 
3<#assign displaytitle = .vars['reserved-article-title'].data> 
4<#assign displayTags = .vars['reserved-article-asset-tag-names'].data> 
5<#assign dateDayFormat = "dd" /> 
6<#assign dateMonthFormat = "MMM" /> 
7<#assign dateYearFormat = "yyyy" /> 
8 
9<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService")> 
10 
11<#assign catLocalService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetCategoryLocalService" )> 
12 
13<#assign assetLocalService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetEntryLocalService" )> 
14 
15<#assign assetEntryQuery = objectUtil("com.liferay.portlet.asset.service.persistence.AssetEntryQuery") /> 
16 
17<#assign getterUtil = staticUtil["com.liferay.portal.kernel.util.GetterUtil"] /> 
18 
19<#assign currentArticle = JournalArticleLocalService.getArticle(getterUtil.getLong(groupId),.vars['reserved-article-id'].data)> 
20 
21<#assign currentArticleResourcePrimKey = currentArticle.getResourcePrimKey()> 
22 
23<#assign categoriesList = catLocalService.getCategories("com.liferay.portlet.journal.model.JournalArticle", currentArticleResourcePrimKey)/> 
24 
25<#-- <#assign articleCatIds = catLocalService.getCategoryIds("com.liferay.portlet.journal.model.JournalArticle", currentArticleResourcePrimKey)/> 
26 --> 
27<#assign articleCatIds = []> 
28<#list categoriesList as category> 
29  <#if category.name != "Destaque" && category.name != "Notícias" && category.name != "Manchete"> 
30    <#assign articleCatIds = articleCatIds + [category.getCategoryId()]> 
31  </#if> 
32</#list> 
33 
34<#-- Parametros da query de assets --> 
35<#assign VOID = assetEntryQuery.setAnyCategoryIds(articleCatIds) /> 
36<#assign VOID = assetEntryQuery.setClassName("com.liferay.portlet.journal.model.JournalArticle") /> 
37<#assign VOID = assetEntryQuery.setEnd(4) /> 
38<#assign VOID = assetEntryQuery.setStart(-1) /> 
39<#assign VOID = assetEntryQuery.setOrderByCol1("CREATEDATE") /> 
40 
41<#assign assetsFromCategories = assetLocalService.getEntries(assetEntryQuery) /> 
42 
43<#assign assetEntry = assetLocalService.fetchEntry("com.liferay.portlet.journal.model.JournalArticle", currentArticleResourcePrimKey)/> 
44  
45<#-- Save the original page locale for later --> 
46<#assign originalLocale = .locale> 
47  
48<#-- Set the page locale to the portals default locale --> 
49<#setting locale = localeUtil.getDefault()> 
50  
51<#-- Parse the date to a date object --> 
52<#assign displaydate = displaydate?datetime("EEE, d MMM yyyy HH:mm:ss Z")> 
53 
54<#-- Url para pagina de tags por categoria --> 
55<#assign vocabularyService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetVocabularyLocalService")> 
56<#assign targetFriendlyURL = "noticias-por-categoria" /> 
57  
58<#-- Set the page locale back to the original page locale --> 
59<#assign locale = originalLocale> 
60<div class="featured-news--article"> 
61  <h6> 
62    <#if categoriesList?size <= 3 > 
63      <#list categoriesList as category> 
64        <#if category.name != "Destaque" && category.name != "Notícias"> 
65          <#assign vocabulary = vocabularyService.getVocabulary(category.vocabularyId)> 
66            <a class="tag--${vocabulary.getName()?lower_case?replace(" ", "-")?replace("ã", "a")?replace("ç", "c")?replace("á", "a")?replace("õ", "o")}"href="/${targetFriendlyURL}?p_p_id=122_INSTANCE_pDpvw9aOr6wg&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=column-2&p_r_p_564233524_resetCur=true&p_r_p_564233524_categoryId=${category.getCategoryId()}">${category.name}</a> 
67        </#if> 
68      </#list>  
69    <#else > 
70      <#list categoriesList[0..2] as category> 
71        <#if category.name != "Destaque" && category.name != "Notícias"> 
72          <#assign vocabulary = vocabularyService.getVocabulary(category.vocabularyId)> 
73          <a class="tag--${vocabulary.getName()?lower_case?replace(" ", "-")?replace("ã", "a")?replace("ç", "c")?replace("á", "a")?replace("õ", "o")}"href="/${targetFriendlyURL}?p_p_id=122_INSTANCE_pDpvw9aOr6wg&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=column-2&p_r_p_564233524_resetCur=true&p_r_p_564233524_categoryId=${category.getCategoryId()}">${category.name}</a> 
74        </#if> 
75      </#list>  
76    </#if> 
77    <span> 
78      ${displaydate?string["dd"]} de ${displaydate?string["MMMMMMMM"]} de ${displaydate?string["yyyy"]} 
79    </span> 
80  </h6> 
81   
82  <h2 class="news-focus__title"> 
83    ${displaytitle} 
84  </h2> 
85   
86  <div class="social-share"> 
87    <a href="https://twitter.com/inep_imprensa" target="_blank"></a> 
88  </div> 
89 
90</div>       
91  
92<div class="article__content"> 
93   
94  <#if artigo.texto_da_imagem_do_artigo.imagem_do_artigo.getData()?has_content> 
95    <img alt="${artigo.texto_da_imagem_do_artigo.getData()}" class="featured-news__img" src="${artigo.texto_da_imagem_do_artigo.imagem_do_artigo.getData()}"> 
96  </#if> 
97 
98  ${artigo.conteudo_do_artigo.getData()}  
99  <p class="article__author"> 
100    ${autoria.descricao_da_autoria_do_artigo.getData()} 
101  </p> 
102</div>  
103   
104<div class="recommended-news"> 
105   
106  <#if assetsFromCategories?size gt 1> 
107    <h5>Notícias recomendadas</h5> 
108     
109    <#assign assetsPublished = 0 > 
110     
111    <#list assetsFromCategories as ra> 
112     
113      <#if assetsPublished == 3> 
114        <#break> 
115      </#if> 
116 
117      <#assign isRelated = false> 
118      <#assign pageUrl = ""> 
119      <#if request?has_content> 
120        <#assign pageUrl = request.attributes.CURRENT_URL?split("/")> 
121      </#if> 
122      <#assign relatedAssetCategories = ra.getCategories()> 
123       
124      <#-- Se for um Article --> 
125      <#if (ra.getClassPK() != assetEntry.getClassPK()) > 
126        <#assign ja = JournalArticleLocalService.getLatestArticle(ra.getClassPK())> 
127        <#assign targetViewUrl = "artigo" /> 
128        <#assign targetPortletID = "B4AQV9zFY7Bv" /> 
129        <#assign viewURL = "/${targetViewUrl}/-/asset_publisher/${targetPortletID}/content/${ja.urlTitle}/21206" /> 
130        <#assign titulo = ja.getTitle(locale)> 
131        <#assign data = ja.getDisplayDate()> 
132        <#assign isRelated = true> 
133      </#if> 
134       
135      <#if (isRelated)> 
136        <article class="featured-news"> 
137          <h6> 
138            <#if relatedAssetCategories?size <= 3 > 
139              <#list relatedAssetCategories as relatedAssetCategorie> 
140                <#if relatedAssetCategorie.name != "Destaque" && relatedAssetCategorie.name != "Notícias"> 
141                  <#assign vocabulary = vocabularyService.getVocabulary(relatedAssetCategorie.vocabularyId)> 
142                  <a class="tag--${vocabulary.getName()?lower_case?replace(" ", "-")?replace("ã", "a")?replace("ç", "c")?replace("á", "a")?replace("õ", "o")}"href="/${targetFriendlyURL}?p_p_id=122_INSTANCE_pDpvw9aOr6wg&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=column-2&p_r_p_564233524_resetCur=true&p_r_p_564233524_categoryId=${relatedAssetCategorie.getCategoryId()}">${relatedAssetCategorie.name}</a> 
143                </#if> 
144              </#list> 
145            <#else> 
146              <#list relatedAssetCategories[0..2] as relatedAssetCategorie> 
147                <#if relatedAssetCategorie.name != "Destaque" && relatedAssetCategorie.name != "Notícias"> 
148                  <#assign vocabulary = vocabularyService.getVocabulary(relatedAssetCategorie.vocabularyId)> 
149                  <a class="tag--${vocabulary.getName()?lower_case?replace(" ", "-")?replace("ã", "a")?replace("ç", "c")?replace("á", "a")?replace("õ", "o")}"href="/${targetFriendlyURL}?p_p_id=122_INSTANCE_pDpvw9aOr6wg&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=column-2&p_r_p_564233524_resetCur=true&p_r_p_564233524_categoryId=${relatedAssetCategorie.getCategoryId()}">${relatedAssetCategorie.name}</a> 
150                </#if> 
151              </#list> 
152            </#if> 
153            <span>${data?string["dd"]} de ${data?string["MMMMMMMM"]} 
154          </span></h6> 
155          <a href="${viewURL}"> 
156            <h5>${titulo}</h5> 
157          </a> 
158        </article> 
159 
160        <#assign assetsPublished = assetsPublished + 1> 
161      </#if> 
162    </#list> 
163  </#if> 
164</div> 

$theme.runtime($myPortletId, '', $velocityPortletPreferences.toString())