Tuesday, February 26, 2013

ECM on Cloud


Table of Contents
Overview…………………………………………………………………………………...
What is CMIS………………………………………………………………………………
What is SaaS………………………………………………………………………………..
Architecture…………………………………………………………………………………
CMIS Documentum…………………………………………………………………………
Implementation Approach……………………………………………………………………
Advantage…………………………………………………………………………………...

Overview                                            
In my last article I had shown how documents can be retrieved from a mobile device from Documentum repository. Now I thought to discuss a cloud based ECM system which interacts with different ECM vendors. Yes, you are thinking correct; this cloud based ECM system is independent of ECM vendors like EMC Documentum, Alfresco Document Management, IBM Content Manager or Microsoft SharePoint.  Technologies are changing day by day, so it’s a time to move from web based application to cloud based application.  Your favorite cell phone or tablet can become effective way to communicate between different repositories.  One person can access documents from one repository to another repository seamlessly and for this we do not need to develop vendor specific application.  Well, this solution can be achieved using CMIS- Content Management Interpretability Service.


What is CMIS?
CMIS is a standard developed by OASIS to communicate between different Enterprise content management systems. CMIS uses Web services and Web 2.0 interfaces to enable rich information to be shared across Internet protocols in vendor-neutral formats, among document systems, publishers and repositories, within one enterprise and between companies. CMIS is vendor independent and it has its own APIs to talk to different repositories. Using CMIS one repository can communicate to another repository(Figure 1). CMIS comes with two different flavors : i) RestFul AtomPub binding ii) Webservice binding. In my application I’ve used AtomPub binding. Atom feed has many advantage over RSS feed like image or audio file can be handled by Atom feed but RSS feed deals with only plain text and html.
CMIS provides different services like Repository service, Object Service, Version service, Policy service.

  

                                                                          Figure 1


Below is one atom example which I used to create Folder called CloudTest –

<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/"
xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/">
<title>CloudTest</title>
<cmisra:object>
<cmis:properties>
<cmis:propertyId propertyDefinitionId="cmis:objectTypeId"><cmis:value>cmis:folder</cmis:value></cmis:propertyId>
</cmis:properties>
</cmisra:object>
</entry>

By executing the below crul command, we can create a sub folder under a folder called cmistest in Alfresco repository.


curl -X POST -uadmin:admin "http://localhost:8080/alfresco/s/cmis/s/workspace:SpacesStore/p/cmistest/children" -H "Content-Type:application/atom+xml" -d @C:/CMIS/testFolder.atom.xml

 Below is Atom example of creating document –


<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:cmisra="http://docs.oasisopen.org/ns/cmis/restatom/200908/"  
xmlns:cmis="http://docs.oasisopen.org/ns/cmis/core/200908/">
<title>sample.doc</title>
<summary>A sample Doc</summary>
<content type="application/msword">
Cloud Test
</content>
<cmisra:object>
<cmis:properties>
<cmis:propertyId propertyDefinitionId="cmis:objectTypeId"><cmis:value>cmis:document</cmis:value></cmis:propertyId>
</cmis:properties>
</cmisra:object>
</entry>

Command –
curl -X POST -uadmin:admin "http://localhost:8080/alfresco/s/cmis/s/workspace:SpacesStore/p/cmistest/CloudTest/children" -H "Content-Type: application/atom+xml" -d @C:/CMIS/testDoc.atom.xml

Query language to fetch info from CMIS repository –
We do not need to use DQL to query Documentum repository, instead we you can use CMIS query. It looks like –
SELECT * FROM cmis:document

Here obvious question is where is the security? CMIS does not talk about security. There are many ways to implement security. One of the ways I followed is encode the content using Apache Base64 encoding. So before putting your message, content needs to be encoded.



What is SaaS

Cloud computing means you are not selling your product instead you are renting your product as a service.  There are 3 types of service available in market – i) Infrastructure as a service(IaaS) ii) Software as a service(SaaS) and iii) Platform as a service (PaaS). Again, Cloud service can be divided into 3 categories  i) Public Cloud ii) Private Cloud and iii)Hybrid Cloud



There is a big challenge In ECM market which cloud should be used. Considering the fact of security, an IT company can host Private cloud and configure ECM strategy.  ECM on cloud solution can be implemented as SaaS in private cloud to make it secure.


Architecture diagram - 



                                                                            Figure 3


CMIS Documentum
EMC has launched Documentum 6.7 which is CMIS compliant.  You can also use 6.6 version of CS.
Below Documentum object types are mapped with CMIS types –

Documentum Object Type
CMIS Object type
dm_folder
cmis:folder
dm_document
cmis:document
dm_relation
cmis:relation

                                                                 Document properties
CMIS property
 Documentum property Description
cmis:name
object_name
cmis:objected
 r_object_id
cmis:objectTypeId
 r_object_type
cmis:createdBy
r_creator_name
cmis:creationDate
 r_creation_date
cmis:lastModifiedBy
r_modifier
cmis:lastModificationDate
r_modification_date

ACL representation with only CMIS basic permissions
<cmis:acl>
<cmis:permission>
<cmis:principal>
<cmis:principalId>dm_world</cmis:principalId>
</cmis:principal>
<cmis:permission>cmis:read</cmis:permission>
<cmis:direct>true</cmis:direct>
</cmis:permission>
<cmis:permission>
<cmis:principal>
<cmis:principalId>dm_owner</cmis:principalId>
</cmis:principal>
<cmis:permission>cmis:write</cmis:permission>
<cmis:direct>true</cmis:direct>
</cmis:permission>
<cmis:permission>
<cmis:principal>
<cmis:principalId>docu</cmis:principalId>
</cmis:principal>
<cmis:permission>cmis:read</cmis:permission>
<cmis:direct>true</cmis:direct>
</cmis:permission>
</cmis:acl>



Below are the steps which you need to implement if you want to deploy any other app sever other than Content server –
1.     Download emc-cmis.war from EMC Download center
2.     Change the connection information in dfc.properties
3.     cmis-runtime.properties file defines application behavior at CMIS layer. You may need to modify as per requirement.
4.     RESTful AtomPub binding can be obtained from this address:

http://<host>:<port>/<contextPath>/resources/

Implementation Approach:
In my application I’ve used Android to communicate with CMIS repository.  As stated in the above diagram a user using mobile device first launch this application. Authentication can be done against LDAP directory through SOAP.  To make it more secure I used http basic authentication to successfully login to repository.
Here is code snippet –

String url ="http://192.168.1.109:8080/alfresco/cmisatom";
        HttpClient client = new HttpClient( );
        HttpState state = client.getState( );
       
        Credentials credentials =
            new UsernamePasswordCredentials( "admin", "***" );
       state.setCredentials( null, null, credentials );
       HttpMethod method = new GetMethod( url );
       client.executeMethod( method );
       String response = method.getResponseBodyAsString( );

Below are the two snapshots, figure 4 & 5 -

                                                                    
                                                                                         
                
                   Figure 4                                                                  Figure 5


After user login, application will display default folder structure which is present in Alfresco repository and each folder will display corresponding documents, figure 6 &7.


         
         
              Figure 6                                                                           Figure 7

Below screenshot describes how folder structure looks like in Alfresco repository when through Alfresco web application –



User has the ability to check-out and check-in a new version of a document. User can also read document directly from repository. I have introduced cache mechanishim to make the document available in less time. This application has the ability to take metadata input and store the same in Repository during Check-in operation. This metadata can be custom or default of repository. Figure 8, 9 and 10 describes this behavior –


     Figure 8                                                                               Figure 9


                                                                      Figure 10

I’ve seen people are too lazy to write some information because today’s technology is well advance. Instead of writing people generally prefer to take picture and use this information later as per requirement. This application is perfectly suitable to serve these purpose  Any user can take photo and upload it respective repository in cloud.  Figure 11 describes the same –

                                               





Advantage:
Considering the current trend in technology, I’ve found mobile application running on Android or Apple devices are emerging market. There are many advantages of this application –
1.     It is difficult for one user to fetch a information from different repository. For example, in an organization, HR related documents are stored in Alfresco repository and Documentum stores Finance related documents. In this scenario, its difficult to fetch or write information at the same time.  This application is well suited for this purpose.  
2.     There is scope to integrate BPM with this application.
3.     User can easily upload photo in any repository.


Please feel free to write to me at sumantapakira@gmail.com for any assistance or opportunity . 

Reference:
Link : https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=cmis, http://developer.android.com/guide/components/fundamentals.html