CMIS content viewer portlet, a Liferay plugin to query and render CMIS objects from an Alfresco CMIS repository

A usual situation in many-content (web and media) systems is the combination of a portal (such as Liferay Portal) and a CMIS 1.0 container such as Alfresco repository. That architectural aproximation consists on one hand, of a java portal as CMS presentation tier, and on the other, a ECM repository as its CMIS backend. Our requirement is to render CMIS objects via Liferay portlet delegating the workflow publication and the definition of the corresponding types and metadata for blog, events, web documents and media assets in Alfresco repository. So the general purpose of this portlet, is to be a content viewer portlet of CMIS objects from an external repository.
We developed a portlet that can execute a configurable groovy script for rendering CMIS objects. Groovy is a dynamic programming language (like python, ruby or perl) that is used as a scripting language within the java plattform.
The configuration of the portlet allows to specify all required data:

  • CMIS Repository: Binding type('AtomPub', 'Webservices'), Authentication mode ('None', 'Standard'), and url of the CMIS repository and the username and password (if needed)
  • CMIS data query: a CMIS query, limit of the number of the results given for the defined query, and a root parent search folder for restricting the search by path in CMIS repository. The portlet also uses Liferay variables when the query will be executed: '[$COMPANYID$]', '[$GROUPID$]', '[$USERID$]', '[$SCREENNAME$]', '[$LOCALE$]', '[$COUNTRY$]' and '[$LANGUAGE$]'
  • Groovy script: The groovy script allows to read, process and check the resulting list of CMIS objects (called 'objects') for specified query. A Liferay variable of the class 'ThemeDisplay' (called themeDisplay') contains the information related to Liferay: the logged user in the portal, the current community, the current language etc. etc.


The properties of CMIS repository are set in the configuration of the portlet:



with the corresponding CMIS query:



and the groovy script to render:



The groovy script can preview the final results, before publishing:


And finally, in a Liferay page:



This portlet is tested in LF 6.0 EE SP1 & SP2, LF 6.1.x CE, and Alfresco 4.x EE and Nuxeo 5.6 DM CMIS repositories.


Más entradas de blog

Añadir comentarios