0

I have 2 filenet Server.i want to download the Documents from 1st server and upload into 2nd server.Is it Possible usning FILENET API?

ᄂ ᄀ
  • 5,669
  • 6
  • 43
  • 57
Abhishek Mahapatra
  • 51
  • 1
  • 2
  • 10
  • it is possible, but your best approach would be to use the Filenet deployment manager, thats the tool to use in that scenario. use this source: http://www-01.ibm.com/support/docview.wss?uid=swg21667406 – icrovett Mar 02 '15 at 14:29

1 Answers1

1

This should be possible. If I understand your problem correctly, it should be something like this:

    ObjectStore os1 = Factory.GetOSForSystem1();//create some function to get the object store for system one and for system two
    ObjectStore os2 = Factory.GetOSForSystem2();
    Document d = Factory.Document.fetchInstance(os1, "guid", null);//fetch the document from the first system

    Document newDoc = Factory.Document.createInstance(os2, "Document");//create the document in the second system
    //create contentlist for reservation object
    ContentElementList cteList = Factory.ContentElement.createList();

    //Create content transfer object and get the content from the current version
    ContentTransfer ctNew = Factory.ContentTransfer.createInstance();
    ContentTransfer ct = (ContentTransfer) d.get_ContentElements().get(0);
    //get the content as a contentstream to prevent reuse and read only error.
    ctNew.setCaptureSource(ct.accessContentStream());
    ctNew.set_RetrievalName(ct.get_RetrievalName());
    //add the new content to the list and add the list to the reservation
    cteList.add(ctNew); 
    newDoc.set_ContentElements(cteList);
    newDoc.save(RefreshMode.NO_REFRESH);//if you do not need the document after the save say no refresh, saves system resources
Robert vd S
  • 342
  • 1
  • 6