Documentación

Documentación

Categorías
Documentación
Rango de fechas
Fecha de inicio
Fecha final
6 Emaitza
Sort
Errorea gertatu da txantiloia prozesatzerakoan.
Java method "com.sun.proxy.$Proxy1051.getFriendlyURLEntryLocalization(long, String)" threw an exception when invoked on com.sun.proxy.$Proxy1051 object "com.liferay.friendly.url.service.impl.FriendlyURLEntryLocalServiceImpl@3d303b84"; see cause exception in the Java stack trace.

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign friendlyURLEntryLocalization ...  [in template "13333257#13333299#13752006" at line 31, column 41]
----
1<#assign classNameLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.ClassNameLocalService")/> 
2<#assign dlFileEntryLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService")/> 
3<#assign dlFileEntryTypeLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryTypeLocalService")/> 
4<#assign dlFileEntryMetadataLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryMetadataLocalService")/> 
5<#assign friendlyURLLocalService = serviceLocator.findService("com.liferay.friendly.url.service.FriendlyURLEntryLocalService")/> 
6<#assign storageEngineManagerUtil = objectUtil("com.liferay.dynamic.data.mapping.kernel.StorageEngineManagerUtil")/> 
7 
8<#assign groupLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.GroupLocalService")/> 
9<#assign layout = themeDisplay.getLayout()> 
10	<#if layout??> 
11		<#if layout.isPrivateLayout()> 
12			 <#assign fiscalRepositoryGroup = groupLocalService.getGroup(companyId, "FISCAL_Zona_Privada")/> 
13		<#else> 
14				<#assign fiscalRepositoryGroup = groupLocalService.getGroup(companyId, "Guest")/> 
15		</#if> 
16		<#assign repositoryFriendlyUrl = fiscalRepositoryGroup.getFriendlyURL()/>     
17    <#assign imgUrlBase = "/documents/d"+repositoryFriendlyUrl+"/"/> 
18	</#if> 
19		 
20<#assign documentUrlPrincipal = ""/> 
21 
22<#if entries?has_content> 
23	<ul class="mj-results-list"> 
24		<#list entries as curEntry> 
25			<li class="mj-box__information w-100"> 
26				<#assign dlFileEntry = dlFileEntryLocalService.getDLFileEntry(curEntry.classPK) /> 
27				<#assign classNameId = classNameLocalService.getClassNameId("com.liferay.portal.kernel.repository.model.FileEntry") /> 
28			<#-- 	<#assign friendlyURLEntry = friendlyURLLocalService.getMainFriendlyURLEntry(classNameId, curEntry.classPK) />   --> 
29				<#assign friendlyURLEntry = friendlyURLLocalService.fetchMainFriendlyURLEntry(classNameId, curEntry.classPK) /> 
30				<#if friendlyURLEntry?? && friendlyURLEntry!="" > 
31				   	<#assign friendlyURLEntryLocalization = friendlyURLLocalService.getFriendlyURLEntryLocalization(friendlyURLEntry.getFriendlyURLEntryId(), themeDisplay.getLanguageId()) /> 
32				</#if>			 
33				<#if dlFileEntry.getSize() gt 0 && friendlyURLEntryLocalization?? > 
34					<#assign documentUrlPrincipal = getDocumentUrl(repositoryFriendlyUrl, friendlyURLEntryLocalization.getUrlTitle(), false)/> 
35				<#else> 
36					<#assign documentUrlPrincipal = ""/> 
37				</#if> 
38 
39				<#assign descripcion = dlFileEntry.getDescription() /> 
40				<#assign fileEntryType = dlFileEntryTypeLocalService.getFileEntryType(dlFileEntry.getFileEntryTypeId()) /> 
41				<#assign fileEntryMetadata = dlFileEntryMetadataLocalService.getFileEntryMetadata(fileEntryType.getDataDefinitionId(), dlFileEntry.getLatestFileVersion(true).getFileVersionId()) /> 
42				<#assign ddmFormValues = storageEngineManagerUtil.getDDMFormValues(fileEntryMetadata.getDDMStorageId()) /> 
43				<#assign ddmFormFieldValues = ddmFormValues.getDDMFormFieldValues()/> 
44 
45				<#-- start  --> 
46				<#list ddmFormFieldValues as field> 
47					<#assign reference = field.getFieldReference() /> 
48					<#if reference=="titulo" > 
49						<#assign documentTitulo = (field.getValue().getString(locale)?has_content)?then(field.getValue().getString(locale),dlFileEntry.fileName) /> 
50					<#elseif reference=="tituloUrl" > 
51						<#assign documentTituloUrl = field.getValue().getString(locale)/> 
52					<#elseif reference=="url" > 
53						<#assign documentUrl = field.getValue().getString(locale)/> 
54					<#elseif reference=="fecha"> 
55						<#assign documentFecha = field.getValue().getString(locale)/> 
56					<#elseif reference=="ca_document" > 
57						<#assign documentJsonRaw = field.getValue().getString(locale) /> 
58						<#if documentJsonRaw?? && documentJsonRaw!="{}"> 
59							<#assign documentJson = documentJsonRaw?eval/> 
60							<#assign documentUrlCA = getDocumentUrl(repositoryFriendlyUrl, documentJson.title, false)/> 
61						<#else> 
62							<#assign documentUrlCA = ""> 
63						</#if> 
64					<#elseif reference=="gl_document" > 
65						<#assign documentJsonRaw = field.getValue().getString(locale) /> 
66						<#if documentJsonRaw?? && documentJsonRaw!="{}"> 
67							<#assign documentJson = documentJsonRaw?eval/> 
68							<#assign documentUrlGL = getDocumentUrl(repositoryFriendlyUrl, documentJson.title, false)/> 
69						<#else> 
70							<#assign documentUrlGL = ""> 
71						</#if> 
72					<#elseif reference=="va_document" > 
73						<#assign documentJsonRaw = field.getValue().getString(locale) /> 
74						<#if documentJsonRaw?? && documentJsonRaw!="{}"> 
75							<#assign documentJson = documentJsonRaw?eval/> 
76							<#assign documentUrlVA = getDocumentUrl(repositoryFriendlyUrl, documentJson.title, false)/> 
77						<#else> 
78							<#assign documentUrlVA = ""> 
79						</#if> 
80					<#elseif reference=="eu_document" > 
81						<#assign documentJsonRaw = field.getValue().getString(locale) /> 
82						<#if documentJsonRaw?? && documentJsonRaw!="{}"> 
83							<#assign documentJson = documentJsonRaw?eval/> 
84							<#assign documentUrlEU = getDocumentUrl(repositoryFriendlyUrl, documentJson.title, false)/> 
85						<#else> 
86							<#assign documentUrlEU = ""> 
87						</#if> 
88					<#elseif reference=="en_document" > 
89						<#assign documentJsonRaw = field.getValue().getString(locale) /> 
90						<#if documentJsonRaw?? && documentJsonRaw!="{}"> 
91							<#assign documentJson = documentJsonRaw?eval/> 
92							<#assign documentUrlEN = getDocumentUrl(repositoryFriendlyUrl, documentJson.title, false)/> 
93						<#else> 
94							<#assign documentUrlEN = ""> 
95						</#if> 
96					</#if> 
97 
98				</#list> 
99 
100				<#-- html --> 
101				<div class="mj-box__information--top-wrapper"> 
102					<#if documentTitulo?? && documentTitulo!=""> 
103						<p class="mj-box__information--title bold"> 
104							<#if documentUrlPrincipal?? && documentUrlPrincipal!="">  
105								<a href="${documentUrlPrincipal}?download=false" target="_blank" title="<@liferay.language key='opens-new-window'/>">${htmlUtil.escape(documentTitulo)} 
106								</a> 
107							<#else> 
108								${htmlUtil.escape(documentTitulo)} 
109							</#if> 
110						</p> 
111					</#if> 
112					<#if documentTituloUrl?? && documentTituloUrl!=""> 
113						<a class="mj-link mb-10 d-inline-block" href="${htmlUtil.escape(documentUrl)}" target="_blank" aria-label="${languageUtil.format(locale, 'x-opens-new-window', htmlUtil.escape(documentTituloUrl), false)}"> 
114							${htmlUtil.escape(documentTituloUrl)} 
115						</a> 
116					</#if> 
117					<#if descripcion?? && descripcion!=""> 
118						<p class="mj-box__information--text"> 
119							${htmlUtil.escape(descripcion)} 
120						</p> 
121					</#if> 
122				</div> 
123				<div class="mj-box__information--bottom-wrapper"> 
124					<div> 
125						<#if documentUrlPrincipal?? && documentUrlPrincipal!=""> 
126							<a href="${documentUrlPrincipal}" class="mj-link-download mr-2" download aria-label="${languageUtil.format(locale, 'download-x', htmlUtil.escape(documentTitulo), false)}" title="<@liferay.language key='download' /> ${htmlUtil.escape(documentTitulo)}"><@liferay.language key="download" /></a> 
127						</#if> 
128						<#if documentUrlCA?? && documentUrlCA!=""> 
129							<@printDownloadFlag documentUrlCA "ca_es" /> 
130						</#if> 
131						<#if documentUrlGL?? && documentUrlGL!=""> 
132						<@printDownloadFlag documentUrlGL "gl_es" /> 
133						</#if> 
134						<#if documentUrlVA?? && documentUrlVA!=""> 
135							<@printDownloadFlag documentUrlVA "va_es" /> 
136						</#if> 
137						<#if documentUrlEU?? && documentUrlEU!=""> 
138							<@printDownloadFlag documentUrlEU "eu_es" /> 
139						</#if> 
140						<#if documentUrlEN?? && documentUrlEN!=""> 
141							<@printDownloadFlag documentUrlEN "en_gb" /> 
142						</#if> 
143					</div> 
144					<#if documentFecha?? && documentFecha!=""> 
145						<#assign documentFecha_DateObj = dateUtil.parseDate("yyyy-MM-dd", documentFecha, locale)>  
146						<#assign documentFechaFormat = dateUtil.getDate(documentFecha_DateObj, "dd/MM/yyyy", locale)/> 
147						<time class="mj-datetime" datetime="${documentFecha_DateObj?date?iso_utc}">${documentFechaFormat}</time> 
148					</#if> 
149				</div> 
150			</li> 
151		</#list> 
152	</ul> 
153</#if> 
154 
155<#function getDocumentUrl repositoryUrl title isDownload> 
156	<#if repositoryUrl?? && repositoryUrl!="" && title?? && title!="" > 
157		<#if isDownload?? && isDownload==true > 
158			<#return "/documents/d"+repositoryUrl+"/"+title+"?download=true"> 
159		<#else> 
160			<#return "/documents/d"+repositoryUrl+"/"+title > 
161		</#if> 
162	<#else> 
163		<#return ""> 
164	</#if> 
165</#function> 
166 
167<#macro printDownloadFlag documentUrl localeFlag> 
168	<#if localeFlag == 'ca_es'> 
169		<#assign language = 'catalán' /> 
170	<#elseif localeFlag == 'gl_es'> 
171		<#assign language = 'gallego' /> 
172	<#elseif localeFlag == 'va_es'> 
173		<#assign language = 'valenciano' /> 
174	<#elseif localeFlag == 'eu_es'> 
175		<#assign language = 'euskera' /> 
176	<#elseif localeFlag == 'en_gb'> 
177		<#assign language = 'inglés' /> 
178	</#if> 
179 
180	<a href="${documentUrl}" class="mr-1" download target="_blank" title="<@liferay.language key='download' /> ${htmlUtil.escape(documentTitulo)} > ${language}"> 
181		<img src="${imgUrlBase}${localeFlag}" /> 
182	</a> 
183</#macro>