Search
处理模板时发生错误。
For "?size" left-hand operand: Expected an extended-hash or sequence or extended collection, but this has evaluated to a string (wrapper: f.t.SimpleScalar):
==> productType [in template "20099#20125#4886299" at line 385, column 42]
----
FTL stack trace ("~" means nesting-related):
- Failed at: #assign count = productType?size [in template "20099#20125#4886299" at line 385, column 25]
----
1<#--
2Widget templates can be used to modify the look of a
3specific application.
4
5Please use the left panel to quickly add commonly used variables.
6Autocomplete is also available and can be invoked by typing "${".
7-->
8
9<style>
10.tooltip.bs-tooltip-bottom.fade{
11 line-height:2px;
12}
13.tooltip-wrapper {
14 position: relative;
15 display: inline-block;
16}
17
18.tooltip-preview {
19 display: inline-block;
20 max-width: 180px;
21 white-space: nowrap;
22 overflow: hidden;
23 text-overflow: ellipsis;
24 cursor: pointer;
25 color: #0053f0;
26 font-weight: 500;
27}
28
29.tooltip-box {
30 display: none;
31 position: absolute;
32
33 top: 110%;
34 left: 0;
35 z-index: 9999;
36 min-width: 200px;
37
38 background: #fff;
39 border: 1px solid #ccc;
40 padding: 8px;
41 border-radius: 6px;
42 box-shadow: 0 3px 12px rgba(0,0,0,0.15);
43
44 opacity: 0;
45 transform: translateY(5px);
46 transition: opacity .2s ease, transform .2s ease;
47}
48
49.tooltip-wrapper:hover .tooltip-box {
50 display: block;
51 opacity: 1;
52 transform: translateY(0);
53}
54
55.tooltip-item {
56 padding: 4px 0;
57 border-bottom: 1px dashed #ddd;
58}
59
60.tooltip-item:last-child {
61 border-bottom: none;
62}
63
64.card, .card-horizontal {
65 box-shadow: 1px 1px 3px -1px rgb(0 0 0 / 60%);
66}
67.makeFavoriteSelected .glyphicon{
68 color:#0058DD !important
69}
70.makeFavorite:hover .glyphicon{
71 color:#0058DD !important
72}
73.cardBorder{
74 border:0px;
75 border-bottom: 3px solid;
76 border-image: linear-gradient(to right,#53b351,#5bbfd6,#4c1570) 10;
77}
78.custom-control-input:checked ~ .custom-control-label::before {
79 background-color: #1848b6;
80 border-color: #1848b6;
81 box-shadow: none;
82 color: #fff;
83}
84.custom-control:only-child {
85 margin-bottom: 0;
86}
87.custom-control {
88 margin:10px 0;
89}
90.search-facet .facet-clear-btn {
91 background: transparent;
92 color: #1848b6;
93}
94.pagination-bar{
95 background:#fff;
96}
97.panel-body {
98 padding: 0rem 1.25rem;
99}
100.search-bar {
101 box-shadow: 1px 1px 2px -1px rgb(0 0 0 / 60%);
102}
103
104.search-bar .form-control, .search-bar .input-group-inset-item {
105 background-color: inherit;
106}
107.disabledClick {
108 pointer-events: none;
109}
110.confidential.docType {
111 position: absolute;
112 top: 38%;
113 z-index: 1;
114 font-weight: bold;
115 color: #ff000085;
116 font-size: 24px;
117 font-family: Arial;
118 transform: rotate(341deg);
119}
120
121.customers.docType {
122 position: absolute;
123 top: 38%;
124 text-align: center;
125 z-index: 1;
126 font-weight: bold;
127 color: #ff8f00a8;
128 font-size: 24px;
129 font-family: Arial;
130 transform: rotate(341deg);
131}
132 .modal-content{
133 box-shadow: none !important;
134 border: none ! important;
135 background: transparent !important;
136}
137.colseIcon{
138 position: absolute;
139 right: 5px;
140 color: #fff;
141 font-size: 42px;
142 font-weight: normal;
143 padding-bottom: 10px;
144}
145button.close:focus {
146 box-shadow: none !important;
147 outline: 0;
148}
149video#videoimg {
150 width: 100%;
151 min-height: 450px;
152}
153</style>
154<style>
155
156 .hoverAcctoin{
157 position: relative;
158 }
159
160 .hoverAcctoin:hover .hoverContainer{
161 opacity: 1;
162 visibility: visible;
163
164 }
165 .hoverContainer{
166 opacity: 0;
167 visibility: hidden;
168 transition: opacity 0.4s ease, visibility 0.4s ease;
169 }
170 .feature-list-tooltip li > span:first-child {
171 width: 50%;
172 font-weight: 600;
173 }
174 .feature-list-tooltip{
175 list-style-type: none;
176 background: #ffffff;
177 margin: 0;
178 padding: 10px;
179 position: absolute;
180 left: 0px;
181 box-sizing: -50%;
182 bottom: 0;
183 z-index: 1;
184 border: .1rem solid #dee5e7;
185 border-radius: .4rem;
186 -webkit-box-shadow: .1rem .1rem .3rem rgba(0, 0, 0, .1);
187 box-shadow: .1rem .1rem .3rem rgba(0, 0, 0, .1);
188 font-size: 12px;
189 font-weight: 500;
190 left: -18px;
191 right: -18px;
192 }
193 .feature-list-tooltip li{
194 padding:3px 0 ;
195 display: flex;
196 align-items: flex-start;
197 gap:5px;
198 }
199 .feature-list-tooltip li img{
200 width: 24px;
201 height: 24px;
202 margin-right: 10px;
203
204 }
205 .hoverContainer hr{
206 border: 0.5px solid #ccc;
207 margin: 7px 0;
208 }
209 ul.p_type {
210 padding: 0;
211 }
212 .spanv{
213 flex: 1;
214 }
215
216
217 </style>
218<script>
219 function toggleView(event) {
220 if(event == 'tileView'){
221 document.getElementById("tileView").style.display = 'block';
222 document.getElementById("listView").style.display = 'none';
223 document.getElementById("tileViewAction").childNodes[0].classList.add("text-primary");
224 document.getElementById("listViewAction").childNodes[0].classList.remove("text-primary");
225 }else{
226 document.getElementById("tileView").style.display = 'none';
227 document.getElementById("listView").style.display = 'block';
228 document.getElementById("tileViewAction").childNodes[0].classList.remove("text-primary");
229 document.getElementById("listViewAction").childNodes[0].classList.add("text-primary");
230 }
231 }
232
233 function getFavList(favClass, url){
234 isUrlInFav(url).then(data => {
235 console.log(url + ', exists in fav: ' + data);
236 if(data){
237 $('.'+favClass).addClass('makeFavoriteSelected');
238 }else{
239 $('.'+favClass).removeClass('makeFavoriteSelected');
240 }
241 });
242 }
243 function getFavorite(favClass, url){
244 $('.'+favClass).addClass('disabledClick');
245 if($('.'+favClass).hasClass("makeFavoriteSelected")){
246 removeFromFav(url).then(data => {
247 console.log('remove: ' + data);
248 $('.'+favClass).removeClass("makeFavoriteSelected");
249 $('.'+favClass).removeClass("disabledClick");
250 });
251 }else{
252 addToFav(url).then(data => {
253 console.log('added: ' + data);
254 $('.'+favClass).addClass("makeFavoriteSelected");
255 $('.'+favClass).removeClass("disabledClick");
256 });
257 }
258 }
259 $(function () {
260 $('[data-toggle="tooltip"]').tooltip()
261})
262 function openVModel(url){
263 document.getElementById("videoModel").classList.remove('hide');
264 document.getElementById("modal-backdrop").classList.remove('hide');
265 document.getElementById("videoModel").classList.add('show');
266 document.getElementById("modal-backdrop").classList.add('show');
267 document.getElementById("videoimg").src = url
268 }
269 function closeVModel(url){
270 document.getElementById("videoModel").classList.remove('show');
271 document.getElementById("modal-backdrop").classList.remove('show');
272 document.getElementById("videoModel").classList.add('hide');
273 document.getElementById("modal-backdrop").classList.add('hide');
274 document.getElementById("videoimg").src = '';
275 }
276 </script>
277<#if entries?has_content>
278
279<div class="modal bd-example-modal-lg hide fade" id="videoModel" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
280 <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
281 <div class="modal-content">
282 <button onClick="closeVModel()" type="button" class="close" id="closeVideoModel" aria-label="Close">
283 <span class="colseIcon" aria-hidden="true">×</span>
284 </button><div class="">
285 <video id="videoimg" width="100%" src="" controls autoplay controlsList="nodownload">Your browser does not support HTML video.</video>
286 </div>
287
288 </div>
289 </div>
290</div>
291<div id="modal-backdrop" class="modal-backdrop hide fade"></div>
292
293<div class="bg-white px-4 py-2">
294<div class="d-flex justify-content-end align-items-center my-2">
295 <div class="justdoit">
296 <a data-toggle="tooltip" data-placement="bottom" title="Thumbnail view" id="tileViewAction" onclick="toggleView('tileView')" aria-label="Tile view" class="btn text-secondary btn-default mx-1 p-0"><span class="glyphicon glyphicon-th text-primary" aria-hidden="true"></span></a>
297 <a data-toggle="tooltip" data-placement="bottom" title="List view" id="listViewAction" onclick="toggleView('listView')" aria-label="List view" class="btn text-secondary btn-default mx-1 p-0"><span class="glyphicon glyphicon-list" aria-hidden="true"></span></a>
298 </div>
299 </div>
300<div id="tileView">
301
302<div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 g-3">
303 <#list entries as entry>
304 <#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") />
305 <#assign assetEntry = assetEntryLocalService.getEntry(entry.getClassName(), entry.getClassPK()) />
306 <#if entry.getClassName()?has_content && entry.getClassName() == "com.liferay.document.library.kernel.model.DLFileEntry">
307 <#assign DLFileEntryLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService") />
308 <#assign fileEntry = DLFileEntryLocalService.getDLFileEntry(entry.getClassPK()) />
309 <#if fileEntry?? && fileEntry.getExpandoBridge()??>
310 <#assign expandoBridge = fileEntry.getExpandoBridge()! />
311 <#assign documentType = expandoBridge.getAttribute("Documenttype")!"" />
312 <#assign applicationType = expandoBridge.getAttribute("Applicationtype")!"" />
313 <#assign productType = expandoBridge.getAttribute("Producttype")!"" />
314 <#assign permissionType = expandoBridge.getAttribute("Permissiontype")!"" />
315 <#assign languageType = expandoBridge.getAttribute("Languagetype")!"" />
316 <#assign roleType = expandoBridge.getAttribute("Roletype")!"" />
317 <#assign fileSizeBytes = fileEntry.getSize() />
318 <#assign fileSizeMB = (fileSizeBytes / (1024 * 1024))?string("0.##") />
319 <#assign modifiedDate = fileEntry.getModifiedDate() />
320 <#assign formattedModifiedDate = dateUtil.getDate(modifiedDate, "MMM dd yyyy, hh:mm", locale) />
321 </#if>
322 </#if>
323 <div class="col mb-5 mt-2">
324 <div class="card border border-light h-100 mb-0">
325 <#if entry.getThumbnailURLString()??>
326 <div role="img" class="cardBorder" style="background:url('${entry.getThumbnailURLString()}') center center no-repeat; width:100%; height:225px; background-size:contain;background-color: #eee;display: flex;justify-content: center;position: relative;">
327 <#list assetEntry.getCategories() as category>
328 <#if category.getName() == "Confidential">
329 <div style="position: absolute; top: 40%; z-index: 1; font-weight: bold; color: #fff; padding:0 5px; background: #1a63bad1; font-size: 15px; font-family: Arial; transform: rotate(341deg);
330">CONFIDENTIAL</div>
331 </#if>
332 <#if category.getName() == "Customer" >
333 <div style="position: absolute; top: 40%; z-index: 1; font-weight: bold; color: #fff; padding:0 5px; background: #cc3333b3; font-size: 15px; font-family: Arial; transform: rotate(341deg);
334">CUSTOMER SPECIFIC</div>
335 </#if>
336 </#list>
337 </div>
338 </#if>
339 <#if !entry.getThumbnailURLString()??>
340 <div role="img" class="cardBorder" style="background:url('/documents/20123/55369/defaultSearchImg.jpg') center center no-repeat; width:100%; height:225px; background-size:contain; background-color: #eee;display: flex;justify-content: center;position: relative;"">
341 <#list assetEntry.getCategories() as category>
342 <#if category.getName() == "Confidential">
343 <div style="position: absolute; top: 40%; z-index: 1; font-weight: bold; color: #fff; padding:0 5px; background: #1a63bad1; font-size: 15px; font-family: Arial; transform: rotate(341deg);
344">CONFIDENTIAL</div>
345 </#if>
346 <#if category.getName() == "Customer" >
347 <div style="position: absolute; top: 40%; z-index: 1; font-weight: bold; color: #fff; padding:0 5px; background: #cc3333b3; font-size: 15px; font-family: Arial; transform: rotate(341deg);
348">CUSTOMER SPECIFIC</div>
349 </#if>
350 </#list>
351 </div>
352 </#if>
353 <div class="card-body">
354 <h4>
355
356 <div class="clearfix publishedDate mb-2 text-secondary small">
357 <#if entry.getCreationDateString()??>
358 ${entry.getCreationDateString()}
359 </#if>
360 </div>
361 <#if entry.getAssetRendererURLDownload() ??>
362 <#assign urlString = entry.getAssetRendererURLDownload()?replace("https://contentportal.ambiq.com", "") />
363 <#assign regexMatchedUrlString = urlString?matches("(/.*)/+?")>
364 <#list regexMatchedUrlString as matchedString>
365 <#assign matchedUrlString = matchedString?groups[1]>
366 </#list>
367 <#else>
368 <#assign matchedUrlString = "">
369 </#if>
370 <div class="clearfix hoverAcctoin" style=" min-height: 57px;">
371 <#if matchedUrlString?has_content >
372 <#if matchedUrlString?ends_with(".mp4")>
373 <a style="color:#272833" onclick="openVModel('${urlString}')">${entry.getHighlightedTitle()}</a>
374
375 <!-- <a target="_blank" style="color:#272833" href="${matchedUrlString}">${entry.getHighlightedTitle()}</a>-->
376 <#else>
377 <a target="_blank" style="color:#272833" href="${matchedUrlString}">${entry.getHighlightedTitle()}</a>
378
379<ul class="feature-list-tooltip hoverContainer">
380 <li>
381 <span>Document Type: </span><span class="spanv">${documentType!}</span>
382 </li>
383 <li>
384 <span>Product Type:</span>
385 <#assign count = productType?size />
386
387 <#if count == 1>
388 <div class="single-value">
389 ${productType[0]}
390 </div>
391
392 <#elseif count gt 1>
393 <#assign firstValue = productType[0] />
394 <#assign remainingValues = productType[1..] /> <!-- list from 2nd onwards -->
395
396 <div class="tooltip-wrapper">
397
398 <span class="tooltip-preview spanv">
399 ${firstValue} +${remainingValues?size} more
400 </span>
401
402 <div class="tooltip-box">
403 <#list remainingValues as item>
404 <div class="tooltip-item">${item}</div>
405 </#list>
406 </div>
407
408 </div>
409 </#if>
410 </li>
411 <li>
412 <span>Application: </span>
413 <#assign count = applicationType?size />
414
415 <#if count == 1>
416 <div class="single-value">
417 ${applicationType[0]}
418 </div>
419
420 <#elseif count gt 1>
421 <#assign firstValue = applicationType[0] />
422 <#assign remainingValues = applicationType[1..] /> <!-- list from 2nd onwards -->
423
424 <div class="tooltip-wrapper">
425
426 <span class="tooltip-preview spanv">
427 ${firstValue} +${remainingValues?size} more
428 </span>
429
430 <div class="tooltip-box">
431 <#list remainingValues as item>
432 <div class="tooltip-item">${item}</div>
433 </#list>
434 </div>
435
436 </div>
437 </#if>
438 </li>
439
440 <li><span>Access Classification:</span><span class="spanv"> ${permissionType!}</span></li>
441
442 <#if roleType?? && roleType?has_content>
443 <li><span>Customer: </span><span class="spanv"> ${roleType!}</span></li>
444 </#if>
445 <div><hr></div>
446 <#if languageType?? && languageType?has_content>
447 <li><span>Language:</span><span class="spanv"> ${languageType!}</span></li>
448 </#if>
449 <li><span>Size:</span><span class="spanv"> ${fileSizeMB!} MB</span></li>
450 <li><span>Modified Date:</span> <span class="spanv">${formattedModifiedDate!}</span></li>
451 </ul>
452
453 </#if>
454
455 <#else>
456 <a target="_blank" style="color:#272833" href="${entry.getViewURL()}">${entry.getHighlightedTitle()}</a>
457 </#if>
458 </div>
459 </h4>
460 <div style="display:flex; flex-direction:row; justify-content:space-between; align-items:center; width:100%;">
461
462 <!-- LEFT -->
463 <div style="white-space:nowrap;">
464 <a target="_blank" style="color:#272833" href="${matchedUrlString}">Open Document</a>
465 </div>
466
467 <!-- RIGHT -->
468 <div style="white-space:nowrap;">
469 <#if matchedUrlString?has_content && themeDisplay.isSignedIn() >
470 <script>
471 getFavList('makeFavorite-${entry?index}', '${matchedUrlString}');
472 </script>
473
474 <a data-toggle="tooltip"
475 data-placement="bottom"
476 title="Favorites"
477 onclick="getFavorite('makeFavorite-${entry?index}', '${matchedUrlString}')"
478 class="makeFavorite makeFavorite-${entry?index}">
479 <span aria-hidden="true" class="glyphicon glyphicon-bookmark text-muted"></span>
480 </a>
481 </#if>
482 </div>
483
484 </div>
485
486 <!--<div class="d-flex justify-content-start align-items-center">
487 Link
488 </div>
489 <div class="d-flex justify-content-end align-items-center">
490 <#if matchedUrlString?has_content && themeDisplay.isSignedIn() >
491 <script>
492 getFavList('makeFavorite-${entry?index}', '${matchedUrlString}');
493 </script>
494 <a data-toggle="tooltip" data-placement="bottom" title="Favorites" onclick="getFavorite('makeFavorite-${entry?index}', '${matchedUrlString}')" class="makeFavorite makeFavorite-${entry?index}">
495 <span aria-hidden="true" class="glyphicon glyphicon-bookmark text-muted"></span>
496 </a>
497 </#if>
498 </div>-->
499 </div>
500 </div>
501 </div>
502 </#list>
503 </div>
504</div>
505
506
507
508<div id="listView" class="display-list" style="display:none">
509 <ul class="list-group">
510 <#list entries as entry>
511 <#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") />
512 <#assign assetEntry = assetEntryLocalService.getEntry(entry.getClassName(), entry.getClassPK()) />
513 <li class="list-group-item list-group-item-flex py-2 border-left-0 border-top-0 border-right-0 my-2">
514 <div class="autofit-col h-100 p-0">
515 <#if entry.getThumbnailURLString()??>
516 <div role="img" class="border border-light" style="background:url('${entry.getThumbnailURLString()}') center center no-repeat; width:150px; height:130px; background-size:contain; background-color: #eee; position: relative; display: flex; justify-content: center;">
517 <#list assetEntry.getCategories() as category>
518 <#if category.getName() == "Confidential" >
519 <div style="position: absolute; top: 40%; z-index: 1; font-weight: bold; color: #fff; padding:0 5px; background: #1a63bad1; font-size: 12px; text-align: center; font-family: Arial; transform: rotate(341deg);
520">CONFIDENTIAL</div>
521 </#if>
522 <#if category.getName() == "Customer" >
523 <div style="position: absolute; top: 40%; z-index: 1; font-weight: bold; color: #fff; padding:0 5px; background: #cc3333b3; font-size: 12px; text-align: center; font-family: Arial; transform: rotate(341deg);
524">CUSTOMER SPECIFIC</div>
525 </#if>
526 </#list>
527 </div>
528 </#if>
529 <#if !entry.getThumbnailURLString()??>
530 <div role="img" class="border border-light border-top-0 border-end-0 border-start-0" style="background:url('/documents/20123/55369/defaultSearchImg.jpg') center center no-repeat; width:150px; height:130px; background-size:contain; background-color: #eee; position: relative; display: flex; justify-content: center;">
531 <#list assetEntry.getCategories() as category>
532 <#if category.getName() == "Confidential" >
533 <div style="position: absolute; top: 40%; z-index: 1; font-weight: bold; color: #fff; padding:0 5px; background: #1a63bad1; font-size: 12px; text-align: center; font-family: Arial; transform: rotate(341deg);
534">CONFIDENTIAL</div>
535 </#if>
536 <#if category.getName() == "Customer" >
537 <div style="position: absolute; top: 40%; z-index: 1; font-weight: bold; color: #fff; padding:0 5px; background: #cc3333b3; font-size: 12px; text-align: center; font-family: Arial; transform: rotate(341deg);
538">CUSTOMER SPECIFIC</div>
539 </#if>
540 </#list>
541 </div>
542 </#if>
543 </div>
544
545 <div class="autofit-col autofit-col-expand px-3">
546 <section class="autofit-section pt-1 ">
547 <h4>
548 <div class="clearfix publishedDate mb-2 text-secondary small">
549 <#if entry.getCreationDateString()??>
550 ${entry.getCreationDateString()}
551 </#if>
552 </div>
553 <#if entry.getAssetRendererURLDownload() ??>
554 <#assign urlString = entry.getAssetRendererURLDownload()?replace("https://contentportal.ambiq.com", "") />
555 <#assign regexMatchedUrlString = urlString?matches("(/.*)/+?")>
556 <#list regexMatchedUrlString as matchedString>
557 <#assign matchedUrlString = matchedString?groups[1]>
558 </#list>
559 <#else>
560 <#assign matchedUrlString = "">
561 </#if>
562 <div class="clearfix " style=" min-height: 57px;">
563 <#if matchedUrlString?has_content >
564 <#if matchedUrlString?ends_with(".mp4")>
565 <a style="color:#272833" onclick="openVModel('${urlString}')">${entry.getHighlightedTitle()}</a>
566 <#else>
567 <a target="_blank" style="color:#272833" href="${matchedUrlString}">${entry.getHighlightedTitle()}</a>
568 </#if>
569 <#else>
570 <a target="_blank" style="color:#272833" href="${entry.getViewURL()}">${entry.getHighlightedTitle()}</a>
571 </#if>
572 </div>
573 </h4>
574
575 <#if entry.getContent()??>
576 <p>
577 ${entry.getContent()}
578 </p>
579 </#if>
580
581 <div class="d-flex justify-content-end align-items-center position-absolute" style="top: 0; right: 0;">
582 <#if matchedUrlString?has_content && themeDisplay.isSignedIn() >
583 <script>
584 getFavList('makeFavorite-${entry?index}', '${matchedUrlString}');
585 </script>
586 <a data-toggle="tooltip" data-placement="bottom" title="Favorites" onclick="getFavorite('makeFavorite-${entry?index}', '${matchedUrlString}')" class="makeFavorite makeFavorite-${entry?index}">
587 <span aria-hidden="true" class="glyphicon glyphicon-bookmark text-muted"></span>
588 </a>
589 </#if>
590 </div>
591 </section>
592 </div>
593
594 </li>
595 </#list>
596 </ul>
597</div>
598</div>
599</#if>