This discussion is archived
1 2 3 Previous Next 30 Replies Latest reply: Aug 25, 2013 10:37 PM by Bharath Umesh RSS

Retrieving values from resultset

Bharath Umesh Newbie
Currently Being Moderated

Hi ,

How do we retrieve the values from a resultset in custom component's java file?

As of now,I am running the service COLLECTION_COPY_ITEM and retrieving the resultset using m_binder.getResultSets().

It returns a map,looping over the map to get the values. i am able to fetch the fieldnames but not the values for those fields.

How do i fetch those values?

 

This is the code I am using:

        Map map = m_binder.getResultSets();

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

                     while(iterator.hasNext()){

   

      String fieldname=iterator.next().toString();

             if(fieldname.equalsIgnoreCase("desktoptags")){

 

                ResultSet rset1 = m_binder.getResultSet(fieldname);

               Report.trace("mysectionstring", rset1.toString(), null);

                Report.trace("mysectionstring", rset1.getFieldName(0), null);

                Report.trace("mysectionstring", rset1.getFieldName(1), null);

            }

 

Please provide pointers/inputs to solve the need.

Thanks in advance.

  • 1. Re: Retrieving values from resultset
    Bharath Umesh Newbie
    Currently Being Moderated

    This is the output visible in audit information for the trace applied.

     

    >mysectionstring/6 08.18 23:01:13.813 IdcServer-83 SimpleProfileFieldFormats
    >mysectionstring/6 08.18 23:01:13.813 IdcServer-83 UserAttribInfo
    >mysectionstring/6 08.18 23:01:13.813 IdcServer-83 desktoptags
    >mysectionstring/6 08.18 23:01:13.813 IdcServer-83 -------------------------------------------------
    >mysectionstring/6 08.18 23:01:13.813 IdcServer-83
    mysectionstring/6 08.18 23:01:13.813 IdcServer-83
    mysectionstring/6 08.18 23:01:13.813 IdcServer-83 --- @ResultSet ---
    mysectionstring/6 08.18 23:01:13.813 IdcServer-83 numFields=2,numRows=7,currentRow=7

    >mysectionstring/6 08.18 23:01:13.813 IdcServer-83 -------------------------------------------------
    >mysectionstring/6 08.18 23:01:13.813 IdcServer-83 name
    >mysectionstring/6 08.18 23:01:13.814 IdcServer-83 value

  • 2. Re: Retrieving values from resultset
    Srinath Menon Guru
    Currently Being Moderated

    Hi ,

     

    Can you please elaborate what exactly are you are trying to set the values to in result sets ? The service which you are calling copies a content item from Folder1 to Folder2 and only params needed for it are collection id and tohasCollectionID .

     

    Other than that we don't need to set any other values in it .

     

    Maybe I am missing the point which you are looking for .

     

    Thanks,

    Srinath

  • 3. Re: Retrieving values from resultset
    Bharath Umesh Newbie
    Currently Being Moderated

    Hi Srinath,

    Thanks for the reply.

    Yes these are the values i am setting in order to copy the content and executing the below service in my custom component:

            m_binder.putLocal("dDocName", contentId);

            m_binder.putLocal("tohasCollectionID", "true");

            m_binder.removeLocal("todCollectionID");

            m_binder.putLocal("todCollectionID",collectionID);

            m_service.getRequestImplementor().executeServiceTopLevelSimple(m_binder,

                                                                           "COLLECTION_COPY_ITEM",

                                                                           m_service.getUserData());

    I am not setting any other values. I need to retrieve the value of the contentID of the item checked in newly in folder2.

    I got to know that this value(new content id) will be stored in the resultset 'desktoptags' of the service COLLECTION_COPY_ITEM.

    How do i retrieve the value from the resultset?

  • 4. Re: Retrieving values from resultset
    Srinath Menon Guru
    Currently Being Moderated

    Hi ,

     

    You would need to use COLLECTION_DISPLAY and retrieve the dDocName from CONTENTINFO result set  :

     

     

    http://docs.oracle.com/cd/E21764_01/doc.1111/e11011/c08_folders.htm#i1082379

     

    Thanks,

    Srinath

  • 5. Re: Retrieving values from resultset
    Bharath Umesh Newbie
    Currently Being Moderated

    Hi Srinath,

     

    Will the resultset of COLLECTION_DISPLAY  have the new content ID?

    It says in the link you have provided :"Service that returns a list of the items contained in a Folders_g folder, including content items, folders and short cuts."

     

    But what i need is the content ID of the item newly checked-in in the destination.

    Please revert back ASAP.

     

    Thanks in advance.

  • 6. Re: Retrieving values from resultset
    Srinath Menon Guru
    Currently Being Moderated

    Hi ,

     

    Yes , that will show the list of all content id's which are part of the target folder .

     

    After executing COLLECTION_DISPLAY iterate over @ResultSet CONTENTS and there look for dDocName which will list the value .Now , this will not show which file is copied from source and which is not since the service or content does not have a metadata which identifies this .

     

    Hope this helps .

     

    Thanks,

    Srinath

  • 7. Re: Retrieving values from resultset
    Bharath Umesh Newbie
    Currently Being Moderated

    Hi Srinath,

     

    Thanks for the reply, But the need is that i have to retrieve the new content ID from the resultset.

    In my stand alone program when i run it through RIDC i am able to get the new content id but when i incorporate it in the custom component and use the m_binder to fetch data , i am not able to get the values after iterating through the resultset.

    Could you please suggest me with some information in order to achieve it.

     

    Thanks,

    Bharath

  • 8. Re: Retrieving values from resultset
    Srinath Menon Guru
    Currently Being Moderated

    Hi Bharath ,

     

    How are you retrieving the dDocName for the new content item using stand-alone RIDC program ?

     

    Thanks,

    Srinath

  • 9. Re: Retrieving values from resultset
    Bharath Umesh Newbie
    Currently Being Moderated

    Hi Srinath,

     

    I created a method as below:

     

    public String NewItemDetails(ServiceResponse responseFetched,IdcClient idcClient){

            DataBinder binderForNewItem=idcClient.createBinder();

            String contentIDOfNewItem=null;

      try {

      binderForNewItem = responseFetched.getResponseAsBinder();

      DataResultSet resultSetNew = binderForNewItem.getResultSet ("desktoptags");

     

    // found that in the desktoptags' resultset "DISdDocName" has the value of new content ID.

     

      DataObject test = resultSetNew.getRows().get(0);

      contentIDOfNewItem  = test.get("value");

      System.out.println("value of new doc: "+ contentIDOfNewItem);

     

      } catch (IdcClientException e) {

      e.printStackTrace();

      }

      return contentIDOfNewItem;

     

     

            }

     

    This works fine. But the requirement is that we are not using RIDC for our custom component. Instead of creating binders using idcClient, we have to make use of m_binder.In addition,Here, we fetch the resultset with the type DataResultSet,create a DataObject and then fetching the new contentID. But if we don't make use of RIDC then the resultset's type will be ResultSet.Is there any alternative?

     

    Thanks,

    Bharath

  • 10. Re: Retrieving values from resultset
    Srinath Menon Guru
    Currently Being Moderated

    Hi ,


    Desktoptags is not the right field we should be using to get listing of content id . It's not the result set which is returned from the service call either .

     

    Thanks,

    Srinath

  • 11. Re: Retrieving values from resultset
    Srinath Menon Guru
    Currently Being Moderated

    Hi ,

     

    Why not try COPY_REVISION service call and there in provide the target folder details . Using this you can get the dDocName in resultset and also achieve the requirement of copying the content item from folder A to folder B .

     

    Only requirement to execute this service is that WCC should be PS5 + latest patchset (MLR 15 - https://support.oracle.com/epmos/faces/PatchDetail?patchId=17046964) since the base version does not have the service .

     

    To get details on how to run it please check Note : 1543674.1 on MoS portal .

     

    Hope this helps .

     

    Thanks,

    Srinath

  • 12. Re: Retrieving values from resultset
    Jonathan Hult Pro
    Currently Being Moderated

    For more information on the COPY_REVISION service, check out this blog post: http://jonathanhult.com/blog/2013/04/clone-content-webcenter-content-11g/

     

    Jonathan

    http://jonathanhult.com

  • 13. Re: Retrieving values from resultset
    Bharath Umesh Newbie
    Currently Being Moderated

    Hi Srinath,

     

     

    We tried using the COLLECTION_DISPLAY service and retrieve the new content id at the destination.

    It works fine, but if there are any other items in the destination folder prior to the execution of COLLECTION_COPY_ITEM, the COLLECTION_DISPLAY fetches a random content id rather than the appropriate new content ID. Could you provide some inputs such that we can fetch the appropriate content ID that will be associated with the item that was created as a result of COLLECTION_COPY_ITEM?

     

     

     

     

    Thanks and Regards,

    Bharath

  • 14. Re: Retrieving values from resultset
    Srinath Menon Guru
    Currently Being Moderated

    Hi Bharath ,

     

    I believe using COLLECTION_COPY_ITEM will not be the best approach for your requirement (assuming there is no "exact" need to use it ) since the dDocName for the new content item will not be returned in the associated result set . Only other way of doing this would be to have SQL query for checking the contents which are copied over but to me that would be a overkill .

     

    The reason for this is there are no metadata associated with the content item which says the item was copied from source.

     

    In my opinion using COPY_REVISION is the best approach given that knowing the copied content id is of paramount importance .

     

    Thanks,

    Srinath

1 2 3 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points