19 de noviembre de 2015

:: Liferay. Generar fichero .ICS desde Velocity

Para generar un fichero .ICS con los eventos de la agenda desde una plantilla Velocity en el CMS Liferay, el código a utilizar es el siguiente:


#set ($serviceContext = $portal.getClass().forName("com.liferay.portal.service.ServiceContextThreadLocal").getServiceContext())
#set ($httpServletRequest = $serviceContext.getRequest())
##get the real themeDisplay object, not the $themeDisplay map
#set ($objThemeDisplay = $httpServletRequest.getAttribute("THEME_DISPLAY"))

#set ($exportURL = $portletURLFactory.create($httpServletRequest, "8", $objThemeDisplay.getPlid(), "ACTION_PHASE"))
#set ($temp = $exportURL.setWindowState("exclusive"))
#set ($temp = $exportURL.setPortletMode("view"))
#set ($temp = $exportURL.setParameter("struts_action", "/calendar/export_events"))
#set ($temp = $exportURL.setParameter("exportFileName", "events.ics"))


Sobre la capa con la clase "export-ics" aplicaremos los estilos que sean necesarios.

No hay comentarios:

Publicar un comentario

Déjanos tu comentario

:: Liferay. Script para ir al inicio de la página

En diversos temas de apariencia es necesario contar un enlace que permita al usuario realizar un scroll al inicio de la página. Este comport...