An error occurred while processing the template.
The following has evaluated to null or missing:
==> publicationNote [in template "20098#20124#2513884" at line 102, column 86]
----
Tip: If the failing expression is known to 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: #if publicationNote.getData()?has_con... [in template "20098#20124#2513884" at line 102, column 81]
----
1<div data-analytics-asset-type="document"
2 data-analytics-asset-id="publications-downloaded"
3 data-analytics-asset-title="Publications Downloaded"
4 data-analytics-asset-action="download">
5
6<#assign catLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")
7 JournalArticleService=serviceLocator.findService("com.liferay.journal.service.JournalArticleResourceLocalService")
8 resourcePrimKey=JournalArticleService.getArticleResourcePrimKey(groupId, .vars['reserved-article-id'].data)
9 articleCatNames=catLocalService.getCategories("com.liferay.journal.model.JournalArticle", resourcePrimKey)
10 dlFileEntryService=serviceLocator.findService('com.liferay.document.library.kernel.service.DLFileEntryService')
11 assetVocabularyLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")
12 dlAppLocalServiceUtil=staticUtil["com.liferay.document.library.kernel.service.DLAppLocalServiceUtil"]
13 dlUtil=staticUtil["com.liferay.document.library.kernel.util.DLUtil"]
14 statisticVocabulary=assetVocabularyLocalService.getGroupVocabulary(groupId?long,"statistics")
15 assetCategoryPropService=serviceLocator.findService("com.liferay.asset.category.property.service.AssetCategoryPropertyLocalService") />
16 <#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
17
18
19<#assign journalArticleTitle=.vars['reserved-article-title'].data />
20<#assign journalArticleDisplayDate=.vars['reserved-article-display-date'].data />
21
22
23
24
25<#assign themeColor="d29c4b" imgUrl="${themeDisplay.getPathThemeImages()}/publications/005.jpg"
26 categoryDisplay="Economic" />
27<#if (articleCatNames?size > 0)>
28 <#list articleCatNames as category>
29 <#if category.parentCategoryId==0>
30 <#if category.getVocabularyId()==statisticVocabulary.getVocabularyId()>
31 <#assign assetThemeCategoryId=category.categoryId?long />
32 <#assign
33 themeColor=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"theme_color").getValue()
34 themeIconId=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"theme_icon_id").getValue()
35 themeImgId=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"portfolio-image").getValue() />
36
37 <#if themeImgId!="0">
38 <#assign imgDlFile=dlAppLocalServiceUtil.getFileEntry(themeImgId?number)
39 imgUrl=dlUtil.getPreviewURL(imgDlFile, imgDlFile.getFileVersion(), themeDisplay, '' ) />
40 </#if>
41 <#list category.name?split(" ") as catWords>
42 <#assign categoryDisplay = catWords/>
43 <#break>
44 </#list>
45 <#assign categoryDisplay = category.titleCurrentValue/>
46 </#if>
47 </#if>
48 </#list>
49
50 </#if>
51
52
53<#if file_upload.getSiblings()?has_content>
54
55 <#list file_upload.getSiblings() as medias>
56 <#if medias.getData()?has_content >
57
58 <div class=" row mb-3 mx-0 bg-white d-flex w-100 align-items-center h-100 border rounded">
59 <div class="col-lg-1 p-0 ">
60 <div class="icon d-flex text-center px-2 py-3" style="background: #eee">
61 <div class="align-self-center mx-auto d-flex flex-column">
62 <img src="/documents/d/guest/${themeIconId}" height="30">
63 <label class="small mx-auto mb-0" style="color: #${themeColor} ;">
64 ${categoryDisplay}
65 </label>
66 </div>
67 </div>
68 </div>
69
70 <div class="col-8">
71 <p class="mb-0 py-3 publication-p">${journalArticleTitle}</p>
72 <div class="dates_inside_wrapper">
73
74<div class="dates_inside">
75<img height="16" src="https://scad.gov.ae/documents/d/guest/release_icon" class="pe-2" style="filter: invert(1); padding-inline-end: 2px; padding-bottom:3px;">
76
77 <div>
78 Release Date:
79<#assign releaseDate = .vars["reserved-article-display-date"].data?date("EEE, dd MMM yyyy HH:mm:ss Z") />
80${releaseDate?string("yyyy-MM-dd")}
81 </div>
82 </div>
83 <#assign publicationArticle = JournalArticleLocalService.getArticle(groupId, .vars["reserved-article-id"].data) />
84<#assign revisionDate = publicationArticle.getExpandoBridge().getAttribute("revisionDate")/>
85 <#assign formattedRevDate = revisionDate?string("yyyy-MM-dd")>
86 <#if formattedRevDate != "1888-01-01">
87 <div class="dates_inside">
88 <img height="16" src="https://scad.gov.ae/documents/d/guest/revision_icon" class="pe-2" style="filter: invert(1); padding-inline-end: 2px; padding-bottom:3px;">
89
90<div>Revision Date:
91 ${revisionDate?string("yyyy-MM-dd")}
92 </div>
93 </div>
94 </#if>
95
96
97
98
99 </div>
100
101 <#assign articleId = .vars["reserved-article-id"].data?number>
102 <#if publicationNote.getData()?has_content >
103 <div class="dates_inside_wrapper p-1">
104 <img src="https://scad.gov.ae/documents/d/guest/information-circle-svgrepo-com" height="20" width="20">
105 ${publicationNote.getData()}
106 </div>
107</#if>
108
109
110
111
112 </div>
113
114 <div class="col-3 d-flex align-items-center justify-content-end">
115
116
117 <div class="my-2 right-icons d-flex align-items-center ">
118 <#if file_upload.getSiblings()?has_content>
119 <#list file_upload.getSiblings() as media>
120 <#if media.getData()?has_content>
121
122 <#assign counter=0>
123 <#list "${media.getData()}" ?split("/") as mediaDataSplit>
124 <#if counter==5>
125 <#list mediaDataSplit?split("?") as uuId>
126 <#assign uuid=uuId />
127 <#break>
128 </#list>
129 </#if>
130 <#assign counter=counter+1>
131 </#list>
132 <#if uuid??>
133 <#assign file=dlFileEntryService.getFileEntryByUuidAndGroupId(uuid,groupId)>
134 <#assign fileExtension=file.extension>
135 <#assign fileSize = file.size >
136 <#assign fileSizeInMB = (file.size / 1024 / 1024)?string('0.##')>
137 <#if fileExtension=="">
138 <#list "${file.fileName}" ?split(".") as extention>
139 <#if extention?is_last>
140 <#assign fileExtension=extention>
141 <#break>
142 </#if>
143 </#list>
144 </#if>
145 <#if media.getData()?has_content>
146
147
148 <#if fileExtension=="pdf" || fileExtension=="PDF">
149 <a class="ml-2" href="${media.getData()}" target="blank"
150 style="order:1" onclick="trackDownload(event, '${file.fileName}')">
151 <li class="list-item list-inline-item d-flex flex-column">
152 <img src=${themeDisplay.getPathThemeImages()}/publications/pdf-svgrepo-com.svg
153 class="d-flex mx-auto align-self-center" />
154 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
155 </li>
156 </a>
157
158 <#elseif fileExtension=="xls" || fileExtension=="XLS" ||
159 fileExtension=="xlsx" || fileExtension=="XLSX">
160 <a class="ml-2" href="${media.getData()}" target="blank"
161 style="order:2" onclick="trackDownload(event, '${file.fileName}')">
162 <li class="list-item list-inline-item d-flex flex-column">
163
164 <img src=${themeDisplay.getPathThemeImages()}/publications/excel-svgrepo-com.svg
165 class="d-flex mx-auto align-self-center" />
166 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
167 </li>
168 </a>
169
170 <#else>
171
172 <a class="ml-2" href="${media.getData()}" target="blank"
173 style="order:3" onclick="trackDownload(event, '${file.fileName}')">
174 <li class="list-item list-inline-item d-flex flex-column">
175
176 <img src="https://scad.gov.ae/documents/d/guest/docx-1-"
177 class="d-flex mx-auto align-self-center" style="height:25px;" />
178 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
179
180 </li>
181 </a>
182
183 </#if>
184
185
186 </#if>
187 </#if>
188 </#if>
189 </#list>
190 </#if>
191 </div>
192 </div>
193 </div>
194
195
196
197<#break>
198
199 </#if>
200</#list>
201</#if>
202<style>.dates_inside_wrapper{
203
204display: flex;
205 gap: 5px;
206 align-items: center;
207 font-size: 13px;
208 flex-direction: row;
209 gap: 20px;
210}
211
212.dates_inside {
213
214 display: flex;
215 gap: 5px;
216 align-items: center;
217
218 padding: 4px 10px;
219 color: #616060;
220 border-radius: 5px;
221
222}
223.file-size{padding :5px;}</style>
224<script>
225var dateString = '${.vars["reserved-article-display-date"].data}';
226
227// Convert the string into a Date object
228var date = new Date(dateString);
229
230// Format the date to "dd MMM yyyy" (e.g., "02 Feb 2024")
231var formattedDate = date.toLocaleDateString('en-GB', {
232 day: '2-digit',
233 month: 'short',
234 year: 'numeric'
235});
236
237// Set the formatted date into the HTML
238document.querySelector('.publications-display').innerHTML = formattedDate;
239function trackDownload(event, fileName) {
240 console.log("INSIDE TRACKING DOWNLOADS");
241
242 // Check if fileName is correctly passed
243 if (fileName) {
244 console.log("File Name: " + fileName);
245 Analytics.track('trackPublicationDownloads', {
246 'fileName': fileName
247 });
248 } else {
249 console.log("Error: File name is missing or incorrect.");
250 }
251
252 console.log("INSIDE TRACKER");
253}
254</script>
An error occurred while processing the template.
The following has evaluated to null or missing:
==> publicationNote [in template "20098#20124#2513884" at line 102, column 86]
----
Tip: If the failing expression is known to 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: #if publicationNote.getData()?has_con... [in template "20098#20124#2513884" at line 102, column 81]
----
1<div data-analytics-asset-type="document"
2 data-analytics-asset-id="publications-downloaded"
3 data-analytics-asset-title="Publications Downloaded"
4 data-analytics-asset-action="download">
5
6<#assign catLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")
7 JournalArticleService=serviceLocator.findService("com.liferay.journal.service.JournalArticleResourceLocalService")
8 resourcePrimKey=JournalArticleService.getArticleResourcePrimKey(groupId, .vars['reserved-article-id'].data)
9 articleCatNames=catLocalService.getCategories("com.liferay.journal.model.JournalArticle", resourcePrimKey)
10 dlFileEntryService=serviceLocator.findService('com.liferay.document.library.kernel.service.DLFileEntryService')
11 assetVocabularyLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")
12 dlAppLocalServiceUtil=staticUtil["com.liferay.document.library.kernel.service.DLAppLocalServiceUtil"]
13 dlUtil=staticUtil["com.liferay.document.library.kernel.util.DLUtil"]
14 statisticVocabulary=assetVocabularyLocalService.getGroupVocabulary(groupId?long,"statistics")
15 assetCategoryPropService=serviceLocator.findService("com.liferay.asset.category.property.service.AssetCategoryPropertyLocalService") />
16 <#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
17
18
19<#assign journalArticleTitle=.vars['reserved-article-title'].data />
20<#assign journalArticleDisplayDate=.vars['reserved-article-display-date'].data />
21
22
23
24
25<#assign themeColor="d29c4b" imgUrl="${themeDisplay.getPathThemeImages()}/publications/005.jpg"
26 categoryDisplay="Economic" />
27<#if (articleCatNames?size > 0)>
28 <#list articleCatNames as category>
29 <#if category.parentCategoryId==0>
30 <#if category.getVocabularyId()==statisticVocabulary.getVocabularyId()>
31 <#assign assetThemeCategoryId=category.categoryId?long />
32 <#assign
33 themeColor=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"theme_color").getValue()
34 themeIconId=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"theme_icon_id").getValue()
35 themeImgId=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"portfolio-image").getValue() />
36
37 <#if themeImgId!="0">
38 <#assign imgDlFile=dlAppLocalServiceUtil.getFileEntry(themeImgId?number)
39 imgUrl=dlUtil.getPreviewURL(imgDlFile, imgDlFile.getFileVersion(), themeDisplay, '' ) />
40 </#if>
41 <#list category.name?split(" ") as catWords>
42 <#assign categoryDisplay = catWords/>
43 <#break>
44 </#list>
45 <#assign categoryDisplay = category.titleCurrentValue/>
46 </#if>
47 </#if>
48 </#list>
49
50 </#if>
51
52
53<#if file_upload.getSiblings()?has_content>
54
55 <#list file_upload.getSiblings() as medias>
56 <#if medias.getData()?has_content >
57
58 <div class=" row mb-3 mx-0 bg-white d-flex w-100 align-items-center h-100 border rounded">
59 <div class="col-lg-1 p-0 ">
60 <div class="icon d-flex text-center px-2 py-3" style="background: #eee">
61 <div class="align-self-center mx-auto d-flex flex-column">
62 <img src="/documents/d/guest/${themeIconId}" height="30">
63 <label class="small mx-auto mb-0" style="color: #${themeColor} ;">
64 ${categoryDisplay}
65 </label>
66 </div>
67 </div>
68 </div>
69
70 <div class="col-8">
71 <p class="mb-0 py-3 publication-p">${journalArticleTitle}</p>
72 <div class="dates_inside_wrapper">
73
74<div class="dates_inside">
75<img height="16" src="https://scad.gov.ae/documents/d/guest/release_icon" class="pe-2" style="filter: invert(1); padding-inline-end: 2px; padding-bottom:3px;">
76
77 <div>
78 Release Date:
79<#assign releaseDate = .vars["reserved-article-display-date"].data?date("EEE, dd MMM yyyy HH:mm:ss Z") />
80${releaseDate?string("yyyy-MM-dd")}
81 </div>
82 </div>
83 <#assign publicationArticle = JournalArticleLocalService.getArticle(groupId, .vars["reserved-article-id"].data) />
84<#assign revisionDate = publicationArticle.getExpandoBridge().getAttribute("revisionDate")/>
85 <#assign formattedRevDate = revisionDate?string("yyyy-MM-dd")>
86 <#if formattedRevDate != "1888-01-01">
87 <div class="dates_inside">
88 <img height="16" src="https://scad.gov.ae/documents/d/guest/revision_icon" class="pe-2" style="filter: invert(1); padding-inline-end: 2px; padding-bottom:3px;">
89
90<div>Revision Date:
91 ${revisionDate?string("yyyy-MM-dd")}
92 </div>
93 </div>
94 </#if>
95
96
97
98
99 </div>
100
101 <#assign articleId = .vars["reserved-article-id"].data?number>
102 <#if publicationNote.getData()?has_content >
103 <div class="dates_inside_wrapper p-1">
104 <img src="https://scad.gov.ae/documents/d/guest/information-circle-svgrepo-com" height="20" width="20">
105 ${publicationNote.getData()}
106 </div>
107</#if>
108
109
110
111
112 </div>
113
114 <div class="col-3 d-flex align-items-center justify-content-end">
115
116
117 <div class="my-2 right-icons d-flex align-items-center ">
118 <#if file_upload.getSiblings()?has_content>
119 <#list file_upload.getSiblings() as media>
120 <#if media.getData()?has_content>
121
122 <#assign counter=0>
123 <#list "${media.getData()}" ?split("/") as mediaDataSplit>
124 <#if counter==5>
125 <#list mediaDataSplit?split("?") as uuId>
126 <#assign uuid=uuId />
127 <#break>
128 </#list>
129 </#if>
130 <#assign counter=counter+1>
131 </#list>
132 <#if uuid??>
133 <#assign file=dlFileEntryService.getFileEntryByUuidAndGroupId(uuid,groupId)>
134 <#assign fileExtension=file.extension>
135 <#assign fileSize = file.size >
136 <#assign fileSizeInMB = (file.size / 1024 / 1024)?string('0.##')>
137 <#if fileExtension=="">
138 <#list "${file.fileName}" ?split(".") as extention>
139 <#if extention?is_last>
140 <#assign fileExtension=extention>
141 <#break>
142 </#if>
143 </#list>
144 </#if>
145 <#if media.getData()?has_content>
146
147
148 <#if fileExtension=="pdf" || fileExtension=="PDF">
149 <a class="ml-2" href="${media.getData()}" target="blank"
150 style="order:1" onclick="trackDownload(event, '${file.fileName}')">
151 <li class="list-item list-inline-item d-flex flex-column">
152 <img src=${themeDisplay.getPathThemeImages()}/publications/pdf-svgrepo-com.svg
153 class="d-flex mx-auto align-self-center" />
154 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
155 </li>
156 </a>
157
158 <#elseif fileExtension=="xls" || fileExtension=="XLS" ||
159 fileExtension=="xlsx" || fileExtension=="XLSX">
160 <a class="ml-2" href="${media.getData()}" target="blank"
161 style="order:2" onclick="trackDownload(event, '${file.fileName}')">
162 <li class="list-item list-inline-item d-flex flex-column">
163
164 <img src=${themeDisplay.getPathThemeImages()}/publications/excel-svgrepo-com.svg
165 class="d-flex mx-auto align-self-center" />
166 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
167 </li>
168 </a>
169
170 <#else>
171
172 <a class="ml-2" href="${media.getData()}" target="blank"
173 style="order:3" onclick="trackDownload(event, '${file.fileName}')">
174 <li class="list-item list-inline-item d-flex flex-column">
175
176 <img src="https://scad.gov.ae/documents/d/guest/docx-1-"
177 class="d-flex mx-auto align-self-center" style="height:25px;" />
178 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
179
180 </li>
181 </a>
182
183 </#if>
184
185
186 </#if>
187 </#if>
188 </#if>
189 </#list>
190 </#if>
191 </div>
192 </div>
193 </div>
194
195
196
197<#break>
198
199 </#if>
200</#list>
201</#if>
202<style>.dates_inside_wrapper{
203
204display: flex;
205 gap: 5px;
206 align-items: center;
207 font-size: 13px;
208 flex-direction: row;
209 gap: 20px;
210}
211
212.dates_inside {
213
214 display: flex;
215 gap: 5px;
216 align-items: center;
217
218 padding: 4px 10px;
219 color: #616060;
220 border-radius: 5px;
221
222}
223.file-size{padding :5px;}</style>
224<script>
225var dateString = '${.vars["reserved-article-display-date"].data}';
226
227// Convert the string into a Date object
228var date = new Date(dateString);
229
230// Format the date to "dd MMM yyyy" (e.g., "02 Feb 2024")
231var formattedDate = date.toLocaleDateString('en-GB', {
232 day: '2-digit',
233 month: 'short',
234 year: 'numeric'
235});
236
237// Set the formatted date into the HTML
238document.querySelector('.publications-display').innerHTML = formattedDate;
239function trackDownload(event, fileName) {
240 console.log("INSIDE TRACKING DOWNLOADS");
241
242 // Check if fileName is correctly passed
243 if (fileName) {
244 console.log("File Name: " + fileName);
245 Analytics.track('trackPublicationDownloads', {
246 'fileName': fileName
247 });
248 } else {
249 console.log("Error: File name is missing or incorrect.");
250 }
251
252 console.log("INSIDE TRACKER");
253}
254</script>
An error occurred while processing the template.
The following has evaluated to null or missing:
==> publicationNote [in template "20098#20124#2513884" at line 102, column 86]
----
Tip: If the failing expression is known to 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: #if publicationNote.getData()?has_con... [in template "20098#20124#2513884" at line 102, column 81]
----
1<div data-analytics-asset-type="document"
2 data-analytics-asset-id="publications-downloaded"
3 data-analytics-asset-title="Publications Downloaded"
4 data-analytics-asset-action="download">
5
6<#assign catLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")
7 JournalArticleService=serviceLocator.findService("com.liferay.journal.service.JournalArticleResourceLocalService")
8 resourcePrimKey=JournalArticleService.getArticleResourcePrimKey(groupId, .vars['reserved-article-id'].data)
9 articleCatNames=catLocalService.getCategories("com.liferay.journal.model.JournalArticle", resourcePrimKey)
10 dlFileEntryService=serviceLocator.findService('com.liferay.document.library.kernel.service.DLFileEntryService')
11 assetVocabularyLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")
12 dlAppLocalServiceUtil=staticUtil["com.liferay.document.library.kernel.service.DLAppLocalServiceUtil"]
13 dlUtil=staticUtil["com.liferay.document.library.kernel.util.DLUtil"]
14 statisticVocabulary=assetVocabularyLocalService.getGroupVocabulary(groupId?long,"statistics")
15 assetCategoryPropService=serviceLocator.findService("com.liferay.asset.category.property.service.AssetCategoryPropertyLocalService") />
16 <#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
17
18
19<#assign journalArticleTitle=.vars['reserved-article-title'].data />
20<#assign journalArticleDisplayDate=.vars['reserved-article-display-date'].data />
21
22
23
24
25<#assign themeColor="d29c4b" imgUrl="${themeDisplay.getPathThemeImages()}/publications/005.jpg"
26 categoryDisplay="Economic" />
27<#if (articleCatNames?size > 0)>
28 <#list articleCatNames as category>
29 <#if category.parentCategoryId==0>
30 <#if category.getVocabularyId()==statisticVocabulary.getVocabularyId()>
31 <#assign assetThemeCategoryId=category.categoryId?long />
32 <#assign
33 themeColor=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"theme_color").getValue()
34 themeIconId=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"theme_icon_id").getValue()
35 themeImgId=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"portfolio-image").getValue() />
36
37 <#if themeImgId!="0">
38 <#assign imgDlFile=dlAppLocalServiceUtil.getFileEntry(themeImgId?number)
39 imgUrl=dlUtil.getPreviewURL(imgDlFile, imgDlFile.getFileVersion(), themeDisplay, '' ) />
40 </#if>
41 <#list category.name?split(" ") as catWords>
42 <#assign categoryDisplay = catWords/>
43 <#break>
44 </#list>
45 <#assign categoryDisplay = category.titleCurrentValue/>
46 </#if>
47 </#if>
48 </#list>
49
50 </#if>
51
52
53<#if file_upload.getSiblings()?has_content>
54
55 <#list file_upload.getSiblings() as medias>
56 <#if medias.getData()?has_content >
57
58 <div class=" row mb-3 mx-0 bg-white d-flex w-100 align-items-center h-100 border rounded">
59 <div class="col-lg-1 p-0 ">
60 <div class="icon d-flex text-center px-2 py-3" style="background: #eee">
61 <div class="align-self-center mx-auto d-flex flex-column">
62 <img src="/documents/d/guest/${themeIconId}" height="30">
63 <label class="small mx-auto mb-0" style="color: #${themeColor} ;">
64 ${categoryDisplay}
65 </label>
66 </div>
67 </div>
68 </div>
69
70 <div class="col-8">
71 <p class="mb-0 py-3 publication-p">${journalArticleTitle}</p>
72 <div class="dates_inside_wrapper">
73
74<div class="dates_inside">
75<img height="16" src="https://scad.gov.ae/documents/d/guest/release_icon" class="pe-2" style="filter: invert(1); padding-inline-end: 2px; padding-bottom:3px;">
76
77 <div>
78 Release Date:
79<#assign releaseDate = .vars["reserved-article-display-date"].data?date("EEE, dd MMM yyyy HH:mm:ss Z") />
80${releaseDate?string("yyyy-MM-dd")}
81 </div>
82 </div>
83 <#assign publicationArticle = JournalArticleLocalService.getArticle(groupId, .vars["reserved-article-id"].data) />
84<#assign revisionDate = publicationArticle.getExpandoBridge().getAttribute("revisionDate")/>
85 <#assign formattedRevDate = revisionDate?string("yyyy-MM-dd")>
86 <#if formattedRevDate != "1888-01-01">
87 <div class="dates_inside">
88 <img height="16" src="https://scad.gov.ae/documents/d/guest/revision_icon" class="pe-2" style="filter: invert(1); padding-inline-end: 2px; padding-bottom:3px;">
89
90<div>Revision Date:
91 ${revisionDate?string("yyyy-MM-dd")}
92 </div>
93 </div>
94 </#if>
95
96
97
98
99 </div>
100
101 <#assign articleId = .vars["reserved-article-id"].data?number>
102 <#if publicationNote.getData()?has_content >
103 <div class="dates_inside_wrapper p-1">
104 <img src="https://scad.gov.ae/documents/d/guest/information-circle-svgrepo-com" height="20" width="20">
105 ${publicationNote.getData()}
106 </div>
107</#if>
108
109
110
111
112 </div>
113
114 <div class="col-3 d-flex align-items-center justify-content-end">
115
116
117 <div class="my-2 right-icons d-flex align-items-center ">
118 <#if file_upload.getSiblings()?has_content>
119 <#list file_upload.getSiblings() as media>
120 <#if media.getData()?has_content>
121
122 <#assign counter=0>
123 <#list "${media.getData()}" ?split("/") as mediaDataSplit>
124 <#if counter==5>
125 <#list mediaDataSplit?split("?") as uuId>
126 <#assign uuid=uuId />
127 <#break>
128 </#list>
129 </#if>
130 <#assign counter=counter+1>
131 </#list>
132 <#if uuid??>
133 <#assign file=dlFileEntryService.getFileEntryByUuidAndGroupId(uuid,groupId)>
134 <#assign fileExtension=file.extension>
135 <#assign fileSize = file.size >
136 <#assign fileSizeInMB = (file.size / 1024 / 1024)?string('0.##')>
137 <#if fileExtension=="">
138 <#list "${file.fileName}" ?split(".") as extention>
139 <#if extention?is_last>
140 <#assign fileExtension=extention>
141 <#break>
142 </#if>
143 </#list>
144 </#if>
145 <#if media.getData()?has_content>
146
147
148 <#if fileExtension=="pdf" || fileExtension=="PDF">
149 <a class="ml-2" href="${media.getData()}" target="blank"
150 style="order:1" onclick="trackDownload(event, '${file.fileName}')">
151 <li class="list-item list-inline-item d-flex flex-column">
152 <img src=${themeDisplay.getPathThemeImages()}/publications/pdf-svgrepo-com.svg
153 class="d-flex mx-auto align-self-center" />
154 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
155 </li>
156 </a>
157
158 <#elseif fileExtension=="xls" || fileExtension=="XLS" ||
159 fileExtension=="xlsx" || fileExtension=="XLSX">
160 <a class="ml-2" href="${media.getData()}" target="blank"
161 style="order:2" onclick="trackDownload(event, '${file.fileName}')">
162 <li class="list-item list-inline-item d-flex flex-column">
163
164 <img src=${themeDisplay.getPathThemeImages()}/publications/excel-svgrepo-com.svg
165 class="d-flex mx-auto align-self-center" />
166 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
167 </li>
168 </a>
169
170 <#else>
171
172 <a class="ml-2" href="${media.getData()}" target="blank"
173 style="order:3" onclick="trackDownload(event, '${file.fileName}')">
174 <li class="list-item list-inline-item d-flex flex-column">
175
176 <img src="https://scad.gov.ae/documents/d/guest/docx-1-"
177 class="d-flex mx-auto align-self-center" style="height:25px;" />
178 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
179
180 </li>
181 </a>
182
183 </#if>
184
185
186 </#if>
187 </#if>
188 </#if>
189 </#list>
190 </#if>
191 </div>
192 </div>
193 </div>
194
195
196
197<#break>
198
199 </#if>
200</#list>
201</#if>
202<style>.dates_inside_wrapper{
203
204display: flex;
205 gap: 5px;
206 align-items: center;
207 font-size: 13px;
208 flex-direction: row;
209 gap: 20px;
210}
211
212.dates_inside {
213
214 display: flex;
215 gap: 5px;
216 align-items: center;
217
218 padding: 4px 10px;
219 color: #616060;
220 border-radius: 5px;
221
222}
223.file-size{padding :5px;}</style>
224<script>
225var dateString = '${.vars["reserved-article-display-date"].data}';
226
227// Convert the string into a Date object
228var date = new Date(dateString);
229
230// Format the date to "dd MMM yyyy" (e.g., "02 Feb 2024")
231var formattedDate = date.toLocaleDateString('en-GB', {
232 day: '2-digit',
233 month: 'short',
234 year: 'numeric'
235});
236
237// Set the formatted date into the HTML
238document.querySelector('.publications-display').innerHTML = formattedDate;
239function trackDownload(event, fileName) {
240 console.log("INSIDE TRACKING DOWNLOADS");
241
242 // Check if fileName is correctly passed
243 if (fileName) {
244 console.log("File Name: " + fileName);
245 Analytics.track('trackPublicationDownloads', {
246 'fileName': fileName
247 });
248 } else {
249 console.log("Error: File name is missing or incorrect.");
250 }
251
252 console.log("INSIDE TRACKER");
253}
254</script>
An error occurred while processing the template.
The following has evaluated to null or missing:
==> publicationNote [in template "20098#20124#2513884" at line 102, column 86]
----
Tip: If the failing expression is known to 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: #if publicationNote.getData()?has_con... [in template "20098#20124#2513884" at line 102, column 81]
----
1<div data-analytics-asset-type="document"
2 data-analytics-asset-id="publications-downloaded"
3 data-analytics-asset-title="Publications Downloaded"
4 data-analytics-asset-action="download">
5
6<#assign catLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")
7 JournalArticleService=serviceLocator.findService("com.liferay.journal.service.JournalArticleResourceLocalService")
8 resourcePrimKey=JournalArticleService.getArticleResourcePrimKey(groupId, .vars['reserved-article-id'].data)
9 articleCatNames=catLocalService.getCategories("com.liferay.journal.model.JournalArticle", resourcePrimKey)
10 dlFileEntryService=serviceLocator.findService('com.liferay.document.library.kernel.service.DLFileEntryService')
11 assetVocabularyLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")
12 dlAppLocalServiceUtil=staticUtil["com.liferay.document.library.kernel.service.DLAppLocalServiceUtil"]
13 dlUtil=staticUtil["com.liferay.document.library.kernel.util.DLUtil"]
14 statisticVocabulary=assetVocabularyLocalService.getGroupVocabulary(groupId?long,"statistics")
15 assetCategoryPropService=serviceLocator.findService("com.liferay.asset.category.property.service.AssetCategoryPropertyLocalService") />
16 <#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
17
18
19<#assign journalArticleTitle=.vars['reserved-article-title'].data />
20<#assign journalArticleDisplayDate=.vars['reserved-article-display-date'].data />
21
22
23
24
25<#assign themeColor="d29c4b" imgUrl="${themeDisplay.getPathThemeImages()}/publications/005.jpg"
26 categoryDisplay="Economic" />
27<#if (articleCatNames?size > 0)>
28 <#list articleCatNames as category>
29 <#if category.parentCategoryId==0>
30 <#if category.getVocabularyId()==statisticVocabulary.getVocabularyId()>
31 <#assign assetThemeCategoryId=category.categoryId?long />
32 <#assign
33 themeColor=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"theme_color").getValue()
34 themeIconId=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"theme_icon_id").getValue()
35 themeImgId=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"portfolio-image").getValue() />
36
37 <#if themeImgId!="0">
38 <#assign imgDlFile=dlAppLocalServiceUtil.getFileEntry(themeImgId?number)
39 imgUrl=dlUtil.getPreviewURL(imgDlFile, imgDlFile.getFileVersion(), themeDisplay, '' ) />
40 </#if>
41 <#list category.name?split(" ") as catWords>
42 <#assign categoryDisplay = catWords/>
43 <#break>
44 </#list>
45 <#assign categoryDisplay = category.titleCurrentValue/>
46 </#if>
47 </#if>
48 </#list>
49
50 </#if>
51
52
53<#if file_upload.getSiblings()?has_content>
54
55 <#list file_upload.getSiblings() as medias>
56 <#if medias.getData()?has_content >
57
58 <div class=" row mb-3 mx-0 bg-white d-flex w-100 align-items-center h-100 border rounded">
59 <div class="col-lg-1 p-0 ">
60 <div class="icon d-flex text-center px-2 py-3" style="background: #eee">
61 <div class="align-self-center mx-auto d-flex flex-column">
62 <img src="/documents/d/guest/${themeIconId}" height="30">
63 <label class="small mx-auto mb-0" style="color: #${themeColor} ;">
64 ${categoryDisplay}
65 </label>
66 </div>
67 </div>
68 </div>
69
70 <div class="col-8">
71 <p class="mb-0 py-3 publication-p">${journalArticleTitle}</p>
72 <div class="dates_inside_wrapper">
73
74<div class="dates_inside">
75<img height="16" src="https://scad.gov.ae/documents/d/guest/release_icon" class="pe-2" style="filter: invert(1); padding-inline-end: 2px; padding-bottom:3px;">
76
77 <div>
78 Release Date:
79<#assign releaseDate = .vars["reserved-article-display-date"].data?date("EEE, dd MMM yyyy HH:mm:ss Z") />
80${releaseDate?string("yyyy-MM-dd")}
81 </div>
82 </div>
83 <#assign publicationArticle = JournalArticleLocalService.getArticle(groupId, .vars["reserved-article-id"].data) />
84<#assign revisionDate = publicationArticle.getExpandoBridge().getAttribute("revisionDate")/>
85 <#assign formattedRevDate = revisionDate?string("yyyy-MM-dd")>
86 <#if formattedRevDate != "1888-01-01">
87 <div class="dates_inside">
88 <img height="16" src="https://scad.gov.ae/documents/d/guest/revision_icon" class="pe-2" style="filter: invert(1); padding-inline-end: 2px; padding-bottom:3px;">
89
90<div>Revision Date:
91 ${revisionDate?string("yyyy-MM-dd")}
92 </div>
93 </div>
94 </#if>
95
96
97
98
99 </div>
100
101 <#assign articleId = .vars["reserved-article-id"].data?number>
102 <#if publicationNote.getData()?has_content >
103 <div class="dates_inside_wrapper p-1">
104 <img src="https://scad.gov.ae/documents/d/guest/information-circle-svgrepo-com" height="20" width="20">
105 ${publicationNote.getData()}
106 </div>
107</#if>
108
109
110
111
112 </div>
113
114 <div class="col-3 d-flex align-items-center justify-content-end">
115
116
117 <div class="my-2 right-icons d-flex align-items-center ">
118 <#if file_upload.getSiblings()?has_content>
119 <#list file_upload.getSiblings() as media>
120 <#if media.getData()?has_content>
121
122 <#assign counter=0>
123 <#list "${media.getData()}" ?split("/") as mediaDataSplit>
124 <#if counter==5>
125 <#list mediaDataSplit?split("?") as uuId>
126 <#assign uuid=uuId />
127 <#break>
128 </#list>
129 </#if>
130 <#assign counter=counter+1>
131 </#list>
132 <#if uuid??>
133 <#assign file=dlFileEntryService.getFileEntryByUuidAndGroupId(uuid,groupId)>
134 <#assign fileExtension=file.extension>
135 <#assign fileSize = file.size >
136 <#assign fileSizeInMB = (file.size / 1024 / 1024)?string('0.##')>
137 <#if fileExtension=="">
138 <#list "${file.fileName}" ?split(".") as extention>
139 <#if extention?is_last>
140 <#assign fileExtension=extention>
141 <#break>
142 </#if>
143 </#list>
144 </#if>
145 <#if media.getData()?has_content>
146
147
148 <#if fileExtension=="pdf" || fileExtension=="PDF">
149 <a class="ml-2" href="${media.getData()}" target="blank"
150 style="order:1" onclick="trackDownload(event, '${file.fileName}')">
151 <li class="list-item list-inline-item d-flex flex-column">
152 <img src=${themeDisplay.getPathThemeImages()}/publications/pdf-svgrepo-com.svg
153 class="d-flex mx-auto align-self-center" />
154 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
155 </li>
156 </a>
157
158 <#elseif fileExtension=="xls" || fileExtension=="XLS" ||
159 fileExtension=="xlsx" || fileExtension=="XLSX">
160 <a class="ml-2" href="${media.getData()}" target="blank"
161 style="order:2" onclick="trackDownload(event, '${file.fileName}')">
162 <li class="list-item list-inline-item d-flex flex-column">
163
164 <img src=${themeDisplay.getPathThemeImages()}/publications/excel-svgrepo-com.svg
165 class="d-flex mx-auto align-self-center" />
166 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
167 </li>
168 </a>
169
170 <#else>
171
172 <a class="ml-2" href="${media.getData()}" target="blank"
173 style="order:3" onclick="trackDownload(event, '${file.fileName}')">
174 <li class="list-item list-inline-item d-flex flex-column">
175
176 <img src="https://scad.gov.ae/documents/d/guest/docx-1-"
177 class="d-flex mx-auto align-self-center" style="height:25px;" />
178 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
179
180 </li>
181 </a>
182
183 </#if>
184
185
186 </#if>
187 </#if>
188 </#if>
189 </#list>
190 </#if>
191 </div>
192 </div>
193 </div>
194
195
196
197<#break>
198
199 </#if>
200</#list>
201</#if>
202<style>.dates_inside_wrapper{
203
204display: flex;
205 gap: 5px;
206 align-items: center;
207 font-size: 13px;
208 flex-direction: row;
209 gap: 20px;
210}
211
212.dates_inside {
213
214 display: flex;
215 gap: 5px;
216 align-items: center;
217
218 padding: 4px 10px;
219 color: #616060;
220 border-radius: 5px;
221
222}
223.file-size{padding :5px;}</style>
224<script>
225var dateString = '${.vars["reserved-article-display-date"].data}';
226
227// Convert the string into a Date object
228var date = new Date(dateString);
229
230// Format the date to "dd MMM yyyy" (e.g., "02 Feb 2024")
231var formattedDate = date.toLocaleDateString('en-GB', {
232 day: '2-digit',
233 month: 'short',
234 year: 'numeric'
235});
236
237// Set the formatted date into the HTML
238document.querySelector('.publications-display').innerHTML = formattedDate;
239function trackDownload(event, fileName) {
240 console.log("INSIDE TRACKING DOWNLOADS");
241
242 // Check if fileName is correctly passed
243 if (fileName) {
244 console.log("File Name: " + fileName);
245 Analytics.track('trackPublicationDownloads', {
246 'fileName': fileName
247 });
248 } else {
249 console.log("Error: File name is missing or incorrect.");
250 }
251
252 console.log("INSIDE TRACKER");
253}
254</script>
An error occurred while processing the template.
The following has evaluated to null or missing:
==> publicationNote [in template "20098#20124#2513884" at line 102, column 86]
----
Tip: If the failing expression is known to 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: #if publicationNote.getData()?has_con... [in template "20098#20124#2513884" at line 102, column 81]
----
1<div data-analytics-asset-type="document"
2 data-analytics-asset-id="publications-downloaded"
3 data-analytics-asset-title="Publications Downloaded"
4 data-analytics-asset-action="download">
5
6<#assign catLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")
7 JournalArticleService=serviceLocator.findService("com.liferay.journal.service.JournalArticleResourceLocalService")
8 resourcePrimKey=JournalArticleService.getArticleResourcePrimKey(groupId, .vars['reserved-article-id'].data)
9 articleCatNames=catLocalService.getCategories("com.liferay.journal.model.JournalArticle", resourcePrimKey)
10 dlFileEntryService=serviceLocator.findService('com.liferay.document.library.kernel.service.DLFileEntryService')
11 assetVocabularyLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")
12 dlAppLocalServiceUtil=staticUtil["com.liferay.document.library.kernel.service.DLAppLocalServiceUtil"]
13 dlUtil=staticUtil["com.liferay.document.library.kernel.util.DLUtil"]
14 statisticVocabulary=assetVocabularyLocalService.getGroupVocabulary(groupId?long,"statistics")
15 assetCategoryPropService=serviceLocator.findService("com.liferay.asset.category.property.service.AssetCategoryPropertyLocalService") />
16 <#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
17
18
19<#assign journalArticleTitle=.vars['reserved-article-title'].data />
20<#assign journalArticleDisplayDate=.vars['reserved-article-display-date'].data />
21
22
23
24
25<#assign themeColor="d29c4b" imgUrl="${themeDisplay.getPathThemeImages()}/publications/005.jpg"
26 categoryDisplay="Economic" />
27<#if (articleCatNames?size > 0)>
28 <#list articleCatNames as category>
29 <#if category.parentCategoryId==0>
30 <#if category.getVocabularyId()==statisticVocabulary.getVocabularyId()>
31 <#assign assetThemeCategoryId=category.categoryId?long />
32 <#assign
33 themeColor=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"theme_color").getValue()
34 themeIconId=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"theme_icon_id").getValue()
35 themeImgId=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"portfolio-image").getValue() />
36
37 <#if themeImgId!="0">
38 <#assign imgDlFile=dlAppLocalServiceUtil.getFileEntry(themeImgId?number)
39 imgUrl=dlUtil.getPreviewURL(imgDlFile, imgDlFile.getFileVersion(), themeDisplay, '' ) />
40 </#if>
41 <#list category.name?split(" ") as catWords>
42 <#assign categoryDisplay = catWords/>
43 <#break>
44 </#list>
45 <#assign categoryDisplay = category.titleCurrentValue/>
46 </#if>
47 </#if>
48 </#list>
49
50 </#if>
51
52
53<#if file_upload.getSiblings()?has_content>
54
55 <#list file_upload.getSiblings() as medias>
56 <#if medias.getData()?has_content >
57
58 <div class=" row mb-3 mx-0 bg-white d-flex w-100 align-items-center h-100 border rounded">
59 <div class="col-lg-1 p-0 ">
60 <div class="icon d-flex text-center px-2 py-3" style="background: #eee">
61 <div class="align-self-center mx-auto d-flex flex-column">
62 <img src="/documents/d/guest/${themeIconId}" height="30">
63 <label class="small mx-auto mb-0" style="color: #${themeColor} ;">
64 ${categoryDisplay}
65 </label>
66 </div>
67 </div>
68 </div>
69
70 <div class="col-8">
71 <p class="mb-0 py-3 publication-p">${journalArticleTitle}</p>
72 <div class="dates_inside_wrapper">
73
74<div class="dates_inside">
75<img height="16" src="https://scad.gov.ae/documents/d/guest/release_icon" class="pe-2" style="filter: invert(1); padding-inline-end: 2px; padding-bottom:3px;">
76
77 <div>
78 Release Date:
79<#assign releaseDate = .vars["reserved-article-display-date"].data?date("EEE, dd MMM yyyy HH:mm:ss Z") />
80${releaseDate?string("yyyy-MM-dd")}
81 </div>
82 </div>
83 <#assign publicationArticle = JournalArticleLocalService.getArticle(groupId, .vars["reserved-article-id"].data) />
84<#assign revisionDate = publicationArticle.getExpandoBridge().getAttribute("revisionDate")/>
85 <#assign formattedRevDate = revisionDate?string("yyyy-MM-dd")>
86 <#if formattedRevDate != "1888-01-01">
87 <div class="dates_inside">
88 <img height="16" src="https://scad.gov.ae/documents/d/guest/revision_icon" class="pe-2" style="filter: invert(1); padding-inline-end: 2px; padding-bottom:3px;">
89
90<div>Revision Date:
91 ${revisionDate?string("yyyy-MM-dd")}
92 </div>
93 </div>
94 </#if>
95
96
97
98
99 </div>
100
101 <#assign articleId = .vars["reserved-article-id"].data?number>
102 <#if publicationNote.getData()?has_content >
103 <div class="dates_inside_wrapper p-1">
104 <img src="https://scad.gov.ae/documents/d/guest/information-circle-svgrepo-com" height="20" width="20">
105 ${publicationNote.getData()}
106 </div>
107</#if>
108
109
110
111
112 </div>
113
114 <div class="col-3 d-flex align-items-center justify-content-end">
115
116
117 <div class="my-2 right-icons d-flex align-items-center ">
118 <#if file_upload.getSiblings()?has_content>
119 <#list file_upload.getSiblings() as media>
120 <#if media.getData()?has_content>
121
122 <#assign counter=0>
123 <#list "${media.getData()}" ?split("/") as mediaDataSplit>
124 <#if counter==5>
125 <#list mediaDataSplit?split("?") as uuId>
126 <#assign uuid=uuId />
127 <#break>
128 </#list>
129 </#if>
130 <#assign counter=counter+1>
131 </#list>
132 <#if uuid??>
133 <#assign file=dlFileEntryService.getFileEntryByUuidAndGroupId(uuid,groupId)>
134 <#assign fileExtension=file.extension>
135 <#assign fileSize = file.size >
136 <#assign fileSizeInMB = (file.size / 1024 / 1024)?string('0.##')>
137 <#if fileExtension=="">
138 <#list "${file.fileName}" ?split(".") as extention>
139 <#if extention?is_last>
140 <#assign fileExtension=extention>
141 <#break>
142 </#if>
143 </#list>
144 </#if>
145 <#if media.getData()?has_content>
146
147
148 <#if fileExtension=="pdf" || fileExtension=="PDF">
149 <a class="ml-2" href="${media.getData()}" target="blank"
150 style="order:1" onclick="trackDownload(event, '${file.fileName}')">
151 <li class="list-item list-inline-item d-flex flex-column">
152 <img src=${themeDisplay.getPathThemeImages()}/publications/pdf-svgrepo-com.svg
153 class="d-flex mx-auto align-self-center" />
154 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
155 </li>
156 </a>
157
158 <#elseif fileExtension=="xls" || fileExtension=="XLS" ||
159 fileExtension=="xlsx" || fileExtension=="XLSX">
160 <a class="ml-2" href="${media.getData()}" target="blank"
161 style="order:2" onclick="trackDownload(event, '${file.fileName}')">
162 <li class="list-item list-inline-item d-flex flex-column">
163
164 <img src=${themeDisplay.getPathThemeImages()}/publications/excel-svgrepo-com.svg
165 class="d-flex mx-auto align-self-center" />
166 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
167 </li>
168 </a>
169
170 <#else>
171
172 <a class="ml-2" href="${media.getData()}" target="blank"
173 style="order:3" onclick="trackDownload(event, '${file.fileName}')">
174 <li class="list-item list-inline-item d-flex flex-column">
175
176 <img src="https://scad.gov.ae/documents/d/guest/docx-1-"
177 class="d-flex mx-auto align-self-center" style="height:25px;" />
178 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
179
180 </li>
181 </a>
182
183 </#if>
184
185
186 </#if>
187 </#if>
188 </#if>
189 </#list>
190 </#if>
191 </div>
192 </div>
193 </div>
194
195
196
197<#break>
198
199 </#if>
200</#list>
201</#if>
202<style>.dates_inside_wrapper{
203
204display: flex;
205 gap: 5px;
206 align-items: center;
207 font-size: 13px;
208 flex-direction: row;
209 gap: 20px;
210}
211
212.dates_inside {
213
214 display: flex;
215 gap: 5px;
216 align-items: center;
217
218 padding: 4px 10px;
219 color: #616060;
220 border-radius: 5px;
221
222}
223.file-size{padding :5px;}</style>
224<script>
225var dateString = '${.vars["reserved-article-display-date"].data}';
226
227// Convert the string into a Date object
228var date = new Date(dateString);
229
230// Format the date to "dd MMM yyyy" (e.g., "02 Feb 2024")
231var formattedDate = date.toLocaleDateString('en-GB', {
232 day: '2-digit',
233 month: 'short',
234 year: 'numeric'
235});
236
237// Set the formatted date into the HTML
238document.querySelector('.publications-display').innerHTML = formattedDate;
239function trackDownload(event, fileName) {
240 console.log("INSIDE TRACKING DOWNLOADS");
241
242 // Check if fileName is correctly passed
243 if (fileName) {
244 console.log("File Name: " + fileName);
245 Analytics.track('trackPublicationDownloads', {
246 'fileName': fileName
247 });
248 } else {
249 console.log("Error: File name is missing or incorrect.");
250 }
251
252 console.log("INSIDE TRACKER");
253}
254</script>
An error occurred while processing the template.
The following has evaluated to null or missing:
==> publicationNote [in template "20098#20124#2513884" at line 102, column 86]
----
Tip: If the failing expression is known to 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: #if publicationNote.getData()?has_con... [in template "20098#20124#2513884" at line 102, column 81]
----
1<div data-analytics-asset-type="document"
2 data-analytics-asset-id="publications-downloaded"
3 data-analytics-asset-title="Publications Downloaded"
4 data-analytics-asset-action="download">
5
6<#assign catLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")
7 JournalArticleService=serviceLocator.findService("com.liferay.journal.service.JournalArticleResourceLocalService")
8 resourcePrimKey=JournalArticleService.getArticleResourcePrimKey(groupId, .vars['reserved-article-id'].data)
9 articleCatNames=catLocalService.getCategories("com.liferay.journal.model.JournalArticle", resourcePrimKey)
10 dlFileEntryService=serviceLocator.findService('com.liferay.document.library.kernel.service.DLFileEntryService')
11 assetVocabularyLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")
12 dlAppLocalServiceUtil=staticUtil["com.liferay.document.library.kernel.service.DLAppLocalServiceUtil"]
13 dlUtil=staticUtil["com.liferay.document.library.kernel.util.DLUtil"]
14 statisticVocabulary=assetVocabularyLocalService.getGroupVocabulary(groupId?long,"statistics")
15 assetCategoryPropService=serviceLocator.findService("com.liferay.asset.category.property.service.AssetCategoryPropertyLocalService") />
16 <#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
17
18
19<#assign journalArticleTitle=.vars['reserved-article-title'].data />
20<#assign journalArticleDisplayDate=.vars['reserved-article-display-date'].data />
21
22
23
24
25<#assign themeColor="d29c4b" imgUrl="${themeDisplay.getPathThemeImages()}/publications/005.jpg"
26 categoryDisplay="Economic" />
27<#if (articleCatNames?size > 0)>
28 <#list articleCatNames as category>
29 <#if category.parentCategoryId==0>
30 <#if category.getVocabularyId()==statisticVocabulary.getVocabularyId()>
31 <#assign assetThemeCategoryId=category.categoryId?long />
32 <#assign
33 themeColor=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"theme_color").getValue()
34 themeIconId=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"theme_icon_id").getValue()
35 themeImgId=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"portfolio-image").getValue() />
36
37 <#if themeImgId!="0">
38 <#assign imgDlFile=dlAppLocalServiceUtil.getFileEntry(themeImgId?number)
39 imgUrl=dlUtil.getPreviewURL(imgDlFile, imgDlFile.getFileVersion(), themeDisplay, '' ) />
40 </#if>
41 <#list category.name?split(" ") as catWords>
42 <#assign categoryDisplay = catWords/>
43 <#break>
44 </#list>
45 <#assign categoryDisplay = category.titleCurrentValue/>
46 </#if>
47 </#if>
48 </#list>
49
50 </#if>
51
52
53<#if file_upload.getSiblings()?has_content>
54
55 <#list file_upload.getSiblings() as medias>
56 <#if medias.getData()?has_content >
57
58 <div class=" row mb-3 mx-0 bg-white d-flex w-100 align-items-center h-100 border rounded">
59 <div class="col-lg-1 p-0 ">
60 <div class="icon d-flex text-center px-2 py-3" style="background: #eee">
61 <div class="align-self-center mx-auto d-flex flex-column">
62 <img src="/documents/d/guest/${themeIconId}" height="30">
63 <label class="small mx-auto mb-0" style="color: #${themeColor} ;">
64 ${categoryDisplay}
65 </label>
66 </div>
67 </div>
68 </div>
69
70 <div class="col-8">
71 <p class="mb-0 py-3 publication-p">${journalArticleTitle}</p>
72 <div class="dates_inside_wrapper">
73
74<div class="dates_inside">
75<img height="16" src="https://scad.gov.ae/documents/d/guest/release_icon" class="pe-2" style="filter: invert(1); padding-inline-end: 2px; padding-bottom:3px;">
76
77 <div>
78 Release Date:
79<#assign releaseDate = .vars["reserved-article-display-date"].data?date("EEE, dd MMM yyyy HH:mm:ss Z") />
80${releaseDate?string("yyyy-MM-dd")}
81 </div>
82 </div>
83 <#assign publicationArticle = JournalArticleLocalService.getArticle(groupId, .vars["reserved-article-id"].data) />
84<#assign revisionDate = publicationArticle.getExpandoBridge().getAttribute("revisionDate")/>
85 <#assign formattedRevDate = revisionDate?string("yyyy-MM-dd")>
86 <#if formattedRevDate != "1888-01-01">
87 <div class="dates_inside">
88 <img height="16" src="https://scad.gov.ae/documents/d/guest/revision_icon" class="pe-2" style="filter: invert(1); padding-inline-end: 2px; padding-bottom:3px;">
89
90<div>Revision Date:
91 ${revisionDate?string("yyyy-MM-dd")}
92 </div>
93 </div>
94 </#if>
95
96
97
98
99 </div>
100
101 <#assign articleId = .vars["reserved-article-id"].data?number>
102 <#if publicationNote.getData()?has_content >
103 <div class="dates_inside_wrapper p-1">
104 <img src="https://scad.gov.ae/documents/d/guest/information-circle-svgrepo-com" height="20" width="20">
105 ${publicationNote.getData()}
106 </div>
107</#if>
108
109
110
111
112 </div>
113
114 <div class="col-3 d-flex align-items-center justify-content-end">
115
116
117 <div class="my-2 right-icons d-flex align-items-center ">
118 <#if file_upload.getSiblings()?has_content>
119 <#list file_upload.getSiblings() as media>
120 <#if media.getData()?has_content>
121
122 <#assign counter=0>
123 <#list "${media.getData()}" ?split("/") as mediaDataSplit>
124 <#if counter==5>
125 <#list mediaDataSplit?split("?") as uuId>
126 <#assign uuid=uuId />
127 <#break>
128 </#list>
129 </#if>
130 <#assign counter=counter+1>
131 </#list>
132 <#if uuid??>
133 <#assign file=dlFileEntryService.getFileEntryByUuidAndGroupId(uuid,groupId)>
134 <#assign fileExtension=file.extension>
135 <#assign fileSize = file.size >
136 <#assign fileSizeInMB = (file.size / 1024 / 1024)?string('0.##')>
137 <#if fileExtension=="">
138 <#list "${file.fileName}" ?split(".") as extention>
139 <#if extention?is_last>
140 <#assign fileExtension=extention>
141 <#break>
142 </#if>
143 </#list>
144 </#if>
145 <#if media.getData()?has_content>
146
147
148 <#if fileExtension=="pdf" || fileExtension=="PDF">
149 <a class="ml-2" href="${media.getData()}" target="blank"
150 style="order:1" onclick="trackDownload(event, '${file.fileName}')">
151 <li class="list-item list-inline-item d-flex flex-column">
152 <img src=${themeDisplay.getPathThemeImages()}/publications/pdf-svgrepo-com.svg
153 class="d-flex mx-auto align-self-center" />
154 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
155 </li>
156 </a>
157
158 <#elseif fileExtension=="xls" || fileExtension=="XLS" ||
159 fileExtension=="xlsx" || fileExtension=="XLSX">
160 <a class="ml-2" href="${media.getData()}" target="blank"
161 style="order:2" onclick="trackDownload(event, '${file.fileName}')">
162 <li class="list-item list-inline-item d-flex flex-column">
163
164 <img src=${themeDisplay.getPathThemeImages()}/publications/excel-svgrepo-com.svg
165 class="d-flex mx-auto align-self-center" />
166 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
167 </li>
168 </a>
169
170 <#else>
171
172 <a class="ml-2" href="${media.getData()}" target="blank"
173 style="order:3" onclick="trackDownload(event, '${file.fileName}')">
174 <li class="list-item list-inline-item d-flex flex-column">
175
176 <img src="https://scad.gov.ae/documents/d/guest/docx-1-"
177 class="d-flex mx-auto align-self-center" style="height:25px;" />
178 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
179
180 </li>
181 </a>
182
183 </#if>
184
185
186 </#if>
187 </#if>
188 </#if>
189 </#list>
190 </#if>
191 </div>
192 </div>
193 </div>
194
195
196
197<#break>
198
199 </#if>
200</#list>
201</#if>
202<style>.dates_inside_wrapper{
203
204display: flex;
205 gap: 5px;
206 align-items: center;
207 font-size: 13px;
208 flex-direction: row;
209 gap: 20px;
210}
211
212.dates_inside {
213
214 display: flex;
215 gap: 5px;
216 align-items: center;
217
218 padding: 4px 10px;
219 color: #616060;
220 border-radius: 5px;
221
222}
223.file-size{padding :5px;}</style>
224<script>
225var dateString = '${.vars["reserved-article-display-date"].data}';
226
227// Convert the string into a Date object
228var date = new Date(dateString);
229
230// Format the date to "dd MMM yyyy" (e.g., "02 Feb 2024")
231var formattedDate = date.toLocaleDateString('en-GB', {
232 day: '2-digit',
233 month: 'short',
234 year: 'numeric'
235});
236
237// Set the formatted date into the HTML
238document.querySelector('.publications-display').innerHTML = formattedDate;
239function trackDownload(event, fileName) {
240 console.log("INSIDE TRACKING DOWNLOADS");
241
242 // Check if fileName is correctly passed
243 if (fileName) {
244 console.log("File Name: " + fileName);
245 Analytics.track('trackPublicationDownloads', {
246 'fileName': fileName
247 });
248 } else {
249 console.log("Error: File name is missing or incorrect.");
250 }
251
252 console.log("INSIDE TRACKER");
253}
254</script>
An error occurred while processing the template.
The following has evaluated to null or missing:
==> publicationNote [in template "20098#20124#2513884" at line 102, column 86]
----
Tip: If the failing expression is known to 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: #if publicationNote.getData()?has_con... [in template "20098#20124#2513884" at line 102, column 81]
----
1<div data-analytics-asset-type="document"
2 data-analytics-asset-id="publications-downloaded"
3 data-analytics-asset-title="Publications Downloaded"
4 data-analytics-asset-action="download">
5
6<#assign catLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")
7 JournalArticleService=serviceLocator.findService("com.liferay.journal.service.JournalArticleResourceLocalService")
8 resourcePrimKey=JournalArticleService.getArticleResourcePrimKey(groupId, .vars['reserved-article-id'].data)
9 articleCatNames=catLocalService.getCategories("com.liferay.journal.model.JournalArticle", resourcePrimKey)
10 dlFileEntryService=serviceLocator.findService('com.liferay.document.library.kernel.service.DLFileEntryService')
11 assetVocabularyLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")
12 dlAppLocalServiceUtil=staticUtil["com.liferay.document.library.kernel.service.DLAppLocalServiceUtil"]
13 dlUtil=staticUtil["com.liferay.document.library.kernel.util.DLUtil"]
14 statisticVocabulary=assetVocabularyLocalService.getGroupVocabulary(groupId?long,"statistics")
15 assetCategoryPropService=serviceLocator.findService("com.liferay.asset.category.property.service.AssetCategoryPropertyLocalService") />
16 <#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
17
18
19<#assign journalArticleTitle=.vars['reserved-article-title'].data />
20<#assign journalArticleDisplayDate=.vars['reserved-article-display-date'].data />
21
22
23
24
25<#assign themeColor="d29c4b" imgUrl="${themeDisplay.getPathThemeImages()}/publications/005.jpg"
26 categoryDisplay="Economic" />
27<#if (articleCatNames?size > 0)>
28 <#list articleCatNames as category>
29 <#if category.parentCategoryId==0>
30 <#if category.getVocabularyId()==statisticVocabulary.getVocabularyId()>
31 <#assign assetThemeCategoryId=category.categoryId?long />
32 <#assign
33 themeColor=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"theme_color").getValue()
34 themeIconId=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"theme_icon_id").getValue()
35 themeImgId=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"portfolio-image").getValue() />
36
37 <#if themeImgId!="0">
38 <#assign imgDlFile=dlAppLocalServiceUtil.getFileEntry(themeImgId?number)
39 imgUrl=dlUtil.getPreviewURL(imgDlFile, imgDlFile.getFileVersion(), themeDisplay, '' ) />
40 </#if>
41 <#list category.name?split(" ") as catWords>
42 <#assign categoryDisplay = catWords/>
43 <#break>
44 </#list>
45 <#assign categoryDisplay = category.titleCurrentValue/>
46 </#if>
47 </#if>
48 </#list>
49
50 </#if>
51
52
53<#if file_upload.getSiblings()?has_content>
54
55 <#list file_upload.getSiblings() as medias>
56 <#if medias.getData()?has_content >
57
58 <div class=" row mb-3 mx-0 bg-white d-flex w-100 align-items-center h-100 border rounded">
59 <div class="col-lg-1 p-0 ">
60 <div class="icon d-flex text-center px-2 py-3" style="background: #eee">
61 <div class="align-self-center mx-auto d-flex flex-column">
62 <img src="/documents/d/guest/${themeIconId}" height="30">
63 <label class="small mx-auto mb-0" style="color: #${themeColor} ;">
64 ${categoryDisplay}
65 </label>
66 </div>
67 </div>
68 </div>
69
70 <div class="col-8">
71 <p class="mb-0 py-3 publication-p">${journalArticleTitle}</p>
72 <div class="dates_inside_wrapper">
73
74<div class="dates_inside">
75<img height="16" src="https://scad.gov.ae/documents/d/guest/release_icon" class="pe-2" style="filter: invert(1); padding-inline-end: 2px; padding-bottom:3px;">
76
77 <div>
78 Release Date:
79<#assign releaseDate = .vars["reserved-article-display-date"].data?date("EEE, dd MMM yyyy HH:mm:ss Z") />
80${releaseDate?string("yyyy-MM-dd")}
81 </div>
82 </div>
83 <#assign publicationArticle = JournalArticleLocalService.getArticle(groupId, .vars["reserved-article-id"].data) />
84<#assign revisionDate = publicationArticle.getExpandoBridge().getAttribute("revisionDate")/>
85 <#assign formattedRevDate = revisionDate?string("yyyy-MM-dd")>
86 <#if formattedRevDate != "1888-01-01">
87 <div class="dates_inside">
88 <img height="16" src="https://scad.gov.ae/documents/d/guest/revision_icon" class="pe-2" style="filter: invert(1); padding-inline-end: 2px; padding-bottom:3px;">
89
90<div>Revision Date:
91 ${revisionDate?string("yyyy-MM-dd")}
92 </div>
93 </div>
94 </#if>
95
96
97
98
99 </div>
100
101 <#assign articleId = .vars["reserved-article-id"].data?number>
102 <#if publicationNote.getData()?has_content >
103 <div class="dates_inside_wrapper p-1">
104 <img src="https://scad.gov.ae/documents/d/guest/information-circle-svgrepo-com" height="20" width="20">
105 ${publicationNote.getData()}
106 </div>
107</#if>
108
109
110
111
112 </div>
113
114 <div class="col-3 d-flex align-items-center justify-content-end">
115
116
117 <div class="my-2 right-icons d-flex align-items-center ">
118 <#if file_upload.getSiblings()?has_content>
119 <#list file_upload.getSiblings() as media>
120 <#if media.getData()?has_content>
121
122 <#assign counter=0>
123 <#list "${media.getData()}" ?split("/") as mediaDataSplit>
124 <#if counter==5>
125 <#list mediaDataSplit?split("?") as uuId>
126 <#assign uuid=uuId />
127 <#break>
128 </#list>
129 </#if>
130 <#assign counter=counter+1>
131 </#list>
132 <#if uuid??>
133 <#assign file=dlFileEntryService.getFileEntryByUuidAndGroupId(uuid,groupId)>
134 <#assign fileExtension=file.extension>
135 <#assign fileSize = file.size >
136 <#assign fileSizeInMB = (file.size / 1024 / 1024)?string('0.##')>
137 <#if fileExtension=="">
138 <#list "${file.fileName}" ?split(".") as extention>
139 <#if extention?is_last>
140 <#assign fileExtension=extention>
141 <#break>
142 </#if>
143 </#list>
144 </#if>
145 <#if media.getData()?has_content>
146
147
148 <#if fileExtension=="pdf" || fileExtension=="PDF">
149 <a class="ml-2" href="${media.getData()}" target="blank"
150 style="order:1" onclick="trackDownload(event, '${file.fileName}')">
151 <li class="list-item list-inline-item d-flex flex-column">
152 <img src=${themeDisplay.getPathThemeImages()}/publications/pdf-svgrepo-com.svg
153 class="d-flex mx-auto align-self-center" />
154 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
155 </li>
156 </a>
157
158 <#elseif fileExtension=="xls" || fileExtension=="XLS" ||
159 fileExtension=="xlsx" || fileExtension=="XLSX">
160 <a class="ml-2" href="${media.getData()}" target="blank"
161 style="order:2" onclick="trackDownload(event, '${file.fileName}')">
162 <li class="list-item list-inline-item d-flex flex-column">
163
164 <img src=${themeDisplay.getPathThemeImages()}/publications/excel-svgrepo-com.svg
165 class="d-flex mx-auto align-self-center" />
166 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
167 </li>
168 </a>
169
170 <#else>
171
172 <a class="ml-2" href="${media.getData()}" target="blank"
173 style="order:3" onclick="trackDownload(event, '${file.fileName}')">
174 <li class="list-item list-inline-item d-flex flex-column">
175
176 <img src="https://scad.gov.ae/documents/d/guest/docx-1-"
177 class="d-flex mx-auto align-self-center" style="height:25px;" />
178 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
179
180 </li>
181 </a>
182
183 </#if>
184
185
186 </#if>
187 </#if>
188 </#if>
189 </#list>
190 </#if>
191 </div>
192 </div>
193 </div>
194
195
196
197<#break>
198
199 </#if>
200</#list>
201</#if>
202<style>.dates_inside_wrapper{
203
204display: flex;
205 gap: 5px;
206 align-items: center;
207 font-size: 13px;
208 flex-direction: row;
209 gap: 20px;
210}
211
212.dates_inside {
213
214 display: flex;
215 gap: 5px;
216 align-items: center;
217
218 padding: 4px 10px;
219 color: #616060;
220 border-radius: 5px;
221
222}
223.file-size{padding :5px;}</style>
224<script>
225var dateString = '${.vars["reserved-article-display-date"].data}';
226
227// Convert the string into a Date object
228var date = new Date(dateString);
229
230// Format the date to "dd MMM yyyy" (e.g., "02 Feb 2024")
231var formattedDate = date.toLocaleDateString('en-GB', {
232 day: '2-digit',
233 month: 'short',
234 year: 'numeric'
235});
236
237// Set the formatted date into the HTML
238document.querySelector('.publications-display').innerHTML = formattedDate;
239function trackDownload(event, fileName) {
240 console.log("INSIDE TRACKING DOWNLOADS");
241
242 // Check if fileName is correctly passed
243 if (fileName) {
244 console.log("File Name: " + fileName);
245 Analytics.track('trackPublicationDownloads', {
246 'fileName': fileName
247 });
248 } else {
249 console.log("Error: File name is missing or incorrect.");
250 }
251
252 console.log("INSIDE TRACKER");
253}
254</script>
An error occurred while processing the template.
The following has evaluated to null or missing:
==> publicationNote [in template "20098#20124#2513884" at line 102, column 86]
----
Tip: If the failing expression is known to 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: #if publicationNote.getData()?has_con... [in template "20098#20124#2513884" at line 102, column 81]
----
1<div data-analytics-asset-type="document"
2 data-analytics-asset-id="publications-downloaded"
3 data-analytics-asset-title="Publications Downloaded"
4 data-analytics-asset-action="download">
5
6<#assign catLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")
7 JournalArticleService=serviceLocator.findService("com.liferay.journal.service.JournalArticleResourceLocalService")
8 resourcePrimKey=JournalArticleService.getArticleResourcePrimKey(groupId, .vars['reserved-article-id'].data)
9 articleCatNames=catLocalService.getCategories("com.liferay.journal.model.JournalArticle", resourcePrimKey)
10 dlFileEntryService=serviceLocator.findService('com.liferay.document.library.kernel.service.DLFileEntryService')
11 assetVocabularyLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")
12 dlAppLocalServiceUtil=staticUtil["com.liferay.document.library.kernel.service.DLAppLocalServiceUtil"]
13 dlUtil=staticUtil["com.liferay.document.library.kernel.util.DLUtil"]
14 statisticVocabulary=assetVocabularyLocalService.getGroupVocabulary(groupId?long,"statistics")
15 assetCategoryPropService=serviceLocator.findService("com.liferay.asset.category.property.service.AssetCategoryPropertyLocalService") />
16 <#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
17
18
19<#assign journalArticleTitle=.vars['reserved-article-title'].data />
20<#assign journalArticleDisplayDate=.vars['reserved-article-display-date'].data />
21
22
23
24
25<#assign themeColor="d29c4b" imgUrl="${themeDisplay.getPathThemeImages()}/publications/005.jpg"
26 categoryDisplay="Economic" />
27<#if (articleCatNames?size > 0)>
28 <#list articleCatNames as category>
29 <#if category.parentCategoryId==0>
30 <#if category.getVocabularyId()==statisticVocabulary.getVocabularyId()>
31 <#assign assetThemeCategoryId=category.categoryId?long />
32 <#assign
33 themeColor=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"theme_color").getValue()
34 themeIconId=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"theme_icon_id").getValue()
35 themeImgId=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"portfolio-image").getValue() />
36
37 <#if themeImgId!="0">
38 <#assign imgDlFile=dlAppLocalServiceUtil.getFileEntry(themeImgId?number)
39 imgUrl=dlUtil.getPreviewURL(imgDlFile, imgDlFile.getFileVersion(), themeDisplay, '' ) />
40 </#if>
41 <#list category.name?split(" ") as catWords>
42 <#assign categoryDisplay = catWords/>
43 <#break>
44 </#list>
45 <#assign categoryDisplay = category.titleCurrentValue/>
46 </#if>
47 </#if>
48 </#list>
49
50 </#if>
51
52
53<#if file_upload.getSiblings()?has_content>
54
55 <#list file_upload.getSiblings() as medias>
56 <#if medias.getData()?has_content >
57
58 <div class=" row mb-3 mx-0 bg-white d-flex w-100 align-items-center h-100 border rounded">
59 <div class="col-lg-1 p-0 ">
60 <div class="icon d-flex text-center px-2 py-3" style="background: #eee">
61 <div class="align-self-center mx-auto d-flex flex-column">
62 <img src="/documents/d/guest/${themeIconId}" height="30">
63 <label class="small mx-auto mb-0" style="color: #${themeColor} ;">
64 ${categoryDisplay}
65 </label>
66 </div>
67 </div>
68 </div>
69
70 <div class="col-8">
71 <p class="mb-0 py-3 publication-p">${journalArticleTitle}</p>
72 <div class="dates_inside_wrapper">
73
74<div class="dates_inside">
75<img height="16" src="https://scad.gov.ae/documents/d/guest/release_icon" class="pe-2" style="filter: invert(1); padding-inline-end: 2px; padding-bottom:3px;">
76
77 <div>
78 Release Date:
79<#assign releaseDate = .vars["reserved-article-display-date"].data?date("EEE, dd MMM yyyy HH:mm:ss Z") />
80${releaseDate?string("yyyy-MM-dd")}
81 </div>
82 </div>
83 <#assign publicationArticle = JournalArticleLocalService.getArticle(groupId, .vars["reserved-article-id"].data) />
84<#assign revisionDate = publicationArticle.getExpandoBridge().getAttribute("revisionDate")/>
85 <#assign formattedRevDate = revisionDate?string("yyyy-MM-dd")>
86 <#if formattedRevDate != "1888-01-01">
87 <div class="dates_inside">
88 <img height="16" src="https://scad.gov.ae/documents/d/guest/revision_icon" class="pe-2" style="filter: invert(1); padding-inline-end: 2px; padding-bottom:3px;">
89
90<div>Revision Date:
91 ${revisionDate?string("yyyy-MM-dd")}
92 </div>
93 </div>
94 </#if>
95
96
97
98
99 </div>
100
101 <#assign articleId = .vars["reserved-article-id"].data?number>
102 <#if publicationNote.getData()?has_content >
103 <div class="dates_inside_wrapper p-1">
104 <img src="https://scad.gov.ae/documents/d/guest/information-circle-svgrepo-com" height="20" width="20">
105 ${publicationNote.getData()}
106 </div>
107</#if>
108
109
110
111
112 </div>
113
114 <div class="col-3 d-flex align-items-center justify-content-end">
115
116
117 <div class="my-2 right-icons d-flex align-items-center ">
118 <#if file_upload.getSiblings()?has_content>
119 <#list file_upload.getSiblings() as media>
120 <#if media.getData()?has_content>
121
122 <#assign counter=0>
123 <#list "${media.getData()}" ?split("/") as mediaDataSplit>
124 <#if counter==5>
125 <#list mediaDataSplit?split("?") as uuId>
126 <#assign uuid=uuId />
127 <#break>
128 </#list>
129 </#if>
130 <#assign counter=counter+1>
131 </#list>
132 <#if uuid??>
133 <#assign file=dlFileEntryService.getFileEntryByUuidAndGroupId(uuid,groupId)>
134 <#assign fileExtension=file.extension>
135 <#assign fileSize = file.size >
136 <#assign fileSizeInMB = (file.size / 1024 / 1024)?string('0.##')>
137 <#if fileExtension=="">
138 <#list "${file.fileName}" ?split(".") as extention>
139 <#if extention?is_last>
140 <#assign fileExtension=extention>
141 <#break>
142 </#if>
143 </#list>
144 </#if>
145 <#if media.getData()?has_content>
146
147
148 <#if fileExtension=="pdf" || fileExtension=="PDF">
149 <a class="ml-2" href="${media.getData()}" target="blank"
150 style="order:1" onclick="trackDownload(event, '${file.fileName}')">
151 <li class="list-item list-inline-item d-flex flex-column">
152 <img src=${themeDisplay.getPathThemeImages()}/publications/pdf-svgrepo-com.svg
153 class="d-flex mx-auto align-self-center" />
154 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
155 </li>
156 </a>
157
158 <#elseif fileExtension=="xls" || fileExtension=="XLS" ||
159 fileExtension=="xlsx" || fileExtension=="XLSX">
160 <a class="ml-2" href="${media.getData()}" target="blank"
161 style="order:2" onclick="trackDownload(event, '${file.fileName}')">
162 <li class="list-item list-inline-item d-flex flex-column">
163
164 <img src=${themeDisplay.getPathThemeImages()}/publications/excel-svgrepo-com.svg
165 class="d-flex mx-auto align-self-center" />
166 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
167 </li>
168 </a>
169
170 <#else>
171
172 <a class="ml-2" href="${media.getData()}" target="blank"
173 style="order:3" onclick="trackDownload(event, '${file.fileName}')">
174 <li class="list-item list-inline-item d-flex flex-column">
175
176 <img src="https://scad.gov.ae/documents/d/guest/docx-1-"
177 class="d-flex mx-auto align-self-center" style="height:25px;" />
178 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
179
180 </li>
181 </a>
182
183 </#if>
184
185
186 </#if>
187 </#if>
188 </#if>
189 </#list>
190 </#if>
191 </div>
192 </div>
193 </div>
194
195
196
197<#break>
198
199 </#if>
200</#list>
201</#if>
202<style>.dates_inside_wrapper{
203
204display: flex;
205 gap: 5px;
206 align-items: center;
207 font-size: 13px;
208 flex-direction: row;
209 gap: 20px;
210}
211
212.dates_inside {
213
214 display: flex;
215 gap: 5px;
216 align-items: center;
217
218 padding: 4px 10px;
219 color: #616060;
220 border-radius: 5px;
221
222}
223.file-size{padding :5px;}</style>
224<script>
225var dateString = '${.vars["reserved-article-display-date"].data}';
226
227// Convert the string into a Date object
228var date = new Date(dateString);
229
230// Format the date to "dd MMM yyyy" (e.g., "02 Feb 2024")
231var formattedDate = date.toLocaleDateString('en-GB', {
232 day: '2-digit',
233 month: 'short',
234 year: 'numeric'
235});
236
237// Set the formatted date into the HTML
238document.querySelector('.publications-display').innerHTML = formattedDate;
239function trackDownload(event, fileName) {
240 console.log("INSIDE TRACKING DOWNLOADS");
241
242 // Check if fileName is correctly passed
243 if (fileName) {
244 console.log("File Name: " + fileName);
245 Analytics.track('trackPublicationDownloads', {
246 'fileName': fileName
247 });
248 } else {
249 console.log("Error: File name is missing or incorrect.");
250 }
251
252 console.log("INSIDE TRACKER");
253}
254</script>
An error occurred while processing the template.
The following has evaluated to null or missing:
==> publicationNote [in template "20098#20124#2513884" at line 102, column 86]
----
Tip: If the failing expression is known to 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: #if publicationNote.getData()?has_con... [in template "20098#20124#2513884" at line 102, column 81]
----
1<div data-analytics-asset-type="document"
2 data-analytics-asset-id="publications-downloaded"
3 data-analytics-asset-title="Publications Downloaded"
4 data-analytics-asset-action="download">
5
6<#assign catLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")
7 JournalArticleService=serviceLocator.findService("com.liferay.journal.service.JournalArticleResourceLocalService")
8 resourcePrimKey=JournalArticleService.getArticleResourcePrimKey(groupId, .vars['reserved-article-id'].data)
9 articleCatNames=catLocalService.getCategories("com.liferay.journal.model.JournalArticle", resourcePrimKey)
10 dlFileEntryService=serviceLocator.findService('com.liferay.document.library.kernel.service.DLFileEntryService')
11 assetVocabularyLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")
12 dlAppLocalServiceUtil=staticUtil["com.liferay.document.library.kernel.service.DLAppLocalServiceUtil"]
13 dlUtil=staticUtil["com.liferay.document.library.kernel.util.DLUtil"]
14 statisticVocabulary=assetVocabularyLocalService.getGroupVocabulary(groupId?long,"statistics")
15 assetCategoryPropService=serviceLocator.findService("com.liferay.asset.category.property.service.AssetCategoryPropertyLocalService") />
16 <#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
17
18
19<#assign journalArticleTitle=.vars['reserved-article-title'].data />
20<#assign journalArticleDisplayDate=.vars['reserved-article-display-date'].data />
21
22
23
24
25<#assign themeColor="d29c4b" imgUrl="${themeDisplay.getPathThemeImages()}/publications/005.jpg"
26 categoryDisplay="Economic" />
27<#if (articleCatNames?size > 0)>
28 <#list articleCatNames as category>
29 <#if category.parentCategoryId==0>
30 <#if category.getVocabularyId()==statisticVocabulary.getVocabularyId()>
31 <#assign assetThemeCategoryId=category.categoryId?long />
32 <#assign
33 themeColor=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"theme_color").getValue()
34 themeIconId=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"theme_icon_id").getValue()
35 themeImgId=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"portfolio-image").getValue() />
36
37 <#if themeImgId!="0">
38 <#assign imgDlFile=dlAppLocalServiceUtil.getFileEntry(themeImgId?number)
39 imgUrl=dlUtil.getPreviewURL(imgDlFile, imgDlFile.getFileVersion(), themeDisplay, '' ) />
40 </#if>
41 <#list category.name?split(" ") as catWords>
42 <#assign categoryDisplay = catWords/>
43 <#break>
44 </#list>
45 <#assign categoryDisplay = category.titleCurrentValue/>
46 </#if>
47 </#if>
48 </#list>
49
50 </#if>
51
52
53<#if file_upload.getSiblings()?has_content>
54
55 <#list file_upload.getSiblings() as medias>
56 <#if medias.getData()?has_content >
57
58 <div class=" row mb-3 mx-0 bg-white d-flex w-100 align-items-center h-100 border rounded">
59 <div class="col-lg-1 p-0 ">
60 <div class="icon d-flex text-center px-2 py-3" style="background: #eee">
61 <div class="align-self-center mx-auto d-flex flex-column">
62 <img src="/documents/d/guest/${themeIconId}" height="30">
63 <label class="small mx-auto mb-0" style="color: #${themeColor} ;">
64 ${categoryDisplay}
65 </label>
66 </div>
67 </div>
68 </div>
69
70 <div class="col-8">
71 <p class="mb-0 py-3 publication-p">${journalArticleTitle}</p>
72 <div class="dates_inside_wrapper">
73
74<div class="dates_inside">
75<img height="16" src="https://scad.gov.ae/documents/d/guest/release_icon" class="pe-2" style="filter: invert(1); padding-inline-end: 2px; padding-bottom:3px;">
76
77 <div>
78 Release Date:
79<#assign releaseDate = .vars["reserved-article-display-date"].data?date("EEE, dd MMM yyyy HH:mm:ss Z") />
80${releaseDate?string("yyyy-MM-dd")}
81 </div>
82 </div>
83 <#assign publicationArticle = JournalArticleLocalService.getArticle(groupId, .vars["reserved-article-id"].data) />
84<#assign revisionDate = publicationArticle.getExpandoBridge().getAttribute("revisionDate")/>
85 <#assign formattedRevDate = revisionDate?string("yyyy-MM-dd")>
86 <#if formattedRevDate != "1888-01-01">
87 <div class="dates_inside">
88 <img height="16" src="https://scad.gov.ae/documents/d/guest/revision_icon" class="pe-2" style="filter: invert(1); padding-inline-end: 2px; padding-bottom:3px;">
89
90<div>Revision Date:
91 ${revisionDate?string("yyyy-MM-dd")}
92 </div>
93 </div>
94 </#if>
95
96
97
98
99 </div>
100
101 <#assign articleId = .vars["reserved-article-id"].data?number>
102 <#if publicationNote.getData()?has_content >
103 <div class="dates_inside_wrapper p-1">
104 <img src="https://scad.gov.ae/documents/d/guest/information-circle-svgrepo-com" height="20" width="20">
105 ${publicationNote.getData()}
106 </div>
107</#if>
108
109
110
111
112 </div>
113
114 <div class="col-3 d-flex align-items-center justify-content-end">
115
116
117 <div class="my-2 right-icons d-flex align-items-center ">
118 <#if file_upload.getSiblings()?has_content>
119 <#list file_upload.getSiblings() as media>
120 <#if media.getData()?has_content>
121
122 <#assign counter=0>
123 <#list "${media.getData()}" ?split("/") as mediaDataSplit>
124 <#if counter==5>
125 <#list mediaDataSplit?split("?") as uuId>
126 <#assign uuid=uuId />
127 <#break>
128 </#list>
129 </#if>
130 <#assign counter=counter+1>
131 </#list>
132 <#if uuid??>
133 <#assign file=dlFileEntryService.getFileEntryByUuidAndGroupId(uuid,groupId)>
134 <#assign fileExtension=file.extension>
135 <#assign fileSize = file.size >
136 <#assign fileSizeInMB = (file.size / 1024 / 1024)?string('0.##')>
137 <#if fileExtension=="">
138 <#list "${file.fileName}" ?split(".") as extention>
139 <#if extention?is_last>
140 <#assign fileExtension=extention>
141 <#break>
142 </#if>
143 </#list>
144 </#if>
145 <#if media.getData()?has_content>
146
147
148 <#if fileExtension=="pdf" || fileExtension=="PDF">
149 <a class="ml-2" href="${media.getData()}" target="blank"
150 style="order:1" onclick="trackDownload(event, '${file.fileName}')">
151 <li class="list-item list-inline-item d-flex flex-column">
152 <img src=${themeDisplay.getPathThemeImages()}/publications/pdf-svgrepo-com.svg
153 class="d-flex mx-auto align-self-center" />
154 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
155 </li>
156 </a>
157
158 <#elseif fileExtension=="xls" || fileExtension=="XLS" ||
159 fileExtension=="xlsx" || fileExtension=="XLSX">
160 <a class="ml-2" href="${media.getData()}" target="blank"
161 style="order:2" onclick="trackDownload(event, '${file.fileName}')">
162 <li class="list-item list-inline-item d-flex flex-column">
163
164 <img src=${themeDisplay.getPathThemeImages()}/publications/excel-svgrepo-com.svg
165 class="d-flex mx-auto align-self-center" />
166 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
167 </li>
168 </a>
169
170 <#else>
171
172 <a class="ml-2" href="${media.getData()}" target="blank"
173 style="order:3" onclick="trackDownload(event, '${file.fileName}')">
174 <li class="list-item list-inline-item d-flex flex-column">
175
176 <img src="https://scad.gov.ae/documents/d/guest/docx-1-"
177 class="d-flex mx-auto align-self-center" style="height:25px;" />
178 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
179
180 </li>
181 </a>
182
183 </#if>
184
185
186 </#if>
187 </#if>
188 </#if>
189 </#list>
190 </#if>
191 </div>
192 </div>
193 </div>
194
195
196
197<#break>
198
199 </#if>
200</#list>
201</#if>
202<style>.dates_inside_wrapper{
203
204display: flex;
205 gap: 5px;
206 align-items: center;
207 font-size: 13px;
208 flex-direction: row;
209 gap: 20px;
210}
211
212.dates_inside {
213
214 display: flex;
215 gap: 5px;
216 align-items: center;
217
218 padding: 4px 10px;
219 color: #616060;
220 border-radius: 5px;
221
222}
223.file-size{padding :5px;}</style>
224<script>
225var dateString = '${.vars["reserved-article-display-date"].data}';
226
227// Convert the string into a Date object
228var date = new Date(dateString);
229
230// Format the date to "dd MMM yyyy" (e.g., "02 Feb 2024")
231var formattedDate = date.toLocaleDateString('en-GB', {
232 day: '2-digit',
233 month: 'short',
234 year: 'numeric'
235});
236
237// Set the formatted date into the HTML
238document.querySelector('.publications-display').innerHTML = formattedDate;
239function trackDownload(event, fileName) {
240 console.log("INSIDE TRACKING DOWNLOADS");
241
242 // Check if fileName is correctly passed
243 if (fileName) {
244 console.log("File Name: " + fileName);
245 Analytics.track('trackPublicationDownloads', {
246 'fileName': fileName
247 });
248 } else {
249 console.log("Error: File name is missing or incorrect.");
250 }
251
252 console.log("INSIDE TRACKER");
253}
254</script>
An error occurred while processing the template.
The following has evaluated to null or missing:
==> publicationNote [in template "20098#20124#2513884" at line 102, column 86]
----
Tip: If the failing expression is known to 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: #if publicationNote.getData()?has_con... [in template "20098#20124#2513884" at line 102, column 81]
----
1<div data-analytics-asset-type="document"
2 data-analytics-asset-id="publications-downloaded"
3 data-analytics-asset-title="Publications Downloaded"
4 data-analytics-asset-action="download">
5
6<#assign catLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")
7 JournalArticleService=serviceLocator.findService("com.liferay.journal.service.JournalArticleResourceLocalService")
8 resourcePrimKey=JournalArticleService.getArticleResourcePrimKey(groupId, .vars['reserved-article-id'].data)
9 articleCatNames=catLocalService.getCategories("com.liferay.journal.model.JournalArticle", resourcePrimKey)
10 dlFileEntryService=serviceLocator.findService('com.liferay.document.library.kernel.service.DLFileEntryService')
11 assetVocabularyLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")
12 dlAppLocalServiceUtil=staticUtil["com.liferay.document.library.kernel.service.DLAppLocalServiceUtil"]
13 dlUtil=staticUtil["com.liferay.document.library.kernel.util.DLUtil"]
14 statisticVocabulary=assetVocabularyLocalService.getGroupVocabulary(groupId?long,"statistics")
15 assetCategoryPropService=serviceLocator.findService("com.liferay.asset.category.property.service.AssetCategoryPropertyLocalService") />
16 <#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
17
18
19<#assign journalArticleTitle=.vars['reserved-article-title'].data />
20<#assign journalArticleDisplayDate=.vars['reserved-article-display-date'].data />
21
22
23
24
25<#assign themeColor="d29c4b" imgUrl="${themeDisplay.getPathThemeImages()}/publications/005.jpg"
26 categoryDisplay="Economic" />
27<#if (articleCatNames?size > 0)>
28 <#list articleCatNames as category>
29 <#if category.parentCategoryId==0>
30 <#if category.getVocabularyId()==statisticVocabulary.getVocabularyId()>
31 <#assign assetThemeCategoryId=category.categoryId?long />
32 <#assign
33 themeColor=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"theme_color").getValue()
34 themeIconId=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"theme_icon_id").getValue()
35 themeImgId=assetCategoryPropService.getCategoryProperty(assetThemeCategoryId,"portfolio-image").getValue() />
36
37 <#if themeImgId!="0">
38 <#assign imgDlFile=dlAppLocalServiceUtil.getFileEntry(themeImgId?number)
39 imgUrl=dlUtil.getPreviewURL(imgDlFile, imgDlFile.getFileVersion(), themeDisplay, '' ) />
40 </#if>
41 <#list category.name?split(" ") as catWords>
42 <#assign categoryDisplay = catWords/>
43 <#break>
44 </#list>
45 <#assign categoryDisplay = category.titleCurrentValue/>
46 </#if>
47 </#if>
48 </#list>
49
50 </#if>
51
52
53<#if file_upload.getSiblings()?has_content>
54
55 <#list file_upload.getSiblings() as medias>
56 <#if medias.getData()?has_content >
57
58 <div class=" row mb-3 mx-0 bg-white d-flex w-100 align-items-center h-100 border rounded">
59 <div class="col-lg-1 p-0 ">
60 <div class="icon d-flex text-center px-2 py-3" style="background: #eee">
61 <div class="align-self-center mx-auto d-flex flex-column">
62 <img src="/documents/d/guest/${themeIconId}" height="30">
63 <label class="small mx-auto mb-0" style="color: #${themeColor} ;">
64 ${categoryDisplay}
65 </label>
66 </div>
67 </div>
68 </div>
69
70 <div class="col-8">
71 <p class="mb-0 py-3 publication-p">${journalArticleTitle}</p>
72 <div class="dates_inside_wrapper">
73
74<div class="dates_inside">
75<img height="16" src="https://scad.gov.ae/documents/d/guest/release_icon" class="pe-2" style="filter: invert(1); padding-inline-end: 2px; padding-bottom:3px;">
76
77 <div>
78 Release Date:
79<#assign releaseDate = .vars["reserved-article-display-date"].data?date("EEE, dd MMM yyyy HH:mm:ss Z") />
80${releaseDate?string("yyyy-MM-dd")}
81 </div>
82 </div>
83 <#assign publicationArticle = JournalArticleLocalService.getArticle(groupId, .vars["reserved-article-id"].data) />
84<#assign revisionDate = publicationArticle.getExpandoBridge().getAttribute("revisionDate")/>
85 <#assign formattedRevDate = revisionDate?string("yyyy-MM-dd")>
86 <#if formattedRevDate != "1888-01-01">
87 <div class="dates_inside">
88 <img height="16" src="https://scad.gov.ae/documents/d/guest/revision_icon" class="pe-2" style="filter: invert(1); padding-inline-end: 2px; padding-bottom:3px;">
89
90<div>Revision Date:
91 ${revisionDate?string("yyyy-MM-dd")}
92 </div>
93 </div>
94 </#if>
95
96
97
98
99 </div>
100
101 <#assign articleId = .vars["reserved-article-id"].data?number>
102 <#if publicationNote.getData()?has_content >
103 <div class="dates_inside_wrapper p-1">
104 <img src="https://scad.gov.ae/documents/d/guest/information-circle-svgrepo-com" height="20" width="20">
105 ${publicationNote.getData()}
106 </div>
107</#if>
108
109
110
111
112 </div>
113
114 <div class="col-3 d-flex align-items-center justify-content-end">
115
116
117 <div class="my-2 right-icons d-flex align-items-center ">
118 <#if file_upload.getSiblings()?has_content>
119 <#list file_upload.getSiblings() as media>
120 <#if media.getData()?has_content>
121
122 <#assign counter=0>
123 <#list "${media.getData()}" ?split("/") as mediaDataSplit>
124 <#if counter==5>
125 <#list mediaDataSplit?split("?") as uuId>
126 <#assign uuid=uuId />
127 <#break>
128 </#list>
129 </#if>
130 <#assign counter=counter+1>
131 </#list>
132 <#if uuid??>
133 <#assign file=dlFileEntryService.getFileEntryByUuidAndGroupId(uuid,groupId)>
134 <#assign fileExtension=file.extension>
135 <#assign fileSize = file.size >
136 <#assign fileSizeInMB = (file.size / 1024 / 1024)?string('0.##')>
137 <#if fileExtension=="">
138 <#list "${file.fileName}" ?split(".") as extention>
139 <#if extention?is_last>
140 <#assign fileExtension=extention>
141 <#break>
142 </#if>
143 </#list>
144 </#if>
145 <#if media.getData()?has_content>
146
147
148 <#if fileExtension=="pdf" || fileExtension=="PDF">
149 <a class="ml-2" href="${media.getData()}" target="blank"
150 style="order:1" onclick="trackDownload(event, '${file.fileName}')">
151 <li class="list-item list-inline-item d-flex flex-column">
152 <img src=${themeDisplay.getPathThemeImages()}/publications/pdf-svgrepo-com.svg
153 class="d-flex mx-auto align-self-center" />
154 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
155 </li>
156 </a>
157
158 <#elseif fileExtension=="xls" || fileExtension=="XLS" ||
159 fileExtension=="xlsx" || fileExtension=="XLSX">
160 <a class="ml-2" href="${media.getData()}" target="blank"
161 style="order:2" onclick="trackDownload(event, '${file.fileName}')">
162 <li class="list-item list-inline-item d-flex flex-column">
163
164 <img src=${themeDisplay.getPathThemeImages()}/publications/excel-svgrepo-com.svg
165 class="d-flex mx-auto align-self-center" />
166 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
167 </li>
168 </a>
169
170 <#else>
171
172 <a class="ml-2" href="${media.getData()}" target="blank"
173 style="order:3" onclick="trackDownload(event, '${file.fileName}')">
174 <li class="list-item list-inline-item d-flex flex-column">
175
176 <img src="https://scad.gov.ae/documents/d/guest/docx-1-"
177 class="d-flex mx-auto align-self-center" style="height:25px;" />
178 <small class="text-dark-blue"> ${fileSizeInMB} MB </small>
179
180 </li>
181 </a>
182
183 </#if>
184
185
186 </#if>
187 </#if>
188 </#if>
189 </#list>
190 </#if>
191 </div>
192 </div>
193 </div>
194
195
196
197<#break>
198
199 </#if>
200</#list>
201</#if>
202<style>.dates_inside_wrapper{
203
204display: flex;
205 gap: 5px;
206 align-items: center;
207 font-size: 13px;
208 flex-direction: row;
209 gap: 20px;
210}
211
212.dates_inside {
213
214 display: flex;
215 gap: 5px;
216 align-items: center;
217
218 padding: 4px 10px;
219 color: #616060;
220 border-radius: 5px;
221
222}
223.file-size{padding :5px;}</style>
224<script>
225var dateString = '${.vars["reserved-article-display-date"].data}';
226
227// Convert the string into a Date object
228var date = new Date(dateString);
229
230// Format the date to "dd MMM yyyy" (e.g., "02 Feb 2024")
231var formattedDate = date.toLocaleDateString('en-GB', {
232 day: '2-digit',
233 month: 'short',
234 year: 'numeric'
235});
236
237// Set the formatted date into the HTML
238document.querySelector('.publications-display').innerHTML = formattedDate;
239function trackDownload(event, fileName) {
240 console.log("INSIDE TRACKING DOWNLOADS");
241
242 // Check if fileName is correctly passed
243 if (fileName) {
244 console.log("File Name: " + fileName);
245 Analytics.track('trackPublicationDownloads', {
246 'fileName': fileName
247 });
248 } else {
249 console.log("Error: File name is missing or incorrect.");
250 }
251
252 console.log("INSIDE TRACKER");
253}
254</script>
Did you find this content useful?
Share your feedback with us so we can improve your experience.