With osCaddie, we try to continuously improve the Drupal - Alfresco integration. Traditionally, Alfresco is used as a back-end document repository, and Drupal as the front-end. Drupal is a flexible CMS, and this is a very good tool for creating a nice, dynamic and ergonomic user interface. On the other side, Alfresco is a very powerful document management system, but it’s not trivial to deeply tweak the UI. The classic osCaddie integration is based on the CMIS standard : Alfresco is used as a CMIS server, while Drupal is set as a CMIS browser. This provides a way to manage documents stored in Alfresco, from Drupal. In an attempt to push the integration further, we wanted to create an integration at the UI level : We wanted to integrate a custom Alfresco document view inside a iframe, on the Drupal side. We thought it would greatly improve the user experience, as it would allow users to manage documents the same way they would do from Alfresco Share, without having to connect to another webapp. They would be able to trigger actions from Alfresco Share & Drupal from the same page. In order to do that, we first needed to create a custom Alfresco Share page. This is an easy task, and the Alfresco wiki is well documented about that : http://wiki.alfresco.com/wiki/Share_Custom_Pages We needed to create a new “Page definition”, “template instance” and “template”. Since we just wanted to simplify the “document-details” page, we copied those 3 files for this page, renamed them and removed the unnecessary parts, to create our “custom-document-details” page. This custom page only had to include those 3 elements from the original document details page :
- Passing the “view” argument to the “Actions” component of the page, in the “template-instance” page. This parameter should match the “action group” name. As the original “document-details” page uses the “document-details” action group name, we chose to create a new “document-customdetails” action group name.
- Create a new DoclistActionGroupResolver (Java Class) by overriding the DefaultDoclistActionGroupResolver, and declare it as “resolver.doclib.customActionGroup” in the spring context. This new CustomDoclistActionGroupResolver is responsible to give the “action-group” name as an output from the node details and the “view” argument received as input. In our case, we want to return “document-customdetails” when input string “view” equals “customdetails”.
- Edit the share-custom-config.xml to :
- Use that new CustomDoclistActionGroupResolver, instead of the DefaultDoclistActionGroupResolver
- Set the different actions available in that custom action group “document-customdetails”
<config evaluator="string-compare" condition="DocLibActions"> <actionGroupResolver>resolver.doclib.customActionGroup>/actionGroupResolver> <actionGroups> <actionGroup id="document-customdetails"> <action index="100" id="document-download" /> <action index="110" id="document-view-content" /> </actionGroup> </actionGroups> </config>