Hi all,I had this method working in version 1.3:
private Reference createFolder (Store inStore, Reference inNode, String folder_name, String str_prepend, String description)
throws Exception{
ParentReference parent_folder_ref;
parent_folder_ref = new ParentReference(inStore, inNode.getUuid(), null, Constants.ASSOC_CONTAINS, str_prepend+folder_name);
NamedValue[] folder_properties = new NamedValue[]{new NamedValue(Constants.PROP_NAME, false, folder_name, null)};
//CMLCreate create_folder = new CMLCreate(folder_name, parent_folder_ref, Constants.TYPE_FOLDER, folder_properties);
CMLCreate create_folder = new CMLCreate(folder_name, parent_folder_ref, null, null, null, Constants.TYPE_FOLDER, folder_properties);
CML cml = new CML();
cml.setCreate(new CMLCreate[]{create_folder});
UpdateResult[] upd_result = WebServiceFactory.getRepositoryService().update(cml);
Reference folder_ref = upd_result[0].getDestination();
NamedValue[] aspect_properties = new NamedValue[]{new NamedValue(Constants.PROP_DESCRIPTION, false, description, null)};
CMLAddAspect addAspect2Folder = new CMLAddAspect(
"{http://www.alfresco.org/model/application/1.0}uifacets",
aspect_properties,
new Predicate(new Reference[]{folder_ref}, inStore, null),
null);
cml.setAddAspect(new CMLAddAspect[]{addAspect2Folder});
WebServiceFactory.getRepositoryService().update(cml);
return folder_ref;
}
which creates a new folder in Alfresco and fills 'description' field and adds aspect 'uifacets'.But now, with version 2.0, it crashes at:
…
cml.setAddAspect(new CMLAddAspect[]{addAspect2Folder});
WebServiceFactory.getRepositoryService().update(cml); //This is the command that crashes
It creates the folder, but the aspect and the property are not added…From the error stack trace it seems to be related to some axis, xerces. But sorry, i can't find the stack trace in any log (Tomcat or Alfresco), it's only on the console… =(Any help appreciated.Regards,Enrique