Professional Documents
Culture Documents
October 2013
Introduction ....................................................................................... 1
Audience ....................................................................................... 1
Oracle WebCenter Content and File-Based Loader ........................... 2
Methods of Staging Files with Oracle WebCenter Content ................ 2
File Import and Export Interface..................................................... 2
WebCenter Content Document Transfer Utility Interface ............... 4
Remote Intradoc Client (RIDC) ...................................................... 5
Loader Integration Service................................................................. 9
Sample Code to Invoke LoaderIntegrationService ......................... 9
Integrating File-Based Loader with Oracle WebCenter Content
Introduction
This document shows how to integrate Oracle Fusion Human Capital Management (HCM) 11g
Release 7 (11.1.7) File-Based Loader (FBL) with Oracle WebCenter Content.
WebCenter Content is the staging mechanism for files to be loaded and processed by FBL.
Two topics are covered:
The available methods for staging a zip file on the WebCenter Content server for
consumption by FBL
How to invoke the web service to consume and process the staged zip file
See the File-Based Loader Users Guide (document ID 1533860.1) for general information
about FBL and instructions for constructing the zip file containing data to be loaded.
Audience
This document is mainly technical in nature and will therefore be of interest to integration
architects and developers needing to understand how to interact programmatically with FBL.
An understanding of WS-Security is desirable. Java is used for supporting example code but
is not a requirement for integration.
1
Integrating File-Based Loader with Oracle WebCenter Content
Figure 1. Location of the File Import and Export Task in the Navigator
2
Integrating File-Based Loader with Oracle WebCenter Content
Figure 2. Uploading a File Using the File Import and Export Interface
When you upload a file, the Account value must be set to hcm/dataload/import.
One of the parameters required for both the LoaderIntegrationService and manual processing is the
WebCenter Content ID. This ID is automatically generated when the file is loaded.
By default, the content ID is not displayed on the File Import and Export page. You can make it
visible by setting the Search Results table to include the column. Select View - Columns - Content
ID to include the Content ID column.
Once the file is loaded, you can process it manually from the Load HCM Data for Coexistence page.
Note that this function is delivered in Oracle Fusion HCM Release 7 Patch Bundle 3.
To process the file manually once it is loaded:
1. Open the Data Exchange work area (Navigator - Workforce Management - Data Exchange).
2. In the Data Exchange work area, select the task Load HCM Data for Coexistence.
3. On the Load HCM Data for Coexistence page, click Import.
4. In the Import and Load HCM Data dialog box, enter the content ID that you obtained when
loading the data file using the File Import and Export interface.
5. Select an individual business object or All to load all business objects in the zip file.
6. Provide a meaningful batch name. Object names are prefixed with the batch name to provide a unique
batch name for each batch.
7. Set the Loader Run Type parameter to Import (to import data for later loading) or Import and
Load Batch Data (to both import the data and initiate the data load).
3
Integrating File-Based Loader with Oracle WebCenter Content
8. Click Submit.
Figure 3. Manually Loading and Optionally Processing an FBL Zip File Using the Load HCM Data for
Coexistence Interface
4
Integrating File-Based Loader with Oracle WebCenter Content
Figure 4. Example Invocation Command for the WebCenter Content Document Transfer Utility
The dDocName value (which is equivalent to the content ID) returned when executing the above
statement is required for the LoaderIntegrationService call described later in this document.
Intradoc
The Intradoc protocol communicates with Oracle Content Server over the Intradoc socket port
(typically, 4444). This protocol does not perform password validation and so requires a trusted
connection between the client and Oracle Content Server. Clients that use this protocol are expected to
perform any required authentication. Intradoc communication can also be configured to run over SSL.
HTTP
RIDC communicates with the web server for Oracle Content Server using the Apache HttpClient
package. Unlike Intradoc, this protocol requires authentication credentials for each request.
JAX-WS
The JAX-WS protocol is supported only in Oracle WebCenter Content 11g with Oracle Content Server
running in Oracle WebLogic Server. To provide JAX-WS support, several additional JAR files are
required.
For more information, see:
Oracle WebCenter Content Developer's Guide for Content Server (specifically the section Using
RIDC to Access Content Server)
Oracle Fusion Middleware Developer's Guide for Remote Intradoc Client (RIDC)
Once the RIDC Component Library download file has been unzipped, include the following JAR files
in your project. Figure 5 shows an example from Oracle JDeveloper.
5
Integrating File-Based Loader with Oracle WebCenter Content
Figure 6 shows example code for uploading a file into WebCenter Content. Parameter details are
provided in Figure 7.
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.IOException;
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.TransferFile;
import oracle.stellent.ridc.protocol.ServiceResponse;
6
Integrating File-Based Loader with Oracle WebCenter Content
relevant URL
IdcContext userContext = new IdcContext("HCM_ADMIN", "Password"); // replace with
relevant username password
checkin(idcClient, userContext,
"/scratch/jdoe/ridc/BusinessUnit1.zip",
// Replace with fully qualified path to source file
"Document", // content type
"BusinessUnit1", // doc title
userContext.getUser(), // author
"FAFusionImportExport", // security group
"hcm$/dataloader$/import$", // account
"BU5") // dDocName - this is the ContentId
;
} catch (IdcClientException e) {
e.printStackTrace();
}
/**
* Method description
*
* @param idcClient
* @param userContext
* @param sourceFileFQP fully qualified path to source content
* @param contentType content type
* @param dDocTitle doc title
* @param dDocAuthor author
* @param dSecurityGroup security group
* @param dDocAccount account
* @param dDocName dDocName
*
* @throws IdcClientException
*/
public static void checkin(IdcClient idcClient, IdcContext userContext,
String sourceFileFQP, String contentType,
String dDocTitle, String dDocAuthor,
String dSecurityGroup, String dDocAccount,
String dDocName) throws IdcClientException {
InputStream is = null;
try {
String fileName =
sourceFileFQP.substring(sourceFileFQP.lastIndexOf('/') + 1);
is = new FileInputStream(sourceFileFQP);
// note!!! when using HTTP protocol (not intradoc/jaxws) - one must explicitly
// set the Content Length when supplying an InputStream to the transfer file
// e.g. primaryFile.setContentLength(xxx);
// otherwise, a 0-byte file results on the server
7
Integrating File-Based Loader with Oracle WebCenter Content
request.addFile("primaryFile", primaryFile);
request.putLocal("dDocTitle", dDocTitle);
request.putLocal("dDocAuthor", dDocAuthor);
request.putLocal("dDocType", contentType);
request.putLocal("dSecurityGroup", dSecurityGroup);
} catch (IOException e) {
e.printStackTrace(System.out);
} finally {
if (is != null) {
try {
is.close();
} catch (IOException ignore) {
}
}
}
Figure 6. Example Java Code for Uploading Files to Oracle WebCenter Content
dDocName The content ID for the content item. Value passed to LoaderIntegrationService
dDocAccount The account for the content item. Required only if accounts hcm$/dataloader$/import$
are enabled.
primaryFile The absolute path to the location of the file as seen from
the server.
8
Integrating File-Based Loader with Oracle WebCenter Content
http://{Host}/hcmCommonBatchLoader/LoaderIntegrationService
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns1:submitBatch
xmlns:ns1="http://xmlns.oracle.com/apps/hcm/common/batchLoader/core/loaderIntegrationSe
rvice/types/">
<ns1:ZipFileName></ns1:ZipFileName>
<ns1:BusinessObjectList></ns1:BusinessObjectList>
<ns1:BatchName></ns1:BatchName>
<ns1:LoadType></ns1:LoadType>
<ns1:AutoLoad></ns1:AutoLoad>
</ns1:submitBatch>
</soap:Body>
</soap:Envelope>
9
Integrating File-Based Loader with Oracle WebCenter Content
Parameter Description
ZipFileName Content ID of the file on the WebCenter Content server (the same value as dDocName in the WebCenter
Content Java call)
BusinessObjectList Name of the business object to be loaded. Repeat this tag for each business object to be loaded.
LoadType The type of load. Can be either FBL or HR2HR. Use FBL.
N = Import only
Note: This parameter in the service replaces the setup parameter Load HCM Data Files Automatically on the
Manage HCM Configuration for Coexistence page.
10
Integrating File-Based Loader with Oracle WebCenter Content
keytool -import -file <Provide the path of the certification.cer file> -alias orakey -
keypass welcome -keystore <Provide the path where the jks file needs to be
created(including the file name)> -storepass welcome
6. You can find the KeyStore file in the KeyStore path you set.
Once the client KeyStore has been created, you can call the service using the proxy classes. The
following parameters are used by the proxy class to encrypt and decrypt the message.
11
Integrating File-Based Loader with Oracle WebCenter Content
Parameter Description
WSBindingProvider.USERNAME_PROPERTY User name of the application user who has relevant privileges for
importing and processing FBL data files.
ClientConstants.WSSEC_KEYSTORE_TYPE: Type of the KeyStore you created. JKS (Java KeyStore) is widely used
and is the most common type.
ClientConstants.WSSEC_ENC_KEY_ALIAS Alias of the key you use to decrypt the SOAP message from the
server.
ClientConstants.WSSEC_ENC_KEY_PASSWORD: Password of the key you use to decrypt the SOAP message.
ClientConstants.WSSEC_RECIPIENT_KEY_ALIAS: Alias of the key you use to encrypt the SOAP message to the server.
Generate the JAX-WS proxy class for the LoaderIntegrationService using the wsimport command,
which is available at JAVA_HOME/bin:
wsimport -s <Provide the folder where the generated files need to be placed> -d
<Provide the folder where the generated files need to be placed> <The Loader
Integration Service URL>
e.g, wsimport -s "D:\LoaderIntegrationService" -d "D:\LoaderIntegrationService"
https://{host}/hcmCommonBatchLoader/LoaderIntegrationService?wsdl
package com.oracle.xmlns.apps.hcm.common.batchloader.core.loaderintegrationservice;
12
Integrating File-Based Loader with Oracle WebCenter Content
import java.util.ArrayList;
import java.util.Map;
import java.util.StringTokenizer;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.WebServiceRef;
import weblogic.wsee.jws.jaxws.owsm.SecurityPolicyFeature;
loaderIntegrationService_Service =
new LoaderIntegrationService_Service();
SecurityPolicyFeature[] securityFeatures =
new SecurityPolicyFeature[] { new
SecurityPolicyFeature("oracle/wss11_username_token_with_message_protection_client_polic
y") };
LoaderIntegrationService loaderIntegrationService =
loaderIntegrationService_Service.getLoaderIntegrationServiceSoapHttpPort(securityFeatur
es);
BindingProvider wsbp = (BindingProvider)loaderIntegrationService;
Map<String, Object> requestContext = wsbp.getRequestContext();
requestContext.put(BindingProvider.USERNAME_PROPERTY,"Provide the applications
username");
requestContext.put(BindingProvider.PASSWORD_PROPERTY, "Provide the password");
requestContext.put("oracle.webservices.security.keystore.type", "JKS");
requestContext.put("oracle.webservices.security.keystore.location",
"Provide the location of the default-keystore.jks (including the file name)");
requestContext.put("oracle.webservices.security.keystore.password", "welcome");
requestContext.put("oracle.webservices.security.encryption.key.alias", "orakey");
requestContext.put("oracle.webservices.security.encryption.key.password", "welcome");
requestContext.put("oracle.webservices.security.recipient.key.alias", "orakey");
String fileName = args[0];
String batchName = args[1];
String autoLoad = args[2];
String businessObj = args[3];
StringTokenizer strTok = new StringTokenizer(businessObj, ",");
ArrayList businessObjList = new ArrayList();
while (strTok.hasMoreTokens()) {
businessObjList.add(strTok.nextToken());
}
String response;
try {
response =
loaderIntegrationService.submitBatch(fileName, businessObjList,
batchName, "FBL",
autoLoad);
System.out.println("The response received from the server is ...");
System.out.println(response);
} catch (ServiceException e) {
System.out.println("Error occurred during the invocation of the service ...");
e.printStackTrace();
}
}
}
To generate the class file you need the following JAR file:
ws.api_1.1.0.0.jar
This JAR file is available at the following location:
13
Integrating File-Based Loader with Oracle WebCenter Content
$MIDDLEWARE_HOME/modules
If you do not have the JAR file, it can be can be downloaded as part of JDeveloper. The JAR file is
available at the following location in the JDeveloper installation.
modules/ ws.api_1.1.0.0.jar
Compile the Java code.
javac -classpath <Provide the path of the folder where the JAX-WS files are
generated>;<Provide the location of the ws.api_1.1.0.0.jar>
LoaderIntegrationServiceSoapHttpPortClient.java
java -classpath <Provide the path of the folder where the JAX-WS files are
generated>;<Provide the location of the weblogic.jar>;<Provide the location of the
jrf.jar>
com.oracle.xmlns.apps.hcm.common.batchloader.core.loaderintegrationservice.LoaderIntegr
ationServiceSoapHttpPortClient <ZipFileName> <BatchName> <AutoLoad>
<BusinessObjectList>
14
Integrating File-Based Loader with Oracle Copyright 2013, Oracle and/or its affiliates. All rights reserved.
WebCenter Content
October 2013 This document is provided for information purposes only, and the contents hereof are subject to change without notice. This
Author: Pardhasaradhirao Veluguleti document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in
law, including implied warranties and conditions of merchantability or fitness for a particular purpose. We specifically disclaim any
Contributing Authors: Bill Kerr liability with respect to this document, and no contractual obligations are formed either directly or indirectly by this document. This
document may not be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without our
Oracle Corporation
prior written permission.
World Headquarters
500 Oracle Parkway
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Redwood Shores, CA 94065
U.S.A.
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and
Worldwide Inquiries: are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are
Phone: +1.650.506.7000 trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group. 0113
Fax: +1.650.506.7200