Urgent Problem. I have the following code to rename a folder.
/**
* folderPath e.g. /app:company_home/app:user_homes/cm:Main/cm:Users/cm:Bewerber/cm:Hancock_Paul
* newFoldername e.g. Hancock_Herbie
*/
public static void updateFolderName (String folderPath, String newFoldername){
UpdateResult [] result = null;
//get the reference to the data which should be updated
final Reference reference = new Reference(STORE, null, folderPath);
final Predicate p = new Predicate(new Reference[]{reference},STORE,null);
//create CMLUpdate instance referring to the current data
final CMLUpdate updateFolder = new CMLUpdate( new NamedValue[]{Utils.createNamedValue(Constants.PROP_NAME, newFoldername)},p,null);
CML cml = new CML();
cml.setUpdate(new CMLUpdate[]{updateFolder});
try {
result = WebServiceFactory.getRepositoryService().update(cml);
// still the old path!
System.out.println("new path: "+result[0].getDestination().getPath());
} catch ( RepositoryFault rf ) {
rf.printStackTrace();
} catch ( RemoteException re ) {
re.printStackTrace();
}
}
May anybody help me, why does sysout not print what i am expecting? when i look in alfresco, the folder has been successfully renamed!Thank you very much for any advice!