Forum Stats

  • 3,814,867 Users
  • 2,258,922 Discussions
  • 7,892,882 Comments

Discussions

CHECK IN The document in certain folder By Using RIDC

2

Answers

  • Raja Kummathi
    Raja Kummathi Member Posts: 743 Silver Badge
    edited Aug 4, 2016 2:36AM

    Hi,

    problem is the service which called  "COLLECTION_INFO" is not define --> Means when you enabled Folders_g component then only collection_info service will called.

    If your using framework folder component ,then use the below code to get the fFolderGUID

    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 FLD_INFO {

        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:4449";

      myIdcClientManager = new IdcClientManager();

      myIdcClient = myIdcClientManager.createClient(UCMConnectionURL);

      idcContext = new IdcContext(username);

      DataBinder myRequestDataBinder = myIdcClient.createBinder();

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

            myRequestDataBinder.putLocal("path", "/test");

            myServiceResponse = myIdcClient.sendRequest(idcContext,myRequestDataBinder);

            DataBinder myResponseDataBinder = myServiceResponse.getResponseAsBinder();

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

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

            String myFolderId = myDataObject.get("fFolderGUID");

            System.out.println(myFolderId);

           // System.out.println(myResponseDataBinder);

          

           

            /*Pass this value to fFolderGUID,

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

      

      }

    }

    --Raja

  • 3026322
    3026322 Member Posts: 68
    edited Aug 4, 2016 7:54AM

    dear Mr.Raj

    Thanks a lot about your help by your code the result is good .. but small point remain ...

    my code is :

        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);

            }

            String ss = getFolderIdFromPath11() ;

            System.out.println("ss==========="+ss);

            dataBinder.putLocal("fFolderGUID",ss);

           

            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");

        }

     

    /////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public  String getFolderIdFromPath11(){

                String myFolderId = "" ;

               try {

                   IdcClient client = getUCMConnection();   

                  DataBinder dataBinder = client.createBinder();

                   ServiceResponse myServiceResponse = null;

                   IdcClientManager myIdcClientManager = new IdcClientManager();

                  IdcClient  myIdcClient = myIdcClientManager.createClient(ucmUrl);              

                  IdcContext IdcContext = new IdcContext("weblogic");            

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

                           dataBinder.putLocal("path", "/INOUT_FOLDER");

                           myServiceResponse  = myIdcClient.sendRequest(IdcContext,dataBinder);

                           DataBinder myResponseDataBinder = myServiceResponse.getResponseAsBinder();

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

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

                           myFolderId = myDataObject.get("fFolderGUID");

                           System.out.println("myFolderId =========="+myFolderId);

                          // System.out.println(myResponseDataBinder);

                  

                 } catch(Exception ex) {

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

               } 

               return myFolderId;

           } //

    And I find the value of ss variable : ss===========1EF98AA49760998C10A9600FA742B94B .. I check in database and I find this value is correct for the folder which name is  "/INOUT_FOLDER" .

    And Its success Check In process  .. but when I search about this document I found it but without Folder path :

    pastedImage_0.png

    Thanks

  • Raja Kummathi
    Raja Kummathi Member Posts: 743 Silver Badge
    edited Aug 4, 2016 7:59AM

    Hi,

    Can u go and check the content in folder manually.

    --Raja

  • 3026322
    3026322 Member Posts: 68
    edited Aug 4, 2016 8:35AM

    Hi

    I don't find the document in the folder .

  • 3026322
    3026322 Member Posts: 68
    edited Aug 8, 2016 6:18AM

    Hi Raja

    I try this code :

        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);

            }

            String ss = getFolderIdFromPath11() ;

            System.out.println("ssffff==========="+ss);

         dataBinder.putLocal("fParentGUID","1EF98AA49760998C10A9600FA742B94B"); 

            dataBinder.putLocal("fParentPath","/INOUT_FOLDER");  

           

            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");

        }

       But the CheckIn Process not success ..

    But When I try this code :

        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);

            }

            String ss = getFolderIdFromPath11() ;

            System.out.println("ssffff==========="+ss);

           

             dataBinder.putLocal("fFolderGUID","1EF98AA49760998C10A9600FA742B94B");

            dataBinder.putLocal("fFileName","1802.jpg");              

            dataBinder.putLocal("fFileType ","owner");     

           

            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");

        }

    The CheckIn process success .. but without put file in certain folder which Folder Id mention above .

    I try this code :

        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);

            }

            String ss = getFolderIdFromPath11() ;

            System.out.println("ssffff==========="+ss);

             dataBinder.putLocal("fParentGUID","FLD_ROOT");

             dataBinder.putLocal("xFHACaseNumber","INOUT_FOLDER");

             dataBinder.putLocal("xFHADocumentType","Appraisal");

           

            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");

        }

    The CheckIn process success .. but without put file in certain folder which Folder Id mention above .

    Finally I try this code :

        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);

            }

            String ss = getFolderIdFromPath11() ;

            System.out.println("ssffff==========="+ss);

            dataBinder.putLocal("folderChildren","1EF98AA49760998C10A9600FA742B94B");

           

               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");

        }

    The CheckIn process success .. but without put file in certain folder which Folder Id mention above .

    Thanks

  • Raja Kummathi
    Raja Kummathi Member Posts: 743 Silver Badge
    edited Aug 8, 2016 11:41AM

    Hi,

    Could you please provide the response binder.

  • 3026322
    3026322 Member Posts: 68
    edited Aug 9, 2016 4:41AM

    Hi Raja

    How Can I do that ??

    Can you send the code .

    Thanks

  • Raja Kummathi
    Raja Kummathi Member Posts: 743 Silver Badge
    edited Aug 9, 2016 5:26AM

    Hi ,

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

      DataBinder responseBinder = response.getResponseAsBinder();

    System.out.println(responseBinder.toString());

    --Raja

  • 3026322
    3026322 Member Posts: 68
    edited Aug 9, 2016 7:29AM

    Hi Raja

    This is my code :

        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("fFolderGUID","1EF98AA49760998C10A9600FA742B94B");

            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("responseBinder============"+responseBinder.toString());

       

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

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

     

            if (response != null) {

                response.close();

            }

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

        }

    ---------------------------------------------------------------------------------

    And this is the result of response binder :

    responseBinder============  IdcService: CHECKIN_UNIVERSAL

    Thanks

  • 3026322
    3026322 Member Posts: 68
    edited Aug 10, 2016 6:14AM
This discussion has been closed.