title VĂN BẢN CHỈ ĐẠO, ĐIỀU HÀNH

397/TB-VP
Thứ sáu, 26/05/2023, 09:15 SA
Cỡ chữ Màu chữ image
Có lỗi xảy ra trong quá trình xử lý biểu mẫu.
The following has evaluated to null or missing:
==> arrString[4]  [in template "20115#20151#43251" at line 213, column 61]

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

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign filename = arrString[4]  [in template "20115#20151#43251" at line 213, column 41]
----
1<style scoped> 
2	.style-padding-bottom-attachFile{ 
3		display: flex; 
4
5	.portlet-asset-publisher .asset-full-content img { 
6		max-width: unset; 
7
8	.doc-gen-cover-tt table tr td { 
9        vertical-align: middle; 
10        border: 1px solid #b6b3b3; 
11        line-height: 18px; 
12        padding: 5px 5px; 
13
14    .doc-gen-body-detail{ 
15        padding: 0px !important; 
16
17	.doc-gen-font-bold { 
18        border-bottom: 1px solid #fff !important; 
19        padding: 10px 5px; 
20        width: 100%; 
21        margin: 0; 
22        position: relative; 
23        top: 0; 
24        border: 1px solid #b6b3b3; 
25
26	.attachFile{ 
27		border: 1px solid #b6b3b3; 
28		display: flow-root; 
29		padding: 10px 5px; 
30		margin: -1px 0; 
31		border-top: 1px solid #fff; 
32
33	.doc-gen-file-dk { 
34		padding: 0px 0 0 5px; 
35
36	.doc-gen-file-dk-all{ 
37		padding: 4px; 
38		text-align: center; 
39		margin: 5px 0 10px 0; 
40		border-radius: 4px; 
41		border: 1px solid #b6b3b3; 
42		cursor: pointer; 
43
44	.doc-gen-file-dk-all:hover { 
45		background: #eaeaea; 
46		transition: 0.4s; 
47
48	.title_down{ 
49		word-wrap: break-word; 
50		width: 300px; 
51		margin: 0 0 0 5px; 
52
53	.doc-gen-no-file-dk { 
54        border: 1px solid #b6b3b3; 
55        border-top: 0; 
56        padding: 0 0 15px 7px; 
57        width: 100%; 
58        text-align: left; 
59
60    .portlet-content { 
61        border: 0 !important; 
62
63</style> 
64<#assign StringPool = staticUtil["com.liferay.portal.kernel.util.StringPool"] /> 
65<#assign HttpUtil = staticUtil["com.liferay.portal.kernel.util.HttpUtil"] /> 
66<#assign HtmlUtil = staticUtil["com.liferay.portal.kernel.util.HtmlUtil"] /> 
67<#assign serviceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext()> 
68<#assign themeDisplay = serviceContext.getThemeDisplay() /> 
69<div class="row header-related row-swt-responsive"> 
70    <div class="col-sm-3 tab-menu tab-active" id="tab-properties" onclick="properties()"> 
71    Thuộc tính 
72    </div> 
73    <div class="col-sm-4 tab-menu" id="tab-related" onclick="relatedAsset()"> 
74    Văn bản liên quan 
75    </div> 
76    <div class="col-sm-5"> 
77    
78    </div> 
79</div> 
80<div class="doc-gen-body-detail" id="properties"> 
81<div class="doc-gen-cover-tt" id="content-article-swt-id-voice"> 
82	<table style="color: #100404; width: 100%"> 
83                    <tbody> 
84					<tr> 
85                        <td style="width: 150px;"><b>Số kí hiệu</b></td> 
86                        <td>${htmlUtil.escape(code.getData())}</td> 
87                    </tr> 
88                    <tr> 
89                        <td><b>Người ký</b></td> 
90                        <td>${htmlUtil.escape(signer.getData())}</td> 
91                    </tr> 
92					<#assign loaiVanBan = "" > 
93					<#assign coQuanBanHanh = "" > 
94					<#assign linhVuc = "" > 
95					 
96					<#assign journalLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")> 
97					<#assign articleobj = journalLocalService.getArticle(groupId, .vars["reserved-article-id"].data)> 
98					 
99					<#assign  articlePrimKey = articleobj.getResourcePrimKey()> 
100					 
101					<#assign catLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")> 
102					<#assign articleCates = catLocalService.getCategories("com.liferay.journal.model.JournalArticle", getterUtil.getLong(articlePrimKey))> 
103					 
104					<#assign listName = ""> 
105					<#list articleCates as cat> 
106						<#assign listName = listName + "," + cat.getName()> 
107					</#list> 
108					 
109					<#assign assetVocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")> 
110					<#assign listVocab = assetVocabularyLocalService.getGroupVocabularies(groupId)> 
111					 
112					<#list listVocab as vocab> 
113					<#-- 43261: id vocabulary cua loai van ban --> 
114					<#if vocab.getVocabularyId() == 43261> 
115						<#list vocab.getCategories() as cate> 
116							<#if listName?contains(cate.getName())> 
117								<#assign loaiVanBan = cate.getName()> 
118							</#if> 
119						</#list> 
120					</#if> 
121					 
122					<#-- 43259: id vocabulary cua co quan ban hanh --> 
123					<#if vocab.getVocabularyId() == 43259> 
124						<#list vocab.getCategories() as cate> 
125							<#if listName?contains(cate.getName())> 
126								<#assign coQuanBanHanh = cate.getName()> 
127							</#if> 
128						</#list> 
129					</#if> 
130					 
131					<#-- 43260: id vocabulary cua linh vuc --> 
132					<#if vocab.getVocabularyId() == 43260> 
133						<#list vocab.getCategories() as cate> 
134							<#if listName?contains(cate.getName())> 
135								<#assign linhVuc = cate.getName()> 
136							</#if> 
137						</#list> 
138					</#if> 
139					</#list> 
140                     
141                    <tr> 
142                        <td><b>Loại văn bản</b></td> 
143                        <td>${loaiVanBan}</td> 
144                    </tr> 
145                    <tr> 
146                        <td><b>Cơ quan ban hành</b></td> 
147                        <td>${coQuanBanHanh}</td> 
148                    </tr> 
149                    <tr> 
150                        <td><b>Lĩnh vực</b></td> 
151                        <td>${linhVuc}</td> 
152                    </tr> 
153                     
154                    <tr> 
155                        <td><b>Ngày ban hành</b></td> 
156                        <td> 
157						<#assign issuedDate_Data = getterUtil.getString(issuedDate.getData())> 
158						<#if validator.isNotNull(issuedDate_Data)> 
159							<#assign issuedDate_DateObj = dateUtil.parseDate("yyyy-MM-dd", issuedDate_Data, locale)> 
160							${dateUtil.getDate(issuedDate_DateObj, "dd/MM/yyyy", locale)} 
161						</#if> 
162						</td> 
163                    </tr> 
164                    <tr> 
165                        <td><b>Ngày hiệu lực</b></td> 
166                        <td> 
167						<#assign effectiveDate_Data = getterUtil.getString(effectiveDate.getData())> 
168						 <#if validator.isNotNull(effectiveDate_Data)> 
169							<#assign effectiveDate_DateObj = dateUtil.parseDate("yyyy-MM-dd", effectiveDate_Data, locale)> 
170							${dateUtil.getDate(effectiveDate_DateObj, "dd/MM/yyyy", locale)} 
171						</#if> 
172						</td> 
173                    </tr> 
174                    <tr> 
175                        <td><b>Ngày hết hiệu lực</b></td> 
176                        <td> 
177						<#assign expirationDate_Data = getterUtil.getString(expirationDate.getData())> 
178						<#if validator.isNotNull(expirationDate_Data)> 
179							<#assign expirationDate_DateObj = dateUtil.parseDate("yyyy-MM-dd", expirationDate_Data, locale)> 
180							${dateUtil.getDate(expirationDate_DateObj, "dd/MM/yyyy", locale)} 
181						</#if> 
182						</td> 
183                    </tr> 
184                    <tr> 
185					   <#assign description = .vars["reserved-article-description"].data ?trim > 
186						<#assign docgenrowbttom = "" > 
187						<#if !validator.isBlank(description)> 
188							 <#assign docgenrowbttom = "doc-gen-row-bttom" > 
189						</#if> 
190                        <td><b>Trích yếu</b></td> 
191                        <td> 
192						${htmlUtil.escape(.vars["reserved-article-description"].data)} 
193						</td> 
194                    </tr> 
195                    <tr> 
196                    </tr> 
197					<tr> 
198                    
199                </tbody></table> 
200	 
201	<div class="doc-gen-row doc-gen-row-bttom doc-gen-font-bold"> 
202		Tài liệu đính kèm 
203	</div> 
204		<div class="doc-gen-row"> 
205			<#assign extensionsImg =".jpg_.jpeg_.bmp_.gif_.png"> 
206	    	<#assign urlIconAttachment = "" > 
207			<#assign pathToDownloadAll = "" />		 
208			<#assign iconDownloadall = "" />	 
209			<#if validator.isNotNull(attachment.getData())> 
210			    <#list attachment.getSiblings() as file> 
211					<#assign isPDF = false > 
212					<#assign arrString = file.getData()?string?split("/")/> 
213					<#assign filename = arrString[4] /> 
214					<#assign pathToDownloadAll = pathToDownloadAll +"'" + file.getData() + "'" + "," /> 
215					 
216					<#if (filename?lower_case)?contains(".doc")> 
217					    <#assign urlIconAttachment = themeDisplay.getPathThemeRoot() + "/images/imageVanBan/WORD.png" >						 
218					   <#elseif (filename?lower_case)?contains(".rtf")> 
219					    <#assign urlIconAttachment = themeDisplay.getPathThemeRoot() + "/images/imageVanBan/WORD.png" >				 
220					<#elseif (filename?lower_case)?contains(".pdf")> 
221						<#assign isPDF = true > 
222						<#assign urlIconAttachment = themeDisplay.getPathThemeRoot() + "/images/imageVanBan/PDF.png" > 
223					<#elseif (filename?lower_case)?contains(".xls")> 
224						<#assign urlIconAttachment = themeDisplay.getPathThemeRoot() + "/images/imageVanBan/EXCEL.png" >	 
225					<#else> 
226						<#assign urlIconAttachment = themeDisplay.getPathThemeRoot() + "/images/imageVanBan/OTHER.png" > 
227						<!--Kiem tra co phai la img khong--> 
228						<#list extensionsImg?split("_") as x> 
229							<#if (filename?lower_case)?contains(x)>						 
230								<#assign isPDF = true >						 
231							</#if> 
232						</#list>																		 
233					</#if>					 
234					 
235					<#assign iconDownloadall = themeDisplay.getPathThemeRoot() + "/images/imageVanBan/vb-download.png" > 
236					<#assign iconVBDownload = themeDisplay.getPathThemeRoot() + "/images/imageVanBan/vb-download.png" > 
237					<#assign iconVBReview = themeDisplay.getPathThemeRoot() + "/images/imageVanBan/vb-review.png" > 
238					 
239					<div class="attachFile"> 
240						<div class="col-xs-12 col-sm-8 doc-gen-padd-no doc-gen-row-bttom-mobile style-padding-bottom-attachFile"> 
241							<a href="${file.getData()}"><img  src="${urlIconAttachment}"></a> 
242							<span class="title_down" style="word-wrap: break-word;">${HttpUtil.decodeURL(filename,true)}</span> 
243						</div> 
244						 
245						<div class="col-xs-12 col-sm-4 doc-gen-file-dk"> 
246							<a class="col-xs-5 col-sm-5 doc-gen-padd-no" href="${file.getData()}" download> 
247								<img src="${iconVBDownload}"> 
248								Tải về 
249							</a> 
250							<#if isPDF> 
251								<a class="col-xs-7 col-sm-7 doc-gen-padd-no" href="${file.getData()}" target="_blank"> 
252									<img src="${iconVBReview}" /> 
253									Xem trước 
254								</a> 
255							</#if> 
256						</div>	 
257					</div>					 
258			    </#list> 
259				<#assign pathToDownloadAll = "javascript:downloadAllFiles(" + .vars['reserved-article-author-id'].data + ", [" + pathToDownloadAll + "], '${code.getData()}')" /> 
260				<#if (attachment.getSiblings()?size >1) > 
261					<div class="hidden-xs col-sm-8 doc-gen-padd-no doc-gen-row-bttom-mobile style-padding-bottom-attachFile"> 
262					</div> 
263					<a href="${pathToDownloadAll}"> 
264					<div class="col-xs-12 col-sm-4 doc-gen-file-dk doc-gen-file-dk-all"> 
265						<img  src="${iconDownloadall}"> 
266						<span style="word-wrap: break-word;">Tải về tất cả tài liệu</span> 
267					</div> 
268					</a> 
269				</#if> 
270			<#else> 
271			    <div class="doc-gen-no-file-dk"> 
272			         Không có tài liệu đính kèm 
273		        </div> 
274			</#if> 
275		</div> 
276</div> 
277</div> 
278 
279 
280<a id="hiddenDownload" style="display: none;"></a> 
281 
282<script type="text/javascript"> 
283	/** Perform download all files of the selected record. */ 
284	function downloadAllFiles(id, urls, code) { 
285		zipFiles(id, urls, code); 
286
287 
288	function zipFiles(id, urls, code) { 
289		var jszip = new JSZip(); 
290		doZip(jszip, urls, 0, code); 
291
292	 
293	function doZip(jszip, urls, index, code) { 
294		var fileName = urls[index].split('/')[4]; 
295		 
296		JSZipUtils.getBinaryContent(urls[index], function(err, data) { 
297			if (!err) { 
298				jszip.file(fileName, data, { 
299					binary : true 
300				}); 
301				 
302				if (++index == urls.length) { 
303					jszip.generateAsync({ 
304						type : "blob" 
305					}).then(function(content) { 
306					    var zipName = "tailieudinhkem"; 
307					    if(code != ""){ 
308					        zipName = code; 
309
310						var a = $("#hiddenDownload"); 
311						a.attr("download", zipName); 
312						a.attr("href", URL.createObjectURL(content)); 
313						document.getElementById("hiddenDownload").click(); 
314					}); 
315				} else { 
316					doZip(jszip, urls, index, code); 
317
318
319		}); 
320
321 
322</script>