Videos / palestras
Videos / palestras
VÍDEOS
An error occurred while processing the template.
The following has evaluated to null or missing: ==> xPathSelector.selectSingleNode( root ) [in template "37328#37369#78073" at line 316, column 41] ---- 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: #assign erro = xPathSelector.selectSi... [in template "37328#37369#78073" in function "getSingleNode" at line 316, column 25] ----
1<#--
2- widget template de asset publisher
3- file path: liferay-workspace\manual-import\web-content-related\videos-palestras\widget-template\videos-palestras-paginado.ftl
4- nome no portal: ADT | Vídeos e palestras paginado
5-->
6<#--
7- file path: default-theme/assets/palestras/palestras.ftl
8- new file path: liferay-workspace\manual-import\old-web-content-related\palestras\asset-publisher.ftl
9-->
10
11<#function getNodeValue node>
12 <#return node.selectSingleNode("dynamic-content").getStringValue()/>
13</#function>
14
15<#function getNodeChild node childName>
16 <#return node.selectSingleNode("dynamic-element[@field-reference='" + childName + "']")/>
17</#function>
18
19<#function getNodeChildren node childrenName>
20 <#return node.selectNodes("dynamic-element[@field-reference='" + childrenName + "']")/>
21</#function>
22
23<#function getNodeChildValue node childName>
24 <#local nodeChild = getNodeChild(node, childName)/>
25 <#return getNodeValue(nodeChild)/>
26</#function>
27
28<#function getJournalRootNode journal>
29 <#local document = saxReaderUtil.read(journal.content)/>
30 <#return document.getRootElement()/>
31</#function>
32
33<#function getAssetRootNode asset>
34 <#local journal = asset.getAssetRenderer().getArticle()/>
35 <#return getJournalRootNode(journal)>
36</#function>
37
38<#function getNodeChildImageJSONObject node childImageName>
39 <#local imageJSONString = getNodeChildValue(node, childImageName)/>
40 <#return jsonFactoryUtil.createJSONObject(imageJSONString)/>
41</#function>
42
43 <#function getViewURL asset>
44 <#return themeDisplay.getURLHome() + "/w/" + asset.getAssetRenderer().getUrlTitle()/>
45</#function>
46
47<#function getAssetViewURL asset>
48 <#return themeDisplay.getURLHome() + "/w/" + asset.getAssetRenderer().getUrlTitle()/>
49</#function>
50
51<#function getJournalViewURL journal>
52 <#return themeDisplay.getURLHome() + "/w/" + journal.getUrlTitle()/>
53</#function>
54
55
56<#macro assetImage asset imageKey>
57 <#local
58 assetRootNode = getAssetRootNode(asset)
59 imageJSONObject = getNodeChildImageJSONObject(assetRootNode, imageKey)
60 imageSrc = imageJSONObject.getString("url")!""
61 imageAlt = imageJSONObject.getString("alt")!""
62 />
63
64 <img class="cetiqt_image cetiqt_aspect-ratio" src="${imageSrc}" alt="${imageAlt}"/>
65</#macro>
66
67<#macro assetClickableImage asset imageKey>
68 <#local
69 assetRootNode = getAssetRootNode(asset)
70 imageJSONObject = getNodeChildImageJSONObject(assetRootNode, imageKey)
71 imageSrc = imageJSONObject.getString("url")!""
72 imageAlt = imageJSONObject.getString("alt")!""
73 />
74
75 <a href="${getViewURL(asset)}">
76 <img class="cetiqt_clickable-image cetiqt_aspect-ratio" src="${imageSrc}" alt="${imageAlt}"/>
77 </a>
78</#macro>
79
80<#macro assetDate asset dateKey>
81 <#local
82 rootNode = getAssetRootNode(asset)
83 dateString = getNodeChildValue(rootNode, dateKey)
84 dateObj = dateUtil.parseDate("yyyy-MM-dd", dateString, locale)
85 date = dateUtil.getDate(dateObj, "dd MMM, yyyy", locale)
86 >
87 <span class="cetiqt_date">${date}</span>
88</#macro>
89
90<#macro assetDateAndCategory asset dateKey>
91 <#local
92 rootNode = getAssetRootNode(asset)
93 dateString = getNodeChildValue(rootNode, dateKey)
94 dateObj = dateUtil.parseDate("yyyy-MM-dd", dateString, locale)
95 date = dateUtil.getDate(dateObj, "dd MMM, yyyy", locale)
96
97 assetCategories = asset.getCategories()
98 >
99 <span class="cetiqt_date">${date}</span>
100
101 <#if (assetCategories?size) != 0 >
102 <#local destaqueCategoryName = asset.getCategories()[0].name/>
103 <span class="cetiqt_category">${destaqueCategoryName}</span>
104 </#if>
105</#macro>
106
107<#macro assetCreateDateAndCategory asset>
108 <#setting locale=locale.toString()>
109
110 <#local
111 createDate = asset.getCreateDate()?datetime?string("dd MMM, yyyy")
112 assetCategories = asset.getCategories()
113 >
114 <span class="cetiqt_date">${createDate}</span>
115
116 <#if (assetCategories?size) != 0 >
117 <#local destaqueCategoryName = asset.getCategories()[0].name/>
118 <span class="cetiqt_category">${destaqueCategoryName}</span>
119 </#if>
120</#macro>
121
122<#macro assetTags asset>
123 <#local tagsNames = asset.getTagNames()>
124
125 <span>
126 <#list tagsNames as tagName>
127 <#-- TODO: extrair searchEndpoint para configuração de portlet ou tema -->
128 <#local
129 searchEndpoint = "/blog"
130 tagURL = themeDisplay.getURLHome() + searchEndpoint + "?tag=" + tagName
131 />
132
133 <a href="${tagURL}" class="cetiqt_tag mr-2">
134 ${tagName}
135 </a>
136 </#list>
137 </span>
138</#macro>
139
140<#macro assetTitle asset titleKey>
141 <#local
142 assetRootNode = getAssetRootNode(asset)
143 title = getNodeChildValue(assetRootNode, titleKey)
144 />
145
146 <p class="cetiqt_paragraph clearfix component-paragraph text-break">
147 <a href="${getViewURL(asset)}">
148 ${title}
149 </a>
150 </p>
151</#macro>
152
153<#macro assetFullCard asset imageKey titleKey mobile=false>
154 <#if mobile>
155 <div class="mb-2">
156 <@assetClickableImage asset imageKey/>
157 </div>
158 <@assetCreateDateAndCategory asset/>
159 <@assetTags asset/>
160
161 <div class="mt-2 mb-3" style="color: var(--preto); font-weight: var(--font-weight-bold); font-size: 15px; line-height: 25px;">
162 <@assetTitle asset titleKey/>
163 </div>
164 <#else>
165 <div class="pb-3">
166 <@assetClickableImage asset imageKey/>
167 </div>
168
169 <@assetCreateDateAndCategory asset/>
170 <@assetTags asset/>
171
172 <div class="pb-6 pt-3" style="color: var(--preto); font-weight: var(--font-weight-bold); font-size: 18px; line-height: 30px;">
173 <@assetTitle asset titleKey/>
174 </div>
175 </#if>
176</#macro>
177
178<#macro assetThumbnail asset imageKey onclick>
179 <#local
180 assetRootNode = getAssetRootNode(asset)
181 imageJSONObject = getNodeChildImageJSONObject(assetRootNode, imageKey)
182 imageSrc = imageJSONObject.getString("url")!""
183 imageAlt = imageJSONObject.getString("alt")!""
184 fileEntryId = imageJSONObject.getString("fileEntryId")!""
185 />
186
187 <div
188 class="cetiqt_clickable-image-container"
189 onclick="${onclick}"
190 >
191 <img
192 class="cetiqt_aspect-ratio" alt="${imageAlt}"
193 data-fileentryid="${fileEntryId}" src="${imageSrc}"
194 />
195
196 <svg class="cetiqt_play-icon" width="45" height="45" viewBox="0 0 45 45" fill="none" xmlns="http://www.w3.org/2000/svg">
197 <circle cx="22.5" cy="22.5" r="22.5" fill="var(--branco)"/>
198 <path d="M32.0439 22.5221L17.7608 30.7685L17.7608 14.2757L32.0439 22.5221Z" fill="var(--preto)"/>
199 </svg>
200 </div>
201
202 <style>
203 .cetiqt_clickable-image-container .cetiqt_play-icon {
204 width: 45px;
205 }
206
207 .cetiqt_clickable-image-container .cetiqt_play-icon:hover circle {
208 fill: var(--preto);
209 }
210
211 .cetiqt_clickable-image-container .cetiqt_play-icon:hover path {
212 fill: var(--branco);
213 }
214
215 .cetiqt_paragraph a {
216 text-decoration: none;
217 }
218
219 @media (max-width: 992px) {
220 .cetiqt_paragraph {
221 margin-top: 12px;
222 margin-bottom: 0;
223 }
224
225}
226 </style>
227</#macro>
228
229
230<#macro forAssetPublisher>
231 <#assign searchContainer = renderRequest.getAttribute("ASSET_PUBLISHER_DISPLAY_CONTEXT").getSearchContainer()/>
232
233 <#assign total = searchContainer.getTotal() />
234 <#assign start = searchContainer.getStart() />
235 <#assign delta = searchContainer.getDelta() />
236 <#assign totalPages = (total/delta)?ceiling />
237 <#assign currentPage = ((start+1)/delta)?ceiling />
238
239 <#assign iteratorURL = searchContainer.getIteratorURL() />
240
241 ${iteratorURL.setParameter("cur", "${currentPage-1}")}
242 <#assign previousURL = iteratorURL.toString() />
243 ${iteratorURL.setParameter("cur", "${currentPage+1}")}
244 <#assign nextURL = iteratorURL.toString() />
245
246 <div class="d-flex justify-content-center mb-5 mt-5">
247 <div class="pagination-container">
248 <a href="${previousURL}"><</a>
249 <div> ${currentPage} / ${totalPages} </div>
250 <a href="${nextURL}">></a>
251 </div>
252 </div>
253
254 <style>
255 .pagination-container{
256 border: 1px solid #000000;
257 border-radius: 20px;
258 height: 40px;
259 min-width: 100px;
260 display: inline-flex;
261 justify-content: space-between;
262 align-items: center;
263 padding: 12px;
264 color: #000;
265 font-size: 15px;
266 font-style: normal;
267 }
268
269 .pagination-container:hover {
270 text-decoration: none;
271 color: white;
272 background-color: black;
273 }
274
275 .pagination-container a{
276 padding: 12px;
277 color: inherit;
278 background-color: transparent;
279 }
280
281 .pagination-container a:hover {
282 text-decoration:none;
283 color: white;
284 }
285
286 .lfr-pagination{
287 display:none;
288 }
289 </style>
290</#macro>
291
292
293<#assign prefix = "cetiqt-videos-palestras" />
294<#assign image404 = "https://via.placeholder.com/300x300?text=404" />
295<#assign dlAppService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppService")>
296<#assign categoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") >
297<#assign tagsLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetTagLocalService") >
298
299<#assign imageKey = "image"/>
300<#assign videoURLKey = "Text15427042"/>
301<#assign dateKey = "date"/>
302<#assign noticiaKey = "WebContent60037133"/>
303<#assign titleKey = "title"/>
304
305<#function getRootElement curEntry>
306 <#assign assetRenderer = curEntry.getAssetRenderer() />
307 <#assign article = assetRenderer.getArticle() />
308 <#assign document = saxReaderUtil.read(article.getContent()) />
309 <#return { "root": document.getRootElement(), "article": article } />
310</#function>
311<#assign erro = "">
312
313<#function getSingleNode name root>
314
315 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@field-reference='${name}']/dynamic-content[@language-id='${locale}']") />
316 <#assign erro = xPathSelector.selectSingleNode( root )>
317 <#if xPathSelector.selectSingleNode( root )??>
318 <#return xPathSelector.selectSingleNode( root ).getStringValue()?trim />
319
320 <#else>
321 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@field-reference='${name}']") />
322 <#return xPathSelector.selectSingleNode( root ).getStringValue()?trim />
323
324 </#if>
325</#function>
326
327<style>
328 .${prefix}__title{
329 font-style: normal;
330 font-weight: bold;
331 font-size: 20px;
332 line-height: 30px;
333 text-transform: uppercase;
334 font-feature-settings: 'cpsp' on;
335 color: #000000;
336 }
337
338 .${prefix}__date{
339 font-style: normal;
340 font-weight: 300;
341 font-size: 11px;
342 line-height: 30px;
343 color: #4F4E4E;
344 text-transform: uppercase;
345 }
346
347 .${prefix}-container{
348 display: grid;
349 grid-column-gap: 50px;
350 grid-template-columns: auto;
351 }
352
353 @media(min-width:1025px){
354 .${prefix}-container{
355 grid-template-columns: repeat(3, minmax(0, 1fr));
356 }
357
358 .${prefix}__card-item{
359 max-width: 569px;
360 }
361 }
362
363 .${prefix}-item__play{
364 position: absolute;
365 transform: translate(-50%, -50%);
366 top: 50%;
367 left: 50%;
368 cursor:pointer;
369 }
370
371 .custom-modal-window__content iframe{
372 position:absolute;
373 top:0;
374 left:0;
375 width:100%;
376 height:100%;
377 }
378</style>
379
380<script>
381 const cetiqt = {
382 openModal: function() {
383 const cetiqtModal = document.querySelector('#cetiqt_modal');
384 if (cetiqtModal) {
385 cetiqtModal.style.display='block';
386 document.body.style.overflowY = 'hidden';
387 }
388 },
389 openVideoPlayerModal: function(url) {
390 document.querySelector('#cetiqt-video-player-modal.video-player-modal').style.display = 'block';
391 document.querySelector('#cetiqt-video-player-modal .video-player-video-container').setAttribute('src', url);
392 },
393 closeVideoPlayerModal: function() {
394 document.querySelector('#cetiqt-video-player-modal.video-player-modal').style.display = 'none';
395 document.querySelector('#cetiqt-video-player-modal .video-player-video-container').setAttribute('src', '');
396 },
397 openYoutubePlayerModal: function(url) {
398 document.querySelector('#cetiqt-youtube-player-modal.youtube-player-modal').style.display = 'block';
399 document.querySelector('#cetiqt-youtube-player-modal .youtube-player-video-container').setAttribute('src', _cetiqt_processYoutubeURL(url));
400 },
401 closeYoutubePlayerModal: function() {
402 document.querySelector('#cetiqt-youtube-player-modal.youtube-player-modal').style.display = 'none';
403 document.querySelector('#cetiqt-youtube-player-modal .youtube-player-video-container').setAttribute('src', '');
404 },
405 };
406
407 function _cetiqt_isShortYoutubeURL(url) {
408 return ['www.youtu.be', 'youtu.be'].includes(url.hostname);
409 }
410
411 function _cetiqt_processYoutubeURL(urlString) {
412 const youtubeEmbedURL = 'https://www.youtube.com/embed/';
413
414 if (urlString.includes(youtubeEmbedURL)) {
415 return urlString;
416 }
417
418 const url = new URL(urlString);
419 const videoId = _cetiqt_isShortYoutubeURL(url) ? url.pathname.substr(1) : url.searchParams.get('v');
420
421
422 return youtubeEmbedURL + videoId;
423 }
424</script>
425
426<#assign AssetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService")/>
427
428<#if entries?has_content>
429 <div class="${prefix}-container">
430 <#list entries as entry>
431 <#assign
432 element = getRootElement(entry)
433 title = getSingleNode(titleKey, element.root)
434>
435
436 <#assign
437 journalJSONString = getSingleNode(noticiaKey, element.root)
438 journalJSONObj = jsonFactoryUtil.createJSONObject(journalJSONString)
439 hasNoticia = journalJSONObj.length() != 0
440
441 assetRootNode = getAssetRootNode(entry)
442 videoURL = getNodeChildValue(assetRootNode, videoURLKey)
443 />
444
445
446 <div class="mb-4 d-flex flex-column">
447 <div class="d-none d-lg-block d-xl-block">
448 <@assetThumbnail entry imageKey "cetiqt.openYoutubePlayerModal('${videoURL}')"/>
449
450 <div class="d-block mt-4 mb-2">
451 <@assetDateAndCategory entry dateKey/>
452 </div>
453 <p class="cetiqt_paragraph clearfix component-paragraph text-break mb-4" style="color:
454 black; font-weight: 700; font-size: 18px; line-height: 30px;">
455 <#if hasNoticia>
456 <#assign
457 noticiaAsset = AssetEntryLocalService.getEntry(journalJSONObj.getString("className"), journalJSONObj.getString("classPK")?number)
458 noticiaViewURL = getViewURL(noticiaAsset)
459 />
460 <a href="${noticiaViewURL}">
461 ${title}
462 </a>
463 <#else>
464 <a href="javascript:" onclick="cetiqt.openYoutubePlayerModal('${videoURL}');return false;">
465 ${title}
466 </a>
467 </#if>
468 </p>
469 </div>
470
471 <div class="d-lg-none d-xl-none">
472 <@assetThumbnail entry imageKey "cetiqt.openYoutubePlayerModal('${videoURL}')"/>
473 <!--
474 <div class="d-block pt-3">
475 <@assetDateAndCategory entry dateKey/>
476 </div>
477 -->
478 <p class="cetiqt_paragraph clearfix component-paragraph text-break" style="color: black; font-weight: 700; font-size: 15px; line-height: 25px;">
479 <#if hasNoticia>
480 <#assign
481 noticiaAsset = AssetEntryLocalService.getEntry(journalJSONObj.getString("className"), journalJSONObj.getString("classPK")?number)
482 noticiaViewURL = getViewURL(noticiaAsset)
483 />
484 <a href="${noticiaViewURL}">
485 ${title}
486 </a>
487 <#else>
488 <a href="javascript:" onclick="cetiqt.openYoutubePlayerModal('${videoURL}');return false;">
489 ${title}
490 </a>
491 </#if>
492 </p>
493 </div>
494 </div>
495 </#list>
496 </div>
497 <@forAssetPublisher/>
498</#if>
— 12 Items per Page
assine nossa newsletter
E RECEBA NOSSOS MELHORES CONTEÚDOS!