Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

A connection to a CMIS repository is represented by a CmisBinding object. Such an object can be created by the CmisBindingFactory. The factory provides three main methods, one for each binding and third one for a local connection (same JVM), that require binding specific connection information. The created CmisBinding object exposes a binding agnostic interface.

...

The get*Service() methods provide access to the CMIS services. Some service operations take provider layer specific objects. These objects should be created with the BindingsObjectFactory. This factory can be obtained through the getObjectFactory() method of the CmisBinding object.

Please refer to the OpenCMIS Commons JavaDoc and OpenCMIS Client Binding JavaDoc for more details on the interfaces.

...

Code Block
java
java
Map<String, String> parameters = new HashMap<String, String>();

parameters.put(SessionParameter.USER, username);
parameters.put(SessionParameter.PASSWORD, password);
    
parameters.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, repositoryServiceWsdlUrl);
parameters.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, navigationServiceWsdlUrl);
parameters.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, objectServiceWsdlUrl);
parameters.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, versioningServiceWsdlUrl);
parameters.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, discoveryServiceWsdlUrl);
parameters.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, relationshipServiceWsdlUrl);
parameters.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, multiFilingServiceWsdlUrl);
parameters.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, policyServiceWsdlUrl);
parameters.put(SessionParameter.WEBSERVICES_ACL_SERVICE, aclServiceWsdlUrl);

CmisBindingFactory factory = CmisBindingFactory.newInstance();
CmisBinding binding = factory.createCmisWebServicesBinding(parameters);

...

Code Block
java
java
CmisBinding binding = ...

ObjectData myObject = binding.getObjectService().getObject("myRepository", "myObject", 
   "*", true, IncludeRelationships.BOTH, "cmis:none", true, true, null);

PropertiesData properties = myObject.getProperties();
PropertyData<String> nameProperty = properties.getProperties().get(PropertyIds.NAME);
String name = nameProperty.getFirstValue();

...

The session parameter SessionParameter.AUTHENTICATION_PROVIDER_CLASS must be set to the fully qualified class name in order to active the authentication provider before the session is created.

For example:

Code Block
java
java
Map<String, String> parameters = new HashMap<String, String>();

parameters.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS, "org.example.opencmis.MyAuthenticationProvider");
parameters.put("org.example.opencmis.user", "cmisuser"); // MyAuthenticationProvider can get and evaluate this
parameters.put("org.example.opencmis.secret", "b3BlbmNtaXMgdXNlcg=="); 

parameters.put(SessionParameter.ATOMPUB_URL, url); // service document URL

CmisBindingFactory factory = CmisBindingFactory.newInstance();
CmisBinding provider = factory.createCmisAtomPubBinding(parameters);