Forum Stats

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

Discussions

CHECK IN The document in certain folder By Using RIDC

3026322
3026322 Member Posts: 68
edited Aug 17, 2016 3:32AM in WebCenter Content

How Can I Check In the document in certain folder ??

Thanks

Tagged:
«13

Answers

  • amey g
    amey g Member Posts: 2,631 Gold Trophy
    edited Jul 31, 2016 8:47AM

    Hello,

    You can use RIDC check in server and to check in under particular folder you need to pass the fParentGUID. The fFolderGUID is the unique identifier for the folder, and the fParentGUID is set to the value of fFolderGUID for the folder's parent folder.

    Run the below query in Content database to get fFolderGUID and fParentGUID e.g. prefix_ocs

    SELECT * from FOLDERFOLDERS WHERE FFOLDERNAME = 'ff1

    For code to check in refer below thread

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

    Thanks,

    Amey

  • Raja Kummathi
    Raja Kummathi Member Posts: 743 Silver Badge
    edited Aug 1, 2016 12:00AM

    Hi ,

    Step 1:- Get dCollectionIDby pasing your folder Name

    DataBinder myRequestDataBinder = myIdcClient.createBinder();

                myRequestDataBinder.putLocal("IdcService", "COLLECTION_INFO");

                myRequestDataBinder.putLocal("hasCollectionPath", "true");

                // Folder path for which ID is needed.

                myRequestDataBinder.putLocal("dCollectionPath", myFolderPath); //--> your folder path

                myServiceResponse = myIdcClient.sendRequest(myIdcContext,myRequestDataBinder);

                DataBinder myResponseDataBinder = myServiceResponse.getResponseAsBinder();

                DataResultSet myDataResultSet = myResponseDataBinder.getResultSet("PATH");

                DataObject myDataObject = (DataObject) myDataResultSet.getRows().get(myDataResultSet.getRows().size() - 1) ;

                myFolderId = new Long(myDataObject.get("dCollectionID"));

    Step 2:- After getting dCollectionID  pass to your checkin  service

    DataBinder myRequestDataBinder = myIdcClient.createBinder();

                         myRequestDataBinder.putLocal("IdcService", "CHECKIN_UNIVERSAL");

                         myRequestDataBinder.putLocal("xCollectionID", myFolderId);

    Regards,

    Raja

  • 3026322
    3026322 Member Posts: 68
    edited Aug 3, 2016 2:57AM

    Hello Amey

    I use this code to do Check In process :

        public String checkInRIDC(HashMap map,

                                  InputStream dPrimaryFile) throws IdcClientException,

                                                                   IOException {

            dataBinder.putLocal("IdcService", "CHECKIN_UNIVERSAL");

            Iterator keySetIterator = map.keySet().iterator();

            while (keySetIterator.hasNext()) {

                String key = (String)keySetIterator.next();

                String value = (String)map.get(key);

                System.out.println("key : " + key + " ....... value : " + value);

                dataBinder.putLocal(key, value);

            }

           dataBinder.putLocal("fParentGUID","71771ED40AF2CE70D36C9AABE43E47EF"); // This Line which I add according your answer .. I pass the value directly .. but the Check In process is not working .. before adding this line..Check In process is working .

          

            TransferFile tf = new TransferFile();

            tf.setInputStream(dPrimaryFile);

            dataBinder.addFile("primaryFile", tf);

           

            ServiceResponse response = client.sendRequest(userContext, dataBinder);

            DataBinder responseBinder = response.getResponseAsBinder();

            Collection<String> did = responseBinder.getResultSetNames();

            System.out.println("dID ..............." +

                               responseBinder.getLocalData().get("dID"));

            if (response != null) {

                response.close();

            }

            return responseBinder.getLocalData().get("dID");

        }

    Thnks Amey

  • 3026322
    3026322 Member Posts: 68
    edited Aug 3, 2016 3:16AM

    Hi Raja

    I try your solution .. my folder path is '/INOUT_FOLDER/INOUT_SECRET' ..the Check In process is success but the file is not saved in the certain folder .. the file is not saved in any folder .

    Thanks 

  • Jiri.Machotka-Oracle
    Jiri.Machotka-Oracle Member Posts: 5,078
    edited Aug 3, 2016 5:53AM

    I will give you the advice that I always give in such situations:

    1) turn on server-wide tracing for REQUESTAUDIT (see Troubleshooting Oracle WebCenter Content)

    2) perform your scenario from GUI

    3) read in the log what your RIDC program should be doing

    You can use the tracing for troubleshooting your program, too - you will see if there are some differences.

  • 3026322
    3026322 Member Posts: 68
    edited Aug 3, 2016 8:32AM

    I try but I have some confusion ..and many information I find ..if you want I will send it to you .

    Another point .. I find some sites about same subject :

    public String getFolderIdFromPath(String username, String path){

            String folderId=null;

           

            try {

                IdcClient client = getIdcClient();

                DataBinder dataBinder = client.createBinder();

                dataBinder.putLocal("IdcService", "COLLECTION_INFO");

                dataBinder.putLocal("hasCollectionPath", "true");

                dataBinder.putLocal("dCollectionPath", path);

                ServiceResponse response = client.sendRequest(new IdcContext(username), dataBinder);

                DataBinder serverBinder = response.getResponseAsBinder();

                DataResultSet resultSet = serverBinder.getResultSet("PATH");

                DataObject dataObject = resultSet.getRows().get(resultSet.getRows().size() - 1);

                folderId = dataObject.get("dCollectionID");  

                                   

            } catch(Exception ex) {

                System.out.println("Error: " + ex.getMessage());               

            }

           

            return folderId;

        }

    But the problem is  : Error: No service defined for COLLECTION_INFO.

    Thanks

  • Jiri.Machotka-Oracle
    Jiri.Machotka-Oracle Member Posts: 5,078
    edited Aug 3, 2016 8:51AM

    COLLECTION_INFO is a service provided by an older component called Folders_g. If your system uses the other component, Framework Folders, you will have to call a different service.

    The REQUESTAUDIT trace log will tell you what your GUI does and how - there's no need to re-invent the wheel.

  • Raja Kummathi
    Raja Kummathi Member Posts: 743 Silver Badge
    edited Aug 3, 2016 11:43AM

    Hi ,

    Sorry my above code will not work, Could you please try the below one and let me know

    package newrevision;

    import oracle.stellent.ridc.IdcClient;

    import oracle.stellent.ridc.IdcClientException;

    import oracle.stellent.ridc.IdcClientManager;

    import oracle.stellent.ridc.IdcContext;

    import oracle.stellent.ridc.model.DataBinder;

    import oracle.stellent.ridc.model.DataObject;

    import oracle.stellent.ridc.model.DataResultSet;

    import oracle.stellent.ridc.protocol.ServiceResponse;

    public class FolderId {

        private static String username;

        private static String UCMConnectionURL;

        private static IdcClientManager myIdcClientManager;

        private static IdcClient myIdcClient;

        private static IdcContext idcContext;

       

      public static void main(String[] args) throws IdcClientException {

      ServiceResponse myServiceResponse = null;

      

      username = "ucmadminsvr";

      UCMConnectionURL = "idc://localhost:4447";

       myIdcClientManager = new IdcClientManager();

      myIdcClient = myIdcClientManager.createClient(UCMConnectionURL);

      idcContext = new IdcContext(username);

      DataBinder myRequestDataBinder = myIdcClient.createBinder();

            myRequestDataBinder.putLocal("IdcService", "COLLECTION_INFO");

            myRequestDataBinder.putLocal("hasCollectionPath", "true");

            // Folder path for which ID is needed.

            myRequestDataBinder.putLocal("dCollectionPath", "/Contribution Folders/test");

            myServiceResponse = myIdcClient.sendRequest(idcContext,myRequestDataBinder);

            DataBinder myResponseDataBinder = myServiceResponse.getResponseAsBinder();

            DataResultSet myDataResultSet = myResponseDataBinder.getResultSet("PATH");

            DataObject myDataObject = (DataObject) myDataResultSet.getRows().get(myDataResultSet.getRows().size() - 1) ;

            Long myFolderId = new Long(myDataObject.get("dCollectionID"));

            System.out.println(myFolderId);

          

           

            /*Pass this value to xColletionID,

             * So that content will be checkin to correct folder*/

      

      }

    }

  • 3026322
    3026322 Member Posts: 68
    edited Aug 4, 2016 1:44AM

    Hi Raj

    Thanks about your effort but the problem is the service which called  "COLLECTION_INFO" is not define do you any alternative service .

    Thanks

  • Srinath Menon-Oracle
    Srinath Menon-Oracle Posts: 6,291 Employee
    edited Aug 4, 2016 1:58AM

    As Jiri mentioned in the earlier post , first confirm if you are using Folders_g or FrameworkFolders .

    on that the code can be modified accordingly to get it working .

    If you are using the latter (which I assume is the case based on your first post) , you should modify this line:

    dataBinder.putLocal("fParentGUID","71771ED40AF2CE70D36C9AABE43E47EF"); 

    and add this :

    dataBinder.putLocal("fParentPath","<path of your folder>");

    If this is failing , then it indicates there is no folder with that path and you will need to verify the right folder to which you need to checkin and get the folder path and replace it here in the code.

    Tracing from view server output should be the first thing to check what all parameters are being passed to the service . Or else you can use chrome developer console - Network tab to read through the request parameters sent when doing the check-in (this is easier) .

This discussion has been closed.