Indietro

PROGETTI DI LEGGE - TESTO ALTO

Si è verificato un errore nell'elaborarazione del modello.
The following has evaluated to null or missing:
==> documentArray[5]  [in template "20099#20135#53519" at line 24, column 37]

----
Tip: It's the final [] step that caused this error, not those before it.
----
Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign uuid = documentArray[5]?keep_...  [in template "20099#20135#53519" at line 24, column 21]
----
1<#assign fileEntry = serviceLocator.findService( 
2"com.liferay.document.library.kernel.service.DLFileEntryLocalService") /> 
3<#assign imagePathTheme = themeDisplay.getPathThemeImages() /> 
4<#if podcast?? && podcast?has_content && validator.isNotNull(podcast.data)> 
5<div class="pubblicazione" id="pubblicazione${randomNamespace}"> 
6    <div class="top-part row"> 
7        <div  
8            class="image"  
9            style="background-image:url('${imagePathTheme}/vendor/background/ANIA-podcast-4.jpg')" 
10
11        </div> 
12    </div> 
13<audio class="audio" id="audio${randomNamespace}"> 
14<source src="${podcast.getData()}" /> 
15</audio> 
16</#if> 
17     
18    <div class="main-part row"> 
19        <div class="ania-wrapper pubblicazione-content"> 
20            <#if titolo.getData()!=""> 
21                <div class="title"> 
22                    <h3 class="section-title">${titolo.getData()}</h3> 
23                     <#assign documentArray = documento.getData()?split("/")/> 
24                    <#assign uuid = documentArray[5]?keep_before("?")/> 
25 
26                    <#assign file = fileEntry.getFileEntryByUuidAndGroupId(uuid, groupId) /> 
27 
28                    <#assign docType = file.getExtension()?trim /> 
29 
30                    <#if docType != "pdf" && 
31                        docType != "xls" && 
32                        docType != "xlsx" && 
33                        docType != "zip" && 
34                        docType != "rar" && 
35                        docType != "7z" 
36
37                        <#assign docType = "generic_file" /> 
38                    </#if> 
39 
40                    <a 
41                        class="btn btn-primary card-icon download-button" 
42                        href="${documento.getData()}" 
43                        target="blank" 
44
45                        Apri 
46                        <#if docType != "generic_file"> 
47                            <img 
48                                alt="${docType}" 
49                                class="media-type-icon " 
50                                src="${imagePathTheme}/vendor/files/${docType}.svg" 
51                                width="20" 
52                            /> 
53                        </#if> 
54                    </a> 
55                </div> 
56            </#if> 
57            <#if testo.getData()!=""> 
58                <p class="bottom-summary"> 
59                    ${testo.getData()} 
60                </p> 
61            </#if> 
62<#if podcast?? && podcast?has_content && validator.isNotNull(podcast.data)> 
63            <div class="player"> 
64                <div class="audio-title"><span>Ascolta e scarica il podcast</span></div> 
65                <img  
66                    class="audio-button open-modal-audio"  
67                    data-media-url="${podcast.getData()?trim}"  
68                    src="/o/ania-theme/images/play.png"  
69                    alt="play" 
70                /> 
71                <a href="${podcast.getData()?html}"> 
72                    <img class="audio-button audio-download" src="/o/ania-theme/images/download.png"/> 
73                </a> 
74            </div> 
75            </#if> 
76            <p class="duration"> 
77            </p> 
78        </div> 
79    </div> 
80</div> 
81<div id="overlay"> 
82    <div class="close"></div> 
83    <div class="overlay-content"></div> 
84</div> 
85 
86<script> 
87    ;(function() { 
88 
89        var $openModalAudioButtons = $("#pubblicazione${randomNamespace} .open-modal-audio"); 
90 
91        $openModalAudioButtons.each(function() { 
92            var $button = $(this); 
93            var audioUrl = $button.data("media-url"); 
94            $button.click(function(e) { 
95                e.preventDefault(); 
96                openModalAudio(audioUrl); 
97            }); 
98        }); 
99 
100        $(document).ready(function(){ 
101            var audioElement = $("#audio${randomNamespace}") 
102            audioElement.on("canplay",function(){ 
103                var duration = document.getElementById("audio${randomNamespace}").duration; 
104                var minutes = Math.floor(duration / 60); 
105                var seconds = duration - minutes * 60; 
106                seconds= parseInt(seconds, 10) 
107                $(".duration").html(minutes+":"+seconds); 
108            }); 
109            var audioElementHtml = document.getElementById("audio${randomNamespace}"); 
110            if (audioElementHtml.readyState > 3) { 
111                var duration = audioElementHtml.duration; 
112                var minutes = Math.floor(duration / 60); 
113                var seconds = duration - minutes * 60; 
114                seconds= parseInt(seconds, 10) 
115                $(".duration").html(minutes+":"+seconds); 
116
117        }); 
118 
119        function openModalAudio(audioId) { 
120            var audioHtml = '<audio controls autoplay><source src=' + audioId.toString() + '></audio>'; 
121            var overlay = $('#overlay .overlay-content'); 
122 
123            var overlayParent = $('#overlay'); 
124            var overlay = overlayParent.find('.overlay-content'); 
125 
126            overlay.append(audioHtml); 
127 
128            overlayParent.addClass('show'); 
129 
130            var btnClose = $('#overlay .close'); 
131                btnClose.click(function() { 
132                overlayParent.removeClass('show'); 
133                overlay.empty(); 
134            }); 
135
136    })(); 
137</script>