Thursday, December 5, 2013

RIDC: GET_DATARESULTSET Service to get the list of docTypes

To achieve the above requirement we would need to use GET_DATARESULTSET service which by definition executes a Select query against the database.

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) under <@table DataSources@>.



package client;

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 RIDCDocTypes {
    
    private static final String WHERE_CLAUSE = null;
    private static final String ORDER_CLAUSE = " order by DocTypes.dDocType desc";

    public static void main(String[] args) {
        IdcClientManager manager = new IdcClientManager();
        try {
            IdcClient idcClient = manager.createClient("idc://127.0.0.1:4444");
            IdcContext userContext = new IdcContext("sysadmin");

            //HdaBinderSerializer serializer = new HdaBinderSerializer("UTF-8", idcClient.getDataFactory());

            DataBinder serviceBinder = idcClient.createBinder();
            serviceBinder.putLocal("IdcService", "GET_DATARESULTSET");
            serviceBinder.putLocal("dataSource", "DocTypes");
            serviceBinder.putLocal("resultName", "DocTypesList");
            
            if (WHERE_CLAUSE != null) {
                    serviceBinder.putLocal("whereClause", WHERE_CLAUSE);
            }

            if (ORDER_CLAUSE != null) {
                    serviceBinder.putLocal("orderClause", ORDER_CLAUSE);
            }

            //serializer.serializeBinder(System.out, dataBinder);
            ServiceResponse response = idcClient.sendRequest(userContext, serviceBinder);
            DataBinder responseData = response.getResponseAsBinder();
            //serializer.serializeBinder(System.out, responseData);

            DataResultSet resultSet = responseData.getResultSet("DocTypesList");

            for (DataObject dataObject : resultSet.getRows()) {
                System.out.println(dataObject.get("dDocType"));
            }

        } catch (IdcClientException ice) {
            ice.printStackTrace();
        } /*catch (IOException ioe) {
            ioe.printStackTrace();
        }*/
    }
}

Similarly, we can get the list of all documents, users, workflows, revisions, etc. This service can be used from browser as well in the following manner : 

http://hostname:port/cs/idcplg?IdcService=GET_DATARESULTSET&dataSource=DocTypes&resultName=DocTypesList&IsJava=1

UCM: Oracle WebCenter Content Server Startup


The startup process contains five steps and takes place in two locations: Oracle WebLogic Server (step 1) and Oracle WebCenter Content Server (steps 2–5). Important Content Server files are as follows:

• intradoc.cfg
   - The intradoc.cfg file is a configuration file that contains the settings for Content Server services, applets, and utilities.
   - It is used to define system variables for Content Server, including directory, Internet and refinery settings, as well as server services, applets, and utilities.
   - Some variables can be set using Content Server’s System Properties utility.
   - <IntradocDir>/bin

• config.cfg
   - The config.cfg file defines the system configuration variables.
   - It is used to define global variables and configuration settings for Content Server.
   - Many of these variables can be set using Content Server’s System Properties utility or the Admin Server’s General Configuration page.
   - <IntradocDir>/config

• idccs_components.hda
   - The idccs_components.hda file identifies all installed custom components that have been added to the Content Server system.
   - This is the file that is read last in step 4 of the startup process.
   - If no custom components are enabled in the system, this file will not have any entries. In this case, the Content Server startup is complete after step 4, and step 5 is obsolete.
   - Step 5 is executed only if one or more custom components are enabled.
   - <IntradocDir>/data/components
<IntradocDir>: C:\Oracle\Middleware\user_projects\domains\base_domain\ucm\cs