01-23-2014 05:32 PM
System.out.println("Step-1");
SessionFactory factory = SessionFactoryImpl.newInstance();
System.out.println("Step-2");
Map<String, String> parameter = new HashMap<String, String>();
System.out.println("Step-3");
parameter.put(SessionParameter.USER, "username");
System.out.println("Step-4");
parameter.put(SessionParameter.PASSWORD, "password");
System.out.println("Step-5");
parameter.put(SessionParameter.ATOMPUB_URL, "http://localhost/alfresco/s/api/cmis");
System.out.println("Step-6");
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
System.out.println("Step-7");
parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
System.out.println("Step-8");
List<Repository> repositories = factory.getRepositories(parameter);
System.out.println("Step-9");
Session session = repositories.get(0).createSession();
System.out.println("Step-10");
System.out.println("Connected to repository:" + repositories.get(0).getId());
Folder root = session.getRootFolder();
System.out.println("Step-11");
for (Tree<FileableCmisObject> item : root.getDescendants(1)) {
System.out.println("Itemname=" + item.getItem().getName());
System.out.println("Itemtype=" + item.getItem().getType().getDisplayName());
}
System.out.println("Reached End");
session cmis
Step-1
Step-2
Step-3
Step-4
Step-5
Step-6
Step-7
Step-8
Step-9
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.745 sec <<< FAILURE!
testSessionCMIS(ec.com.linbrox.alfresco.AlfrescoUtilsV3Test) Time elapsed: 1.684 sec <<< ERROR!
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:635)
at java.util.ArrayList.get(ArrayList.java:411)
01-23-2014 06:55 PM
01-24-2014 05:07 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.