Tuesday, 5 July 2016

Copy content from one location to another location via WCM API

Agenda :- How to copy the content from location to other location via custom workflow using WCM API.


Step1 :- Create a custom workflow action where you have to move contents from one location to another location

Document document1 = ws.copy(document.getId(), docid);

Parameter1 :- 'document.getId()' this is the document which need to be copied to some other location.
Parameter2 :- docid this is document id of sitearea when the document need to be copied. You can utilize workspace methods like getByName or findByPath to retrieve the site area documentId.


ws - workspace object


Step2 :- You can verify the newly created content by printing the title of new content(document1.getTitle()).


Note :- There is one more optional overloaded parameter CopyOptions using which properties of copied contents can be modified for example changing author of the copied content.

No comments:

Post a Comment

Custom single threaded java server

 package com.diffengine.csv; import java.io.*; import java.net.*; import java.util.Date; public class Server { public static void main(Str...