Working with the RIDC Target Connector

This topic provides and overview of the RIDC target connector and discusses how to:

  • Set gateway-level RIDC target connector properties.

  • Set node-level RIDC target connector properties.

  • Create RIDC service requests.

This topic also provides code examples for uploading and downloading files using the connector.

This section provides overview information about the PeopleTools RIDC target connector.

RIDC Target Connector

The Remote Intradoc Client (RIDC) is a Java API used to access the Oracle WebCenter Content product.

The PeopleTools RIDC target connector is a wrapper for the RIDC Java client API that allows PeopleSoft systems to interact with the Oracle WebCenter Content product.

The RIDC target connector allows you to upload or download files from/to your PeopleSoft system to/from the Oracle WebCenter Content server. The target connector supports text and binary file types, including .xls, .pdf, .doc, and .zip formats

The connector ID for the RIDC target connector is RIDCTARGET.

Considerations when Using the RIDC Target Connector

When using the RIDC target connector take the following points into consideration:

  • The connector is for use with synchronous service operations only.

  • While the RIDC client jar supports HTTP, Intradoc, and JAX-WS protocols, the connector only supports HTTP connections.

  • HTTP over SSL is not supported.

The RIDC target connector does not have any properties that you need to set in the integrationGateway.properties file.

Use the Nodes – Connectors page or the Gateway – Connector Properties page to set node-level RIDC target connector properties.

Note: Only required RIDC target connector properties appear on the Nodes – Connectors page.

To access the Nodes – Connectors page select PeopleTools > Integration Broker > Integration Setup > Nodes and click the Connectors tab.

To access the Gateway – Connector Properties page select PeopleTools > Integration Broker > Configuration > Gateways and in the Connectors grid click the Properties link for the RIDCTARGET connector.

This table describes node-level RIDC target connector properties.

Property ID

Property Name

Description

HEADER

sendUncompressed

The application server generally compresses the message body before sending it to the integration gateway.

The valid values are:

  • Y. (Default.) Uncompress the body before sending the message to the content server

  • N. Do not attempt to uncompress the message body.

RIDCTARGET

AddFileName

The system uses this property for uploads.

The only allowed value is primaryFile.

RIDCTARGET

Base64

The system uses this property for binary file transfers only.

The valid values are:

  • DecodeFileBeforeSending. (Default.)

    This value is used when uploading files.

    When set, the message body is assumed to be Base64 data, and will be decoded and the resulting binary sent on the wire. The Charset connector property is ignored, so if the message body is a Base64–encoded string, that string will not be converted by the connector.

  • EncodeReceivedFile.

    This value is used when downloading files.

    When set, any binary data received will be Base64–encoded

RIDCTARGET

Charset

When uploading files, this property determines the character set used when sending character data on the wire.

Note: This property should always be set when uploading text files; it determines the character set used when sending character data on the wire.

The allowable values are those present in the JVM, for example UTF-8, UTF-16, and so on.

RIDCTARGET

ContentType

This property determines the MIME type for the content data. For example, text/plain, text/xml, application/pdf, image/jpeg, and so on.

RIDCTARGET

FileName

The system uses this property for file uploads.

Enter the name of the file

RIDCTARGET

Password

Enter the password to access the target system.

This password must be encrypted.

Note: To set an encrypted password you must set this property using the Nodes – Connectors page.

RIDCTARGET

PingServiceName

(Optional.)

Enter the name of the service to invoke for a Connector Ping.

The default value is GET_DOC_PAGE.

Do not change the default value unless you understand the ramifications of doing so.

RIDCTARGET

PutLocalName

(Optional.)

Use this property in conjunction with the PutLocalValue property to create a name/value pair for invoking RIDC service requests.

RIDCTARGET

PutLocalValue

(Optional.)

Use this property in conjunction with the PutLocalName property to create a name/value pair for invoking RIDC service requests.

RIDCTARGET

URL

Enter the URL for the target system.

RIDCTARGET

Userid

Enter the user ID to access the target system.

The RIDC target connector allows you to invoke basic RIDC requests beyond file upload and download.

Note: The connector is intended to be primarily used for file uploads and downloads. Other services may be invoked via the connector, however, no guarantee is given that all such services will be able to be invoked. If the RIDC target connector does not address your requirements, a custom target connector should be created to invoke the specific services needed.

The connector is a thin wrapper around the RIDC client. The RIDC client uses the PutLocal pattern in Java as a way to form service requests using name-value pairs.

// get the binder
DataBinder binder = idcClient.createBinder();

// populate the binder with the parameters
binder.putLocal ("IdcService", "GET_SEARCH_RESULTS");
binder.putLocal ("QueryText", "");
binder.putLocal ("ResultCount", "20");

// execute the request
ServiceResponse response = idcClient.sendRequest (userContext, binder);

// get the binder
DataBinder serverBinder = response.getResponseAsBinder ();

By setting values for each PutLocalName-PutLocalValue pair you can mimic what would normally be written in Java code. Because of this, the final arbiter of the correct pattern to be used to invoke the services is the Oracle Content Server server and not the RIDC target connector.

See Core Oracle Content Server Services

This section provides PeopleCode examples to upload files to and download files from Oracle Content Servers using the RIDC target connector.

These examples assume that the appropriate outbound synchronous service operation has been created.

The code assumes that the destination node is QE_SFTP and the service operation is TESTSOP.

The examples in this section highlight binary file transfers. Note that when working with text files, you do not need to set the Base64 parameter or use the Base64 methods on the file object - other than these factors, text and binary file transfers are basically the same.

Example: File Upload

Local string &filepath = "D:\work\RIDC\testing\";


Local array of Message &messages;
Local array of Message &responses;
Local Message &MSG;

&messages = CreateArrayRept(&MSG, 0);


Local array of string &nodenames;
Local string &node;
&nodenames = CreateArrayRept(&node, 0);
&nodenames [1] = "QE_SFTP";

&messages [1] = CreateMessage(Operation.TESTSOP);


&ret = &messages [1].IBInfo.LoadConnectorProp("RIDCTARGET");
&requestIbInfo = &messages [1].IBInfo.IBConnectorInfo;
&messages [1].IBInfo.ConnectorOverride = True;

&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("URL", "http://server@example.com", %Property);
&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties 
		("Userid", "fusion", %Property);
&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties 
		("Password", "{V1.1}pSI+2hc9Y01Uto5yAX+O5A==", %Property);


/* =========== */
/* =========== */
/* upload test */
/* =========== */
/* =========== */

rem add properties needed by the connector;
rem --------------------------------------;

&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("AddFileName", "primaryFile", %Property);


rem add binary image data;
rem ---------------------;


&theTempFile = GetFile((&filepath | "corn.jpg"), "R", %FilePath_Absolute);
If &theTempFile.IsOpen Then
   &base64string = &theTempFile.GetBase64StringFromBinary();
   &theTempFile.Close();
End-If;

&boolsink = &messages [1].SetContentString(&base64string);

&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("FileName", "MSN-PSFT-TEST.jpg", %Property);

rem since the data is base 64, we'll need to decode it before sending;
&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("Base64", "DecodeFileBeforeSending", %Property);

&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("ContentType", "image/jpg", %Property);

&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalName1", "IdcService", %Property);
&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalValue1", "CHECKIN_UNIVERSAL", %Property);

&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalName3", "dDocTitle", %Property);
&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalValue3", "MSN TEST DOC", %Property);

&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalName4", "dDocAuthor", %Property);
&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalValue4", "FUSION", %Property);

&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalName5", "dDocType", %Property);
&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalValue5", "Document", %Property);

&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalName6", "dSecurityGroup", %Property);
&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalValue6", "PersonalSpaces", %Property);

&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalName7", "dReleaseDate", %Property);
&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalValue7", "4/22/02 12:19 PM", %Property);

&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalName8", "dRevisionID", %Property);
&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalValue8", "1", %Property);

&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalName9", "dDocAccount", %Property);
&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalValue9", "", %Property);


try
   
   
   &responses = %IntBroker.SyncRequest(&messages, &nodenames);
   
   &theTempFile = GetFile((&filepath | "outputFile.txt"), "W", %FilePath_Absolute);
   If &theTempFile.IsOpen Then
      &theTempFile.Writestring(&responses [1].GetContentString());
      &theTempFile.Close();
   End-If;
   
   
   MessageBox(0, "", 0, 0, "done!");
   
catch Exception &err
   
   MessageBox(0, "", 0, 0, ("Exception caught => " | &err.ToString()));
   rem MessageBox(0, "", 0, 0, ("Exception caught => " | &err.GetSubstitution(1)));
   
end-try;

Example: File Download

Local string &filepath = "D:\work\RIDC\testing\";



Local array of Message &messages;
Local array of Message &responses;
Local Message &MSG;

&messages = CreateArrayRept(&MSG, 0);


Local array of string &nodenames;
Local string &node;
&nodenames = CreateArrayRept(&node, 0);
&nodenames [1] = "QE_SFTP";

&messages [1] = CreateMessage(Operation.TESTSOP);


&ret = &messages [1].IBInfo.LoadConnectorProp("RIDCTARGET");
&requestIbInfo = &messages [1].IBInfo.IBConnectorInfo;
&messages [1].IBInfo.ConnectorOverride = True;

&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("URL", "http://server@example.com", %Property);
&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("Userid", "fusion", %Property);
&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("Password", "{V1.1}pSI+2hc9Y01Uto5yAX+O5A==", %Property);



/* ============= */
/* ============= */
/* download test */
/* ============= */
/* ============= */



&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalName1", "IdcService", %Property);
&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalValue1", "GET_FILE", %Property);

&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalName2", "dDocName", %Property);
&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalValue2", "UCMFA000001", %Property);

&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalName3", "RevisionSelectionMethod", %Property);
&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("PutLocalValue3", "Latest", %Property);


&b = &messages [1].IBInfo.IBConnectorInfo.AddConnectorProperties
		("Base64", "EncodeReceivedFile", %Property);

try
      
   
   &responses = %IntBroker.SyncRequest(&messages, &nodenames);
   
   &theTempFile = GetFile((&filepath | "outputFile.jpg"), "W", %FilePath_Absolute);
   If &theTempFile.IsOpen Then
      &theTempFile.WriteBase64StringToBinary(&responses [1].GetContentString());
      &theTempFile.Close();
   End-If;
   
   MessageBox(0, "", 0, 0, "done!");
   
catch Exception &err
   
   MessageBox(0, "", 0, 0, ("Exception caught => " | &err.ToString()));
   rem MessageBox(0, "", 0, 0, ("Exception caught => " | &err.GetSubstitution(1)));
   
end-try;