Local initiatives - Aquara
Local initiatives
An error occurred while processing the template.
No such key: decodeURL in class com.liferay.portal.kernel.util.HttpUtil ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign cookieMunicipalityIneValue = ... [in template "20116#20152#560411" at line 20, column 1] ----
1<#assign categoryService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")>
2<#assign vocabularyService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")>
3<#assign groupLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.GroupLocalService")>
4<#assign ClassNameLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.ClassNameLocalService")>
5<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
6
7<#assign LanguageUtil = staticUtil["com.liferay.portal.kernel.language.LanguageUtil"]>
8<#assign CookieKeys = staticUtil["com.liferay.portal.kernel.util.CookieKeys"]>
9<#assign PortalUtil = staticUtil["com.liferay.portal.kernel.util.PortalUtil"]>
10<#assign HttpUtil = staticUtil["com.liferay.portal.kernel.util.HttpUtil"]>
11
12<#assign journalClassName = "com.liferay.journal.model.JournalArticle">
13
14<#assign currentGroupId = themeDisplay.getScopeGroupId()>
15
16<#assign cookieMunicipalityIneKey = "LR_MUNICIPIO_CODINE_" + currentGroupId>
17<#assign cookieMunicipalityNameKey = "LR_MUNICIPIO_NOMBRE_" + currentGroupId>
18<#assign cookieMunicipalityProvinceKey = "LR_MUNICIPIO_PROVINCIA_" + currentGroupId>
19
20<#assign cookieMunicipalityIneValue = HttpUtil.decodeURL(CookieKeys.getCookie(request, cookieMunicipalityIneKey))!"">
21<#assign cookieMunicipalityNameValue = HttpUtil.decodeURL(CookieKeys.getCookie(request, cookieMunicipalityNameKey))!"">
22<#assign cookieMunicipalityProvinceValue = HttpUtil.decodeURL(CookieKeys.getCookie(request, cookieMunicipalityProvinceKey))!"">
23
24<#assign globalSiteId = groupLocalService.fetchCompanyGroup(themeDisplay.getCompanyId()).getGroupId()>
25<#assign globalLocale = PortalUtil.getSiteDefaultLocale(globalSiteId)>
26
27<#assign currentSite = groupLocalService.getGroup(currentGroupId)>
28<#assign currentSiteName = currentSite.getName(globalLocale)>
29
30<#assign municipalitiesVocabularyId = vocabularyService.getGroupVocabulary(globalSiteId, "Municipio").getVocabularyId()>
31<#attempt>
32<#assign siteCategory = categoryService.fetchCategory(globalSiteId, 0, currentSiteName, municipalitiesVocabularyId)>
33<#recover>
34 <#assign siteCategory = -1>
35</#attempt>
36
37<#if cookieMunicipalityIneValue?? && cookieMunicipalityIneValue != "" &&
38 cookieMunicipalityNameValue?? && cookieMunicipalityNameValue != "" &&
39 cookieMunicipalityProvinceValue?? && cookieMunicipalityProvinceValue != "">
40
41 <#assign currentMunicipalityCategoryId = categoryService.fetchCategory(globalSiteId, siteCategory.getCategoryId(), cookieMunicipalityNameValue, municipalitiesVocabularyId).getCategoryId()>
42<#else>
43 <#assign currentMunicipalityCategoryId = -1>
44</#if>
45
46<#assign municipalityContents = []>
47<#assign nonMunicipalityContents = []>
48<#assign otherMunicipalityContents = []>
49
50<#if entries?has_content>
51 <#list entries as curEntry>
52 <#assign className = ClassNameLocalService.getClassName(curEntry.getClassNameId()).getValue()>
53 <#if className == journalClassName>
54 <#assign classPK = curEntry.getClassPK() >
55 <#assign journalArticle = JournalArticleLocalService.fetchLatestArticle(classPK)>
56 <#assign categories = categoryService.getAssetEntryAssetCategories(curEntry.getEntryId())>
57 <#assign categorizationType = "none">
58 <#list categories as category>
59 <#if currentMunicipalityCategoryId == category.getCategoryId()>
60 <#assign categorizationType = "current">
61 <#break>
62 <#elseif municipalitiesVocabularyId == category.getVocabularyId() >
63 <#assign categorizationType = "other">
64 </#if>
65 </#list>
66 <#switch categorizationType>
67 <#case "current">
68 <#assign municipalityContents = municipalityContents + [journalArticle] />
69 <#break>
70 <#case "other">
71 <#assign otherMunicipalityContents = otherMunicipalityContents + [journalArticle] />
72 <#break>
73 <#default>
74 <#assign nonMunicipalityContents = nonMunicipalityContents + [journalArticle] />
75 </#switch>
76 </#if>
77 </#list>
78</#if>
79
80<#if municipalityContents?size gt 0>
81
82 <#list municipalityContents as element>
83 <#if element??>
84 <#assign articleDisplay = JournalArticleLocalService.getArticleDisplay(element.getGroupId(), element.getArticleId(), element.getDDMTemplateKey(), null,
85LanguageUtil.getLanguageId(locale), themeDisplay)>
86 ${articleDisplay.getContent()}
87 </#if>
88 </#list>
89
90<#elseif nonMunicipalityContents?size gt 0>
91 <#list nonMunicipalityContents as element2>
92 <#if element2??>
93 <#assign articleDisplay2 = JournalArticleLocalService.getArticleDisplay(element2.getGroupId(), element2.getArticleId(), element2.getDDMTemplateKey(), null,
94LanguageUtil.getLanguageId(locale), themeDisplay)>
95 ${articleDisplay2.getContent()}
96 </#if>
97 </#list>
98</#if>