Académique Documents
Professionnel Documents
Culture Documents
December 2014
Introduction ....................................................................................... 1
Oracle WebCenter Content and HCM Data Loader ........................... 2
Methods of Staging Files on the Oracle WebCenter Content
Server............................................................................................ 2
WebCenter Content Document Transfer Utility Interface ............... 5
Remote Intradoc Client (RIDC) ...................................................... 6
HCM Data Loader Integration Service ............................................. 10
Sample Code to Invoke HCMDataLoader .................................... 10
Automating HCM Data Loader
Introduction
This document describes how to integrate Oracle Fusion Human Capital Management (HCM)
11g Release 9 (11.1.9) HCM Data Loader with Oracle WebCenter Content, to provide the
ability to automate the bulk loading of data into HCM.
WebCenter Content is the staging mechanism for files to be loaded and processed by HCM
Data Loader. The following two topics are covered:
The available methods for staging a zip file on the WebCenter Content server for
consumption by HCM Data Loader.
How to invoke the web service to consume and process the staged zip file.
See the HCM Data Loader Users Guide (My Oracle Support document ID 1664133.1) for
general information about HCM Data Loader and instructions for constructing the zip file
containing data to be loaded.
1
Automating HCM Data Loader
2
Automating HCM Data Loader
Figure 1. Location of the File Import and Export Task in the Navigator
When you upload a file, set the Account value to hcm/dataload/import, to secure the file.
Figure 2. Upload a file using the File Import and Export interface
3
Automating HCM Data Loader
One of the parameters required for both the HCMDataLoader web service 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 Import and Load Data page.
Figure 3. Manually submitting a file for processing using the HCM Data Loader interface
4
Automating HCM Data Loader
Figure 4. Example invocation command for the WebCenter Content document transfer utility.
The URL in the command line uses the same domain name as your service. To obtain the WebCenter
Content URL:
1. Obtain the URL for Setup and Maintenance from the Service Details section in the cloud
environments provisioning email that your administrator received.
It should look like the following example: -
https://fs-xxxxxxxxxxx.oracleoutsourcing.com/setup/faces/TaskListManagerTop
2. Modify this URL by removing /setup/Task and substituting it with /cs/idcplg.
5
Automating HCM Data Loader
The above URL would now be the following, which can be used in the command line script
example detailed in Figure 4.
https://fs-xxxxxxxxxxx.oracleoutsourcing.com/cs/idcplg
This method of defining the WebCenter Content URL also applies to the examples given elsewhere in
this document.
The dDocName value (which is equivalent to the content ID) returned when executing the above
statement is required for the HCMDataLoader call described later in this document.
Review the readme file downloaded with the WebCenter Content Document Transfer Utility for a list
of all parameters, including advanced networking options for resolving proxy issues.
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 Developers 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.
6
Automating HCM Data Loader
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;
7
Automating HCM Data Loader
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
request.addFile("primaryFile", primaryFile);
request.putLocal("dDocTitle", dDocTitle);
8
Automating HCM Data Loader
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 HCMDataLoader
dDocTitle The content item title. The title of the file as it appears in
Import/Export UI
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.
9
Automating HCM Data Loader
http://{Host}/hcmCommonDataLoader/HCMDataLoader
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns1:importAndLoadDataAsync
xmlns:ns1="http://xmlns.oracle.com/apps/hcm/common/dataLoader/core/dataLoaderIntegratio
nService/types/">
<ns1:ContentId></ns1:ContentId>
<ns1:Parameters></ns1:Parameters>
</ns1:importAndLoadDataAsync>
</soap:Body>
</soap:Envelope>
The URL for above is resolved slightly differently than that required for WebCenter Content given
above. You should use the domain name given for the Service Home URL which is shown in the
Service Detail section of you service provision email. Using the same example given earlier, the above
URL will be: -
https://hcm-xxxxxxxxxxx.oracleoutsourcing.com/hcmCommonDataLoader/HCMDataLoader?wsdl
10
Automating HCM Data Loader
Parameter Meaning
ContentId Content ID of the file on the WebCenter Content server (the same value as dDocName in the
WebCenter Content Java call).
Parameters Name and value pairs. The following parameter names are available, none of these are mandatory:
ImportMaximumErrors: Percentage of file lines in error that can occur in a business object
before the import process stops.
LoadMaximumErrors: Percentage of business object instances in error that can occur for a
business object before the validation and load processes stop.
DeleteSourceFile: Y or N value. If set to Y or left blank, deletes the source file from the
WebCenterContent server once the file content has been transferred into HDL stage tables
and is no longer required.
For example:
ImportMaximumErrors=100,LoadMaximumErrors=100,LoadConcurrentThreads=4,FileEncryption=PGP
SIGNED,DeleteSourceFile=N
11
Automating HCM Data Loader
To use the key contained in this certificate, you need to create a local KeyStore and import the
certificate into it:
1. Create a new file with any name you like. You must change the extension to .cer to indicate that it is
a certificate file.
2. Using a text editor, open the file you just created and enter "-----BEGIN CERTIFICATE-----" on
the first line.
3. In the next line, copy the Base64 encoded certificate from the service WSDL file to the newly
created certificate file.
4. Add "-----END CERTIFICATE-----" on a new line and save the file. Now you have a certificate
containing the public key from the server.
5. Open the command line and change the directory to $JAVA_HOME/bin. Use the following
command to create a KeyStore and import the public key from the certificate.
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.
12
Automating HCM Data Loader
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 HCMDataLoader 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 HCM Data Loader
Integration Service URL>
Example:
wsimport -s "D:\HCMDataLoader" -d "D:\ HCMDataLoader"
https://{host}/hcmCommonDataLoader/HCMDataLoader?wsdl
zip loaderIntegrationProxy.jar -r * -
com/oracle/xmlns/apps/hcm/common/dataloader/core/dataloaderintegrationservice
package com.oracle.xmlns.apps.hcm.common.dataloader.core.dataloaderintegrationservice;
import
13
Automating HCM Data Loader
com.oracle.xmlns.apps.hcm.common.dataloader.core.dataloaderintegrationservice.HCMDataLo
ader;
import
com.oracle.xmlns.apps.hcm.common.dataloader.core.dataloaderintegrationservice.HCMDataLo
ader_Service;
import
com.oracle.xmlns.apps.hcm.common.dataloader.core.dataloaderintegrationservice.ServiceEx
ception;
import java.util.Map;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.WebServiceRef;
import weblogic.wsee.jws.jaxws.owsm.SecurityPolicyFeature;
14
Automating HCM Data Loader
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:
$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>
HCMDataLoaderServiceSoapHttpPortClient.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.dataloader.core.dataloaderintegrationservice.HCMDataLo
aderServiceSoapHttpPortClient <ContentId> <Parameters>
15
Integrating File-Based Loader with Oracle Copyright 2013, Oracle and/or its affiliates. All rights reserved.
WebCenter Content
December 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
oracle.com