Um erro ocorreu enquanto processava o modelo.
Error on line 16, column 5 in 20155#20195#122417
categoryService.getAssetCategory(request.getParameter("categoryId")?number) is undefined.
It cannot be assigned to contextcategory
1<#assign liferay_ui = taglibLiferayHash["/WEB-INF/tld/liferay-ui.tld"] /> 
2<#assign vocabularyService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetVocabularyLocalService")> 
3<#assign categoryService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetCategoryLocalService")> 
4<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService")> 
5 
6 
7  <#assign defaultCategory =  124787/> 
8  <#assign noticia_destaque = true /> 
9  <#assign dateDayFormat = "dd" /> 
10  <#assign dateMonthFormat = "MMM" /> 
11  <#assign targetFriendlyURL = "noticias-por-categoria" /> 
12  <#assign targetViewUrl = "artigo" /> 
13  <#assign targetPortletID = "B4AQV9zFY7Bv" /> 
14   
15  <#if request.getParameter("categoryId")?has_content> 
16    <#assign contextcategory = categoryService.getAssetCategory(request.getParameter("categoryId")?number) /> 
17  <#else> 
18    <#assign contextcategory = categoryService.getAssetCategory(defaultCategory) /> 
19  </#if> 
20 
21  <#assign contextvocabulary = vocabularyService.getVocabulary(contextcategory.vocabularyId)> 
22 
23  <div class="tags__header"> 
24    <h2>Notícias › <span class="tags__header--${contextvocabulary.getName()?lower_case?replace(" ", "-")?replace("ã", "a")?replace("ç", "c")?replace("á", "a")?replace("õ", "o")}"> 
25      ${contextcategory.name} 
26    </span></h2> 
27    <#if contextcategory.description??> 
28      <p>${contextcategory.description}</p> 
29    </#if> 
30  </div> 
31  <div class="tags__news-container"> 
32 
33 
34  <#list entries as entry> 
35     
36    <#assign assetRenderer = entry.getAssetRenderer() /> 
37    <#assign entryTitle = htmlUtil.escape(assetRenderer.getTitle(locale)) /> 
38    <#assign viewURL = "/${targetViewUrl}/-/asset_publisher/${targetPortletID}/content/${entry.getAssetRenderer().getUrlTitle()}/21206" /> 
39    <#assign categories = entry.getCategories()> 
40 
41      <article class="featured-news"> 
42        <div class="lfr-meta-actions asset-actions"><@getEditIcon /></div> 
43 
44        <h6> 
45          <#list categories as category> 
46            <#if category.name != "Destaque" && category.name != "Notícias" && category.name != "Manchete"> 
47              <#assign vocabulary = vocabularyService.getVocabulary(category.vocabularyId)> 
48              <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> 
49            </#if> 
50          </#list> 
51          <span> 
52            ${dateUtil.getDate(entry.getPublishDate(), dateDayFormat, locale)} de ${dateUtil.getDate(entry.getPublishDate(), dateMonthFormat, locale)} 
53          </span> 
54        </h6> 
55 
56        <a href="${viewURL}"> 
57          <h5>${entryTitle}</h5> 
58          <#if entry.getSummary(locale)?has_content > 
59            <p class="component__description"><@excerpt abstract="${entry.getSummary(locale)}"/></p> 
60          <#else> 
61            <#assign article = journalArticleLocalService.getLatestArticle(entry.getClassPK())/> 
62            <#assign document = saxReaderUtil.read(article.getContent())/> 
63            <#assign rootElement = document.getRootElement() /> 
64            <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@name='artigo']") /> 
65            <#assign content = xPathSelector.selectSingleNode(rootElement).selectSingleNode("dynamic-element[@name='conteudo_do_artigo']").getStringValue() /> 
66 
67            <p class="component__description"><@excerpt abstract="${content?replace('<[^>]*>', '', 'r')}"/></p> 
68 
69          </#if> 
70        </a>   
71      </article> 
72  </#list> 
73</div> 
74 
75<#macro getEditIcon> 
76  <#if assetRenderer.hasEditPermission(themeDisplay.getPermissionChecker())> 
77    <#assign redirectURL = renderResponse.createRenderURL() /> 
78 
79    ${redirectURL.setParameter("struts_action", "/asset_publisher/add_asset_redirect")} 
80    ${redirectURL.setWindowState("pop_up")} 
81 
82    <#assign editPortletURL = assetRenderer.getURLEdit(renderRequest, renderResponse, windowStateFactory.getWindowState("pop_up"), redirectURL)!"" /> 
83 
84    <#if validator.isNotNull(editPortletURL)> 
85      <#assign title = languageUtil.format(locale, "edit-x", entryTitle) /> 
86      <@liferay_ui["icon"] 
87        image="edit" 
88        message=title 
89        url="javascript:Liferay.Util.openWindow({dialog: {width: 960}, id:'" + renderResponse.getNamespace() + "editAsset', title: '" + title + "', uri:'" + htmlUtil.escapeURL(editPortletURL.toString()) + "'});" 
90      /> 
91    </#if> 
92  </#if> 
93</#macro> 
94 
95<#macro excerpt abstract> 
96  <#assign max=200> 
97  <#assign min=23> 
98  <#if abstract?length &lt; max> 
99    ${htmlUtil.escape(abstract)} 
100  <#else> 
101    <#assign words=htmlUtil.escape(abstract)?word_list> 
102    <#if words?size gt min> 
103      <#list words[0..22] as word>${word} </#list>... 
104    <#else> 
105        ${htmlUtil.escape(abstract)} 
106    </#if> 
107  </#if> 
108</#macro> 
109 
110<#macro excerptFocus abstractFocus> 
111  <#assign max = 70> 
112  <#if abstractFocus?word_list?size &lt; max> 
113    ${htmlUtil.escape(abstractFocus)} 
114  <#else> 
115    <#assign words = htmlUtil.escape(abstractFocus)?word_list> 
116    <#list words[0..max] as word>${word} </#list>...     
117  </#if> 
118</#macro> 
119 
120<#macro getTitle> 
121  <#assign max=60> 
122  <#if entryTitle?length &lt; max> 
123    ${entryTitle} 
124  <#else> 
125    <#assign words=entryTitle?word_list> 
126    <#list words[0..7] as word>${word} </#list>... 
127  </#if> 
128</#macro> 
129 
130<#macro getEditIcon> 
131  <#if assetRenderer.hasEditPermission(themeDisplay.getPermissionChecker())> 
132    <#assign redirectURL = renderResponse.createRenderURL() /> 
133    ${redirectURL.setParameter("struts_action", "/asset_publisher/add_asset_redirect")} 
134    ${redirectURL.setWindowState("pop_up")} 
135    <#assign editPortletURL = assetRenderer.getURLEdit(renderRequest, renderResponse, windowStateFactory.getWindowState("pop_up"), redirectURL)!"" /> 
136    <#if validator.isNotNull(editPortletURL)> 
137      <#assign title = languageUtil.format(locale, "edit-x", entryTitle) /> 
138      <@liferay_ui["icon"] 
139        image="edit" 
140        message=title 
141        url="javascript:Liferay.Util.openWindow({dialog: {width: 960}, id:'" + renderResponse.getNamespace() + "editAsset', title: '" + title + "', uri:'" + htmlUtil.escapeURL(editPortletURL.toString()) + "'});" 
142      /> 
143    </#if> 
144  </#if> 
145</#macro>