O'Reilly logo

Alfresco CMIS by Martin Bergljung

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Copying and moving folders and documents

A document can be copied to a different folder with the Document object's copy method. The copy will be an independent document and it will be of the same type as the original document with the same properties and relationships.

The following code shows how to copy the previously uploaded OpenCMISTest2.pdf document to the /Company Home/Guest Home folder in Alfresco:

public void copyDocument(Session session, Document document) { Folder parentFolder = session.getRootFolder(); String destinationFolderName = "Guest Home"; Folder destinationFolder = (Folder) getObject(session, parentFolder, destinationFolderName); if (destinationFolder == null) { logger.error("Cannot copy " + document.getName() + ", could not ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required