4 Replies Latest reply: Sep 25, 2013 7:39 AM by 1014801 RSS

    RIDC: Retrieve Options from an Option List


      Hello all,


      I have a business requirement involving the utilization of RIDC to retrieve the list of options from an option list. A quick glance at the RIDC API documentation gave me the hint to try the IDC Service GET_DOC_METADATA_INFO. However, with this service, I was only able to get as far as to retrieve the 'dOptionListKey' value from the DocMetaDefinition result set. Are there other services that exist that will allow me to specifically retrieve the options from an option list?


      Bonus question: I have an option list that defines metadata for specific content items whose contents are dependent upon another option list. Is there a way to gather the list options for the second option list as well?


      Many thanks for the help!


        • 1. Re: RIDC: Retrieve Options from an Option List

          Hi Josh,


                    To achieve the above requirement you can use GET_DATARESULTSET service which by definition executes a Select query against the database. Results from this select operation is stored in a result set (which is user defined) and then iterated over to show the list of options present in an option list.

          Required parameter for this service is "dataSource" which is a preset query present in std_resources.htm
          (location : <mw_home>/Oracle_ECM1/ucm/idc/resources/core/tables) .
          Add the following section:
          Under <@table DataSources@>


          <td>select distinct(dOption) from OptionsList where dKey='<OptionListName>' order by dOption</td>


          This creates a new dataSource with name OptionList and the relevant query for execution . Post-editing , server should be restarted.

          With this in place GET_DATARESULTSET can now execute and call OptionList to list the details .


          Code Snippet:

          // Databinder for service request
          DataBinder dataBinder = idcClient.createBinder();
          dataBinder.putLocal("IdcService", "GET_DATARESULTSET");
          dataBinder.putLocal("dataSource","OptionList");//OptionList is the datasource name set in std_resources.htm file. If anything else is name set there then make change here accordingly.
          dataBinder.putLocal("resultName","OptionList"); //ResultSet name arbitrarily set to hold the values
          // Write the data binder for the request to stdout
          serializer.serializeBinder (System.out, dataBinder);
          // Send the request to Content Server
          ServiceResponse response = idcClient.sendRequest(userContext,dataBinder);
          // Get the data binder for the response from Content Server
          DataBinder responseData = response.getResponseAsBinder();
          // Write the response data binder to stdout
          serializer.serializeBinder (System.out, responseData);

          // Retrieve the ResultSet from the response - this should match the value provided for resultName
          DataResultSet resultSet1 = responseData.getResultSet("OptionList");

          // Iterate over the ResultSet, retrieve all the Options

          for (DataObject dataObject : resultSet1.getRows ()) {

          System.out.println ("Option is : " + dataObject.get ("dOption") );



          Note that the resultName(result set created) can be named as per convenience and the same should be used for iterating to list the Options.


          This service can be used from browser as well in the following manner :







          • 2. Re: RIDC: Retrieve Options from an Option List

            Wow, thank you so much for such a detailed response! Quick question though - how would I approach retrieving the actual options that a user has the opportunity to select from. For example, if I have a metadata field titled xMetaField with the options { "apple", "orange", "grape" } then how would I go about retrieving that specific list of items?



            • 3. Re: RIDC: Retrieve Options from an Option List

              Hi Josh,


                       Please refer the below link to enable option list values based on security.



              Just curious to know your use case.




              • 4. Re: RIDC: Retrieve Options from an Option List

                I figured it out using the RIDC API and the Service Call "GET_TABLE"


                Here is a code excerpt:


                IdcClientManager manager = new IdcClientManager();

                IdcClient idcClient = manager.createClient(idc_server);

                IdcContext userContext = new IdcContext(idc_user);


                DataBinder binder = idcClient.createBinder();

                binder.putLocal("IdcService", "GET_TABLE");

                binder.putLocal("tableName", table_name);


                // Issue IDC Service Call

                ServiceResponse requestResponse = idcClient.sendRequest(userContext, binder);

                DataBinder serverBinder = requestResponse.getResponseAsBinder();

                DataResultSet resultSet = serverBinder.getResultSet(table_name);




                for(DataObject dataObject : resultSet.getRows()) {




                This returns all items in an option list. For the example list that I defined above, this code will return apple, orange, grape.