Forum Stats

  • 3,814,896 Users
  • 2,258,927 Discussions
  • 7,892,883 Comments

Discussions

How to check-in multiple files/attatchments on UCM using RIDC?

Filipe Baptista
Filipe Baptista Member Posts: 13
edited Feb 17, 2016 10:42PM in WebCenter Content

HI,

I'd like to know how can I check-in multiple files on UCM using RIDC. I'm currently checking-in a single document to UCM with some bsuiness metadata and a specified file, but the final user should  be able to specify more than one file to upload.

We provide multiple input files on the UI so that the user can choose, besides the primary file, multiple files (e.g., up to 3) which are not created as documents on UCM but rather as other files attatched to a given document.

Should I simply check them in as I do with the first file and then specify on the WCC side that the remaining are "other files". Or there is a special way to treat these attatched/other files for a given document?

Thanks in advance.

Regards,

Filipe Baptista

Tagged:
Jonathan Hult

Best Answer

  • Srinath Menon-Oracle
    Srinath Menon-Oracle Posts: 6,291 Employee
    edited Feb 17, 2016 10:35PM Answer ✓

    Hi Filipe ,

    At the time of check-in you cannot select multiple files because WCC at a time would take 1 primary file and 1 alternate file as inputs per request . If you are looking to add multiple files for a checked-in content then ZipRenditions component can be used to add "multiple" attachments to the checked in file . But again it would be a post check-in operation . A sample code for that would be like this :

    Checkin:

      DataBinder dataBinder = idcClient.createBinder();
                dataBinder.putLocal("IdcService", "CHECKIN_NEW");
                dataBinder.putLocal("dDocAuthor","weblogic");
                dataBinder.putLocal("dDocTitle", "RIDC-AttachTest1");
                dataBinder.putLocal("dDocType", "Document");
                dataBinder.putLocal("xIdcProfile", "RIDCProfile");
                dataBinder.putLocal("dSecurityGroup", "Public");
                dataBinder.addFile("primaryFile", new File("/home/oracle/test/run.sh"));
                 dataBinder.addFile("alternateFile", new File("/home/oracle/test/run1.sh"));
                dataBinder.putLocal("doFileCopy", "1");
                dataBinder.putLocal("fParentGUID","6CD583399ED00A8D86A689BBF0AF89C7"); // if it is to be checked in to a framework folder.
    

    Then the response from this would have the dID and dDocName which you need to use and check if the status is released :

    dataBinder.putLocal("IdcService", "DOC_INFO");
               dataBinder.putLocal("dDocName", "<from response>");
               dataBinder.putLocal("dID", "<from response>");
    

    If the response has dStatus=RELEASED , then run the multiple file attachment code sample like this :

    dataBinder.putLocal("IdcService", "EDIT_RENDITIONS");
    dataBinder.putLocal("dID", "<dID of the content>");
    dataBinder.putLocal("renditionKeys", "addRendition0");
    dataBinder.putLocal("addRendition0.name", "FileAttach");
    dataBinder.putLocal("addRendition0.action", "edit");
    dataBinder.putLocal("addRendition0.file:path", "\ridc\test.txt");
    dataBinder.addFile("addRendition0.file", new File("test.txt"));
    
    addRendition0 is the first attachment that can be added , like wise you can use addRendition1, addRendition2 , addRendition3 etc to add more number of attachments to the same content .
    

    So , it will not be a case where in the checkin request itself you can add the attachments itself ( this feature is available with WCC 12c -

    With UCM 11g you need to check the response data for the checkin and then add the attachments (which at a time I think you can select 6) .

    Hope this helps .

    Thanks,

    Srinath

    Jonathan HultFilipe Baptista

Answers

  • Amol Gavali
    Amol Gavali Member Posts: 124
    edited Feb 17, 2016 2:13PM

    Hi Filipe,

    If you are using WebCenter Content with Records then best way would be to use Related Content https://docs.oracle.com/cd/E23943_01/doc.1111/e10733/c12_links.htm#RMDUG306

    If it is just plain WebCenter Content then just checkin multiple files with same metadata or create metadata on child/associated content which will bind it to parent document and then use search service to find parent and its associated child files.

    OOTB with checkin call you attach alternate file but that's a file which will give more information about main content like if image file is a primary file and then a text file which describing more information about image file can be a alternate file.

    Regards,

    Amol Gavali.

  • amey g
    amey g Member Posts: 2,631 Gold Trophy
    edited Feb 17, 2016 8:09PM

    Hello,

    As you mentioned you need to  handle it at code level for multiple file upload. You can provide multiple input box.

    But if you want one single file as primary content and other files as attachment of that content then you need to create custom metadata for it.

    thanks,
    Amey

  • Srinath Menon-Oracle
    Srinath Menon-Oracle Posts: 6,291 Employee
    edited Feb 17, 2016 10:35PM Answer ✓

    Hi Filipe ,

    At the time of check-in you cannot select multiple files because WCC at a time would take 1 primary file and 1 alternate file as inputs per request . If you are looking to add multiple files for a checked-in content then ZipRenditions component can be used to add "multiple" attachments to the checked in file . But again it would be a post check-in operation . A sample code for that would be like this :

    Checkin:

      DataBinder dataBinder = idcClient.createBinder();
                dataBinder.putLocal("IdcService", "CHECKIN_NEW");
                dataBinder.putLocal("dDocAuthor","weblogic");
                dataBinder.putLocal("dDocTitle", "RIDC-AttachTest1");
                dataBinder.putLocal("dDocType", "Document");
                dataBinder.putLocal("xIdcProfile", "RIDCProfile");
                dataBinder.putLocal("dSecurityGroup", "Public");
                dataBinder.addFile("primaryFile", new File("/home/oracle/test/run.sh"));
                 dataBinder.addFile("alternateFile", new File("/home/oracle/test/run1.sh"));
                dataBinder.putLocal("doFileCopy", "1");
                dataBinder.putLocal("fParentGUID","6CD583399ED00A8D86A689BBF0AF89C7"); // if it is to be checked in to a framework folder.
    

    Then the response from this would have the dID and dDocName which you need to use and check if the status is released :

    dataBinder.putLocal("IdcService", "DOC_INFO");
               dataBinder.putLocal("dDocName", "<from response>");
               dataBinder.putLocal("dID", "<from response>");
    

    If the response has dStatus=RELEASED , then run the multiple file attachment code sample like this :

    dataBinder.putLocal("IdcService", "EDIT_RENDITIONS");
    dataBinder.putLocal("dID", "<dID of the content>");
    dataBinder.putLocal("renditionKeys", "addRendition0");
    dataBinder.putLocal("addRendition0.name", "FileAttach");
    dataBinder.putLocal("addRendition0.action", "edit");
    dataBinder.putLocal("addRendition0.file:path", "\ridc\test.txt");
    dataBinder.addFile("addRendition0.file", new File("test.txt"));
    
    addRendition0 is the first attachment that can be added , like wise you can use addRendition1, addRendition2 , addRendition3 etc to add more number of attachments to the same content .
    

    So , it will not be a case where in the checkin request itself you can add the attachments itself ( this feature is available with WCC 12c -

    With UCM 11g you need to check the response data for the checkin and then add the attachments (which at a time I think you can select 6) .

    Hope this helps .

    Thanks,

    Srinath

    Jonathan HultFilipe Baptista
  • Jonathan Hult
    Jonathan Hult Member Posts: 1,323 Silver Trophy
    edited Feb 17, 2016 10:42PM

    If you need separate metadata, use RelatedContent to link multiple content items.

    Or, you might be able to get away with renditions. https://jonathanhult.com/blog/2015/12/service-to-checkin-content-items-and-attachments-together-webcenter-content/

    Jonathan

    https://jonathanhult.com

This discussion has been closed.