05-05-2014 03:47 PM
I am attempting to do a document.copy on an existing document, with the assumption that if the directories I am copying into may or may not exist. What would be a good way to achieve that?
client = new nuxeo.Client(nuxeoParams)
client.connect()
copyOp = client.operation("Document.Copy")
path = "doc:#{devConfig.path}#{devConfig.username}/#{devConfig.env}"/file.title
var copyParams =
{ target: "doc:#{devConfig.path}#{devConfig.username}/#{devConfig.env}/documents/#{documentId}/" }
copyOp.input(path).params(copyParams)
copyOp.execute(function(error, data){
if(error){
console.debug('error')
}else{
console.debug('data')
}
})
This 404s. What would be a way to avoid this and create the directories necessary in a lazy manner?
05-06-2014 04:44 PM
I ended up catching the 404s and creating the directories as needed. It was pretty verbose, so I'd welcome anyone showing a better way.
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.