Difference between revisions of "Summer of Code 2013/CMIS UCP"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Current Project Status)
Line 58: Line 58:
 
   Status: '''DONE'''
 
   Status: '''DONE'''
 
* ''Code to be able to browse the contents of a repository through the internal file open dialog box''.  
 
* ''Code to be able to browse the contents of a repository through the internal file open dialog box''.  
   Status: ''In Progress''
+
   Status: ''DONE''
 
* ''To be able to open and save files''.  
 
* ''To be able to open and save files''.  
   Status:
+
   Status: ''DONE''
 
* ''Creating, deleting, copying and moving content''.
 
* ''Creating, deleting, copying and moving content''.
   Status:
+
   Status:''Creating, copying and moving are possible through the API but not through the Open Dialog. Deleting is supported''
 
* ''To develop an options page to configure the repository connection''. Also manage the user and several repositories. To use the internal password container.
 
* ''To develop an options page to configure the repository connection''. Also manage the user and several repositories. To use the internal password container.
   Status:  
+
   Status: ''DONE''
 
* ''Support for https connection''. Using internal certificate store and use the interaction handler.
 
* ''Support for https connection''. Using internal certificate store and use the interaction handler.
   Status:
+
   Status: ''DUE FOR NEXT VERSION''
  
 
== Current Project Status ==
 
== Current Project Status ==
Line 80: Line 80:
  
 
the url to be used in the file dialog is - '''cmis://localhost:8080/inmemory/atom/A1/My_Folder-0-0/My_Folder-1-0'''
 
the url to be used in the file dialog is - '''cmis://localhost:8080/inmemory/atom/A1/My_Folder-0-0/My_Folder-1-0'''
 +
 +
The server URL must be configured through the options page. Only then, the file/folder can be accessed in the above format. Also, the server URL can be configured by directly opening the root folder of the repository through the open dialog. The Username and password is stored in the the Openoffice password container.
 +
  
 
The content identifier will be split into two parts: Server URL(includes Repository ID), LocalPATH when used for the first time.  
 
The content identifier will be split into two parts: Server URL(includes Repository ID), LocalPATH when used for the first time.  
THe Server URL will then be stored in the openoffice configuration, along with the user credentials. When the user logs in for the second time, the splitting of URL is easier and less time consuming, because the Server URL will be accessed from the configuration file. This configuration can be done using the options page of the extension.
 
  
 
<big>UCB Commands Implemented:</big>
 
<big>UCB Commands Implemented:</big>
Line 96: Line 98:
 
# "createNewContent"
 
# "createNewContent"
  
A separate class called CMISResourceManager has been created to access the object on a CMIS Repository which provides all the functionality supported by the service Content including obtaining content properties and  inputstream. Basically, this class acts as a bridge between OpenCMIS and the UCP. Every XContent object is linked to a CMISResourceManager object.  
+
Use options page top configure/modify the URL-User credentials set.
 +
A separate class called CMISResourceManager has been created to access the object on a CMIS Repository which provides all the functionality supported by the service Content including obtaining content properties and  inputstream. Basically, this class acts as a bridge between OpenCMIS and the UCP. Every XContent object is linked to a CMISResourceManager object. All the Session and ResourceManager objects are cached so that the session is not recreated. Helps reducing the network activity.  
  
 
Currently all the supported properties are queryable by executing the "getPropertyValues" UCB command.
 
Currently all the supported properties are queryable by executing the "getPropertyValues" UCB command.
Line 106: Line 109:
  
 
Creating a new document in the CMIS repository is supported thorugh OpenOffice Save dialog. Although I expected this to work by using "createNewContent" ucb calls, it happens through "transfer" command which transfers a temporary file stored on the hard drive to the cmis repository.  
 
Creating a new document in the CMIS repository is supported thorugh OpenOffice Save dialog. Although I expected this to work by using "createNewContent" ucb calls, it happens through "transfer" command which transfers a temporary file stored on the hard drive to the cmis repository.  
 
I have implemented the "globalTransfer" command which can transfer file or folder from any source to a CMIS Repository.
 
  
 
"Delete" completely deletes the object from the repository. Unfiling will be supported in the coming days.  
 
"Delete" completely deletes the object from the repository. Unfiling will be supported in the coming days.  
  
Other commands are in the debugging and testing stage.  
+
Other commands are in the debugging and testing stage. Tested on the inmemory repository and the nuxeo demo server.  
  
 
<big>Content Properties:</big>
 
<big>Content Properties:</big>

Revision as of 14:25, 22 September 2013


  • Student: Rajath S.
  • Mentor: Juergen Schmidt (jsc)

Code hosted at: https://github.com/rajaths589/CMISContentProvider.git

Project Description

Before I describe my project plan I would like to write a bit about CMIS and UCP:


CMIS is an acronym for Content Management Interoperability Services. CMIS establishes a standard for all the Enterprise Content Management systems just like what SQL did for the relational databases. CMIS is an abstract layer used for controlling various web repositories and document management systems. Advantages of CMIS is that it is platform independent and available for a wide-range of programming languages. (For more information, links have been provided in the references section). OpenCMIS/Apache CheMISitry is a collection of libraries/tools/frameworks for CMIS client and server development. It is available as Java, Python , PHP , .NET , Objective-C libraries/modules.

UCP is Universal Content Provider. Apache OpenOffice connects to various data sources using Universal Content Broker(UCB) which has a core module and a set of UCP’s for each source. UCB provides generalized access to data sources and a set of functions for querying, modifying, creating, access to folder tree, meta content of documents, permissions,etc. The advantage of UCB is that it provides a common perspective for developer irrespective of the data source. UCPs mask the difference between access protocols for various sources by providing interfaces for access to that particular data source. Currently, UCPs exist for FILE(file-system), WebDAV-HTTP(web-based file-systems and HTTP), FTP(file transfer protocol), Hierarchy(Virtual file hierarchy), ZIP/JAR, Help files(OpenOffice Help files) and Extension Package Content(access to openoffice extensions).

Now, my project is to create a UCP for access to CMIS compliant repositories. Various functionalities include: access to folder tree, changing document properties, version control, creation/deletion documents, setting access permissions, moving files, etc. A sidebar will also be created which will provide access to all these features.

My work can be broken down into these components:

1. Familiarising myself with APIs This includes both OpenCMIS and OpenOffice API. -- JAVA

2. Designing the UI for sidebar

3. Module: Authentication to repositories using a standard authorization protocol. (One that already exists in OpenOffice API).

4. Module: Browser for file hierarchy of the repository. --viewing the folder tree, copying, moving, deleting files.

5. Module: File Properties Editor. -- Changing Permissions, meta data, etc.

6. Module: Version Control.

7. Changes in OpenOffice: Save/Saveas in repository. Recent files accessed from CMIS in recent documents list,etc.

8. UCP: Using all the modules built to create a UCP for CMIS. Integrating the UCP with the UCB.

References:

1. http://wiki.openoffice.org/wiki/Documentation/DevGuide/UCB/

2. http://chemistry.apache.org/project/cmis.html

3. http://www.oldschooltechie.com/blog/2009/11/23/introduction-cmis

4. CMIS and Apache Chemistry in action - Book.

5. http://en.wikipedia.org/wiki/Content_Management_Interoperability_Services

Programming language: Java. Platform: Linux - Ubuntu 12.10

Project Plan

My project plan is marked by milestones. Each milestone is alloted a particular time for completion. But, the time taken to achieve a milestone may vary slightly due to unexpected situations or difficulties faced.

Milestones:

  • Setup Apache OpenOffice Java SDK. Also, setup OpenOffice build environment.
 Status: DONE
  • Get acquainted with OpenCMIS Java Client Libraries. Setting up the development environment. Also, to setup a local inmemory chemistry server for testing. Code an own client to upload and retrieve a .odt document. Then, manually open the .odt from the OpenOffice.
 Status: DONE
  • Code to be able to browse the contents of a repository through the internal file open dialog box.
 Status: DONE
  • To be able to open and save files.
 Status: DONE
  • Creating, deleting, copying and moving content.
 Status:Creating, copying and moving are possible through the API but not through the Open Dialog. Deleting is supported
  • To develop an options page to configure the repository connection. Also manage the user and several repositories. To use the internal password container.
 Status: DONE 
  • Support for https connection. Using internal certificate store and use the interaction handler.
 Status: DUE FOR NEXT VERSION

Current Project Status

URL Scheme to browse a CMIS compliant repository thorugh the file open dialog box: cmis://<server-url>/<repository-id>/<localpath-of-the-object> for http connections cmiss://<server-url>/<repository-id>/<localpath-of-the-object> for https connections

for example: for a local inmemory server with url: http://localhost:8080/inmemory/atom repository id: A1 path of the object relative to root of the repository: /My_Folder-0-0/My_Folder-1-0

the url to be used in the file dialog is - cmis://localhost:8080/inmemory/atom/A1/My_Folder-0-0/My_Folder-1-0

The server URL must be configured through the options page. Only then, the file/folder can be accessed in the above format. Also, the server URL can be configured by directly opening the root folder of the repository through the open dialog. The Username and password is stored in the the Openoffice password container.


The content identifier will be split into two parts: Server URL(includes Repository ID), LocalPATH when used for the first time.

UCB Commands Implemented:

  1. "getCommandInfo"
  2. "getPropertySetInfo"
  3. "getPropertyValues"
  4. "setPropertyValues"
  5. "open"
  6. "transfer"
  7. "delete"
  8. "insert"
  9. "creatableContentsInfo"
  10. "createNewContent"

Use options page top configure/modify the URL-User credentials set. A separate class called CMISResourceManager has been created to access the object on a CMIS Repository which provides all the functionality supported by the service Content including obtaining content properties and inputstream. Basically, this class acts as a bridge between OpenCMIS and the UCP. Every XContent object is linked to a CMISResourceManager object. All the Session and ResourceManager objects are cached so that the session is not recreated. Helps reducing the network activity.

Currently all the supported properties are queryable by executing the "getPropertyValues" UCB command. The supported properties are listed in the content properties section. The property values are wrapped in an implementation of XRow which is returned when the command is executed.

Only, The title of the Content can be changed using the "setPropertyValues" ucb command. All the other properties are read-only.

"Open" of a folder and a document is supported through the file dialog now. The properties of children of a folder are provided through the implementation of XDynamicResultSet. THe inputstream is supplied using ByteArrayToXInputStreamAdapter from the OpenOffice API.

Creating a new document in the CMIS repository is supported thorugh OpenOffice Save dialog. Although I expected this to work by using "createNewContent" ucb calls, it happens through "transfer" command which transfers a temporary file stored on the hard drive to the cmis repository.

"Delete" completely deletes the object from the repository. Unfiling will be supported in the coming days.

Other commands are in the debugging and testing stage. Tested on the inmemory repository and the nuxeo demo server.

Content Properties:

  1. Title (String)
  2. IsFolder (Boolean)
  3. IsDocument (Boolean)
  4. DateCreated (DateTime)
  5. DateModified (DateTime)
  6. Size (HYPER)
  7. MediaType (STRING)
  8. ContentType (STRING - application/cmis-document or application/cmis-folder)
  9. ID (STRING)
  10. CreatedBy (STRING)
  11. ModifiedBy (STRING)

These Content Properties are directly mapped the CmisObject properties using the PropertyIDs in the CMIS API.

Setting up OpenCMIS JAVA Client Libraries

Platform: Linux - Ubuntu 12.10

Setup involves:

  1. Java Client Libraries
  2. Testing Components:
   # OpenCMIS workbench
   # OpenCMIS In-memory repository

Steps involved:

  1. Download OpenCMIS JAVA Client Libraries with Dependencies from [1]. Extract it to a folder. The .jar files inside this folder are the libraries which can be imported into a project in your IDE.
  2. To Setup Workbench:
   # Download OpenCMIS Workbench from [1]. Extract it to a folder.
   # "cd" to that folder and give permission to the shell script by "chmod +x ./workbench.sh".
   # Run "./workbench.sh" to start the workbench.
  1. To Setup In-memory Repository:
   # Download OpenCMIS Server Webapps from [1]. Extract it to obtain chemistry-opencmis-server-inmemory-<version>.war
   # Any servlet deployer can be used to deploy the .war file. I chose Eclipse Jetty. Alternatively, Apache Tomcat can be used. Download Eclipse Jetty from [2]. Extract it.
   # Copy the .war file to <jetty-installation-folder>/webapps folder. Rename the .war file to "inmemory.war" to obtain shorter URL. In the same folder create inmemory.xml configuration file with the following lines:
   <Configure class="org.eclipse.jetty.webapp.WebAppContext">
       <Set name="contextPath">/inmemory</Set>
       <Set name="war"><jetty-installation-path>/webapps/inmemory.war</Set> 
   </Configure>
   # Run "java -jar start.jar" in <jetty-installation-folder> to start the inmemory repository.

Links: [1]. http://chemistry.apache.org/java/download [2]. http://download.eclipse.org/jetty/stable-9/dist/

Personal tools