Hello:
I'm trying to update a node loading a new binary content and versioning it inside a new API REST. The code I post it works, but the problem is that after checkin, the cm:name changes..... How can I solve that problem? Alfresco version: 4.2.f Thank you.
NodeRef nodeCheckedOut = coci.checkout(nr);
Map<String,Serializable> vproprs = new HashMap<String,Serializable>();
vproprs.put(Version.PROP_DESCRIPTION, "Nuova versione contenuto");
vproprs.put("name", fileName);
logger.info("Eseguito CHECK OUT del nodo. " + nodeCheckedOut);
ContentWriter writer = cs.getWriter(nodeCheckedOut, ContentModel.PROP_CONTENT, true);
writer.setMimetype(mimetype);
//propsOriginalFile = ns.getProperties(nodeCheckedOut);
//propsOriginalFile.putAll(propsFile);
ns.setProperties(nodeCheckedOut, propsFile);
//writer.setEncoding(encoding);
try {
writer.putContent(input);
}catch(ContentIOException cie) {
logger.error("Errori con update del contenuto del documento checked out: " + nodeCheckedOut );
errori.concat("Errori con update del contenuto del documento checked out: " + nodeCheckedOut );
model.put("errore",errori);
return model;
}
newDoc = coci.checkin(nodeCheckedOut, vproprs);