Notícias
Um erro ocorreu enquanto processava o modelo.
on line 146, column 21 in 20155#20195#184516
Right side index of range out of bounds, is 70, but the sequence has only 70 element(s).(note that indices are 0 based, and ranges are inclusive).
1<#assign liferay_ui = taglibLiferayHash["/WEB-INF/tld/liferay-ui.tld"] /> 
2<#assign vocabularyService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetVocabularyLocalService")> 
3<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService")> 
4<#assign noticia_destaque = true /> 
5<#assign dateDayFormat = "dd" /> 
6<#assign dateMonthFormat = "MMM" /> 
7<#assign dateYearFormat = "yyyy" /> 
8<#assign targetFriendlyURL = "noticias-por-categoria" /> 
9<#assign targetViewUrl = "artigo" /> 
10<#assign targetPortletID = "B4AQV9zFY7Bv" /> 
11 
12 
13<div> 
14  <#list entries as entry> 
15 
16    <#assign entry = entry /> 
17    <#assign assetRenderer = entry.getAssetRenderer() /> 
18    <#assign entryTitle = htmlUtil.escape(assetRenderer.getTitle(locale)) /> 
19    <#assign viewURL = "/${targetViewUrl}/-/asset_publisher/${targetPortletID}/content/id/${entry.getEntryId()}" /> 
20    <#assign categories = entry.getCategories()> 
21 
22    <#assign urlThumb = entry.getAssetRenderer().getThumbnailPath(renderRequest)/> 
23    <#assign urlLength = urlThumb?length> 
24    <#assign imageDefault = urlThumb?substring(urlLength - 11,urlLength)> 
25 
26    <#if imageDefault != 'article.png'> 
27 
28 
29    <article class="featured-news--horizontal"> 
30      <div class="lfr-meta-actions asset-actions"><@getEditIcon /></div> 
31      <div class="featured-news__img" style="background-image:url(${entry.getAssetRenderer().getThumbnailPath(renderRequest)});"> 
32      </div> 
33      <div class="featured-news__container"> 
34        <h6> 
35          <#list categories as category> 
36            <#if category.name != "Destaque" && category.name != "Notícias" && category.name != "Manchete"> 
37              <#assign vocabulary = vocabularyService.getVocabulary(category.vocabularyId)> 
38              <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> 
39            </#if> 
40          </#list> 
41          <span> 
42            ${dateUtil.getDate(entry.getPublishDate(), dateDayFormat, locale)} de ${dateUtil.getDate(entry.getPublishDate(), dateMonthFormat, locale)} ${dateUtil.getDate(entry.getPublishDate(), dateYearFormat, locale)} 
43          </span> 
44        </h6> 
45        <a href="${viewURL}"> 
46          <h5>${entryTitle}</h5> 
47           
48           
49          <#if entry.getSummary(locale)?has_content > 
50            <p><@excerptFocus abstractFocus="${entry.getSummary(locale)}"/></p> 
51          <#else> 
52            <#assign article = journalArticleLocalService.getLatestArticle(entry.getClassPK())/> 
53            <#assign document = saxReaderUtil.read(article.getContent())/> 
54            <#assign rootElement = document.getRootElement() /> 
55            <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@name='artigo']") /> 
56            <#assign content = xPathSelector.selectSingleNode(rootElement).selectSingleNode("dynamic-element[@name='conteudo_do_artigo']").getStringValue() /> 
57 
58            <p><@excerptFocus abstractFocus="${content?replace('<[^>]*>', '', 'r')}"/></p> 
59 
60          </#if> 
61        </a> 
62      </div>  
63    </article> 
64    <#else> 
65      <article class="featured-news"> 
66        <div class="lfr-meta-actions asset-actions"><@getEditIcon /></div> 
67 
68        <h6> 
69          <#list categories as category> 
70            <#if category.name != "Destaque" && category.name != "Notícias" && category.name != "Manchete"> 
71              <#assign vocabulary = vocabularyService.getVocabulary(category.vocabularyId)> 
72              <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> 
73            </#if> 
74          </#list> 
75          <span> 
76            ${dateUtil.getDate(entry.getPublishDate(), dateDayFormat, locale)} de ${dateUtil.getDate(entry.getPublishDate(), dateMonthFormat, locale)} ${dateUtil.getDate(entry.getPublishDate(), dateYearFormat, locale)} 
77          </span> 
78        </h6> 
79        <a href="${viewURL}"> 
80          <#-- <h5><@getTitle /></h5> --> 
81          <h5>${entryTitle}</h5> 
82 
83          <#if entry.getSummary(locale)?has_content > 
84            <p><@excerpt abstract="${entry.getSummary(locale)}"/></p> 
85          <#else> 
86            <#assign article = journalArticleLocalService.getLatestArticle(entry.getClassPK())/> 
87            <#assign document = saxReaderUtil.read(article.getContent())/> 
88            <#assign rootElement = document.getRootElement() /> 
89            <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@name='artigo']") /> 
90            <#assign content = xPathSelector.selectSingleNode(rootElement).selectSingleNode("dynamic-element[@name='conteudo_do_artigo']").getStringValue() /> 
91 
92 
93            <p><@excerpt abstract="${content?replace('<[^>]*>', '', 'r')}"/></p> 
94          </#if> 
95 
96           
97        </a> 
98      </article> 
99 
100    </#if> 
101 
102  </#list> 
103</div> 
104 
105<#macro getEditIcon> 
106  <#if assetRenderer.hasEditPermission(themeDisplay.getPermissionChecker())> 
107    <#assign redirectURL = renderResponse.createRenderURL() /> 
108 
109    ${redirectURL.setParameter("struts_action", "/asset_publisher/add_asset_redirect")} 
110    ${redirectURL.setWindowState("pop_up")} 
111 
112    <#assign editPortletURL = assetRenderer.getURLEdit(renderRequest, renderResponse, windowStateFactory.getWindowState("pop_up"), redirectURL)!"" /> 
113 
114    <#if validator.isNotNull(editPortletURL)> 
115      <#assign title = languageUtil.format(locale, "edit-x", entryTitle) /> 
116      <@liferay_ui["icon"] 
117        image="edit" 
118        message=title 
119        url="javascript:Liferay.Util.openWindow({dialog: {width: 960}, id:'" + renderResponse.getNamespace() + "editAsset', title: '" + title + "', uri:'" + htmlUtil.escapeURL(editPortletURL.toString()) + "'});" 
120      /> 
121    </#if> 
122  </#if> 
123</#macro> 
124 
125<#macro excerpt abstract> 
126  <#assign max=200> 
127  <#assign min=21> 
128  <#if abstract?length &lt; max> 
129    ${htmlUtil.escape(abstract)} 
130  <#else> 
131    <#assign words=htmlUtil.escape(abstract)?word_list> 
132    <#if words?size gt min> 
133      <#list words[0..21] as word>${word} </#list>... 
134    <#else> 
135        ${htmlUtil.escape(abstract)} 
136    </#if> 
137  </#if> 
138</#macro> 
139 
140<#macro excerptFocus abstractFocus> 
141  <#assign max = 70> 
142  <#if abstractFocus?word_list?size &lt; max> 
143    ${htmlUtil.escape(abstractFocus)} 
144  <#else> 
145    <#assign words = htmlUtil.escape(abstractFocus)?word_list> 
146    <#list words[0..max] as word>${word} </#list>...     
147  </#if> 
148</#macro> 
149 
150<#macro getTitle> 
151  <#assign max=60> 
152  <#if entryTitle?length &lt; max> 
153    ${entryTitle} 
154  <#else> 
155    <#assign words=entryTitle?word_list> 
156    <#list words[0..5] as word>${word} </#list>... 
157  </#if> 
158</#macro> 
159 
160<#macro getEditIcon> 
161  <#if assetRenderer.hasEditPermission(themeDisplay.getPermissionChecker())> 
162    <#assign redirectURL = renderResponse.createRenderURL() /> 
163    ${redirectURL.setParameter("struts_action", "/asset_publisher/add_asset_redirect")} 
164    ${redirectURL.setWindowState("pop_up")} 
165    <#assign editPortletURL = assetRenderer.getURLEdit(renderRequest, renderResponse, windowStateFactory.getWindowState("pop_up"), redirectURL)!"" /> 
166    <#if validator.isNotNull(editPortletURL)> 
167      <#assign title = languageUtil.format(locale, "edit-x", entryTitle) /> 
168      <@liferay_ui["icon"] 
169        image="edit" 
170        message=title 
171        url="javascript:Liferay.Util.openWindow({dialog: {width: 960}, id:'" + renderResponse.getNamespace() + "editAsset', title: '" + title + "', uri:'" + htmlUtil.escapeURL(editPortletURL.toString()) + "'});" 
172      /> 
173    </#if> 
174  </#if> 
175</#macro>