This chapter covers the development of the Java API calls and the configuration required to replicate an IBM FileNet Document Management Object Store.
See also:
www.ibm.com/docs/en/filenet-p8-platform/5.2.1?topic=guide-replication
“Each object in a Content Engine object store has a unique ID that is controlled by the Content Engine. However, a replicated object in an external repository possesses a different unique ID from the original object over which the Content Engine has no control. An ExternalIdentity object represents the identity of a replicated object in an external repository.”
I will demonstrate a Java program process which will maintain an exact replication of the original Object Store ID Documents and their containing folder structure. Unlike the standard replication discussed in the preceding link, the Java Replication program covered in this chapter is designed to even copy the unique GUIDs of the original IBM FileNet Content Object Store Objects (including Documents, Folders, and Property objects).
This functionality is useful for larger organizations with geographically separate sites, where the Standard Operating Procedures and Quality Manuals have to be consistently maintained, but usually require a single point of authorship to maintain the same standards of production across all the sites.
Chapter Organization
This chapter contains the following six core Parts, each of which is organized by sections within:
Part 1 – Bill of Materials. This Part lists the prerequisite IBM Software components, including the IBM product code numbers, required to download the latest IBM FileNet Content Manager software components, used to test the Java Replication Program FileNet API calls. It also covers the download of the document describing the installation of the software on a Red Hat Linux server.
Part 2 – The Replication Program Introduction. This part describes the main Replication Program functionality and the development tools and procedure.
Part 3 – Code Developed for the Replication Program. This Part lists the main Replication Program Java Code.
Part 4 – Code Listing – CEReplicateConfig. In this Part, the Java Code for the supporting utility methods is listed.
Part 5 – Code Listing – CEMigrateConfig. In this Part, the supporting Java Code for the CEMigrateConfig code is listed. This code reads the parameters from the config.xml file which defines the source and target object stores and the required login and security parameters.
Part 6 – Code Listing – Supporting Utility Code. In this Part, the supporting utility Java Code for the Replication Program is listed. This is defined for the compiled fn_utils.jar, fn_connect.jar, and the fn_connection.jar supporting libraries.
Part 1 – Bill of Materials
The installation steps required for the base IBM Case Manager 5.3.3 system we are using are covered step by step in the following free ResearchGate document, downloaded using the DOI URL as follows:
https://doi.org/10.13140/RG.2.2.21708.16001
entitled “Case Manager 5.3.3 Installation on RHEL 8.0 with Content Navigator 3.0.6”
Click the Download file PDF command button in Figure 4-1.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig1_HTML.png)
A screenshot depicts a file titled case manager to install R H E L version 8.0 content navigator 3.0.6 I F 003, authored by Alan Bluck. There is an option to download the file in P D F format.
Download the IBM Case Manager Installation Document
This gives the downloaded document entitled CaseManagerInstallationonRHEL8.0_V3.docx.
The installed IBM software product codes required are listed as follows:
IBM FileNet Content Manager V5.5.0 for IBM Case Foundation V5.3.0 Multiplatform Multilingual eAssembly (CJ2VNML)
FileNet Content Manager V5.5.0 Quick Start Guide Multiplatform Multilingual (CNP8XML)
IBM FileNet Content Platform Engine V5.5.0 Linux Multilingual (CNP8ZML)
IBM FileNet Content Platform Engine V5.5.0 Windows Multilingual (CNP90ML)
IBM FileNet Content Platform Engine Client V5.5.0 Linux English (CNP93EN)
IBM FileNet Content Platform Engine Client V5.5.0 Windows English (CNP94EN)
IBM DB2 Enterprise Server Edition Restricted Use Quick Start and Activation V11.1 for Linux, UNIX and Windows Multilingual (CNB25ML)
Quick Start Guide for IBM WebSphere Application Server V9.0 (CNA8LML)
IBM WebSphere Application Server V9.0 (CND1AML)
IBM WebSphere Application Server V9.0 Supplements – Application Client (CND1CML)
IBM WebSphere Application Server V9.0 Supplements – IBM HTTP Server (CND1DML)
IBM WebSphere Application Server V9.0 Supplements – Web Server Plugins (CND1EML)
IBM WebSphere Application Server V9.0 Supplements – WebSphere Customization Toolkit (CND1FML)
IBM WebSphere Application Server Liberty (IBM Installation Manager install) (CND1GML)
IBM Installation Manager V1.8.5 for Linux x86_64 (CND0ZML)
IBM SDK, Java (TM) Technology Edition, Version 8 for Windows (CND15ML)
IBM SDK, Java (TM) Technology Edition, Version 8 for Linux (CND18ML)
WebSphere 8.5.5 Fix pack 15 automatically installs and defaults the JDK to 1.8.
Part 2 – The Replication Program Introduction
This Java program consists of 4116 lines of Java code calling methods from the FileNet 5.x Java APIs to replicate documents and folders from a selected Folder location in a source Object Store to a selected Target Object Store on a different server. (See the section code lists in this chapter.)
The Target documents are copied with exact GUIDS, Version Series ID, and Security profile and folder linkage as in the source Object Store, except that the Group and User security are set to Read Only for the Replicated Folder and Document Properties and Content.
One exception Group and User are left with their originally defined security levels.
The Replication program also detects security and property changes in the Source Object store and the removal/move of Documents and Folders and faithfully copies the changes to the target object store.
This program was built to satisfy the following requirements:
a) It can be rerun from any starting date and updates the Target replica with all changes; there is no need to reset the target object store as the program has been designed to check and ignore existing Documents or Folders already replicated.
- 1.First replication:
Verify the object store and folders.
The same object store and folders are found at target.
- 2.Verify the document at the target side.
The number of documents are the same.
- 3.Verify the permission setup.
The permission setups are the same.
- 4.Check whether the copy at the target side is editable or not.
The documents on the target Object Store must be READ-ONLY.
- 5.Verify the document change – Upload a new document at the source.
A new document should be synced to the target, with identical permissions.
- 6.Upload a new version of the document at the source.
A new version of the document should be found at the target.
- 7.Change the permissions of the document at the source.
The permissions must be updated at the target.
- 8.Remove a document at the source.
The same document should be removed at the target.
- 9.Modify the document attribute.
The same attribute change is applied at the target.
- 10.Move the document from one folder to another folder at the source.
The same change is applied at the target.
- 11.Change the replication frequency.
The target copy should be refreshed as per the frequency setting.
- 12.Verify the folder change – Create a new folder at the source.
A new folder should be synced to the target, with identical permissions.
- 13.Verify the folder change – Amend the name of an existing folder at the source.
The Folder Name change should be synced to the target Object Store.
- 14.Remove a folder at the source Object Store.
The same folder should be removed at the target Object Store.
- 15.Verify the target Object Store copy is still accessible if the source Object Store copy is stopped.
The target copy should still be accessible for read.
Nonfunctional Requirements
- 1)
An administrator should be able to adjust the replication frequency.
(Originally defined as 1 hour, but run at present every 15 minutes)
- 2)
The full Java code source is in Part 6 of this chapter.
- 3)
The Replication script should be compatible for future FileNet 5.x versions. (All API calls are compatible with the base FileNet 5.2 version.)
Development Tools Used
- 1)
VMware Red Hat Enterprise Linux Server RHEL 8.0 with full IBM FileNet P8 5.5.5 system
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig2_HTML.png)
A screenshot depicts R H E L 8.0 with information related to devices and descriptions. A tab of activities includes project explorer includes 3 folders.
The Red Hat Linux server specification used for the development
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig3_HTML.png)
A screenshot depicts product information with version, license information with status, type, and expiration details, and additional information with memory and file names.
The VMware Host server and version details
The P8 5.5.5 Environment
Machine Name: ECMUKDEMO6
Red Hat Linux Enterprise 8.0 Server
Main User: Alan
WebSphere User: wasadm
DB2 User: db2inst1
Installed WebSphere 8.5.5.15
Installation Manager 1.8.5
Installation IBM Security Directory Services 6.4
Login: root
IBM FileNet Case Manager 5.5.3
IBM FileNet Content Engine 5.5.5
Eclipse IDE Version 2021-12 (4.22.0) for Red Hat Linux 8.0
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig4_HTML.png)
An installation box of the eclipse I D E depicts the version and build I D software downloading sources, and tools with an option to close at the bottom right.
The Eclipse IDE Java version used for the development in this book
(Download eclipse-java-2022-03-R-linux-gtk-x86_64.tar.gz for unpacking and installation.)
New Configuration Files:
Unit Test Data
The Root “/AUDIT_TEST” folder in the OS2 “Target” object store was used for initial testing, Test Data, as shown in Figure 4-5.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig5_HTML.png)
A window depicts object store O S 2 with options to browse, root folder, audit test, level 2 A, 1 B, and 1 C files. A document named Doc level 1 A is listed under level 1 A folder with creation date and author name.
The Test Data folder structure and example Document for the first tests
AUDIT_Common
AUDIT_Utils
FileNetConnection
FN_Connect
- a)
Permissions (Security ACLs)
- b)
Containers
- c)
Containees
- d)
SubFolders
- e)
Contained Documents (retrieved separately in the importDocuments method)
- a)
Replication Group
- b)
External Replica Identities
- c)
Active Markings
- d)
Annotations
- e)
Security Policy
- f)
Coordinated Tasks
- g)
Workflow Subscriptions
The following is required to write DateCreated and Creator properties, etc.
Creator Property
See the following links for updating this:
www.ibm.com/docs/en/filenet-p8-platform/5.5.0?topic=security-working
This indicates the name of the user assigned as the creator of the object.
www.ibm.com/docs/en/filenet-p8-platform/5.5.x?topic=comfilenetapiconstants-accessright
Settability of this property is read-only for most users. For users who have been granted privileged write access (AccessRight.PRIVILEGED_WRITE), this property is settable only on create. After initial object creation, this property is read-only for all users.
Setting Object Store Access Rights
The permissions (access rights) associated with an object store control the degree of access that users have to the objects within the object store. Granting full control means that the specified user is granted permission to connect to the object store, store objects, modify objects, and remove objects. (For additional examples, see Document security levels – IBM Documentation, www.ibm.com/docs/en/filenet-p8-platform/5.5.x?topic=rights-document-security-levels.)
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig6_HTML.png)
An illustration depicts the static and privileged write scripts in two columns. The user or group is granted or denied permission to set the system are specified.
The static AccessRight privilege we need to keep the same system properties
Shell Script Batch Jobs
The following Shell Script jobs were developed to run a scheduled replication service using the Linux cron system to run the Java Replication program which we develop. For cron details, see www.redhat.com/sysadmin/automate-linux-tasks-cron.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig7_HTML.png)
A screenshot depicts 15 lines of commands under address forward slash, opt, forward slash, replication to launch the replication application.
The main Replication.sh shell script for running in the cron scheduled job system
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig8_HTML.png)
A screenshot depicts 15 lines of command to set the classpath environment for the replication environment. The commands start with a start folder and end with envCommonReplicate dot S H.
The CLASSPATH environment is set using this shell script
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig9_HTML.png)
A screenshot depicts 15 lines of command to launch the I B M File Net library classpath. The commands start with a start folder and end with env5x dot s h.
The IBM FileNet API jar files added to the CLASSPATH with the env5x.sh shell script
The edited shell script files have the Linux security updated as shown in Figure 4-6D.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig10_HTML.png)
10 line of command illustrates the square bracket root at E C M U K D E M 0 6 replication, square bracket, with application library env5x dot s h and envCommonReplicate dot S H.
The security on the shell script files is updated using chmod 755 *.sh
Linux Directory Paths Required
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig11_HTML.png)
10 line of command illustrates the square bracket, root at E C M U K D E M 0 6 replication, square bracket, with config application library env5x dot s h and envCommonReplicate dot S H.
The /opt/replication/config subdirectory is created and config.xml copied from Eclipse
The Replication.jar file program uses the following .jars on the AUDIT_CEReplication Project Build Path.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig12_HTML.png)
A screenshot depicts 9 class folders J A R program files with a path under the J R E system library.
The supporting .jar files required by the main Replication.jar program
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig13_HTML.png)
A command illustrates the square bracket, root at E C M U K D E M 0 6 replication, square bracket, with app libs logs and app libs jar logs.
The /opt/replication jar library folders are created
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig14_HTML.png)
A command illustrates the square bracket, root at E C M U K D E M 0 6 replication, square bracket, with applibs logs and applibs other.
The /opt/replication/libs jar library folders are created
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig15_HTML.png)
A screenshot depicts commands under forward slash opt forward slash replication forward slash applibs to copy the supporting jar files common, connection, connect, event handlers, and utils into the directory.
The supporting jar files copied to the /opt/application/applibs subdirectory
Jars Required for Content Engine Client
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig16_HTML.png)
A web page depicts the path under objects under O S 2 as data design, classes, and folders. An audit definition and the option to create a new one are highlighted under the folder section.
The list of supporting IBM FileNet P8 Content Engine Version 5.5.x jars
Config Area
Encryption of the Administrator User Password in config.xml by the Program
- a.
Just for the first run, the Config.xml password setting is unencrypted.
- b.
The first run of the Replication program will load the unencrypted password (remember this is the exact “clear” unencrypted password string and so is a vulnerable security risk just for the first run of the program!)
- c.
It will attempt to decrypt the string found.
- d.
It will test the decrypted string is wrapped as follows: Encrypt3dpasswordvalueP4ssw0rd
- e.
If the decrypted string does not contain the start and end strings shown earlier, it will assume the config contains a clear password.
- f.
In this case, the program will wrap the start and end strings Encrypt3d and P4ssw0rd around the input clear password string.
- g.
Encrypt the resulting Encrypt3dpasswordvalueP4ssw0rd string and write out the result to the config.xml file.
- h.
If the decrypted string is in the form Encrypt3dpasswordvalueP4ssw0rd, passwordvalue will be set as the password.
- i.
Then the read in password will be set in the replication program for use.
Update of the Config.xml Start Date
At the point in time the replication program is started, the current run date and time from the local server system clock will be used as the next start date/time and written back to the config .xml file in the following format:
20220719T114828Z
NB Delta set at -1 indicates no overlap.
0 is 1 hour prior to last run date (to the nearest whole hour).
1 is 2 hours prior "" etc.
Config.xml
This was renamed on Linux as config.xml (all lowercase).
log4j.xml (Updated to Fix Error Issues)
Original log4j.xml File
log4j.dtd
Static Constants for Property Types
Name | Value | Description |
---|---|---|
BINARY | 1 | Specifies a binary data type. Represents binary data by using an array of unsigned 8-bit bytes. |
BOOLEAN | 2 | Specifies a Boolean data type. Represents Boolean data having a value of true or false. |
DATE | 3 | Specifies a DateTime data type. Represents an instance in time as a date and time of day in accordance with ISO 8601. |
DOUBLE | 4 | Specifies a double (Float64) data type. Represents an IEEE-standard 64-bit floating-point number, which has a value ranging from -1.79769313486232e308 to +1.79769313486232e308. |
GUID | 5 | Specifies a GUID (ID) data type. Represents a Globally Unique Identifier (GUID) or DCE Universally Unique Identifier (UUID), which is a unique 128-bit number, as a string of 32 hexadecimal characters enclosed by brackets in the following format: {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}. For example, {3F2504E0-4F89-11D3-9A0C-0305E82C3301}. |
LONG | 6 | Specifies an integer data type. Represents a signed 32-bit integer, which has a value ranging from -2,147, 483,648 to +2,147,483,647. |
OBJECT | 7 | Specifies an object data type. Represents an object that is instantiated from a Content Engine class. |
STRING | 8 | Specifies a string data type. Represents text consisting of a sequential collection of 16-bit Unicode characters. |
Name | Value | Description |
---|---|---|
ENUM | 1 | Specifies a property with enumeration cardinality. A property with enumeration cardinality is an object-valued property that returns a set collection. A set collection is a read-only collection of unique, unordered, independent objects that must be traversed sequentially. You can iterate through the items of a set collection one page of elements at a time from the server to your client application. However, if the collection changes on the server while you are iterating through it, the number, order, and values of the items in your client copy can change, even if you maintain the same reference to it. A set collection cannot hold any items other than independent objects. By contrast, a list collection can hold items of any data type, with the exception of independent objects. |
LIST | 2 | Specifies a property with list cardinality. A property with list cardinality returns a list collection. A list collection is a collection of ordered items that can either be modifiable (allowing items to be inserted, replaced, or deleted) or read-only. These items need not be unique and can be traversed in any order. When you access a list collection from the server, a complete copy of it is created on your client application, which you can iterate through one element at a time. The items in a list collection must all be of the same data type and must match the data type of the property that returns it. If the property returning a list collection is an object-valued property, all of the objects in the list collection must be dependent objects. A list collection can hold items of any data type (provided each item is of the same data type. However, if a list collection holds objects, they must all be dependent objects; only a set collection can hold independent objects. You cannot create a custom property with list cardinality. |
SINGLE | 0 | Specifies a property with single cardinality. A property with single cardinality returns a single value of the data type that the property can hold. |
Event Setup
Events recorded example query:
Events should be set up using the acce web application for the following classes.
Folder Class
File Event
Update Security Event
Unfile Event
Update Event
Deletion Event
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig17_HTML.png)
A window displays the details of the new audit definition. The display name, event, recording level, audit type, filter expression, property name, and options with OK and cancel buttons.
The Folder Class, Audit Definitions tab is selected to add events using New
The acce web application (http://ecmukdemo6:9080/acce/) is used to set the Source (OS2) Folder Class Event records which then can be used to identify changes to the Object Store Folder objects, used by the Replication program.
The New command button is used to create a new Event definition, for example, the Unfile Event to remove a Folder Object from another Folder.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig18_HTML.png)
A screenshot displays a table that lists the display name with 5 files, event, enabled, subclass, audit type, and recording level under the audit information option.
The Folder Class Unfile Event
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig19_HTML.png)
A screenshot displays the details of the new audit definition, such as the display name, event, recording level, audit type, filter expression, property name, and options with OK and cancels buttons.
The Folder Events set for Audit Definitions
Don’t forget to click the Save command button or nothing will be preserved!
Document Class
Update Event
Checkin Event
Deletion Event
Update Security Event
The acce web application (http://ecmukdemo6:9080/acce/) is used to set the Source (OS2) Document Class Event records which then can be used to identify changes to the Object Store Document objects, used by the Replication program.
The New command button is used to create a new Event definition, for example, the Update Security Event to record changes to a Document Object Security.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig20_HTML.png)
A screenshot displays a table with 7 columns listing 11 display names with information about their event, enabled, subclass, audit type, and recording level.
The Audit Definition Event for the Document Update Security Event
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig21_HTML.png)
A screenshot depicts objects stored under the level 2 A 1 folder. The folder has a single file titled, Level 2 A 1 document.
The Document Events set for Audit Definitions
Don’t forget to click the Save command button or nothing will be preserved!
Unit Test Phases
Phase 1
- a)
Source Object Store Connection is successful.
- b)
Target Object Store Connection is successful.
- c)
C) All Test folders under a source Object root Folder, Replicate Test 1, are created in the Target Object Store irrespective of the number of overlapping runs.
The OS1 replicate /AUDIT_TEST folder Object Store now has the replicated folder structure and linked documents exported from the OS2 Object Store source.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig22_HTML.png)
A screenshot depicts objects stored under the level 2 A 1 folder. The folder has a single file titled, Level 2 A 1 document.
The original OS2 test data folder and document structure to be replicated
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig23_HTML.png)
A screenshot of the command base with the use of applibs logs, and applibs jar logs.
The OS1 test data folder and document structure from the OS2 original
Notice that the exported OS1, AUDIT_TEST folder document, Date Created property entry (July 31, 2022 at 3:58:37 PM PDT), is exactly the same as from the original document in the OS2 Object Store, as is required.
Phase 2
- a)
Ensure matching property values in the Source Object and with the same security ACLs and GUID values.
- b)
Ensure major/minor versions of documents under the source Object Folders, Replicate Test 1 and subfolders, are created and linked correctly in the Target Object.
- c)
Ensure Folders and Documents created in other Folder paths outside the defined path are not copied.
This was seen in the preceding output log, for example:
IGNORED: New Folder: Audit Master found linked to external Folder Path : /IBM Case Manager/Solution Deployments/Audit Master Should be linked to :/AUDIT_TEST
- d)
Add new code to test for an existing document in the Target Object Store and delete and recreate it.
Phase 3
- a)
First replication – Verify the object store and folders.
The same object store and folders are found at the target.
- b)
Remove a document at the source – The same document is removed at the target.
- c)
Verify the folder change – Amend the name of the existing folder at the source.
The change is synced to the target.
- d)
Remove a folder at the source – The same folder is removed at the target.
Phase 4
- a)
Complete Deployment Manager full replication Test.
Update to encrypt the Alan password – Automatic config.xml updates.
(This is in the code listing, tested and working!)
Update to automatically update the next replication start date in the config.xml file.
(This was checked in the config.xml file and updated as expected.)
- b)
Release Batch Replication.sh and Java program for testing.
- c)
Create the documentation (this chapter).
Creating the Java Projects
The Java Eclipse Projects used for support of the Replication program
Project Name | Library .Jar Name | Source Java File(s) | Brief Description |
---|---|---|---|
FileNetConnection | fn_connection.jar | CEConnection.java | Loads the user and password |
FN_Connect | fn_connect.jar | CEConnect.java | Uses the FileNet Web Service Interface to connect (using the FileNetP8WSI stanza) |
AUDIT_CEReplicate | replication.jar | CEReplicate.java | The main Replication program in the package com.ibm.ce.rep.utils |
AUDIT_Common | fn_common.jar | CEReplicateConfig.java CEMigrateConfig.java | Reads in the XML configuration parameters for the Replication |
AUDIT_Utils | fn_utils.jar | PropsUtil.java | Loads configuration details from a properties file |
Part 3 – Code Developed for the Replication Program
CEReplicate – 2957 Lines of Java Code – replication.jar
The supporting compiled jar files and standard encryption .jars are copied into the /opt/replication/libs/applibs subfolder.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig24_HTML.png)
A screenshot of the command base under forward slash opt forward slash replication with the use of applibs jars libs for the creation of five jars subdirectories.
The applibs, jars, and libs subdirectories are built under /opt/replication
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig25_HTML.png)
A command under forward slash replication dot s h includes classpath and error data as no appender name could be found.
The /opt/replication/libs/applibs subfolder .jar files
The latest release of the apache codec jar can be downloaded from the following URL:
https://commons.apache.org/proper/commons-codec/download_codec.cgi
A Xerces Java library file can be downloaded from the zip file:
http://archive.apache.org/dist/xml/xerces-j/Xerces-J-bin.1.4.4.zip
(An import used in CEMigrateConfig.java code for XML parsing)
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig26_HTML.png)
A screenshot depicts 24 lines of command under forward slash opt forward slash replication with C E replicate version 3.6 and configuration file search order and highlighted console dot log at the end.
The first run of the Replication.sh shell script (the CLASSPATH is echoed)
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig27_HTML.png)
A screenshot depicts the command under forward slash opt forward slash replication with the ignored files, highlighted replication, imported 13 documents, and updated 242 documents in middle.
The console.log file from the first run of the Replication.sh shell script
The end of the console.log shows the successful transfer of the folders and documents.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig28_HTML.png)
A screenshot depicts the command under forward slash opt forward slash replication with c e login import, file name, and folder subclass highlighted as 20220801 T 1516262.
The Replication program run statistics of the console.log file is shown
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig29_HTML.png)
A command under audit imports audit documents dots log, 5 lines of data, 4 finished times, documents that failed to be processed, and a cursor at the end.
The Replication program has successfully updated the start search date
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig30_HTML.png)
A command includes applibs logs x m l, dot jar, and functions of event handlers to present the details of imported documents.
The AuditImportAuditDocs.log shows the details of imported documents
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig31_HTML.jpg)
An activity titled box depicts the options under file as new, further leading to the project.
The setup of the supporting file systems for the Replication program
Project Creation
The Eclipse New project, AUDIT_CEReplicate, is created.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig32_HTML.png)
A new project titled box depicts the 4 types of wizards with java project under java selected.
The File ➤ New ➤ Project menu option is selected for the New Project wizard
The Java Project type is selected.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig33_HTML.png)
A screenshot depicts the inputs of the user's new project name, file location, J R E project, project layout with default configuration, add project sets, with cancel and finish options.
The Java Project is selected with the Eclipse Project wizard
A number of separate projects will be created for each custom utility .jar file we will reference.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig34_HTML.png)
A screenshot of a new java project box depicts a folder under the Java server setting. A project AUDIT underscore C E Replicate is listed with s r c folder into it.
The Project Name, AUDIT_CEReplicate, is entered and the 1.8 JRE selected
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig35_HTML.png)
A popup window, open associate perspective? illustrates the perspective with no and open perspective options at the bottom right.
The parameters are set for the Java project, and Finish is clicked
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig36_HTML.jpg)
A screenshot depicts 2 folders under a package explorer. The folder titled, s r c under Audit underscore C E replicate is selected and its J units run and errors are shown.
The Open Perspective command button is clicked for Java development
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig37_HTML.png)
A screenshot depicts the way to create a new package under s r c, listed under the folder Audit underscore C E replicate.
The AUDIT_CEReplicate Project is now available for Java packages and code
A new Java package is created for the CEReplicate class.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig38_HTML.jpg)
A dialog box titled new Java packages with options to create new ones, source folder named Audit underscore C E Replicate, the name, com dot I B M dot c e dot rep dot utils, is highlighted.
The right-mouse click is used to select the New ➤ Package menu option
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig39_HTML.png)
A screenshot depicts the way to create a new class under com dot I B M dot c e dot rep dot utils, is listed under the folder Audit underscore C E replicate.
The Java package name, com.ibm.ce.rep.utils, is created by clicking Finish
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig40_HTML.jpg)
A dialog box titled a new Java class has a source folder, packages, name C E replicate highlighted, modifiers set to public, superclass, interfaces, method stubs, and highlight finish option.
The CEReplicate Class is added to the com.ibm.ce.rep.utils package
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig41_HTML.png)
A screenshot of C E replicates dot java and starts listing 15 programming codes by I B M along with decryption java classes.
The CEReplicate class name is entered and the Finish command clicked
Adding the Base CEReplicate Java Code
The base CEReplicate.java code is pasted in from the standard code module as a starting point for the development and comments and new Java code added for changes for our functionality.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig42_HTML.png)
A screenshot displays Audit C E R properties for replicating the Java build path, including resource files and builders. It highlights the Java build path and adds an external J A R, the right side.
The base Java Code is added for CEReplicate.java
Adding the IBM FileNet Libraries to the AUDIT_CEReplicate Classpath
IBM FileNet P8 5.5.x standard libraries are added to the AUDIT_CEReplicate Project Classpath. This should correct the flagged issues on the missing imports from the standard IBM FileNet API jace.jar and its supporting library .jar files.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig43_HTML.png)
A screenshot displays the J A R selection tab that lists 7 folders under file net jars. 4 folders from the bottom are selected.
IBM FileNet P8 .jar libraries are added to the Classpath
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig44_HTML.png)
A screenshot displays the J A R selection tab that lists 4 projects under the file net jars library. All the files are selected.
The Apply and Close command button is clicked to add the library .jar files
The other projects are similarly created as described in Table 4-1 (with the code copied from the Java code listings in the following subsections).
Adding the Apache Commons Codec 1.5 Library
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig45_HTML.png)
A screenshot displays Apache commons C o d e c 1.15 lists information about binaries, sources and archives.
The latest Commons Codec Version 1.5 is downloaded from the Apache site
The URL https://commons.apache.org/proper/commons-code.codec.cgi is entered in the Firefox browser, as shown in Figure 4-27, to download the commons-codec-1.15-bin.tar.gz file for our Linux Eclipse project.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig46_HTML.png)
A popup of download titled, opening common codecs 1.15 bin dot tar dot g z enquires either to open with or save the file by Mozilla Firefox. The save option is highlighted.
The downloaded commons-codec-1.15-bin.tar.gz file is saved
The downloaded commons-codec-1.15-bin.tar.gz file is saved to the /root/Downloads browser folder.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig47_HTML.png)
A screenshot displays 4 zip folders under the download tab. The zip folder titled, common codecs 1.15 bin dot tar dot g z is highlighted.
The downloaded commons-codec-1.15-bin.tar.gz file is unpacked
The downloaded commons-codec-1.15-bin.tar.gz file is unpacked using the Linux File Explorer desktop utility by double-clicking the .gz file to view the packed files.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig48_HTML.png)
A screenshot displays 6 folders and 3 text files under the path name common codecs 1.15. The folder titled, common codecs 1.15 dot jar is selected.
The unpacked .gz file displays the commons-codec-1.15.jar file
The commons-codec-1.15.jar file is now copied to the /opt/FileNetJars folder.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig49_HTML.png)
A screenshot displays options to choose a folder to copy from 8 dot jar extension folders.
The /opt/FileNetJars folder is browsed to copy the commons-codec-1.15.jar
Adding the Supporting External Library JAR Files
The properties for the AUDIT_CEReplicate project show the Java Build Path, and we can use the Add External JARs command button to browse and select the highlighted commons-code-1.15.jar file from the /opt/FileNetJars folder path.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig50_HTML.png)
A screenshot displays the properties for audit underscore C E replicate tab that lists 5 projects under the file net jars library. A project at the top is selected.
The Add External JARs command button is used to load the JAR files required
The commons-code-1.15.jar file we downloaded earlier is used for the password encryption in the config.xml file.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig51_HTML.png)
A screenshot displays the J A R selection tab that lists 8 folders under the J A R selection tab. The folder at the bottom titled, common codecs 1.15 dot jar is selected.
The commons-codec-1.15.jar is selected from the /opt/FileNetJars folder
The Eclipse properties Java Build Path for the AUDIT_CEReplicate project is updated to include the commons-codec-1.15.jar file which is missing from the import statement, highlighted in Figure 4-34, it can be seen that the addition of the Jar file has fixed the flagged issue of the missing Base64 class.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig52_HTML.jpg)
A screenshot of a tab titled, C E replicate dot java lists import functions. The function at line 60, dot C E connection is highlighted.
The import org.apache.commons.codec.binary.Base64 class is now fixed
Adding the Xerces Java Library for XML File Processing
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig53_HTML.png)
A popup of download titled, opening Xerces J bin dot 1.4.4 dot zip f enquires either to open with or save the file by Mozilla Firefox. The save option is highlighted.
The Xerces-J-bin.1.4.4.zip file is downloaded from the Apache website
The Xerces-J-bin.1.4.4.zip file is downloaded from the https://archive.apache.org/dist/xml/xerces-j/Xerces-J-bin.1.4.4.zip Apache jar download site.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig54_HTML.png)
A screenshot displays 4 folders under the download. A folder titled Xerces J bin dot 1.4.4 dot zip at the top is highlighted.
The Xerces-J-bin.1.4.4.zip file is shown in the /root/Downloads Linux folder
The Xerces-J-bin.1.4.4.zip file is downloaded and unpacked using the Extract function of the Linux File Explorer desktop utility.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig55_HTML.png)
A screenshot displays 5 folders and 2 files under path Xerces 1 underscore 4 underscore 4. A folder titled Xerces dot jar is highlighted.
The xerces.jar file is extracted from the Xerces-J-bin.1.4.4.zip file
The unpacked xerces.jar file is extracted to the /opt/FileNetJars folder location.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig56_HTML.png)
A screenshot displays 9 folders to extract under the file net jars.
The unpacked xerces.jar file is extracted to the /opt/FileNetJars folder
The xerces.jar file is used to satisfy the XML parsing requirements for the Java replication program.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig57_HTML.png)
A screenshot displays the J A R selection tab that lists 9 projects under the file net jars library. The project at the top titled, Xerces dot jar is highlighted.
The unpacked xerces.jar file is added to the Java Build Path
The properties of the AUDIT_CEReplicate project are selected to add the xerces.jar file to the Java Build Path property.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig58_HTML.png)
A screenshot displays a tab with selected Java build path that lists 9 projects under the file net jars library. The project at the top titled, Xerces dot jar is highlighted.
The xerces.jar is now added to the Java Build Path
The import statement needed to be updated to adjust the package path of the OutputFormat class as shown in Figure 4-41.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig59_HTML.png)
An illustration of double slash A S B development limited Apache class on 2022, July 29, org dot Apache X M L, and import org dot Apache dot X M L dot serialize dot output format semicolon.
The adjusted import statement for the OutputFormat class
Adding the Supporting Java Projects
The four supporting projects, FileNetConnection, FN_Connect, AUDIT_Common, and AUDIT_Utils, are run as follows to create the supporting .jar files (as defined in Table 4-1).
In the AUDIT_CEReplicate project source folder, we first create a config subfolder.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig60_HTML.png)
A dialog box titled, new folder displays the option to create a new folder resource under the selected parent folder and desired folder name with an option to cancel or finish.
The Config folder is created for the config.xml file
The config.xml file is created to hold the Replication program parameters for the source and target Object Store names, the administrator name and encrypted password for the IBM FileNet content engine system account, and the included users and group security for access to the replicated folders and documents.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig61_HTML.png)
A dialog box titled, create new file displays the option to create a new file resource under the selected parent folder config and desired folder name with an option to cancel or finish.
The Config.xml file is created – note later changed to config.xml (lowercase)
The supporting project jar files are generated as shown in Table 4-1.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig62_HTML.jpg)
A dialog box titled, activities illustrates an option to export audit underscore export listed under package explorer.
The AUDIT_Common project is selected to export the fn_common.jar file
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig63_HTML.png)
A dialog box titled, export displays the option to select an export wizard with a jar file under the Java folder selected with an option to cancel or next.
The Java JAR file export option is selected
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig64_HTML.png)
A dialog box titled, J A R export displays the option to select the resources to export from the list and the destination path with an option to compress, back, finish, cancel or next.
The fn_common.jar export path is selected
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig65_HTML.png)
A dialog box titled, J A R export displays options to select for handling problems, and a description file path with an option to compress, back, finish, cancel or next. The next option is highlighted.
The AUDIT_Common.jardesc file is selected for build, to use for faster rebuilds
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig66_HTML.png)
A dialog box titled, J A R export displays options to specify the manifest, manifest file path, seal content options and options to compress, back, finish, and cancel.
The jar MANIFEST.MF file is selected for creation and Finish clicked
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig67_HTML.png)
A warning box illustrates containing J A R file exports with compile warnings with an option to details and ok.
The Details command button displays the compile warnings found
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig68_HTML.png)
A dialog box titled, export displays the option to select the resources to export, an export destination of fn underscores utils dot jar with an option to compress, back, next, cancel or finish.
The fn_utils.jar export path is selected
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig69_HTML.png)
A dialog box titled, export displays the option to select the resources to export, an export destination of fn underscores connect dot jar with an option to compress, back, next, cancel or finish.
The fn_connect.jar export path is selected
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig70_HTML.png)
A screenshot displays the J A R selection tab that lists 9 projects under the path eclipse. The project titled, fn underscores connect dot jar is highlighted.
The generated fn_connect.jar supporting jar file for the Replication program
The supporting jar file fn_connect.jar is added to the Java Build Path of the FileNet fn_connection.jar creation project FileNetConnection.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig71_HTML.png)
A screenshot displays 9 jar projects listed under Java build path and an option to add external jars. The project titled, an eclipse is highlighted.
The generated fn_connect.jar is added to the FileNetConnection project
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig72_HTML.png)
A screenshot displays the J A R selection tab that lists 9 projects under the file net jars library. The project at the top titled, fn underscore common dot jar is highlighted.
The generated fn_common.jar file is selected from the eclipse root path
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig73_HTML.png)
A screenshot displays 9 jar projects listed under Java build path and option to add external jars. 2 projects titled, fn underscore common dot jar and fn underscore connect dot jar are highlighted.
The generated fn_common.jar is added to the FileNetConnection project
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig74_HTML.png)
A dialog box titled, export displays the option to select the resources to export, an export destination of fn underscore connection dot jar with an option to compress, back, next, cancel or finish.
The fn_connection.jar export path is selected
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig75_HTML.png)
A dialog box titled, export displays the option to specify the manifest, manifest file, and seal contest with an option to back, cancel or finish.
The fn_connection.jar export MANIFEST.MF file path is selected
Updating the Java Build Path with the Required Projects
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig76_HTML.png)
A screenshot displays the properties for audit underscore C E replicate with Java build path selected, with an option to add new under the projects folder.
The Java Build Path Projects tab is selected and the Add command clicked
In Figure 4-58, we select the AUDIT_CEReplicate, Replication.jar build project properties and click the Java Build Path menu item and then select the Projects tab to identify the Required projects on the build path.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig77_HTML.png)
A screenshot displays a box of required project selections that lists 7 projects. A U D I T underscores Common, Utils, file connection, function connect and O K tab is selected.
The supporting Projects selected for addition to the Eclipse Java Build Path
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig78_HTML.png)
A screenshot displays the properties for audit underscore C E replicate with Java build path selected, with 4 selected projects under the projects folder.
The supporting Projects are added to the AUDIT_CEReplicate project
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig79_HTML.png)
A screenshot displays the J A R selection tab that lists 10 projects under the path eclipse. The 4 projects are highlighted.
The four created supporting jar files in the Eclipse root folder on Linux
The Add External JARs command is selected, and the supporting jars displayed in Figure 4-61 are added to the AUDIT_CEReplicate project in the Java Build Path Libraries tab list.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig80_HTML.png)
A screenshot displays the properties for audit underscore C E replicate with Java build path selected lists 9 jar projects and options to add new external.
The four supporting .jar libraries are added to the main Project
Updating the Supporting Jar Library File Security
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig81_HTML.png)
The output screen displays 10 lines of commands, the base, square bracket, root at E C M U K D E M 0 6 eclipses, hashtag p w d. In the third-line function, J A R In the fifth line, write c h m o d.
The security on the four generated supporting jar files is changed to allow access for the project build
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig82_HTML.png)
The output screen displays 10 lines of commands, starting from K D E M 0 6 eclipse l s a slash root, g r r d b m with date and time, 4 and 5 lines of hashtag c h m o d and audit, and ending with a cursor.
The security on the config.xml file is updated to support the search date updates which set the next search start date for source object store changes
Updating the IBM FileNet Object Store Security
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig83_HTML.png)
A dialog box lists available users and groups, selected users and groups, and permission factors as type, apply to, and group with 13 options.
The security on the two Object Stores OS1 and OS2 is updated for the connected Content Engine administrator user used by the Replication program
The security displayed in Figure 4-65 is used to ensure the user has the ACL security options for Modify certain system properties (also programmatically added using the API).
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig84_HTML.png)
The output screen displays 30 lines of commands, including, in square brackets, root at E C M U K D E M 0 6, imported A U D I T folders dot log file with date and time.
The Audit log file security is changed to support the program writes
Running the Replication Program Tests
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig85_HTML.jpg)
A screenshot displays the folders under O S 1. The folder AUDIT underscores TEST folder under the root folder, under browse is highlighted.
The root folder /AUDIT_TEST is created in the target Object Store, OS1
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig86_HTML.png)
The output screen starts with import start, guide, source file, from D0891 A 81 and end with 4642 A 249 D 7 A 0 and the last 4 lines present 36 documents processed, failed 0 and finished.
The 36 Documents processed displayed in the AuditImportAuditDocs.log
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig87_HTML.png)
A screenshot displays eclipse workspace with highlighted AUDIT underscore C E, Common, Utils, file connection, function underscore connect, Java code 40 lines with a private keyword of C E replicate.
The completed project set for the Replication.jar file build
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig88_HTML.png)
A dialog box titled, export displays the option to select the resources to export, an export destination of replication dot jar with an option to compress, back, next, cancel or finish.
The main replication.jar file is exported for use
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig89_HTML.png)
A dialog box titled, export displays the option to select for handling problems, description file AUDIT underscore C E Replicate dot jar with an option to back, next, cancel or finish.
The AUDIT_CEReplicate.jardesc file is created for easy rebuilds
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig90_HTML.png)
A dialog box titled, export displays the option to specify the manifest, manifest file, and seal contest with an option to back, cancel or finish.
The MANIFEST.MF file is selected for addition to the bin folder
Result with the Exact GUID Copy of a Replicated Document
The following two screenshots demonstrate the unique Replication we have achieved where the source and target documents have exactly the same core system properties, including the Creation Date and GUID (ID) values.
The OS2 source of the replicated Document Level2A1 Document is shown in Figure 4-73.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig91_HTML.png)
A screenshot displays the O S 2 H T M L file in level 2 A 1 document properties lists property name, with values and highlight the I D of property.
The Document in OS2 GUID {907B5682-0000-C91D-B246-DA41D0421E00}
The OS1 target of the replicated Document Level2A1 Document is shown in Figure 4-74.
![](https://imgdetail.ebookreading.net/2023/10/9781484288610/9781484288610__9781484288610__files__images__535194_1_En_4_Chapter__535194_1_En_4_Fig92_HTML.png)
A screenshot displays the O S 2 H T M L file in level 2 A 1 document properties lists property name, with values and highlight the I D of property.
The Document in OS1 GUID {907B5682-0000-C91D-B246-DA41D0421E00}
Part 4 – Code Listing – CEReplicateConfig
The CEReplicateConfig Java code contains the Main program calling the Java methods to load the config.xml file parameters and query the source Target Object store for the changed Document and Folder objects based on the search date read in from the file.
CEReplicateConfig – 502 Lines of Java Code –fn_common.jar
Part 5 – Code Listing – CEMigrateConfig
The CEMigrateConfig.java Java code file supports the Main Java Replication program by retrieving the Object Store administration username and password credentials. On a first call to access the config.xml file, it checks if the password requires encryption and updates the config.xml to store an encrypted version of the password for additional security.
It also reads in the replication XML parameters in the config.xml file for the search date and source and target object store names and the root folder name to be replicated.
CEMigrateConfig – 425 Lines of Java Code – fn_common.jar
Part 6 – Code Listing – Supporting Utility Code
This PropsUtil Java code is one of a number of general supporting utility methods described in this part. The code is used to retrieve properties from a cebase.properties file containing external parameters to support access to Object Stores. (It is not used in the example replication program described in this chapter, but is bundled as a utility method.)
PropsUtil – 68 Lines of Java Code – fn_utils.jar
The CEConnect Java code is one of a number of general supporting utility methods described in this part. The method is a helper used to facilitate connection to the IBM FileNet Object stores through the Web Service Interface SOAP calls.
CEConnect – 67 Lines of Java Code – fn_connect.jar
CEConnection – 119 Lines of Java Code – fn_connection.jar
The CEConnection Java code is one of a number of general supporting utility methods described in this part. It is the main method called by the Replication program to sign in the IBM FileNet administration user to the source and target Object Stores. It also sets the necessary user security access to give special access levels to enable the Document and Folder object system properties for Date Created and Date Modified and the unique GUID identifier to be overwritten to create an exact replica of the source objects.
Chapter 4 Exercises
The following questions relate to the Replication Java program, CEReplicate class, and its supporting Java library components we covered in this chapter.
- 1.What shell script would you run to copy the documents and folders from a source Object Store to a Target replicated Object Store?
- a)
envCommonReplicate.sh
- b)
Replicate.sh
- c)
http://ecmukdemo6:9080/acce/
- d)
env5x.sh
- 2.Which file is used to provide the Java for XML parsing requirements for the Java replication program?
- a)
config.xml
- b)
Jace.jar
- c)
xerces.jar
- d)
fn_utils.jar
- 3.In which folder can the Replication.sh file be found?
- a)
/opt/replication/config
- b)
/opt/replication
- c)
/opt/replication/libs
- d)
/opt/replication/jars
- 4.Which of the following Events are not required for replicating the Folder Objects?
- a)
Update Security Event
- b)
Unfile Event
- c)
Checkin Event
- d)
Deletion Event
- 1.
b) Replicate.sh
- 2.
c) xerces.jar
- 3.
b) /opt/replication
- 4.
c) Checkin Event
- 1.
Outline what steps you would use to validate that the Replication program was functioning correctly. Describe the tests you would perform to prove the correct functionality for repeat runs of the Replication program.
- 2.
What security does the connecting program user need to have to run the Replication program?
- 3.
What Java libraries would you install in an Eclipse IDE Classpath to support the Replication program and where would you find them?
In Chapter 5, we will cover the use of the IBM Cognos BI Analytics, Real-Time Monitor to create a new Custom View for a Multilevel Time Dimension.
Note: Although Cognos BI 10.2.2 is at EOS as of December 31, 2022 (www.ibm.com/support/pages/end-continuing-support-cognos-business-intelligence-102x-effective-december-31-2022), the following IBM link announcement indicates that it is included in continuing support:
www.ibm.com/support/pages/cognos-analytics-continuing-support