02-27-2018 05:59 AM
You can use the CopyOperation.java automation operation.
To execute an operation with the JS client, please refer to https://doc.nuxeo.com/nxdoc/javascript-client/ . Something along those lines:
nuxeo.operation('Document.Copy')
.input(src.uid)
.params({'target': target.uid})
.execute()
.then(function(newlyCreatedDoc) {
// work with the copied doc
})
.catch(function(error) {
// something went wrong
throw error;
});
02-27-2018 03:55 AM
The context of the question is too vague. Are you asking programmatically, using Rest API, automation, in JSF UI, Web UI?
02-27-2018 05:53 AM
I use nuxeo-js-client for browser.
02-27-2018 05:59 AM
You can use the CopyOperation.java automation operation.
To execute an operation with the JS client, please refer to https://doc.nuxeo.com/nxdoc/javascript-client/ . Something along those lines:
nuxeo.operation('Document.Copy')
.input(src.uid)
.params({'target': target.uid})
.execute()
.then(function(newlyCreatedDoc) {
// work with the copied doc
})
.catch(function(error) {
// something went wrong
throw error;
});