You are here

Using the Alfresco Content Services OpenCMIS Extension

The Alfresco Content Services OpenCMIS Extension depends on the Apache Chemistry OpenCMIS libraries.

You can download the latest OpenCMIS client libraries from the Apache Chemistry website. Then download the latest Alfresco OpenCMIS Extension package and add the jars to your classpath.

If you are using Maven, follow the instructions in Building the Alfresco Content Services OpenCMIS Extension with Maven.

You do not need to modify OpenCMIS in order to use a different object factory. Set an additional session parameter to change the object factory class, as shown in the following code fragment:

Map<String, String> parameter = new HashMap<String, String>();

// user credentials
parameter.put(SessionParameter.USER, "admin");
parameter.put(SessionParameter.PASSWORD, "admin");

// connection settings
parameter.put(SessionParameter.ATOMPUB_URL, "http://localhost:8080/alfresco/api/-default-/cmis/versions/1.1/atom");
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());

// set the alfresco object factory
parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");

// create session
SessionFactory factory = SessionFactoryImpl.newInstance();
Session session = factory.getRepositories(parameter).get(0).createSession();

Now your code can access and update all aspect properties through the standard OpenCMIS interfaces.

Sending feedback to the Alfresco documentation team

You don't appear to have JavaScript enabled in your browser. With JavaScript enabled, you can provide feedback to us using our simple form. Here are some instructions on how to enable JavaScript in your web browser.