Below are samples for the various ways you can move 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.
Move and rename single asset
<e:moveRequest
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/Beaches 2/Renamed Ilha Bela.jpg</e:target>
<e:folderReplacePolicy>MERGE</e:folderReplacePolicy>
<e:fileReplacePolicy>AUTO_RENAME</e:fileReplacePolicy>
</e:moveRequest>
Move folder
<e:moveRequest
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>/Archive/Old Demo Images</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:moveRequest>
Move with filter
A move operation can be filtered with a query so only assets that match the query will be moved. The operation below will archive all material that was imported more than a month ago:
<e:moveRequest
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>/Archive/Old Demo Images</e:target>
<e:folderReplacePolicy>MERGE</e:folderReplacePolicy>
<e:fileReplacePolicy>OVERWRITE_IF_NEWER</e:fileReplacePolicy>
<e:query>
<q:queryStringQuery>assetCreated:[* TO NOW@DAY-1MONTH]</q:queryStringQuery>
</e:query>
</e:moveRequest>
Or archive only material that was used in a publication:
<e:moveRequest
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>/Archive/Old Demo Images</e:target>
<e:folderReplacePolicy>MERGE</e:folderReplacePolicy>
<e:fileReplacePolicy>OVERWRITE_IF_NEWER</e:fileReplacePolicy>
<e:query>
<q:queryStringQuery>publicationName:*</q:queryStringQuery>
</e:query>
</e:moveRequest>
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 moved.
<e:bulkOperationResponse
xmlns:e="http://www.elvisdam.com/xmlns/elvis/webservice/1.0"
processId="63nbwqvcKSYBixM_wxFtC5">
<e:processedCount>34</e:processedCount>
</e:bulkOperationResponse>
Async
Since the operation might run for a while when moving large folders, it can be started asynchronous and will run as a separate process on the Elvis server.
<e:moveRequest async="true">
...
</e:moveRequest>
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="BdUNNXalKvJ9Mi3lT1yQbG"/>
You can make separate requests to retrieve details about the current status of the process.
<e:processStatusResponse
xmlns:e="http://www.elvisdam.com/xmlns/elvis/webservice/1.0"
processId="BdUNNXalKvJ9Mi3lT1yQbG">
<e:name>MoveBulk</e:name>
<e:load>NORMAL</e:load>
<e:user>admin</e:user>
<e:state>COMPLETED</e:state>
<e:startTime>1321956914821</e:startTime>
<e:endTime>1321956915125</e:endTime>
<e:progress>9</e:progress>
<e:total>9</e:total>
<e:details>/Demo Zone/Images to /Archive/Old Demo Images</e:details>
</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.