05-17-2010 06:18 AM
public void updateContent(docEv document, String nuevoNombre, String nuevaDescr, String path){
try {
WebServiceFactory.setEndpointAddress("http://...:8080/alfresco/api");
AuthenticationUtils.startSession("admin", "admin");
Store storeRef = new Store(Constants.WORKSPACE_STORE, "SpacesStore");
Query query = new Query(Constants.QUERY_LANG_LUCENE, "PATH:\"" +path + "\"AND @ev\\:IDdoc:" + document.getIDdoc());
Predicate pred = new Predicate(null,storeRef,query);
NamedValue[] titledProps = new NamedValue[2];
titledProps[0] = Utils.createNamedValue(Constants.PROP_NAME, nuevoNombre);
titledProps[1] = Utils.createNamedValue(Constants.createQNameString(docEvModel.NAMESPACE_CONTENT_MODEL,
docEvModel.DESCRIPCIO), nuevaDescr);
CMLAddAspect addAspect = new CMLAddAspect(Constants.ASPECT_TITLED, titledProps, null, "1");
CMLUpdate update = new CMLUpdate(titledProps, pred, null);
CML cml = new CML();
cml.setUpdate(new CMLUpdate[] {update});
WebServiceFactory.getRepositoryService().update(cml);
//UpdateResult[] results = WebServiceFactory.getRepositoryService().update(cml);
//dumpUpdateResults (results);
}
catch (Exception e) {
e.printStackTrace();
} finally {
// tanca sessió
System.out.println("Desconectant…");
AuthenticationUtils.endSession();
}
//UpdateResult[] results = WebServiceFactory.getRepositoryService().update(cml);
//dumpUpdateResults (results);
me da el siguiente error05-17-2010 08:03 AM
05-18-2010 03:20 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.