cmis document access - lotus software · pdf filecmis document access using ibm web experience...

18
CMIS Document Access using IBM ® Web Experience Factory May 29, 2012 © Copyright International Business Machines Corporation 2012. All rights reserved. Abstract This article and the accompanying sample explain how to use the new CMIS Document Access builder in IBM® Web Experience Factory Version 8.0 (hereafter called WEF or Experience Factory.) This sample includes three WEF models – standard provider and consumer models, along with a model containing some generic CMIS utilities. These models can be added to an Experience Factory project to provide access to folders and documents in a SharePoint 2010 or FileNet p8 Content Manager 5.0 CMIS repository. Prerequisites You should have a basic familiarity with Experience Factory and be able to create and run models. You will also need to have access to a SharePoint 2010 or FileNet p8 Content Manager 5.0 CMIS repository in order to run the sample application.

Upload: vuhanh

Post on 31-Jan-2018

217 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: CMIS Document Access - Lotus Software · PDF fileCMIS Document Access using IBM Web Experience Factory An Overview of CMIS CMIS stands for Content Management Interoperability

CMIS Document Accessusing IBM

® Web Experience Factory

May 29, 2012

© Copyright International Business Machines Corporation 2012. All rights reserved.

AbstractThis article and the accompanying sample explain how to use the new CMIS Document Access builder in IBM® Web Experience Factory Version 8.0 (hereafter called WEF or Experience Factory.) This sample includes three WEF models – standard provider and consumer models, along with a model containing some generic CMIS utilities. These models can be added to an Experience Factory project to provide access to folders and documents in a SharePoint 2010 or FileNet p8 Content Manager 5.0 CMIS repository.

PrerequisitesYou should have a basic familiarity with Experience Factory and be able to create and run models. You will also need to have access to a SharePoint 2010 or FileNet p8 Content Manager 5.0 CMIS repository in order to run the sample application.

Page 2: CMIS Document Access - Lotus Software · PDF fileCMIS Document Access using IBM Web Experience Factory An Overview of CMIS CMIS stands for Content Management Interoperability

CMIS Document Access using IBM Web Experience Factory

Table of ContentsAn Overview of CMIS.......................................................................................1

CMIS Data Model.........................................................................................1Repository...............................................................................................1Object......................................................................................................1Object Type.............................................................................................1Document................................................................................................1Folder......................................................................................................1Other Object Types.................................................................................1

CMIS Services.............................................................................................1Repository Services.................................................................................1Navigation Services.................................................................................2Object Services.......................................................................................2Multi-Filing Services................................................................................2Discovery Services..................................................................................2Versioning Services.................................................................................2Other Services.........................................................................................3Paging.....................................................................................................3Additional Information..............................................................................3

The Builder – CMIS Document Access............................................................4A Builder to Handle the Complexity.............................................................4The Builder Inputs........................................................................................4

General Inputs.........................................................................................4Authentication Inputs...............................................................................5CMIS Repository Inputs...........................................................................6Service Operations Inputs.......................................................................7Schema Inputs........................................................................................8Advanced Inputs......................................................................................8

Objects Generated by the CMIS Document Access Builder........................9Variables..................................................................................................9Schemas.................................................................................................9Linked Java Objects................................................................................9Data Services..........................................................................................9Service Operations................................................................................10

The Sample Application.................................................................................11Provider Model...........................................................................................11Utilities Model.............................................................................................13Consumer Model........................................................................................14

Appendix A – Service URI..............................................................................15Resources......................................................................................................16Trademarks....................................................................................................16

May 29, 2012 i

Page 3: CMIS Document Access - Lotus Software · PDF fileCMIS Document Access using IBM Web Experience Factory An Overview of CMIS CMIS stands for Content Management Interoperability

CMIS Document Access using IBM Web Experience Factory

An Overview of CMISCMIS stands for Content Management Interoperability Services. It is an OASIS standard that enables sharing of information in Content Management systems. This overview provides general information about what is defined by the CMIS specification. Some optional parts of the specification are not implemented in the CMIS Document Access builder. For a comprehensive description of CMIS, see the Resources section for a link to the CMIS specification.

CMIS Data ModelThe CMIS Data Model defines a set of entity types that are common to most content management systems. This Data Model is a general purpose mechanism for accessing content, and is not meant to provide all the functionality of a full-featured product-specific API.

Repository. The core entity in the CMIS Data Model is a repository. Conceptually, a repository is a container for other CMIS entities such as types, folders, and documents. In general, CMIS is designed to work with a single repository. So the first step in accessing CMIS information is to choose a repository. This repository (actually its ID) will be required in order to access the other entities in the CMIS Data Model and in order to access most CMIS services.

Object. The entities contained in a CMIS repository are modeled as typed object. Each object has a unique ID, an object type, and a set of typed properties based on the object type.

Object Type. CMIS defines four base object types: cmis:document, cmis:folder, cmis:relationship, and cmis:policy. Each object type is analogous to a schema, in that it defines the set of properties for objects of that type. A repository can also define descendant types that extend the base types.

Document. Documents are the primary type of object managed by a CMIS repository. Documents can contain a content stream and have one or more renditions. (A renditions id an alternate representation of a document, for example, a thumbnail image.) Documents can also be versionable.

Folder. Folders contain a set of documents and other folders. Each repository contains a root folder. A folder can have one or more renditions, but cannot have a content stream or versions.

Other Object Types. CMIS defines a few other object types, including Relationship, Policy, andAccess Control. The CMIS Document Access builder does not provide support for these types.

CMIS ServicesCMIS defines a fixed set of services that can be used to access information about a repository and the objects it contains. Each service defines a set of input parameters. There are several parameters that are common to all or most of these services, including paging parameters and parameters used to specify the amount of detail in the results.

The CMIS services are divided into groups, based on functionality or object type.

Table 1. Repository ServicesService Operation Description

getRepositories Get the list of Repository objects available from the given CMIS Service URI.getRepositoryInfo Get information about a specified Repository, and the capabilities it supports.getTypeChildren Get the list of Object Types in the Repository that are children of a specified Object Type.getTypeDescendants Get the list of Object Types in the Repository that are descendants of a specified Object Type.getTypeDefinition Get the definition of a specified Object Type.

May 29, 2012 1

Page 4: CMIS Document Access - Lotus Software · PDF fileCMIS Document Access using IBM Web Experience Factory An Overview of CMIS CMIS stands for Content Management Interoperability

CMIS Document Access using IBM Web Experience Factory

Table 2. Navigation ServicesService Operation Description

getChildren Get the list of Objects contained in a specified Folder.getDescendants Get the list of Objects contained in a specified Folder and its children.getFolderTree Get the list of descendant Folders contained in a specified Folder.getFolderParent Get the parent of a specified Folder.getObjectParents Get the parent of a specified non-folder Object.getCheckedOutDocs Get the list of checked out Documents.

Table 3. Object ServicesService Operation Description

createDocument Create a Document of a specified Object Type in a specified Folder.createDocumentFromSource Create a copy of a specified Document in a specified Folder.createFolder Create a Folder of a specified Object Type in a specified Folder.createRelationship Create a Relationship of a specified Object Type.createPolicy Create a Policy of a specified Object Type.getAllowableActions Get the list of allowable actions for a specified Object.getObject Get the information for a specified Object.getProperties Get the list of properties for a specified Object.getObjectByPath Get the information for the Object at a specified path.getContentStream Get the content stream for a specified Object.getRenditions Get the list of renditions for a specified Object.updateProperties Update the properties for a specified Object.moveObject Move the specified Object from one Folder to another.deleteObject Delete a specified Object.deleteTree Delete the specified Folder and all of its descendants.setContentStream Set the content stream of a specified Document.deleteContentStream Delete the content stream for a specified Document.

Table 4. Multi-Filing ServicesService Operation Description

addObjectToFolder Add an existing (non-folder) Object to a specified Folder.removeObjectFromFolder Remove an existing (non-folder) Object from a specified Folder.

Table 5. Discovery ServicesService Operation Description

query Execute a specified CMIS query statement in a specified Repository.getContentChanges Get a list of content changes in a specified Repository.

Table 6. Versioning ServicesService Operation Description

checkOut Create a "private working copy" of a specified document.cancelCheckOut Delete the "private working copy" of a specified document.checkIn Create a new version of a specified document, based on the "private working copy".getObjectOfLatestVersion Get the latest version of a Document in a specified Version Series.getPropertiesOfLatestVersion Get the list of properties for the latest version of a Document in a specified Version Series.getAllVersions Get a list of all Documents in a specified Version Series.

May 29, 2012 2

Page 5: CMIS Document Access - Lotus Software · PDF fileCMIS Document Access using IBM Web Experience Factory An Overview of CMIS CMIS stands for Content Management Interoperability

CMIS Document Access using IBM Web Experience Factory

Table 7. Other ServicesService Operation Description

getObjectRelationships Get a list of Relationships for a specified Object.applyPolicy Apply a specified Policy to a specified Object.getAppliedPolicies Get a list of Policies currently applied to a specified Object.getACL Get the ACL currently applied to a specified Object.applyACL Apply specified ACEs to the ACL of a specified Object.

Paging. Services that return a set of CMIS documents define paging parameters. These parameters can be defined to return a subset of the results for that service. The skipCount and maxItems parameters can be used to specify which set of items to include in the results. When the paging parameters are specified, the results will contain hasMoreItems and numItems properties.

Additional Information. Some services define input parameters that can be used to limit the information returned in the results. For example, services that return one or more CMIS objects will limit the properties returned to the set defined by by the properties parameter. The same applies for renditions and allowableActions.

May 29, 2012 3

Page 6: CMIS Document Access - Lotus Software · PDF fileCMIS Document Access using IBM Web Experience Factory An Overview of CMIS CMIS stands for Content Management Interoperability

CMIS Document Access using IBM Web Experience Factory

The Builder – CMIS Document AccessThe CMIS Document Access builder is new in WEF 8.0, available by adding the CMIS Document Access Extension feature set to your project. SharePoint 2010 and FileNet P8 Content Manager 5.0 are the only supported CMIS systems in WEF 8.0. It is possible that the CMIS Document Access builder will work with other systems (e.g. Alfresco, Connections Files, Documentum) but these systems are not supported. In addition, some aspects of the CMIS specification (e.g. Relationships, Policies, and Access Control) are not implemented in WEF 8.0

A Builder to Handle the ComplexityThe CMIS API and Data Model provide a standard way to access information in a content repository, but it can require considerable effort to understand the complexity. If a WEF developer were to use REST Service Call builders or Web Service Call builders in order to provide access to a CMIS repository, that developer would need to fully understand the details of the CMIS API and Data Model. By using the CMIS Document Access builder, the same developer could have access to the CMIS API and Data Model without needing to know the underlying details.

Figure 1. Picking the CMIS Document Access Builder

The Builder InputsTable 8. General InputsBuilder Input Description

Enable Builder This is the standard input used to enable or disable the builder call. As it relates to the CMIS Document Access builder, this input will typically be useful when the provider model contains multiple CMIS Document Access builder calls. In that case the different builder calls can be enabled based on a profile. This approach will generally work better than trying to profile the various inputs within the CMIS Document Access builder. Profiling the inputs in the CMIS Document Access builder is also possible, but can lead to more complexity than just using multiple CMIS Document Access builder calls.

Name This is the standard input for the builder name. It will be used for the name of the Data Service generated by the builder. (It will also be used as a prefix for other artifacts.)

May 29, 2012 4

Page 7: CMIS Document Access - Lotus Software · PDF fileCMIS Document Access using IBM Web Experience Factory An Overview of CMIS CMIS stands for Content Management Interoperability

CMIS Document Access using IBM Web Experience Factory

Table 9. Authentication InputsBuilder Input Description

Runtime Authentication Select the authentication type to use when the application connects to the CMIS server.

Basic Authentication. Use the specified Runtime User Name and Runtime Passwordinputs to authenticate using the HTTP Basic Authentication scheme.Use LTPA Token. Use the WebSphere LTPA-based Single Sign On (SSO) scheme. Once a user authenticates with the IBM® WebSphere® Portal server or the IBM WebSphere Application Server, they do not need to authenticate again with the CMIS server. The Portal/WAS server and the CMIS server must be configured for LTPA.

NTLM. Use the specified Runtime User Name and Runtime Password inputs to authenticate using the NTLM HTTP authentication scheme.Custom Authentication. Use the Authentication Class input to specify your own authentication code.

Runtime User Name Specify the name to use for authentication with the CMIS server.This input is only available if the Runtime Authentication input is set to Basic Authentication, NTLM, or Custom Authentication.

Runtime Password Specify the password to use for authentication with the CMIS server.This input is only available if the Runtime Authentication input is set to Basic Authentication, NTLM, or Custom Authentication.

Authentication Class Specify the fully qualified class name to be used for custom authentication. This class must implement the com.bowstreet.builders.webapp.cmis.CmisHttpConnection interface. The easiest way to accomplish this is to extend the CmisHttpUrlConnection class and supply a handleAuthentication() method. This method will manipulate the request being made to the CMIS server in whatever way is needed for authentication. For example, this method might get an HTTP header from the inbound request (to the application server) and add that header to the outbound request (to the CMIS server). Here's a simple example of what that might look like:

HttpServletRequest request = getIncomingRequest();String header_value = request.getHeader("header_name");setRequestHeader("header_name", header_value);

The getIncomingRequest() and setRequestHeader() methods used in this example are implemented by the CmisHttpUrlConnection class.

This input is only available if the Runtime Authentication input is set to Custom Authentication.

Designer Authentication Select the properties file that contains the credentials Web Experience Factory Designer will use to authenticate with the CMIS server. These credentials are only used at design time, never during runtime.The default value for this input is the following file:

/WEB-INF/config/cmis_config/designer/defaultCredentials.propertiesThis file defines the following properties:userName. The string used to identify a user for authentication.password. The string used to verify user identity for authentication. designTimeConnectionClass. The name of the connection class to use for design-time authentication with the CMIS server. See the section above for information about the requirements for this class.A copy of this file is placed in your project when you add the CMIS Document Access Extension feature set to your project. It is best practice to make a copy of this file for each CMIS server being used by your application

May 29, 2012 5

Page 8: CMIS Document Access - Lotus Software · PDF fileCMIS Document Access using IBM Web Experience Factory An Overview of CMIS CMIS stands for Content Management Interoperability

CMIS Document Access using IBM Web Experience Factory

Table 10. CMIS Repository InputsBuilder Input Description

Service URI Specify the Uniform Resource Identifier (URI) used to access the service document for your CMIS system. Each CMIS vendor uses a slightly different format for this URI, so you may need to get this value from the documentation provided with your CMIS system, or from your vendor's support center. Appendix A provides information about the Service URI for supported CMIS systems.Note: If you are accessing the CMIS server using the https protocol, you may need to add security certificates to your Designer JRE and your deployment server. See the article on the WEF wiki titled "Adding Security Certificates to a Deployment Server for Outbound Requests" for details.

Refresh Repository List Press this button after specifying the inputs for authentication and Service URI. A request is made to retrieve the CMIS service document. If the request results in a valid response, the list of available CMIS Repositories will be created. If the request does not result in a valid response, an error message will be displayed with the details.

Repository Select the CMIS Repository to be used for this builder call. For SharePoint, there will only be one Repository in this list. When a Repository is selected, it will be used to populate the Service Operations and Schema sections of the builder. In general, if this input is profiled, then the inputs for Service Operations and Document Types will need to be profiled also.

May 29, 2012 6

Page 9: CMIS Document Access - Lotus Software · PDF fileCMIS Document Access using IBM Web Experience Factory An Overview of CMIS CMIS stands for Content Management Interoperability

CMIS Document Access using IBM Web Experience Factory

Table 11. Service Operations InputsBuilder Input Description

Service Operations Specify the operations to be added to the Data Service generated by this builder call.

cancelCheckout Cancel the checkout of the document with the specified ID.

checkin Check in the document with the specified ID using the specified properties. Selecting this operation results in the addition of several operations, including checkinDocument, and a checkin operation for each selected document type.

checkout Check out the document with the specified ID.

createObject Create an object using the specified properties. Selecting this operation results in the addition of several operations, including createFolder, createDocument, and a create operation for each selected document type.

deleteContentStream Delete the content for the document with the specified ID. This operation is available only if deleting the content stream is supported by the selected repository.

deleteObject Delete the object with the specified ID.

deleteTree Delete the folder with the specified ID, and all descendants of the folder. This operation is available only if deleting a folder tree is supported by the selected repository.

getAllowableActions Get the set of allowable actions for the object with the specified ID.getCheckedOutDocuments Get the checked-out documents that are descendants of the folder with the specified ID.

getChildren Get the children of the folder with the specified ID.

getContentStream Get the content stream for the document with the specified ID. If the retrieveStream input to the getContentStream operation is true, the operation sets up the input stream for the file and stores the content InputStream in the variable <name>ContentStream. If the retrieveStream input is false, the operation simply returns the URL to the content.

getDocumentParents Get the parent folder(s) of the document with the specified ID.

getFolderParent Get the parent folder of the folder with the specified ID.

getObject Get the properties, allowable actions, and renditions for the object with the specified ID. Selecting this operation results in the addition of several operations, including getFolder, getDocument, and a get operation for each selected document type.

getObjectByPath Get the properties, allowable actions, and renditions for the object at the specified path. Selecting this operation results in the addition of several operations, including getFolderByPath, getDocumentByPath, and a getByPath operation for each selected document type.

getObjectProperties Get the properties for the object with the specified ID.

getRenditions Get the set of renditions for the object with the specified ID. This operation is available only if renditions are supported by the selected repository.

query Execute the specified CMIS query. This operation is only available if queries are supported by the selected repository.

setContentStream Set the content for the document with the specified ID. This operation is only available if setting the content stream is supported by the selected repository.

updateObject Update the object with the specified ID using the specified properties. Selecting this operation will result in the addition of several operations, including updateFolder, updateDocument, and an update operation for each selected document type.

May 29, 2012 7

Page 10: CMIS Document Access - Lotus Software · PDF fileCMIS Document Access using IBM Web Experience Factory An Overview of CMIS CMIS stands for Content Management Interoperability

CMIS Document Access using IBM Web Experience Factory

Table 12. Schema InputsBuilder Input Description

Enable Schema Caching If this input is enabled, the CMIS information that is used to generate schemas is cached. The cached information improves regeneration performance.

Include Allowable Actions

By default, the getChildren results do not include an <allowableActions> element. Set this input to have the <allowableActions> element included in the results. Note: Some repositories do not support returning the <allowableActions> element in the getChildren results.

Include Renditions By default, the getChildren results do not include a <rendiions> element. Set this input to have the <renditions> element included in the results. This input is only available if the selected repository supports renditions.

Document Types Specify the names of the document types from the selected CMIS repository to be included in the generated application.Each CMIS type in the selected repository that has a base type ID of "cmis:document" is listed. For each selected type, the builder generates a schema and a set of service operations. Only select a document type from this list if your application will explicitly use the properties defined by that type to create, modify, or display a document.This group of inputs is only available if the selected repository contain derived document types.

Table 13. Advanced InputsBuilder Input Description

Use Existing Service Definition

If this input is not set, the builder will generate a new service definition for the CMIS operations. If this input is set, the service operations generated by this builder call will be added to an existing service definition, as specified in the Data Service input.Using an existing Service Definition provides more control over the generated Data Service. For example, you could specify that the Data Service is stateful, or you could include additional operations.

Data Service Specify an existing service definition to which this builder will add the generated service operations.This input is only available if the Use Existing Service Definition is set.

Make Service Public Set this input to make the generated service definition and the containing model available to the Service Consumer builder. If this input is not set, the service is available only in the model in which this builder call resides.This input is only available if the Use Existing Service Definition is not set.

Add Testing Support Set this input to include testing support in the model. The builder call generates all the artifacts required for testing, including pages (index, input, and result pages for each operation) and methods (required to execute the operations).This input is only available if the Use Existing Service Definition is not set.

Enable Paging By default the getChildren and query service operations will return a list of all specified objects from the selected repository. This list might be very large, so set this input to return the specified objects one page at a time.

May 29, 2012 8

Page 11: CMIS Document Access - Lotus Software · PDF fileCMIS Document Access using IBM Web Experience Factory An Overview of CMIS CMIS stands for Content Management Interoperability

CMIS Document Access using IBM Web Experience Factory

Objects Generated by the CMIS Document Access BuilderWhen a WEF application containing a CMIS Document Access builder is being generated, the following objects may be generated by the CMIS Document Access builder.

Notes:1. Some objects listed below may not be generated by a particular CMIS Document Access builder call

because of the input values provided.2. The notation <name> is used for the name given to a CMIS Document Access builder call.3. The notation <type> is used for a derived document type selected in a CMIS Document Access builder call.4. In the Service Operations table, the schema name for the input and results type has been abbreviated, e.g.

"Object" for "<name>ObjectSchema".

Table 14. VariablesVariable Description

<name>ContentStream Use this variable to access a document's InputStream after calling the getContentStream operation.

Table 15. SchemasSchema Description

<name>ObjectSchema General schema containing elements for input and result values for the <object> element. Many of these elements are used for folder and document values, if there are no type-specific elements required.

<name>FolderSchema The schema containing elements for the specific input and result values of the Folder type.<name>DocumentSchema The schema containing elements for the specific input and result values of the Document type.<name><type>Schema A schema containing elements for the specific input and result values of a derived document

type. There will be a separate schema for each derived document type selected in a builder call.

Table 16. Linked Java ObjectsLJO Description

<name>Helper This LJO is used by the generated Service Operations to access the CMIS Data Model and Services. It's unlikely however, that a WEF developer would need to access this LJO directly.

Table 17. Data ServicesVariable Description

<name> The Data Service which contains the CMIS service operations.

May 29, 2012 9

Page 12: CMIS Document Access - Lotus Software · PDF fileCMIS Document Access using IBM Web Experience Factory An Overview of CMIS CMIS stands for Content Management Interoperability

CMIS Document Access using IBM Web Experience Factory

Table 18. Service OperationsService Operation Description Input/Result Type

cancelCheckout Cancel the checkout of the document with the specified ID. input: Object/inputObjectIdcheckinDocument Check in the document with the specified ID using the specified

properties.input: Document/inputCheckinresult: Document/Document

checkin<type> Check in the derived document with the specified ID using the specified properties.

input: <type>/inputCheckinresult: <type>/<type>

checkout Check out the document with the specified ID. input: Object/inputObjectIdresult: Document/Document

createFolder Create a folder using the specified properties. input: Folder/inputCreateresult: Folder/Folder

createDocument Create a document using the specified properties. input: Document/inputCreateresult: Document/Document

create<type> Create a derived document using the specified properties. input: <type>/inputCreateresult: <type>/<type>

deleteContentStream Delete the content for the document with the specified ID. input: Object/inputObjectIddeleteObject Delete the object with the specified ID. input: Object/inputDeleteObjectdeleteTree Delete the folder with the specified ID and all descendants . input: Object/inputDeleteTreegetAllowableActions Get the set of allowable actions for the object with the specified ID. input: Object/inputObjectId

result: Object/allowableActionsgetCheckedOutDocuments Get the checked-out documents that are descendants of the folder

with the specified ID.input: Object/inputGetCheckedOutDocumentsresult: Document/documents

getChildren Get the children of the folder with the specified ID. input: Object/inputGetChildrenresult: Object/objects

getContentStream Get the content stream for the document with the specified ID. input: Object/inputGetContentStreamresult: Object/content

getDocumentParents Get the parent folder(s) of the document with the specified ID. input: Object/inputObjectIdresult: Folder/folders

getFolderParent Get the parent folder of the folder with the specified ID. input: Object/inputObjectIdresult: Folder/Folder

getFolder Get the properties, allowable actions, and renditions for the folder with the specified ID.

input: Object/inputGetFolderresult: Folder/Folder

getDocument Get the properties, allowable actions, and renditions for the document with the specified ID.

input: Object/inputObjectIdresult: Document/Document

get<type> Get the properties, allowable actions, and renditions for the derived document with the specified ID.

input: Object/inputObjectIdresult: <type>/<type>

getFolderByPath Get the properties, allowable actions, and renditions for the folder at the specified path.

input: Object/inputObjectPathresult: Folder/Folder

getDocumentByPath Get the properties, allowable actions, and renditions for the document at the specified path.

input: Object/inputObjectPathresult: Document/Document

get<type>ByPath Get the properties, allowable actions, and renditions for the derived document at the specified path.

input: Object/inputObjectPathresult: <type>/<type>

getFolderProperties Get the properties for the folder with the specified ID. input: Object/inputObjectIdresult: Folder/properties

getDocumentProperties Get the properties for the document with the specified ID. input: Object/inputObjectIdresult: Document/properties

get<type>Properties Get the properties for the derived document with the specified ID. input: Object/inputObjectIdresult: <type>/properties

getRenditions Get the set of renditions for the object with the specified ID. input: Object/inputObjectIdresult: Object/renditions

query Execute the specified CMIS query. input: Object/inputQueryresult: Object/objects

setContentStream Set the content for the document with the specified ID. input: Object/inputSetContentStreamupdateFolder Update the folder with the specified ID using the specified

properties.input: Folder/inputUpdateresult: Folder/Folder

updateDocument Update the document with the specified ID using the specified properties.

input: Document/inputUpdateresult: Document/Document

update<type> Update the derived document with the specified ID using the specified properties.

input: <type>/inputUpdateresult: <type>/<type>

May 29, 2012 10

Page 13: CMIS Document Access - Lotus Software · PDF fileCMIS Document Access using IBM Web Experience Factory An Overview of CMIS CMIS stands for Content Management Interoperability

CMIS Document Access using IBM Web Experience Factory

The Sample ApplicationCreate a new project using the File, New, Web Experience Factory Project command. Make sure the CMIS Document Access Extension feature set is specified for your new project. Now download the CmisDocumentAccess.zip file for this sample. Import the file into your new project with the File, Import, Web Experience Factory Archive command.

The sample application contains models for three different CMIS systems -- SharePoint, FileNet, and Alfresco. These are contained in separate folders, with each folder containing a provider model, a utilities model, and a consumer model. Please note that a set of Alfresco models has been provided, but Alfresco is not supported in this release. These models have been provided for those users who do not have access to a FileNet or SharePoint CMIS server. In that case, the Alfresco models can be used to access the public Alfresco server. For more details on how to access this server, see See http://cmis.alfresco.com/.

Provider Model

The CMIS Document Access builder generates a new Data Service, or adds Service Operations to an existing Data Service. Therefore, CMIS Document Access builder calls should be added to a Provider model. The Provider model for this sample contains only a CMIS Document Access builder call and a Shared Variable builder call. The shared variable allows a consumer model to access the content stream of a downloaded document.

Figure 2. Builder call outline for the provider model.

Here is additional information about some of the CMIS Document Access builder inputs.

Runtime Authentication. This input defines how the generated application will authenticate with the CMIS server (runtime). If possible, you want the application to authenticate with the CMIS server as the same user who already authenticated for the current session with Portal (or WAS). If the CMIS server is FileNet, and if the FileNet server and the Portal/WAS server have been configured for single sign on (SSO) using LTPA, then you can specify an input value of LTPA, and the authentication will be handled seamlessly.

If the servers have not been configured for SSO, you have a few options.1. If your CMIS server just serves content without different levels of access for different users, then just use

Basic Authentication or NTLM and specify the credentials of a generic CMIS user.2. If your CMIS server provides different levels of access based on membership in a group, then profile the

credential inputs based on the group containing the current user. In this case the credentials specified would be those of a "representative" user for the CMIS group.

3. Use Custom Authentication to authenticate as a CMIS user based on the current Portal/WAS user.

Before running the sample, you need to specify appropriate runtime credentials for your CMIS server.

May 29, 2012 11

Page 14: CMIS Document Access - Lotus Software · PDF fileCMIS Document Access using IBM Web Experience Factory An Overview of CMIS CMIS stands for Content Management Interoperability

CMIS Document Access using IBM Web Experience Factory

Designer Authentication. This input defines where the CMIS Document Access builder will get the authentication credentials to use when accessing a CMIS server from the Designer (design time). It is common for the Designer to use the credentials for an administrator account. This allows the builder to have access to the largest possible set of information, otherwise it is possible that certain capabilities of the CMIS repository will not be available.

The sample specifies an input value of "/WEB-INF/config/cmis_config/designer/sampleXCredentials.properties" where "X" is the name of the back-end CMIS product. There are no files of this name provided with the sample however. This value is just a placeholder, and is meant to indicate that the user should provide a file that contains the credentials for the CMIS repository to be accessed.

Before running the sample, you need to create a properties file which contains appropriate credentials for your CMIS server. The name of this file needs to be specified in the Designer Authentication input.

Service URI. The sample uses a place holder as the input value. See Appendix A for more information.

Before running the sample, you need to specify appropriate runtime credentials for your CMIS server.

Service Operations. Only the operations used by the sample application are selected. The generated application will be larger than necessary if you include service operations that the application does not need to use.

Enable Schema Caching. The CMIS Document Access builder uses object-type information from the CMIS repository to generate schemas. Caching this information improves the performance of schema generation, because the HTTP requests to retrieve the object-type information from the CMIS server will not be required.

Include Allowable Actions. The sample application does not use "allowable action" information for enabling or disabling UI controls, therefore this input is not selected.

Document Types. The sample application does not provide support for any derived document types, therefore none of these inputs are selected. If you want to provide functionality specific to a derived document type, you can select one or more of these inputs in your application.

Testing Support. The input for testing support is enabled in the sample application. This allows the provider model to be run from within the Designer. Running the model displays a list of the service operations, which can be executed to make sure things are working correctly, and to get a feel for the results returned by each operation.

Enable Paging . Paging is turned on in the sample application. This allows the list of items within a folder to be displayed one page at a time, instead of all at once.

May 29, 2012 12

Page 15: CMIS Document Access - Lotus Software · PDF fileCMIS Document Access using IBM Web Experience Factory An Overview of CMIS CMIS stands for Content Management Interoperability

CMIS Document Access using IBM Web Experience Factory

Utilities ModelThe Utilities model contains a collection of CMIS variables, action lists, and methods. They are generally useful in a WEF application that includes CMIS functionality, independent of the consumer model being used. Because some of the variables, action lists, and methods in the Utilities model are dependent on the CMIS Provider model, the Service Consumer builder call for the sample application is included also. If the Utilities model is going to be used in a different application, the Service Consumer will typically be the only builder call that is changed.

Root Folder. The rootFolderId and rootFolderName variables are static values. The rootFolderId is the cmis:id property of the folder that will serve as the root folder for your application. If the value is left blank, the root folder of the repository will be used. The rootFolderName is the name to use for the root folder if the canonical name of the folder is "/".

Current Folder. The currentFolderId and currentFolderName variables contain the corresponding values for the folder that is currently being displayed. The retrieveCurrentFolderContents action list calls the CMIS service operation to retrieve the children of the current folder.

Folders. The getFolderName action list returns the folder name for the CMIS object passed in. A value of null will be returned if the object passed in is not a folder. The folder name will also be corrected to the rootFolderName if the folder name is "/". The retrieveFolderContents action list is just a wrapper for retrieveCurrentFolderContents . The prepareNewFolder and createNewFolder action lists can be used when creating a new folder. The prepareNewFolder action list initializes any known values before displaying the New Folder input form. The createNewFolder action list calls the CMIS service operation to create a new folder after the input form has been submitted.

Documents. The getFileContents action list calls the CMIS service operation to get the file contents of the document with the specified ID. The contentStream and sharedContentStream variables provide access to the corresponding shared variable in the Provider Model. The prepareNewDocument and createNewDocument action lists can be used when creating a new document. The prepareNewDocument action list initializes any known values before displaying the New Document input form. The createNewDocument action list calls the CMIS service operation to create a new document after the input form has been submitted. The getUploadedFileName method can be used to get the file name of a file being uploaded.

Objects. The isDocument and isFolder methods are simple utility methods for determining the type of a CMIS object. The getObjectId and getObjectName methods are abstractions for getting the named property from a CMIS object. The deleteObject action list handles the difference in deletion logic between documents and folders.

May 29, 2012 13

Page 16: CMIS Document Access - Lotus Software · PDF fileCMIS Document Access using IBM Web Experience Factory An Overview of CMIS CMIS stands for Content Management Interoperability

CMIS Document Access using IBM Web Experience Factory

Consumer ModelThe Consumer model contains all of the builder calls for generating the application UI. These builder calls are not specific to any CMIS functionality, they just display the information made available by the CMIS Document Access builder. Many of these builder calls are standard stuff, meaning there's nothing unexpected or interesting about them. Here is a brief discussion of some of the more interesting builder calls.

Breadcrumbs. The selector value for the breadcrumbs must be chosen carefully. This value contains the necessary information for a single level in the breadcrumbs list. The representation of the selector value can be whatever the developer needs. In this sample, the selector includes the method to be called when the level is clicked and the parameters for that method. These values are separated by "#####", because this value is not expected to occur in a CMIS object ID or a folder name. The breadCrumbSelected method is called to process the selector value.

main. The main action list calls the getFolder service operation in order to get the name of the root folder. This is only necessary for the first folder displayed. The name for subsequent folders is obtained from the results of the previous getChildren service operation (see DisplayChildFolder.)

documentIcon, folderIcon. Both images are contained in the "icon" column. The Visibility Setters for these images ensure that only one is displayed for a given row, based on whether the CMIS object for that row is a document or a folder.

DisplayChildFolder, FileContents, cmis:name. The link for drilling down to a child folder, the link for launching document content, and the name of the CMIS object are all contained in the "cmis_name" column. The Visibility Setters for these ensure that the child folder link displayed for a folder, the launch link is displayed for a document, and the CMIS object name is always hidden.(The links each use the name of the CMIS object, so the name is actually still displayed.)

ContentLaunchAction. Pressing the link to launch document content calls the launchFileContents action list, which sets up the information needed by the Content Launch Action builder call and its launchContent() method. When the document content is downloaded, it will be presented to the user in a browser-dependent manner.

Dojo Tooltips. There are dojo tooltips for the document and folder icons. When the mouse is rolled over an icon, a details page will be displayed for that row.

FileUpload. Creating a new document requires that a file be uploaded to the server. In order to enable file upload for your project, the file upload capability must be enabled in the override.properties file.

May 29, 2012 14

Page 17: CMIS Document Access - Lotus Software · PDF fileCMIS Document Access using IBM Web Experience Factory An Overview of CMIS CMIS stands for Content Management Interoperability

CMIS Document Access using IBM Web Experience Factory

Appendix A – Service URIFileNet p8 Content Manager 5.0. The Service URI for FileNet has the following format:

http(s)://<host-name>:<port>/p8cmis/resources/Service

where <host-name> is the DNS name of the CMIS server (an IP address can also be used), and <port> is the number of the port on the CMIS server used for CMIS requests. Ask your system administrator for this information if you do not know it already.

SharePoint 2010. The Service URI for SharePoint has the following format:

http(s)://<host-name>:<port>/_vti_bin/cmis/rest/<list-id>?getRepositoryInfo

where <host-name> is the DNS name of the CMIS server (an IP address can also be used), <port> is the number of the port on the CMIS server used for CMIS requests, and <list-id> is the ID of the SharePoint document library you are accessing. Ask your system administrator for this information if you do not know it already.

If you need to determine the <list-id> for your document library, the easiest way is to use SharePoint Designer.

1. Open your SharePoint site in SharePoint Designer.2. Navigate to "Lists and Libraries" and select the document library.3. The resulting page contains a value for "List ID" that looks like {nnn} (where "nnn" is a long ID value).4. The value you want to use for <list-id> within the Service URI is the nnn part, without the curly braces.

Additional information about installing the SharePoint 2010 Administration Toolkit and configuring CMIS:

http://technet.microsoft.com/en-us/library/cc508849http://technet.microsoft.com/en-us/library/ff934619.aspx

Other CMIS systems. These systems are not officially supported by the CMIS Document Access builder, but can be used in an unsupported manner if that suits the developer's purpose. Information for Alfresco and Connections Files is listed below. For information about connecting to CMIS systems not listed, contact the vendor.

Alfresco.

http(s)://<host-name>:<port>/service/cmis

Connections Files 3.0. There are several different types of repositories in Connections Files.

Personal Repository

http(s)://<host-name>:<port>/files/basic/cmis/my/servicedoc

User Repository

http(s)://<host-name>:<port>/files/basic/cmis/user/<usedr-id>/servicedoc

Community (Owned) Repository

http(s)://<host-name>:<port>/files/basic/cmis/community/{communityId}/owned/servicedoc

Community (Shared) Repository

http(s)://<host-name>:<port>/files/basic/cmis/community/{communityId}/shared/servicedoc

May 29, 2012 15

Page 18: CMIS Document Access - Lotus Software · PDF fileCMIS Document Access using IBM Web Experience Factory An Overview of CMIS CMIS stands for Content Management Interoperability

CMIS Document Access using IBM Web Experience Factory

ResourcesWeb Experience Factory product documentationhttp://www.ibm.com/developerworks/websphere/zones/portal/portletfactory/proddoc.html

Web Experience Factory supporth ttp://www.ibm.com/support/entry/portal/Overview/Software/Lotus/IBM_Web_Experience_Factory

Web Experience Factory wikihttp://www-10.lotus.com/ldd/pfwiki.nsf

Web Experience Factory forum – Best Practiceshttp://www.ibm.com/developerworks/forums/forum.jspa?forumID=889

CMIS v1.0 specificationhttp://docs.oasis-open.org/cmis/CMIS/v1.0/os/cmis-spec-v1.0.html

Trademarks• IBM, Lotus, FileNet, Connections, WebSphere, and Web Experience Factory are trademarks or registered

trademarks of IBM Corporation in the United States, other countries, or both.• Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle Corp. in the

United States, other countries, or both.• SharePoint, SharePoint 2010, and SharePoint Designer are trademarks or registered trademarks of Microsoft

Corp. in the United States, other countries, or both.• Other company, product, and service names may be trademarks or service marks of others.

May 29, 2012 16