01-10-2015 02:22 PM
public static Session openCMISSession(String username, String password) {
loadProperties();
Map<String, String> parameter = new HashMap<>();
parameter.put(SessionParameter.USER, username);
parameter.put(SessionParameter.PASSWORD, password);
parameter.put(SessionParameter.ATOMPUB_URL,"http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom");
parameter.put(SessionParameter.BINDING_TYPE,BindingType.ATOMPUB.value());
parameter.put(SessionParameter.REPOSITORY_ID, repository);
// Set the alfresco object factory
parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
SessionFactory sf=SessionFactoryImpl.newInstance();
List<Repository> repositories = sf.getRepositories(parameter);
return sf.getRepositories(parameter).get(0).createSession();
}
01-10-2015 08:01 PM
01-11-2015 01:42 AM
01-11-2015 01:42 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.