Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

CMIS: Is Private Working copy is updatable?


RepositoryCapabilities interface provides 'isPwcUpdatableSupported' method, it returns true, if Private Working Copy" of a checked-out document is updatable, else false.

Example
                  Boolean isPWCUpdatable = repoInfo.getCapabilities().isPwcUpdatableSupported();

                  if (isPWCUpdatable == null) {
                           System.out.println("Repository is not providing this value");
                  } else if (isPWCUpdatable) {
                           System.out.println("Privae working copy can be updatable");
                  } else {
                           System.out.println("Private working copy updation is not supported");
                  }

Find the following working application.

TestCmis.java
package com.sample.util;

import java.util.HashMap;
import java.util.Map;

import org.apache.chemistry.opencmis.client.api.Session;
import org.apache.chemistry.opencmis.client.api.SessionFactory;
import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
import org.apache.chemistry.opencmis.commons.SessionParameter;
import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
import org.apache.chemistry.opencmis.commons.enums.BindingType;

public class TestCmis {

private static String serverURL = "http://localhost:8080/chemistry-opencmis-server-inmemory-1.1.0/browser";
private static String repositoryId = "A1";

public static Session getSession() {
MapString, String> parameters = new HashMap();
parameters.put(SessionParameter.BINDING_TYPE, BindingType.BROWSER.value());

parameters.put(SessionParameter.USER, "");
parameters.put(SessionParameter.PASSWORD, "");

parameters.put(SessionParameter.REPOSITORY_ID, repositoryId);
parameters.put(SessionParameter.BROWSER_URL, serverURL);

SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
return sessionFactory.createSession(parameters);
}

public static void main(String args[]) {
Session session = getSession();

RepositoryInfo repoInfo = session.getRepositoryInfo();

Boolean isPWCUpdatable = repoInfo.getCapabilities().isPwcUpdatableSupported();

if (isPWCUpdatable == null) {
System.out.println("Repository is not providing this value");
} else if (isPWCUpdatable) {
System.out.println("Private working copy can be updatable");
} else {
System.out.println("Private working copy updation is not supported");
}
}

}



Previous                                                 Next                                                 Home


This post first appeared on Java Tutorial : Blog To Learn Java Programming, please read the originial post: here

Share the post

CMIS: Is Private Working copy is updatable?

×

Subscribe to Java Tutorial : Blog To Learn Java Programming

Get updates delivered right to your inbox!

Thank you for your subscription

×