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 322, column 120]

----
FTL stack trace ("~" means nesting-related):
	- Failed at: ${file.getSize()[0..(file.getSize()?l...  [in template "10154#10192#RECURSO-VIDEO" at line 322, 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 class="iframe-video" 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<#-- Video section --> 
176<#if docprincipal.getSiblings()?size gt 1 > 
177<#assign classIframe = "video-selected-recurso" /> 
178<div class="container info-video"> 
179    <#list docprincipal.getSiblings() as cur_docprincipal> 
180        <#assign siteMetaDoc = UtilsService.getDocumentMetadataInJSON(cur_docprincipal.getData(), themeDisplay) /> 
181        <#assign idioma = siteMetaDoc.get(0).idioma?keep_after('"')?keep_before('"') /> 
182        <div class="${classIframe} image-preview-video"> 
183        <img onClick='changeIframeUrl("${siteMetaDoc.get(0).brightcove_id}", "${idioma}");' src="http://img.youtube.com/vi/${siteMetaDoc.get(0).brightcove_id}/0.jpg"> 
184        </div> 
185        <#assign classIframe = "" /> 
186    </#list> 
187</div> 
188</#if> 
189 
190<#-- Categories section--> 
191<div class="container vertical info-view"> 
192    <div class="row"> 
193        <#if nivel_educativo?size != 0 > 
194            <div class="col-lg col-xs-6 col-sm"> 
195                <h2 class="purple-title">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.ficha.nivel.educativo")}</h2><br> 
196                <ul> 
197                    <#list nivel_educativo as item> 
198                        <li class="marked">${item}</li> 
199                    </#list> 
200                </ul> 
201	        </div> 
202        </#if> 
203        <#if area_conocimiento?size != 0 > 
204        	<div class="col-lg col-xs-6 col-sm"> 
205                <h2 class="purple-title">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.ficha.area.conocimiento")}</h2><br> 
206                <ul> 
207                    <#list area_conocimiento as item> 
208                        <li class="marked">${item}</li> 
209                    </#list> 
210                </ul> 
211        	</div> 
212        </#if> 
213        <#if area_conocimiento?size != 0 > 
214        	<div class="col-lg col-xs-6 col-sm"> 
215                <h2 class="purple-title">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.ficha.competencias")}</h2><br> 
216                <ul> 
217                    <#list competencias as item> 
218                        <li class="marked">${item}</li> 
219                    </#list> 
220                </ul> 
221	        </div> 
222        </#if> 
223        <#if siteMeta?? && siteMeta.get(0).idioma?has_content> 
224        	<div class="col-lg col-xs-6 col-sm"> 
225                <h2 class="purple-title">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.ficha.idioma")}</h2><br> 
226                <ul> 
227                    <#assign idioma = siteMeta.get(0).idioma?keep_after('"')?keep_before('"') /> 
228                    <li class="marked idiomaList">${idioma} </li> 
229                </ul> 
230	        </div> 
231        </#if>         
232    </div> 
233    <hr class="line-12">  
234</div> 
235 
236<#-- Content section--> 
237<div class="container vertical info-content"> 
238    <div class="row"> 
239        <div class="col-lg-7 col-xs-12"> 
240            <#if introduccion?has_content> 
241                <h2 class="obj-rec-title"> 
242                    <b style="color: #7B2FA1;">${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.recurso.descripcion")}</b> 
243                </h2> 
244                <p class="description-text-rec"> 
245                    ${introduccion.getData()} 
246                </p> 
247            </#if> 
248                        <#if objetivosdidacticos?has_content> 
249                <h2 class="obj-rec-title"> 
250                    <b>${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.recurso.objetivos")}</b> 
251                </h2> 
252                <div class="row" style="margin-top: 4%;"> 
253                    ${objetivosdidacticos.getData()} 
254                </div> 
255            </#if> 
256            <#-- Si las competencias del programa no incluyen dimensiones y/o subcompetencias, el modulo se sustituye por uno como el de objetivos!!!!!!--> 
257            <#if competenceGeneralDescription.getSiblings()?has_content> 
258                <div class="compet-rec-dropdown"> 
259                    <#if competenceGeneralDescription.getData()?has_content> 
260                        <h2 class="obj-rec-title"> 
261		                    <b>${competenceGeneralDescription.getData()}</b> 
262		                </h2> 
263		                <div class="compet-rec-dropdown"> 
264		                    <#-- 
265		                    Por ahora no está el campo relleno. HAbilitar cuando se solicite   
266		                    <li class="compet-rec-sub accordion">${competenceGeneralDescription.competenceTitle.getData()}</li>--> 
267		                    <div class="compet-rec-sub-info panel">${competenceGeneralDescription.competenceTitle.competenceDesc.getData()}</div> 
268		                </div> 
269                    </#if> 
270                </div> 
271            </#if> 
272            <#if otrainfodidactica.getData()?has_content> 
273                <h2 class="obj-rec-title"> 
274                    ${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.recurso.sobre")} 
275                </h2> 
276                <p class="desc-rec">${otrainfodidactica.getData()}</p> 
277            </#if> 
278            <#-- MATERIALES Y DESCARGAS -->	 
279            <#if materialrelacionado.getData()?has_content || linkTxt.getSiblings()?has_content || materialrelacionado.titulomaterial.getSiblings()?has_content > 
280                <h2 class="obj-rec-title"> 
281                    ${LiteralsToolsServiceUtil.getLiteral(groupId, language, "com.educaixa.seccion.recurso.material.relacionado")} 
282                </h2> 
283                <#list materialrelacionado.getSiblings() as fileText> 
284                    <#if materialesTexto.getData()?has_content> 
285                        <div> 
286                            ${materialesTexto.getData()} 
287                        </div> 
288                    </#if> 
289                    <#if linkTxt.internalLink.getData()?has_content> 
290                        <#list linkTxt.getSiblings() as linkTxt> 
291                            <li class="resource-lis"> 
292                                <#if linkTxt.internalLink.getData()?has_content && is_signed_in> 
293                                    <a href="${linkTxt.internalLink.getData()}"> 
294                                <#elseif linkTxt.externalLink.getData()?has_content && is_signed_in> 
295                                    <a href="${linkTxt.externalLink.getData()}" target="_blank"> 
296                                <#else> 
297                                    <a onClick="openPopup('${loginURL}','','500', '650')"> 
298                                </#if> 
299                                    <span>${linkTxt.getData()}</span> 
300                                    </a> 
301                            </li> 
302                            </ul> 
303                        </#list> 
304                    </#if> 
305                </#list> 
306                <#if materialrelacionado.titulomaterial.getSiblings()?has_content> 
307                    <#list materialrelacionado.getSiblings() as material> 
308                        <#if material.getData()?? && material.getData() != ""> 
309                            <#assign file = dLFileEntryLocalService.getFileEntryByUuidAndGroupId(material.getData()?keep_after_last("/")?keep_before("?"),scopeGroupId) /> 
310                            <li class="resource-lis"> 
311                                <#if is_signed_in> 
312                                	<#if material.getData()?contains("?t")> 
313										<#assign materialUrl = material.getData()[0..(material.getData()?last_index_of("/") - 1)]/> 
314                                	<#else> 
315										<#assign materialUrl = material.getData()[0..material.getData()?length]/> 
316									</#if> 
317                                    <a href="${material.getData()}" target="_blank" onClick="addGTMEvent('contenido', 'descarga recursos', '${materialUrl}')"> 
318                                <#else> 
319                                    <a onClick="openPopup('${loginURL}','','500', '650')"> 
320                                </#if> 
321	                                <span>${material.titulomaterial.getData()}</span> 
322	                                <span> (${file.getMimeType()?keep_after_last("/")?upper_case} ${file.getSize()[0..(file.getSize()?length - 4)]}Kb)</span> 
323	                                </a> 
324                            </li> 
325                        </#if> 
326                    </#list> 
327                </#if> 
328                <#if descargable.getData()?has_content> 
329                    <div class = "row"> 
330                        <#if is_signed_in> 
331							<#if descargable.getData()?contains("?t")> 
332								<#assign descargableUrl = descargable.getData()[0..(descargable.getData()?last_index_of("/") - 1)]/> 
333                            <#else> 
334								<#assign descargableUrl = descargable.getData()[0..descargable.getData()?length]/> 
335							</#if> 
336                            <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> 
337                        <#else> 
338                            <p class="center"><a onClick="openPopup('${loginURL}','','500', '650') class= "link-rec" ">${LiteralsToolsServiceUtil.getLiteral(scopeGroupId, language, "com.educaixa.download.all")}</a></p> 
339                        </#if> 
340                    </div> 
341			    </#if> 
342            </#if> 
343            <#-- EJEMPLOS DE USO --> 
344            <#if casosuso.getData()?has_content> 
345                <div class="bloque" id="ejemplos-uso-recurso"> 
346                    <h2 class="obj-rec-title">${LiteralsToolsServiceUtil.getLiteral(scopeGroupId, language, "com.educaixa.example.use")}</h2> 
347                    <div class="row" style="margin-top: 4%;"> 
348                        ${casosuso.getData()} 
349                    </div> 
350                </div> 
351            </#if> 
352        </div> 
353        <#-- Register content --> 
354		<#if journalArticleLocalService.fetchArticle(groupId, "CAPTACION_RECURSO") ??> 
355		<#assign register = journalArticleLocalService.getArticle(groupId, "CAPTACION_RECURSO")/>  
356			<#if register?? && register != ""> 
357	            <#assign registerContent = journalArticleLocalService.getArticleContent(register, register.DDMTemplateKey, "VIEW", themeDisplay.getLocale(), themeDisplay) />  
358	        </#if> 
359	        <#assign registerContent = journalArticleLocalService.getArticleContent(register, register.DDMTemplateKey, "VIEW", themeDisplay.getLocale(), themeDisplay) />  
360		  	<div class= "captacion-ficha"> 
361		  		${registerContent} 
362	  		</div> 
363	    </#if> 
364    </div> 
365</div> 
366 
367<script> 
368$( document ).ready(function() { 
369    initAddThis(); 
370    var searchParams = new URLSearchParams(window.location.search); 
371    var countImg = $(".image-preview-video img").length; 
372    if(searchParams.has('v')){ 
373        var valueParam = searchParams.get('v'); 
374        if(valueParam > 1 && valueParam <= countImg){ 
375            $(".image-preview-video:nth-child("+ valueParam +") img").click(); 
376
377
378     
379    var recursoTitle = document.getElementsByTagName('title')[0].innerHTML; 
380    window.dataLayer = window.dataLayer || []; 
381     dataLayer.push({ 
382         'event': 'CG',  
383         'eventCategory': 'recurso | video', 
384         'eventAction': recursoTitle 
385     }) 
386     
387     
388}); 
389$( "#myModal .close" ).click(function() { 
390	$('#yt-modal').each(function(){ 
391	  this.contentWindow.postMessage('{"event":"command","func":"stopVideo","args":""}', '*') 
392	}); 
393}); 
394 
395$(".image-preview-video").click(function() { 
396    $('.video-selected-recurso').removeClass("video-selected-recurso"); 
397    $(this).addClass("video-selected-recurso"); 
398}); 
399 
400function changeIframeUrl(idVideo, idioma){ 
401    var urlIframe = $('.iframe-video').attr("src"); 
402    var count = urlIframe.indexOf("embed/"); 
403    var urlIframeReplace = urlIframe.substring(count); 
404    count = urlIframeReplace.indexOf("/"); 
405    urlIframeReplace = urlIframeReplace.substring(count+1); 
406    count = urlIframeReplace.indexOf("?"); 
407    urlIframeReplace = urlIframeReplace.substring(0,count); 
408    urlIframe = urlIframe.replace(urlIframeReplace,idVideo); 
409    $('.iframe-video').attr("src", urlIframe); 
410    var urlIframePopup = $('#yt-modal').attr("src"); 
411    urlIframePopup = urlIframePopup.replace(urlIframeReplace, idVideo); 
412    $('#yt-modal').attr("src", urlIframePopup); 
413    $(".iframe-video")[0].scrollIntoView() 
414    $(".idiomaList").text(idioma); 
415
416</script> 
417 
418<style> 
419.video-selected-recurso{ 
420    border: 5px solid #7B2FA1; 
421
422.image-preview-video{ 
423    max-width: 15%;  
424    margin-right: 1%; 
425
426.image-preview-video img{ 
427    cursor: pointer; 
428
429.info-video{ 
430    margin-top: 10px;  
431    margin-bottom: 10px;  
432    display:flex; 
433
434@media only screen and (max-width: 1024px) { 
435    .image-preview-video{ 
436        max-width: 50%;  
437        margin-right: 1%; 
438        margin: auto; 
439        margin-top: 10px; 
440
441    .info-video{ 
442        display:block; 
443
444
445</style> 
0.0
Encara no hi ha cap comentari. Sigues el primer a enviar comentaris.

Valoració mitjana global sobre 5

Basada en 0 valoracions