03-02-2016 07:49 AM
java.lang.NoClassDefFoundError: org/apache/chemistry/opencmis/client/api/TransientCmisObject
protected CmisObject searchDocumentByName( String fileName ){
String queryString = "select * from kd:doc where "+PropertyIds.NAME+" = '"+fileName+"'";
ItemIterable<QueryResult> results = getSession().query(queryString, false);
CmisObject checkingDocument = null;
for (QueryResult qResult : results) {
String objectId = "";
PropertyData<?> propData = qResult.getPropertyById("cmis:objectId"); // Atom Pub binding
if (propData != null) {
objectId = (String) propData.getFirstValue();
} else {
objectId = qResult.getPropertyValueByQueryName("d.cmis:objectId"); // Web Services binding
}
checkingDocument = getSession().getObject(getSession().createObjectId(objectId));
}
return checkingDocument;
}
03-02-2016 08:10 AM
03-02-2016 09:01 AM
SessionFactory factory = SessionFactoryImpl.newInstance();
Map<String, String> parameter = new HashMap<String, String>();
// user credentials
parameter.put(SessionParameter.USER, user);
parameter.put(SessionParameter.PASSWORD, password);
// connection settings
parameter.put(SessionParameter.ATOMPUB_URL, "http://'+urlAlfresco+'/alfresco/api/-default-/public/cmis/versions/1.1/atom/");
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
//if the repository id is unknown : gets the list of all available repositories and connects to the first one.
List<Repository> repositories = factory.getRepositories(parameter);
this.session = repositories.get(0).createSession();
03-02-2016 11:55 AM
03-02-2016 12:01 PM
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.