Skip to end of metadata
Go to start of metadata


The CMIS plugin enables the usage of the CMIS specification via Apache Chemistry.


The current version of griffon-cmis-plugin is 0.2
To install just issue the following command


Upon installation the plugin will generate the following artifact in $appdir/griffon-app/conf:

  • CmisConfig.groovy - contains the session definitions.

A new dynamic method named withCmis will be injected into all controllers, giving you access to a org.apache.chemistry.opencmis.client.api.Sessionl object, with which you'll be able to make calls to the database. Remember to make all calls to the database off the EDT otherwise your application may appear unresponsive when doing long computations inside the EDT.
This method is aware of multiple datasources. If no dataSourceName is specified when calling it then the default dataSource will be selected. Here are two example usages, the first queries against the default datasource while the second queries a datasource whose name has been configured as 'internal'

This method is also accessible to any component through the singleton griffon.plugins.cmis.CmisConnector. You can inject these methods to non-artifacts via metaclasses. Simply grab hold of a particular metaclass and call CmisConnector.enhance(metaClassInstance).


Dynamic method injection

The withCmis() dynamic method will be added to controllers by default. You can change this setting by adding a configuration flag in Config.groovy


The following events will be triggered by this addon

  • CmisConnectStart[config, sessionName] - triggered before connecting to the datastore
  • CmisConnectEnd[sessionName, session] - triggered after connecting to the datastore
  • CmisDisconnectStart[config, sessionName, session] - triggered before disconnecting from the datastore
  • CmisDisconnectEnd[config, sessionName] - triggered after disconnecting from the datastore

Multiple datasources

The config file CmisConfig.groovy defines a default dataSource block. As the name implies this is the dataSource used by default, however you can configure named dataSources by adding a new config block. For example connecting to a dataSource whose name is 'internal' can be done in this way

This block can be used inside the environments() block in the same way as the default session block is used.


Taken from the following controller assumes the default connection is setup to query an AtomPub repo (

The usage of the onReadyEnd event handler is just for demonstration purposes; the method withCmis() can be called from anywhere in the controller.







Release sync with Griffon 0.9.4



Initial release

  • No labels