Below are samples for the various ways you can copy assets.
Note: The wrapping SOAP envelope and authentication header have been omitted to make the samples easier to read. Detailed documentation about each of the elements and their possible values is provided in the WSDL.
Copy single asset
<e:copyRequest
xmlns:e="http://www.elvisdam.com/xmlns/elvis/webservice/1.0"
xmlns:q="http://www.elvisdam.com/xmlns/elvis/query/1.0">
<e:source>/Demo Zone/Images/Beaches/Ilha Bela.jpg</e:source>
<e:target>/Demo Zone/Images/Architecture/Copied Ilha Bela.jpg</e:target>
<e:folderReplacePolicy>MERGE</e:folderReplacePolicy>
<e:fileReplacePolicy>AUTO_RENAME</e:fileReplacePolicy>
</e:copyRequest>
Copy folder
<e:copyRequest
xmlns:e="http://www.elvisdam.com/xmlns/elvis/webservice/1.0"
xmlns:q="http://www.elvisdam.com/xmlns/elvis/query/1.0">
<e:source>/Demo Zone/Images</e:source>
<e:target>/Demo Zone/Images Copy</e:target>
<e:folderReplacePolicy>AUTO_RENAME|MERGE|THROW_EXCEPTION</e:folderReplacePolicy>
<e:fileReplacePolicy>AUTO_RENAME|OVERWRITE|OVERWRITE_IF_NEWER|REMOVE_SOURCE|THROW_EXCEPTION|DO_NOTHING</e:fileReplacePolicy>
</e:copyRequest>
Copy with filter
A copy operation can be filtered with a query so only assets that match the query will be copied.
<e:copyRequest
xmlns:e="http://www.elvisdam.com/xmlns/elvis/webservice/1.0"
xmlns:q="http://www.elvisdam.com/xmlns/elvis/query/1.0">
<e:source>/Demo Zone/Images</e:source>
<e:target>/User/admin/Copy of all PNG images</e:target>
<e:folderReplacePolicy>MERGE</e:folderReplacePolicy>
<e:fileReplacePolicy>OVERWRITE_IF_NEWER</e:fileReplacePolicy>
<e:query>
<q:queryStringQuery>extension:png</q:queryStringQuery>
</e:query>
</e:copyRequest>
Response
When async is not specified, the response will wait until the operation to complete. In this case the response indicates the number of items copied.
<e:bulkOperationResponse
xmlns:e="http://www.elvisdam.com/xmlns/elvis/webservice/1.0"
processId="FXCllwm5KEV8BkACDRZfcl">
<e:processedCount>9</e:processedCount>
</e:bulkOperationResponse>
Async
Since the operation might run for a while when copying large folders, it can be started asynchronous and will run as a separate process on the Elvis server.
<e:copyRequest async="true">
...
</e:copyRequest>
In this case the operation immediately returns after the process has started and only returns the process id, not the outcome of the operation.
<e:bulkOperationResponse
xmlns:e="http://www.elvisdam.com/xmlns/elvis/webservice/1.0"
processId="A6npMCy8ag6991GAHBDMh0"/>
You can make separate requests to retrieve details about the current status of the process.
<e:processStatusRequest
xmlns:e="http://www.elvisdam.com/xmlns/elvis/webservice/1.0"
processId="A6npMCy8ag6991GAHBDMh0"/>
Which returns the following information.
<e:processStatusResponse
xmlns:e="http://www.elvisdam.com/xmlns/elvis/webservice/1.0"
processId="A6npMCy8ag6991GAHBDMh0">
<e:name>CopyBulk</e:name>
<e:load>NORMAL</e:load>
<e:user>webservice</e:user>
<e:state>FAILED</e:state>
<e:startTime>1321955198664</e:startTime>
<e:endTime>1321955198665</e:endTime>
<e:failureMessage>Source does not exist, unable to move /Demo Zone/Images to /Demo Zone/Images Copy</e:failureMessage>
</e:processStatusResponse>
Comment
Do you have corrections or additional information about this article? Leave a comment! Do you have a question about what is described in this article? Please contact Support.
0 comments
Please sign in to leave a comment.