12-24-2014 02:39 AM
Map<String, String> parameter = new HashMap<String, String>();
parameter.put(SessionParameter.USER, "admin");
parameter.put(SessionParameter.PASSWORD, "admin");
parameter.put(SessionParameter.ATOMPUB_URL, "http://192.168.22.100:8090/alfresco/api/-default-/public/cmis/versions/1.0/atom");
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
SessionFactory factory = SessionFactoryImpl.newInstance();
Session session = factory.getRepositories(parameter).get(0).createSession();
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(PropertyIds.NAME, "My folder");
properties.put(PropertyIds.OBJECT_TYPE_ID, "F:kb:irhDosya");
properties.put("P:kb:Aciklama", "My description");
Folder folder = session.getRootFolder().createFolder(properties);
System.out.println("Başarılı");
12-26-2014 01:32 AM
Map<String, String> parameter = new HashMap<String, String>();
parameter.put(SessionParameter.USER, "admin");
parameter.put(SessionParameter.PASSWORD, "admin");
parameter.put(SessionParameter.ATOMPUB_URL, "http://192.168.22.100:8090/alfresco/api/-default-/public/cmis/versions/1.0/atom");
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
SessionFactory factory = SessionFactoryImpl.newInstance();
Session session = factory.getRepositories(parameter).get(0).createSession();
Map<String, Object> properties = new HashMap<String, Object>();
Map<String, Object> updProps = new HashMap<String, Object>();
properties.put(PropertyIds.NAME, "My folder");
properties.put(PropertyIds.OBJECT_TYPE_ID, "F:kb:irhDosya");
updProps.put("P:kb:Aciklama", "My description");
Folder folder = session.getRootFolder().createFolder(properties);
folder.updateProperties(updProps);
System.out.println("Başarılı");
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.