S'ha produït un error mentre es processava la plantilla.
Negative range end index (-3) isn't allowed for a range used for slicing.
The blamed expression:
==> 0..(file.getSize()?length - 4)  [in template "10154#10192#RECURSO-VIDEO" at line 307, column 120]

----
FTL stack trace ("~" means nesting-related):
	- Failed at: ${file.getSize()[0..(file.getSize()?l...  [in template "10154#10192#RECURSO-VIDEO" at line 307, column 103]
----
1<#-- get services --> 
2<#assign LiteralsToolsServiceUtil = serviceLocator.findService("com.aqua.literals.util.LiteralsToolsService")/> 
3<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") /> 
4<#assign UtilsService = serviceLocator.findService("com.educaixa.common.service.EduCaixaCommonService")/> 
5<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") /> 
6<#assign dLFileEntryLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService") /> 
7<#assign valoracionesDisplay = serviceLocator.findService("com.educaixa.services.service.RatingStatsLocalService")/> 
8<#assign LiteralsToolsServiceUtil = serviceLocator.findService("com.aqua.literals.util.LiteralsToolsService")/> 
9<#assign language = themeDisplay.getLocale()/> 
10<#assign groupId = themeDisplay.getScopeGroupId()/> 
11<#assign restultsLiteral = LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.common.link.resultados") /> 
12<#assign recurso = LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.recurso") /> 
13<#assign serviceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext()> 
14<#assign httpServletRequest = serviceContext.getRequest() /> 
15<#assign UserBookmarkLocalService = serviceLocator.findService("com.educaixa.services.service.UserBookmarkLocalService") /> 
16 
17<#-- get the content categories --> 
18<#assign article = journalArticleLocalService.getArticle(getterUtil.getLong(scopeGroupId), .vars['reserved-article-id'].data) /> 
19<#assign asset = assetEntryLocalService.getEntry("com.liferay.journal.model.JournalArticle", article.resourcePrimKey) /> 
20 
21<#-- get the results URL and valoration value--> 
22<#assign results_url = "https://${request.serverName}/${locale.getLanguage()}${restultsLiteral}?q=" /> 
23<#assign valoracionesDisplayAverage = 0/> 
24<#if valoracionesDisplay.fetchByResourcePK(scopeGroupId,themeDisplay.getCompanyId(),article.getResourcePrimKey()) ??> 
25    <#assign valoracionesDisplayValue = valoracionesDisplay.findByResourcePK(scopeGroupId,themeDisplay.getCompanyId(),article.getResourcePrimKey()) /> 
26    <#assign valoracionesDisplayAverage = valoracionesDisplayValue.getAverageGlobalScore() /> 
27</#if> 
28 
29<#assign journalArticleId = .vars['reserved-article-id'].data/> 
30<#assign userId =themeDisplay.getUserId()/> 
31<#assign isUserBookmark = UserBookmarkLocalService.isUserBookmark(themeDisplay.getCompanyId(),userId,journalArticleId,groupId)/> 
32 
33<#-- Resource type --> 
34<#assign resourceType = LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.recurso.video") /> 
35<#assign imgType = "/o/educaixa-theme/images/video-icon.png"> 
36 
37<#-- Escape title text --> 
38<#assign titleEscaped = "" /> 
39<#if titulo.getData()??> 
40    <#assign titleEscaped = titulo.getData()?replace('<p>','','r')/> 
41    <#assign titleEscaped = titleEscaped?replace('</p>','','r')/> 
42    <#assign titleEscaped = titleEscaped?replace('<div>','','r')/> 
43    <#assign titleEscaped = titleEscaped?replace('</div>','','r')/> 
44    <#assign titleEscaped = titleEscaped?replace('<h1>','','r')/> 
45    <#assign titleEscaped = titleEscaped?replace('</h1>','','r')/> 
46</#if> 
47 
48<#assign subtituloEscaped = "" /> 
49<#if subtitulo.getData()??> 
50    <#assign subtituloEscaped = subtitulo.getData() /> 
51    <#assign subtituloEscaped = subtituloEscaped?replace('<p>','','r')/> 
52    <#assign subtituloEscaped = subtituloEscaped?replace('</p>','','r')/> 
53</#if> 
54 
55<#-- get image alt --> 
56<#if image_alt?? && image_alt.getData()?? && image_alt.getData() != ""> 
57    <#assign altImage = image_alt.getData() /> 
58<#else> 
59    <#assign altImage = titleEscaped /> 
60</#if> 
61 
62<#-- get image banner --> 
63<#if imagenficha ?? && imagenficha.getData() ?? && imagenficha.getData() != ""> 
64    <#assign imageSrc = imagenficha.getData() /> 
65<#else>     
66    <#assign imageSrc = "/o/educaixa-theme/images/blured-lights-recursos.png" /> 
67</#if> 
68 
69<#assign language = themeDisplay.getLocale()/> 
70<#assign nivel_educativo = []> 
71<#assign area_conocimiento = []> 
72<#assign competencias = []> 
73<#assign objectius = []> 
74 
75<#list asset.getCategories() as cur_category> 
76    <#if cur_category.vocabularyId == 10515> 
77        <#assign nivel_educativo = nivel_educativo + [cur_category.getTitle(language)]> 
78    <#elseif cur_category.vocabularyId == 6> 
79        <#assign area_conocimiento = area_conocimiento + [cur_category.getTitle(language)]> 
80    <#elseif cur_category.vocabularyId == 401> 
81        <#assign competencias = competencias + [cur_category.getTitle(language)]> 
82    <#elseif cur_category.vocabularyId == 43203> 
83        <#assign objectius = objectius + [cur_category.getTitle(language)]> 
84    </#if> 
85</#list> 
86 
87<#-- 
88<#assign videoid =  linkTxt.externalLink.getData()?replace('https://img.youtube.com/vi/','','r')/> 
89<#assign videoid =  videoid?replace('/hqdefault.jpg','','r')/> 
90--> 
91 
92<#assign thesaurusCategories = UtilsService.getThesaurusCategories(asset) /> 
93<#assign tagsCategories = UtilsService.getTagsCategories(asset) /> 
94<#assign categories = thesaurusCategories + tagsCategories /> 
95 
96<#-- Login --> 
97<#assign is_signed_in = themeDisplay.isSignedIn()/> 
98<#assign plid = portalUtil.getPlidFromPortletId(themeDisplay.getScopeGroupId(), "EducaixaMyeducaixaLogin") /> 
99<#assign loginURL = portletURLFactory.create(httpServletRequest, "EducaixaMyeducaixaLogin", plid, "RENDER_PHASE") /> 
100${loginURL.setParameter("mvcPath", "/login_modal.jsp")} 
101${loginURL.setWindowState("POP_UP")} 
102 
103<#if docprincipal.getData()??> 
104	<#assign siteMeta = UtilsService.getDocumentMetadataInJSON(docprincipal.getData(), themeDisplay) /> 
105</#if> 
106 
107<#-- Banner section --> 
108<div class="container vertical image-view"> 
109    <div class="row"> 
110        <#if siteMeta.get(0).brightcove_id?? && siteMeta.get(0).brightcove_id != ""> 
111            <iframe src="https://www.youtube.com/embed/${siteMeta.get(0).brightcove_id}?rel=0" width="900px" height="458px" allowfullscreen webkitallowfullscreen mozallowfullscreen frameborder='0'></iframe> 
112        <#else> 
113            <img src="${imageSrc}" alt="${altImage}" width="900px" height="458px" class="video-player">   
114        </#if> 
115        <div class="box-img col-lg square"> 
116            <#if resourceType != ""> 
117                <p class="box-img-pre-rec" >${recurso} - ${resourceType} </p> 
118            </#if> 
119            <#if titulo?has_content> 
120                <h1 class="box-img-title-rec">${titleEscaped}</h1> 
121            </#if> 
122            <#if subtitulo?has_content> 
123                <p class="box-img-sub-title-rec">${subtituloEscaped}</p> 
124            </#if> 
125            <p class="box-img-categ-rec"> 
126                <#if categories?has_content> 
127					<#list categories as category> 
128						<#-- redirige la pagina de resultados por tag--> 
129						<a onClick="updateTagsCicks('${category.getTitle(locale)}');" href="${results_url}${category.getTitle(locale)}" >${category.getTitle(locale)}</a> 
130					</#list> 
131				</#if> 
132            </p> 
133            <hr> 
134            <button class="card-button-purple color-caixa-purple background-white" id="myBtn">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.common.link.ver")}</button>       
135            <div class="card-actions flex"> 
136                <div class="statistics"> 
137                    <svg viewBox="0 0 36 36" class="circular-chart orange"> 
138                        <path class="circle-bg" d="M18 2.0845 
139                            a 15.9155 15.9155 0 0 1 0 31.831 
140                            a 15.9155 15.9155 0 0 1 0 -31.831"></path> 
141                        <path class="circle" stroke-dasharray="${valoracionesDisplayAverage*20}, 100" d="M18 2.0845 
142                            a 15.9155 15.9155 0 0 1 0 31.831 
143                            a 15.9155 15.9155 0 0 1 0 -31.831"></path> 
144                        <text x="18" y="22" class="percentage">${valoracionesDisplayAverage}</text> 
145                    </svg> 
146                </div> 
147                <div class="share"> 
148                    <button id="share"></button> 
149                    <div class="addthis_inline_share_toolbox tooltip"></div> 
150                </div> 
151                <div class="bookmark"> 
152					<#if is_signed_in> 
153						<#if isUserBookmark> 
154							<button id="bookmark" onClick="updateUserBookmark(${journalArticleId},false);" data-articleid="${journalArticleId}" class="bookmark bookmarked"></button>  
155						<#else> 
156							<button id="bookmark" onClick="updateUserBookmark(${journalArticleId},true);" data-articleid="${journalArticleId}" class="bookmark"></button> 
157						</#if> 
158					<#else> 
159						<button id="bookmark" onClick="event.stopPropagation();openPopup('${loginURL}','','500', '650')"></button> 
160					</#if> 
161                </div> 
162            </div> 
163            <div id="myModal" class="modal-resource"> 
164                <div class="modal-content-resource"> 
165                    <span class="close">&times;</span> 
166                    <#if siteMeta.get(0).brightcove_id?? && siteMeta.get(0).brightcove_id != ""> 
167                        <iframe id="yt-modal" src="https://www.youtube-nocookie.com/embed/${siteMeta.get(0).brightcove_id}?rel=0" width="100%" height="458px%" allowfullscreen webkitallowfullscreen mozallowfullscreen frameborder='0'></iframe> 
168                    </#if> 
169                </div> 
170            </div> 
171        </div> 
172    </div> 
173</div> 
174 
175<#-- Categories section--> 
176<div class="container vertical info-view"> 
177    <div class="row"> 
178        <#if nivel_educativo?size != 0 > 
179            <div class="col-lg col-xs-6 col-sm"> 
180                <h2 class="purple-title">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.ficha.nivel.educativo")}</h2><br> 
181                <ul> 
182                    <#list nivel_educativo as item> 
183                        <li class="marked">${item}</li> 
184                    </#list> 
185                </ul> 
186	        </div> 
187        </#if> 
188        <#if area_conocimiento?size != 0 > 
189        	<div class="col-lg col-xs-6 col-sm"> 
190                <h2 class="purple-title">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.ficha.area.conocimiento")}</h2><br> 
191                <ul> 
192                    <#list area_conocimiento as item> 
193                        <li class="marked">${item}</li> 
194                    </#list> 
195                </ul> 
196        	</div> 
197        </#if> 
198        <#if area_conocimiento?size != 0 > 
199        	<div class="col-lg col-xs-6 col-sm"> 
200                <h2 class="purple-title">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.ficha.competencias")}</h2><br> 
201                <ul> 
202                    <#list competencias as item> 
203                        <li class="marked">${item}</li> 
204                    </#list> 
205                </ul> 
206	        </div> 
207        </#if> 
208        <#if siteMeta?? && siteMeta.get(0).idioma?has_content> 
209        	<div class="col-lg col-xs-6 col-sm"> 
210                <h2 class="purple-title">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.ficha.idioma")}</h2><br> 
211                <ul> 
212                    <#assign idioma = siteMeta.get(0).idioma?keep_after('"')?keep_before('"') /> 
213                    <li class="marked">${idioma} </li> 
214                </ul> 
215	        </div> 
216        </#if>         
217    </div> 
218    <hr class="line-12">  
219</div> 
220 
221<#-- Content section--> 
222<div class="container vertical info-content"> 
223    <div class="row"> 
224        <div class="col-lg-7 col-xs-12"> 
225            <#if introduccion?has_content> 
226                <h2 class="obj-rec-title"> 
227                    <b style="color: #7B2FA1;">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.recurso.descripcion")}</b> 
228                </h2> 
229                <p class="description-text-rec"> 
230                    ${introduccion.getData()} 
231                </p> 
232            </#if> 
233                        <#if objetivosdidacticos?has_content> 
234                <h2 class="obj-rec-title"> 
235                    <b>${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.recurso.objetivos")}</b> 
236                </h2> 
237                <div class="row" style="margin-top: 4%;"> 
238                    ${objetivosdidacticos.getData()} 
239                </div> 
240            </#if> 
241            <#-- Si las competencias del programa no incluyen dimensiones y/o subcompetencias, el modulo se sustituye por uno como el de objetivos!!!!!!--> 
242            <#if competenceGeneralDescription.getSiblings()?has_content> 
243                <div class="compet-rec-dropdown"> 
244                    <#if competenceGeneralDescription.getData()?has_content> 
245                        <h2 class="obj-rec-title"> 
246		                    <b>${competenceGeneralDescription.getData()}</b> 
247		                </h2> 
248		                <div class="compet-rec-dropdown"> 
249		                    <#-- 
250		                    Por ahora no está el campo relleno. HAbilitar cuando se solicite   
251		                    <li class="compet-rec-sub accordion">${competenceGeneralDescription.competenceTitle.getData()}</li>--> 
252		                    <div class="compet-rec-sub-info panel">${competenceGeneralDescription.competenceTitle.competenceDesc.getData()}</div> 
253		                </div> 
254                    </#if> 
255                </div> 
256            </#if> 
257            <#if otrainfodidactica.getData()?has_content> 
258                <h2 class="obj-rec-title"> 
259                    ${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.recurso.sobre")} 
260                </h2> 
261                <p class="desc-rec">${otrainfodidactica.getData()}</p> 
262            </#if> 
263            <#-- MATERIALES Y DESCARGAS -->	 
264            <#if materialrelacionado.getData()?has_content || linkTxt.getSiblings()?has_content || materialrelacionado.titulomaterial.getSiblings()?has_content > 
265                <h2 class="obj-rec-title"> 
266                    ${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.recurso.material.relacionado")} 
267                </h2> 
268                <#list materialrelacionado.getSiblings() as fileText> 
269                    <#if materialesTexto.getData()?has_content> 
270                        <div> 
271                            ${materialesTexto.getData()} 
272                        </div> 
273                    </#if> 
274                    <#if linkTxt.internalLink.getData()?has_content> 
275                        <#list linkTxt.getSiblings() as linkTxt> 
276                            <li class="resource-lis"> 
277                                <#if linkTxt.internalLink.getData()?has_content && is_signed_in> 
278                                    <a href="${linkTxt.internalLink.getData()}"> 
279                                <#elseif linkTxt.externalLink.getData()?has_content && is_signed_in> 
280                                    <a href="${linkTxt.externalLink.getData()}" target="_blank"> 
281                                <#else> 
282                                    <a onClick="openPopup('${loginURL}','','500', '650')"> 
283                                </#if> 
284                                    <span>${linkTxt.getData()}</span> 
285                                    </a> 
286                            </li> 
287                            </ul> 
288                        </#list> 
289                    </#if> 
290                </#list> 
291                <#if materialrelacionado.titulomaterial.getSiblings()?has_content> 
292                    <#list materialrelacionado.getSiblings() as material> 
293                        <#if material.getData()?? && material.getData() != ""> 
294                            <#assign file = dLFileEntryLocalService.getFileEntryByUuidAndGroupId(material.getData()?keep_after_last("/")?keep_before("?"),scopeGroupId) /> 
295                            <li class="resource-lis"> 
296                                <#if is_signed_in> 
297                                	<#if material.getData()?contains("?t")> 
298										<#assign materialUrl = material.getData()[0..(material.getData()?last_index_of("/") - 1)]/> 
299                                	<#else> 
300										<#assign materialUrl = material.getData()[0..material.getData()?length]/> 
301									</#if> 
302                                    <a href="${material.getData()}" target="_blank" onClick="addGTMEvent('contenido', 'descarga recursos', '${materialUrl}')"> 
303                                <#else> 
304                                    <a onClick="openPopup('${loginURL}','','500', '650')"> 
305                                </#if> 
306	                                <span>${material.titulomaterial.getData()}</span> 
307	                                <span> (${file.getMimeType()?keep_after_last("/")?upper_case} ${file.getSize()[0..(file.getSize()?length - 4)]}Kb)</span> 
308	                                </a> 
309                            </li> 
310                        </#if> 
311                    </#list> 
312                </#if> 
313                <#if descargable.getData()?has_content> 
314                    <div class = "row"> 
315                        <#if is_signed_in> 
316							<#if descargable.getData()?contains("?t")> 
317								<#assign descargableUrl = descargable.getData()[0..(descargable.getData()?last_index_of("/") - 1)]/> 
318                            <#else> 
319								<#assign descargableUrl = descargable.getData()[0..descargable.getData()?length]/> 
320							</#if> 
321                            <p class="center"><a href="${descargable.getData()}" class= "link-rec" onClick="addGTMEvent('contenido', 'descarga recursos', '${descargableUrl}')">${LiteralsToolsServiceUtil.getLiteral(scopeGroupId, language, "com.educaixa.download.all")}</a></p> 
322                        <#else> 
323                            <p class="center"><a onClick="openPopup('${loginURL}','','500', '650') class= "link-rec" ">${LiteralsToolsServiceUtil.getLiteral(scopeGroupId, language, "com.educaixa.download.all")}</a></p> 
324                        </#if> 
325                    </div> 
326			    </#if> 
327            </#if> 
328            <#-- EJEMPLOS DE USO --> 
329            <#if casosuso.getData()?has_content> 
330                <div class="bloque" id="ejemplos-uso-recurso"> 
331                    <h2 class="obj-rec-title">${LiteralsToolsServiceUtil.getLiteral(scopeGroupId, language, "com.educaixa.example.use")}</h2> 
332                    <div class="row" style="margin-top: 4%;"> 
333                        ${casosuso.getData()} 
334                    </div> 
335                </div> 
336            </#if> 
337        </div> 
338        <#-- Register content --> 
339		<#if journalArticleLocalService.fetchArticle(groupId, "CAPTACION_RECURSO") ??> 
340		<#assign register = journalArticleLocalService.getArticle(groupId, "CAPTACION_RECURSO")/>  
341			<#if register?? && register != ""> 
342	            <#assign registerContent = journalArticleLocalService.getArticleContent(register, register.DDMTemplateKey, "VIEW", themeDisplay.getLocale(), themeDisplay) />  
343	        </#if> 
344	        <#assign registerContent = journalArticleLocalService.getArticleContent(register, register.DDMTemplateKey, "VIEW", themeDisplay.getLocale(), themeDisplay) />  
345		  	<div class= "captacion-ficha"> 
346		  		${registerContent} 
347	  		</div> 
348	    </#if> 
349    </div> 
350</div> 
351 
352<script> 
353$( document ).ready(function() { 
354    initAddThis(); 
355}); 
356$( "#myModal .close" ).click(function() { 
357	$('#yt-modal').each(function(){ 
358	  this.contentWindow.postMessage('{"event":"command","func":"stopVideo","args":""}', '*') 
359	}); 
360}); 
361</script> 
0.0
Encara no hi ha cap comentari. Sigues el primer a enviar comentaris.

Valoració mitjana global sobre 5

Basada en 0 valoracions