Intradoc: The Intradoc protocol communicates to the Content Server over the over the Intradoc socket port (typically 4444). This protocol requires a trusted connection between the client and Content Server and will not perform any password validation. Clients that use this protocol are expected to perform any required authentication themselves before making RIDC calls. The Intradoc communication can also be configured to run over SSL.

HTTP: Using the Apache HttpClient package, RIDC communicates with the web server attached to the Content Server. Unlike Intradoc, this protocol requires authentication credentials for each request. HttpClient version 3 is the default. However, version 4 of the httpClient library may also be used. See Section 23.1.1, "Using HttpClient Library Version 4" for details. Refer to the Jakarta Commons HttpClient documentation on the HttpClient Home page of the Apache HttpClient web site for additional information.

JAX-WS: The JAX-WS protocol is only supported in Oracle WebCenter Content 11g with a properly configured Content Server instance and the RIDC client installed. JAX-WS is not supported outside this environment.

The following table summarizes the environment RIDC needs to support each connection type.

URL

Description

idc://

oracle.ucm.ridc-11.1.1.jar

idcs:/

oracle.ucm.ridc-11.1.1.jar

SSL certificate configuration

http:/

oracle.ucm.ridc-11.1.1.jar

HttpClient libraries. These are included in the httpclient-3.*.jar and httpclient-4.*.jar.

https:/

oracle.ucm.ridc-11.1.1.jar

HttpClient libraries. These are included in the httpclient-3.*.jar and httpclient-4.*.jar.

SSL certificate configuration

jax-ws

Oracle shiphome having WLS and JRF stacks

23.1.1 Using HttpClient Library Version 4

Using the Apache HttpClient package, RIDC communicates with the web server attached to the Content Server. Unlike Intradoc, this protocol requires authentication credentials for each request. Remote Intradoc Client (RIDC) version 11.1.1.6.0 uses HttpClient version 3 as the default. However, version 4 of the HttpClient library may also be used.

Refer to the Jakarta Commons HttpClient documentation on the HttpClient Home page of the Apache HttpClient web site for additional information.

If you are creating a new RIDC application using the JDeveloper extension, you can add to your connection, in the Configuration Parameters section, the parameter "http.library" with a value of "apache4". See Section 23.11, "Using the RIDC JDeveloper Extension" for more information on the RIDC JDeveloper extension

If you are in a Site Studio for External Applications (SSXA) application in JDeveloper, because there is no UI, you need to create your connection and save it without testing the connection first. Then open the connections.xml file in the Connections > Descriptors > ADF META-INF node. Add the following StringRefAddr section (shown in Example 23-1) to the connections.xml file and save the file.

The code in Example 23-4 initializes a JAX-WS client. Note that the URL includes the idcnativews web context root. This web context root (by default) is used by two web services exposed by the Content Server: the login service and the request service.

23.3Configuring Clients

Configuration of the clients can be done after they are created. Configuration parameters include setting the socket timeouts, connection pool size, etc. The configuration is specific to the protocol; if you cast the IdcClient object to the specific type, then you can retrieve the protocol configuration object for that type.

Client Configuration for Intradoc Connections

The code in Example 23-5 sets the socket time-out and wait time for Intradoc connections.

For SSL communication, you must install and enable the SecurityProviders component in the Content Server instance that you want to access. You must configure Content Server for SSL communication with a new incoming provider, and specify the truststore or keystore information. You must have a valid keystore or trust manager with signed, trusted certificates on both the client and Content Server.

Oracle does not provide signed certificates. For most implementations, you will want a certificate signed by a universally recognized Certificate Authority.

To configure SSL communication with Content Server, you need to do these tasks:

Install and enable the SecurityProviders component. The SecurityProviders component must be installed and enabled in the Content Server instance that you want to access with SSL communication.

This component is installed and enabled by default in Oracle WebCenter Content Server 11gR1.

You can set the instance name of the Content Server that you would like to connect to. This is set to "/cs/" by default which is the default webcontext for UCM installation. If the server webcontext is different than the default, then you may set it as:

// set the property
jaxwsConfig.setServerInstanceName("/mywebcontext/");

Setting the JPS configuration file location. A JPS configuration file is required for most policies such SAML and/or Message Token.

RIDC uses the default values for the installed webservices. If for some reason, the webservices have been modified and does not conform to the default URI/URLs, you may need to modify the default values.

To determine GPA policy for a ws-client that will be leveraged by RIDC over JAX-WS should no explicit LPA be set: initialize the WebLogic Scripting Tool (WLST) and use the WebLogic Server Administration Scripting Shell.

(/u01/app/oracle/product/Middleware/oracle_common/common/bin)% ./wlst.sh
...
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
wls:/offline> connect('weblogic','welcome1','t3://localhost:7001')
Connecting to t3://localhost:7001 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'base_domain'.
wls:/base_domain/serverConfig> help('wsmManage')
Operations that provide support to manage the global policy attachments and
Oracle MDS repository.
help('abortRepositorySession')
Abort the current repository session,
discarding the changes made to repository.
help('attachPolicySet')
Attach a policy set to the specified resource scope.
help('attachPolicySetPolicy')
Attach a policy to a policy set using the policy's URI.
help('beginRepositorySession')
Begin a session to modify the repository.
help('clonePolicySet')
Clone a new policy set from an existing policy set.
help('commitRepositorySession')
Write the contents of the current session to the repository.
help('createPolicySet')
Create a new, empty policy set.
help('deletePolicySet')
Delete a specified policy set.
help('describeRepositorySession')
Describe the contents of the current repository session.
help('detachPolicySetPolicy')
Detach a policy from a policy set using the policy's URI.
help('displayPolicySet')
Display the configuration of a specified policy set.
help('enablePolicySet')
Enable or disable a policy set.
help('enablePolicySetPolicy')
Enable or disable a policy attachment
for a policy set using the policy's URI.
help('exportRepository')
Export a set of documents from the repository into a supported ZIP archive.
help('importRepository')
Import a set of documents from a supported ZIP archive into the repository.
help('listPolicySets')
Lists the policy sets in the repository.
help('migrateAttachments')
Migrates direct policy attachments to global policy attachments
if they are identical.
help('modifyPolicySet')
Specify an existing policy set for modification in the current session.
help('resetWSMPolicyRepository')
Clean the Oracle MDS repository and re-seed with the current set
of WSM policies.
help('setPolicySetDescription')
Specify a description for the policy set selected within a session.
help('upgradeWSMPolicyRepository')
Add newly introduced WSM policies to the Oracle MDS repository.
help('validatePolicySet')
Validate an existing policy set in the repository or in a session.
wls:/base_domain/serverConfig> listPolicySets()
Location changed to domainRuntime tree. This is a read-only tree with DomainMBean as the root.
For more help, use help(domainRuntime)
Global Policy Sets in Repository:
base-domain-ws-client
wls:/base_domain/serverConfig> displayPolicySet('base-domain-ws-client')
Policy Set Details:
-------------------
Name: base-domain-ws-client
Type of Resources: Web Service Client
Scope of Resources: Domain("base_domain")
Description: Global policy attachments for Web Service Client resources.
Enabled: true
Policy Reference: security : oracle/wss10_saml_token_client_policy, enabled=true

# add GPA for the web service client assuming domain name is base_domain
beginRepositorySession()
createPolicySet('base_domain-ws-client','ws-client','Domain("base_domain")')
# assuming service policy is hardcoded to
# oracle/wss11_saml_token_with_message_protection_service_policy
# and that we want the RIDC client to leverage client policy:
# oracle/wss11_saml_token_with_message_protection_client_policy
attachPolicySetPolicy
('oracle/wss11_saml_token_with_message_protection_client_policy')
validatePolicySet()
commitRepositorySession()
# confirm policy set created
listPolicySets()

# add GPA for the web service client assuming domain name is base_domain
beginRepositorySession()
createPolicySet('base_domain-ws-client','ws-client','Domain("base_domain")')
# assuming service policy is hardcoded to
# oracle/wss11_saml_token_with_message_protection_service_policy
# and that we want the RIDC client to leverage client policy:
# oracle/wss11_saml_token_with_message_protection_client_policy
attachPolicySetPolicy
('oracle/wss11_saml_token_with_message_protection_client_policy')
validatePolicySet()
commitRepositorySession()
# confirm policy set created
listPolicySets()

23.4Authenticating Users

All calls to Remote Intradoc Client (RIDC) require some user identity for authentication. Optionally, this identity credential can be accompanied by other parameters such as a password as required by the protocol. The user identity is held in the IdcContext object; once created, it can be reused for all subsequent calls. To create a context, you pass in the user name and, optionally, some credentials.

The ServiceResponse contains the response from Content Server. From the response, you can access the stream from the Content Server directly, or you can parse it into a DataBinder and query the results.

The code in Example 23-10 takes the ServiceResponse and gets the search results, printing out the title and author value.

23.6Understanding Connection Pooling

The IdcClientConfig#getConnectionPool property determines how RIDC will handle pooling of connections. There are two options, simple and pool.

The simple option is the default. The simple option does not enforce a connection maximum and rather lets every connection proceed without blocking and does not enforce a connection maximum. In most cases this option should be used.

The pool option specifies the use of an internal pool that allows a configurable number of active connections at a time (configurable through the IdcClientConfig#getConnectionSize property), with the default active size set to 20.

Usually, when the RIDC library is used to communicate from an application that itself is in an application container (such as a web application), the inbound requests have already been throttled. Thus, the simple option is the correct choice to use. The only scenario to use the pool option is if you are creating a stand-alone server, and you are manufacturing a large number of concurrent calls to the Content Server which may cause the Content Server to become overwhelmed.

A different pool implementation can be registered via the IdcClientManager#getConnectionPoolManager()#registerPool() method, which maps a name to an implementation of the ConnectionPool interface. The name can then be used in the IdcClientConfig object to select that pool for a particular client.

The response is not converted into a DataBinder unless specifically requested. If you just want the raw HDA data, you can get that directly, along with converting the response to a String or DataBinder.

The code in Example 23-13 executes a service, gets the response as a string, and parses it into a data binder.

23.8Understanding Binders

Binders can be reused among multiple requests. A binder from one request can be sent in to another request. Note that if you reuse a binder from one call to the next you need to be very careful there is nothing leftover in the binder that could impact your next call. RIDC does not clean the binder after each call.

The code in Example 23-14 provides an example that pages the search results by reusing the same binder for multiple calls to Content Server.

23.9Understanding Convenience Classes

There are some patterns of actions that many applications perform using RIDC. The convenience package supplies some of these for reuse. The classes in the convenience package space are consumers of the RIDC code and as such don't add any new functionality. They can be thought of as a new layer on top of RIDC.

23.9.1Setting User Security

The Content Server has several security models that are controlled by settings on the Content Server. To resolve if a particular user has access to a document, three things are needed: The user's permission controls, the document's permission controls, and Content Server security environment settings.

It is assumed that the Application Program calling the UserSecurity module will fetch documents and the DOC_INFO metadata (in the document's binder, typically the result of a Search) as some superuser and cache this information. When the Application needs to know if a particular user has access to the document, a call is made to the Content Server as that user to fetch that user's permissions. Once the user's permission controls are known, then they can matched to the information in the document's metadata to resolve the access level for that user. (Access level is READ or READ/WRITE or READ/WRITE/DELETE). The need therefore is to reduce the number of calls to the Content Server (with a cache) and to provide a default implementation for matching the user's permissions information with the document's permission information. One further complication is that the Content Server controls which types of security are used in some server environment properties: UseAccounts=true and UseCollaboration=true or UseEntitySecurity=1. Additionally, a method allows testing to see if admin rights are assigned to a security type for that document.

The user security convenience is accessed through the IUserSecurityCache interface. There classes implement the optional Content Server security:

The UserSGAcctAclCache class should always be called. This class will check the Content Server for security configuration and internally adjust itself to match.

The UserSecurityGroupsCache class keeps a cache of user permissions and will match documents considering only Security Group information. Do not call this class directly. The UserSGAcctAclCache class will check the Content Server for security configuration and internally adjust itself to match.

The UserSGAccountsCache class adds a resolver to also consider Account information if the Content Server has the UseAccounts=true setting. Do not call this class directly. The UserSGAcctAclCache class will check the Content Server for security configuration and internally adjust itself to match.

23.9.2Setting the ADF Connection Facade

Remote Intradoc Client (RIDC) version 11.1.1.6.0 includes the AdfConnectionFacade convenience class which provides a simple way to store connection details, obtain the idcClient object and create the user credential objects. It also provides a connection UI in the jdeveloper extension.

Note:

This functionality is only available when the RIDC application is deployed in a shiphome provisioned with the proper ADF libraries.

The code in Example 23-16 will fetch a facade for a connection named "example1" and performs a test to see if the connection can be made.

Using facade.getUserCredentials("public") will return populated UserNameOnlyCredentials class. Use value of <default> to get the internal default username

myuser.adf.name

Using facade.getUserCredentials("myuser") will return AdfUserCredentials class.

When the RIDC call is made the logged user is fetched with this code:

ADFContext.getCurrent ().getSecurityContext().getUserName()

These additional parameters are understood automatically by RIDC:

connectionSize

connectionWaitTime

connectionPool

socketTimeout

useSystemProxy

http.proxyHost

http.proxyPort

http.nonProxyHosts

http.proxyUserName

http.proxyPassword

http.library

sslKeystoreFile

sslKeystorePassword

sslAlgorithm

sslKeystoreAlias

sslKeystoreAliasPassword

sslTrustManagerFile

sslTrustManagerPassword

clientSecurityPolicy

jaxWsStack

streamingChunkSiz

23.10 Understanding RIDC Filters

Remote Intradoc Client (RIDC) version 11.1.1.4.0 and greater, permits your application code the ability to add a filter before the DataBinder is processed and sent to the Content Server. You can create a filter by extending one of the IdcFilterAdapter classes, and then register that filter to execute with the IdcFilterManager class. Filters are executed in the order specified when registered. You can also get and remove previously registered filters.

The code in Example 23-17 extends an adapter and overrides a method to perform an action.

// If you are at the start of a pure RIDC application, you typically
// will create a ClientManager, for example:
IdcClientManager m_clientManager = new IdcClientManager();
// New method added to IdcClient to get the ClientManager
// if you do not have the ClientManager instance:
IdcClient client = myClient;
client.getClientManager();
// From the ClientManager, you can get the FilterManager:
IdcFilterManager fmanager = m_clientManager.getFilterManager();
// Then register your filter:
IIdcFilter addCommentFilter = new IdcFilterAddComment();
int slot = fmanager.registerFilter(100, addCommentFilter);
// Optionally, you can deregister. However, it might not be in the slot you
// assigned because there might have already been a filter in that slot.
// When registering, the next available higher slot will be used. You also need
// to pass in the instance currently in the slot you want to remove:
fmanager.deRegisterFilter(slot, addCommentFilter);
// Here is an example to remove all the filters,
// including the ones you did not register
for (Integer slot:fmanager.getUsedSlots()) {
fmanager.deRegisterFilter(slot, fmanager.getFilter (slot));
}

23.11 Using the RIDC JDeveloper Extension

The Remote Intradoc Client (RIDC) communication API is provided as a deployable extension for Oracle JDeveloper. The RIDC JDeveloper extension places a copy of the RIDC library in the JDeveloper environment.

Required Versions and Extensions

This JDeveloper version and RIDC extension is required:

Oracle Remote Intradoc Client (RIDC) extension 11.1.1.6 (11gR1 PS5)

Oracle JDeveloper version 11.1.1.6 (11gR1 PS5)

The Oracle Remote Intradoc Client (RIDC) extension (oracle.ucm.ridc.jdev-11.1.1.6.zip) is located in the /modules/jdev directory of the Remote Intradoc Client (RIDC) suite distribution (ridc-suite-11.1.1.6.zip). The RIDC suite distribution can be downloaded from the Oracle Technology Network (OTN) at http://otn.oracle.com.

Select the RIDC extension (oracle.ucm.ridc.jdev-11.1.1.6.zip) located in the /modules/jdev directory and click Open.

Click Next to deploy the extension.

Click Finish.

After JDeveloper has installed the extension, you can verify that the RIDC library is accessible to JDeveloper by selecting Tools > Preferences > Extensions and scroll to the RIDC entry. To verify the RIDC library is on the disk, check the directory <JDeveloper Home>/jdeveloper/ucm/Distribution/RIDC and confirm these files exist:

23.11.2 Creating a New Application and Project with RIDC Technologies

This topic describes the steps to create a new application and project, add RIDC technologies, and verify the shared library references. It is recommended that you create a new RIDC-enabled project rather than add RIDC technologies to an existing project.

To create a new application and project with RIDC technologies:

From the main menu, select File > New.

The New Gallery dialog opens.

In Categories, select General > Applications.

In Items, select Generic Application.

Click OK.

The Create Generic Application wizard displays.

Provide an application name.

Accept the default directory or provide a different directory.

Click Next.

Provide a project name that identifies this as an RIDC-enabled project.

Note:

Do not use special characters such as the apostrophe ( ' ) or asterisk ( * ) in the project name.

On the Project Technologies tab, select RIDC, HTML, and JSP and Servlets from the list and click the shuttle button to transfer each of these selections to the Selected list.

Click Next.

Review the settings and click Finish.

To verify shared library references:

From the main menu, select View > Application Navigator.

In the Application Navigator, select the Application Resources panel.

Expand Descriptors > META-INF.

Right-click weblogic-application.xml and select Open.

In the editor, select the Overview tab.

Select Libraries and expand Shared Library References.

Verify that the Library Name oracle.ucm.ridc.app-lib is listed.

23.11.3 Working with Connections

This topic describes various procedures for working with connections. Refer to the RIDC section of the JDeveloper Online Help for more information on working with connections.

In JDeveloper 11g you have two ways of creating and managing connections. You can define a connection to be used in the context of an application (called an Application Resource connection), or for the IDE as a whole (called an IDE connection). You use the same dialog to define both of these connections, but their scope within JDeveloper is different.

Application Resources: These connections are locally scoped and just available within the application. The connection information is stored within the application itself, and can be deployed with the application. These types of connections are listed in the Application Resources panel of the Application Navigator, under the Connections node.

IDE Connections: These connections are globally defined and available for reuse. These types of connections are listed in the IDE Connections panel of the Resource Palette. You can copy IDE connections to the Application Navigator to use them within an application

To create a new content server connection:

From the main menu, select View > Application Navigator.

In the Application Navigator, select the Applications Resources panel.

Right-click Connections and select New Connection > RIDC.

Use the Create Content Server Connection dialog to create a new connection. Click Help for descriptions of the options and fields on this dialog.

Click Test Connection.

If the connection fails, verify that you have the correct connection information for the content server and have supplied valid login credentials.

Click OK.

To edit or update an Application Resources connection:

From the main menu, select View > Application Navigator.

In the Application Navigator, select the Applications Resources panel.

Expand Connections > RIDC.

Right-click a connection and select Properties.

Use the Edit Content Server Connection dialog to edit or update the connection details for your connection. Click Help for descriptions of the options and fields on this dialog.

Click Test Connection.

If the connection fails, verify that you have the correct connection information for the content server and have supplied valid login credentials.

Click OK.

To edit or update an IDE connection:

From the main menu, select View > Resource Palette.

In the Resource Palette, select the IDE Connections panel.

Expand the RIDC node.

Right-click a connection and select Properties.

Use the Edit Content Server Connection dialog to edit or update the connection details for your connection. Click Help for descriptions of the options and fields on this dialog.

Click Test Connection.

If the connection fails, verify that you have the correct connection information for the content server and have supplied valid login credentials.

Click OK.

To add an IDE connection to your application with RIDC technologies:

From the main menu, select View > Application Navigator.

From the drop-down list, select an application with RIDC technologies.

From the main menu, select View > Resource Palette.

In the Resource Palette, select the IDE Connections panel.

Expand the RIDC node.

Right-click a connection and select Add to Application.

Note: The connection is added to the application currently open in JDeveloper. The connection is listed in the Application Resources panel of the Application Navigator, under the Connections node.

23.11.4 Example Service Call

This topic provides example code of a service call on a JSP page. These steps assume you have created a JSP page for your RIDC-enabled project. Refer to the RIDC section of the JDeveloper Online Help for more information.

Use these JSP page directives to your JSP page to import required java packages and classes:

<%@ page import="oracle.stellent.ridc.*"%>

<%@ page import="oracle.stellent.ridc.model.*"%>

<%@ page import="oracle.stellent.ridc.model.impl.*"%>

<%@ page import="oracle.stellent.ridc.convenience.adf.connection.*"%>

The code in Example 23-20 provides an example service call added to the body of a JSP page.