Monday Aug 24, 2015

Oracle WebCenter Content Server: FullText Search Examples

Search Type I want to search for… Content Server FullText Query
WORD MATCH All documents with the word CACTUS in them <ftx>CACTUS</ftx>
PHRASE MATCH All documents with the phrase “CACTUS BUTTONS” in them <ftx>”CACTUS BUTTONS”</ftx>
AND All documents with both words CACTUS and BUTTONS in them <ftx>CACTUS BUTTONS</ftx>
AND All documents with all words CACTUS and BUTTONS and LUXURY and AMULET in them <ftx>CACTUS BUTTONS LUXURY AMULET</ftx>
AND (PHRASE) All documents with all the phrases “CACTUS BUTTONS” and “LUXURY AMULET” in them <ftx>”CACTUS BUTTONS” “LUXURY AMULET”</ftx>
OR All documents with either words CACTUS or BUTTONS in them <ftx>CACTUS,BUTTONS</ftx>
OR All documents with either words CACTUS or BUTTONS or LUXURY or AMULET in them <ftx>CACTUS,BUTTONS,LUXURY,AMULET</ftx>
OR (PHRASE) All documents with either one of the phrases “CACTUS BUTTONS” or “LUXURY AMULET” in them <ftx>”CACTUS BUTTONS”,“LUXURY AMULET”</ftx>
NOT All documents with the word CACTUS not in them <ftx>-CACTUS</ftx>
<ftx>NOT CACTUS</ftx>
NOT, AND All documents with none of the words CACTUS and BUTTONS and LUXURY and AMULET in them <ftx>-CACTUS -BUTTONS -LUXURY -AMULET</ftx>
XOR (EOR) All documents with only one of the words CACTUS or BUTTONS and not the other in them <ftx>(CACTUS,BUTTONS) (-CACTUS,-BUTTONS)</ftx>
WILDCARD All documents with the word CACTUS and all words starting with CACTUS <ftx>CACTUS*</ftx>
WILDCARD All documents with the word CACTUS and all words ending with CACTUS <ftx>*CACTUS</ftx>
WILDCARD All documents with the word CACTUS and all words containing the word CACTUS <ftx>*CACTUS*</ftx>
WILDCARD All documents with 8 letter words starting with CACTUS <ftx>CACTUS??</ftx>
WILDCARD All documents with 6 letter words ending with FORM <ftx>??FORM</ftx>

Monday Jul 27, 2015

Migrating huge content repositories using Archiver

I was recently asked to migrate a WebCenter Content repository to a new instance. They had the content exported locally using the Web Archiver applet and they were copying the archive folder to every destination content server file system. The archive folder was ~300 GB in size and it took around ~6 hours to tarball the archive directory and another ~2 hours to copy the tarball to the destination content server and then another ~6 hours to extract the tarball. And this process was repeated every time we wanter to replicate the repository. 

A easier solution may have been to mount a shared volume on the source content server and export the content there. Then you could just mount this shared volume to any destination server and use it for the import. However, the Archiver web applet only allows you to have the archives under the default location in the instance directory, that is [INSTANCE_DIR]/ucm/cs/archives. The key is to run the Archiver from the console as a standalone application. The standalone version of the Archiver application is required to create new collections or browse the local file system to connect to new collections.
  1. After you have identified a location for your archive collection, say /u02/share/archives/abc, create a new file, collection.hda, under the new directory and enter the following lines. Make sure that the IDC_Name parameter does NOT match the IDC_Name for the content server instance.

    @Properties LocalData
    blDateFormat=M/d{/yy}{ h:mm[:ss]{ a}}!mAM,PM!tAmerica/New_York
    @ResultSet Archives

  2. Start the Archiver utility as a standalone application, [DOMAIN_HOME]/ucm/cs/bin/Archiver, go to Options -> Open Archive Collection… and click Browse Local… to create a new collection location. Browse to the newly created directory and select the collection.hda file we just created, /u02/share/archives/abc/collection.hda.
    Open Archive Collection

  3. In the Browse To Archiver Collection, enter the correct paths for the vault and weblayout directories on the current system and click Ok.
    Browse to Archive Collection

  4. Once the new Archive Collection is added to the list, click Open to make it current. You can now create your new archive and export content into it.
  5. After you have completed your content export/import, make sure that you return to Options -> Open Archive Collection… and make the default Archive Collection active.
To IMPORT this archive collection on another content server, make the shared volume available on the target server and follow steps 2-5 to load the collection for import.

Friday Jul 17, 2015

OracleTextSearch fails to index metadata updates and new revisions when using Oracle Database

If you have setup your Oracle WebCenter Content instance using Oracle Database or have recently upgraded your database to this version, you may notice that the indexer is not able to index documents for the following scenarios:
  • Checkin a new revision to an existing document.
  • Update the metadata for an existing document.
If you enable trace on systemdatabase, you will notice the following exception lines in the audit logs:
index update work      !csJdbcCommitError,!$ORA-00604: error occurred at recursive SQL level 1
index update work      ORA-06550: line 1\, column 7:
index update work      PLS-00306: wrong number or types of arguments in call to 'SYNCRN'
index update work      ORA-06550: line 1\, column 7:
index update work      PL/SQL: Statement ignored

This problem is explained in MOS Note 1586704.1 and the solution is to apply patch 17501296 for the unpublished bug.

Wednesday Jul 01, 2015

Install JDeveloper with JDK 7 on OS X

In my previous  post, I described two issues that I was facing with JDeveloper using Oracle JDK 1.7 on a Mac OS X system. After a few trials, I have found that you will need Apple JDK 1.6 for installing JDeveloper. However, this is only required for the installer to work; you can choose Oracle JDK 1.7 during the installation and JDeveloper and its IntegratedWebLogicServer will use JDK 1.7. Here is how:

  1. If you do not have Apple Java 1.6, download it here (Java for OS X 2014-001).
  2. Start the JDeveloper installer using Apple Java 1.6.
    $(/usr/libexec/java_home -v 1.6)/bin/java -jar ~/Downloads/jdevstudio11119install.jar
  3. Follow the screens and when you reach the portion of the installer that asks for the JDK, point it to your JDK 1.7 location. In my case, I have used JDK 7u80.
  4. Complete the installation.

Saturday Jun 27, 2015

JDeveloper and JDK 7 Issues on OS X Yosemite (10.10)

Oracle JDeveloper was released last month (May 2015) and it has been certified to run on Oracle JDK 1.7 on Mac OS X 10.10 (Yosemite). You can review the Certification and Support Matrix here.

I have encountered two issues with this configuration so far. Here is the list with the fixes I use to work around these limitations:

JDeveloper installation fails with “Fatal error encountered during file installation. the installer will now cleanup and exit” error
Fix: Install JDeveloper using Apple JDK1.6. After the installation is complete, edit the <JDEV_HOME>/jdeveloper/jdev/bin/jdev.conf and update SetJavaHome as shown below. After the change JDeveloper will use JDK1.7.
SetJavaHome $(/usr/libexec/java_home -v 1.7)

ADF applications deployed to the IntegratedWebLogicServer show "Unsupported major.minor version 51.0" errors
Issue: Even though JDeveloper runs and compiles code using JDK1.7, the DefaultDomain (IntegratedWebLogicServer) is started using Apple JDK1.6.
Fix: Update <JDEV_USER_DIR>/user_projects/system11. to set JAVA_HOME to $(/usr/libexec/java_home -v 1.7).

Tuesday Jun 16, 2015

Decrypt WebLogic Passwords in a Domain

I was trying to connect to a WebLogic data source using SQL Developer when I realized that I do not remember the password for the schema user. Since WebLogic encrypts the passwords it store in the config files, I had to find a way to decrypt them. Here are the commands you can use in WLST to do this and you can use them for any passwords in the domain.

domain = "<path>"
service =
encryption =
print encryption.decrypt("<encrypted password>")

Command Prompt

Saturday May 30, 2015

Slow startup on MacBook Pro running OS X

I am running the latest OS X Yosemite (10.10.3) on my MacBook Pro and have noticed that the startup duration has increased recently. When I restarted my computer today, I timed the startup delay and was surprised to see that it took more than 10 seconds to even show the Apple logo. A quick search on the Internet solved the problem for me; I reset the PRAM and my MacBook was back to its older self again.

Here is how to do it:

  1. Shutdown your Mac
  2. Locate the following keys on the keyboard: Option, Command (⌘), P, and R. You will need to hold these keys down simultaneously in step 4.
  3. Turn on your Mac.
  4. Immediately press and hold the Option-Command-P-R keys. You must press this key combination before the gray screen appears.
  5. Continue holding the keys down until your Mac restarts, and you hear the startup sound for the second time.
  6. Release the keys. 

Update: If you have Trim Enabler to support a third party SSD, you must disable Trim before attempting to reset PRAM; see

Monday May 11, 2015

Rule-based Classification using Oracle Text in WebCenter Content

A major problem facing businesses and institutions today is that of information overload. Sorting out useful documents from documents that are not of interest challenges the ingenuity and resources of both individuals and organizations. Given that WebCenter Content stores all the content for an organization, you would like to classify documents checked into the system.

Oracle Text offers various approaches to document classification. Under rule-based classification, you have a predefined set of categories and you write the classification rules yourself. With supervised classification, Oracle Text creates classification rules based on a set of sample documents that you pre-classify. Finally, with unsupervised classification (also known as clustering), Oracle Text performs all the steps, from writing the classification rules to classifying the documents. WebCenter Content uses Oracle Text as its underlying indexing engine when you use Database FULLTEXT or OracleTextSearch and so we should be able to use the Oracle Text approaches to classification and apply it within Content.

In this post, I will use rule-based classification where we will decide on categories, formulate the rules that define those categories, index the rules and use the MATCHES operator to classify documents.

Rule-based classification is very accurate for small document sets. Results are always based on what you define, because you write the rules which are actually query phrases. However, defining rules can be tedious for large document sets with many categories. As your document set grows, you may need to write correspondingly more rules.

The first step is to really define a list of categories and the corresponding query a document must match to be placed in that category. For the purpose of this example, we will have the following 5 categories. You will notice that the rules are simple phrases delimited by an operand.

Category Rule
Astronomy Jupiter or Earth or star or planet or Orion or Venus or Mercury or Mars or Milky Way or Telescope or astronomer or NASA or astronaut
Paleontology fossils or scientist or paleontologist or dinosaur or Nature
Health stem cells or embryo or health or medical or medicine or World Health Organization or AIDS or HIV or virus or centers for disease control or vaccination
Natural Disasters earthquake or hurricane or tornado
Technology software or computer or Oracle or Apple or Intel or IBM or Microsoft

Next create a new table within WebCenter Content using the Configuration Manager to store the categories and rules.
Create table using Configuration Manager

Create a new view on the table we just created.
Create new View using Configuration Manager

Load the categories and the rules into the table using this view.
List of Categories

Create a new metadata to store the categories. We will auto populate this metadata for a document with the categories that match the document.
Create a new Metadata using Configuration Manager

Enable option lists for the new metadata, select the option list type as Multiselect List and use the view we just created.
Enable Option List for new Metadata

Create a new database index of type CTXSYS.CTXRULE on the rule table.
Create CTXSYS.CTXRULE index in the Database

Create a new database function to return a comma separated list of categories for a document. In my example, I will use the Oracle Text indexes WebCenter Content creates as WebCenter Content is capable of extracting text from a wide variety of content including attachments in emails and files within compressed archives.
Create FUNCTION categorizeDocument in the Database

Run the following script to generate the categories for all documents that were released today. This script will also update the revisions table to mark the document record for update so that the indexer will pick it up the next time it runs.
PL/SQL Code to generate Categories

After running the script, you should see the metadata updated with the categories on the Content Information screen for any document you checked and released today.

NOTE: Please note that these code snippets are examples and should be used for research and demonstration purposes only, as such they are unsupported.

Wednesday Apr 29, 2015

JDeveloper REST Connection for Oracle Documents Cloud

If you have read my earlier post about creating a Data Control for the RESTful services exposed by the Oracle Documents Cloud Service, you may have wondered why I did not use the out of the box Web Service Data Control (SOAP/REST).
Web Service Data Control (SOAP/REST) in Gallery

The reason is that the Web Service Data Control (SOAP/REST) feature that comes bundled with JDeveloper uses a URLConnection to connect to a RESTful Web Service. You will notice that when you try to test a URL Connection to the Documents cloud, it fails with a Authentication is required error message. URLConnection does not work well with the Oracle Documents Cloud yet.
Create URL Connection Dialog

The Mobile Application Framework update to JDeveloper introduces a new REST Connection resource. To install the Mobile Application Framework (MAF), go to Help -> Check for Updates. Click Next and select Mobile Application Framework and then follow the on screen instructions to install it. After JDeveloper restarts, you may see a warning message that MAF requires JDK 1.8 or higher. You can ignore this message for now.

Among other features, MAF installs a REST Connection resource. You can go to File -> New -> From Gallery -> General -> Connections to create a REST Connection.
New REST Connection in Gallery

You will also notice that the URL Connection dialog in the Create Web Service Data Control (REST) has been replaced with the new REST Connection dialog.
Create Web Service Data Control - Create REST Connection

Now when you try to connect to the Oracle Documents Cloud Service using a REST Connection, it connects just fine.
Create REST Connection Dialog

NOTE: You will need an Oracle Documents Cloud Services subscription and account for this example. Please note that these instructions should be used for development and testing purposes only, as such they are unsupported and should not be used on production environments.

Monday Apr 27, 2015

Being RESTful with Oracle Documents Cloud and Oracle ADF

Oracle Documents Cloud Service is the next-gen content collaboration solution built for the enterprise. It allows for anytime access to files from your Apple or Android device and automatically syncs files with your Mac or Windows PC. It provides application integration through multiple ways including embedding its Web UI and a powerful REST API.

In this post, I will demonstrate how to use the REST API to create a Web Application with Oracle ADF. The Web Application will list the files and folders in a base folder specified in a resource bundle file. It will allow a user to navigate inside and out of folder but does not allow file uploads and downloads yet. I will cover these topics in future posts.

This blog post shows you how to create a simple databound application. To see the complete application you will create, download the application here.

STEP 1: Create a new application and project

  1. Open JDeveloper (12.1.3) and from the main menu, select File -> New -> Application.
  2. In the Items list in the New Gallery, select ADF Fusion Web Application and click Ok.
  3. Enter a Application Name, say OracleDocumentsCloudDataControlPart1. Click Next in following screens to select the default values and finally select Finish to create a new application with the Model and ViewController projects.
STEP 2: Add the necessary libraries to the Model project
  1. In the Projects panel within the Applications window, select the Model project, right-click and select Project Properties.
  2. On the Libraries and Classpath page, use the Add Library... button to add the following libraries.
    1. Apache Http Components
    2. JAX-RS Jersey (Bundled)
    3. JAX-RS Jersey 2.x Client
  3. Create a resource bundle file, and add the following entries. []
STEP 3: Create Java classes to interact with Oracle Documents Cloud
  1. Create entity classes to represent items in Documents Cloud. []
  2. Create a service class to submit the RESTful calls. This is the class we will use to create a Data Control. []
STEP 4: Create a Data Control
  1. In the Applications window, right-click and select Create Data Control.
  2. In the Create Bean Data Control dialog, click Next, then Finish to accept the default values.
STEP 5: Create a JSF page and bind an ADF Faces table to the service bean
  1. In the Projects panel within the Applications window, select the ViewController project, right-click and select New > Page. [index1.jspx]
  2. In the Create JSF Page dialog, enter index1.jspx as the file name. On the Page Layout, select Copy Quick Start Layout and then choose the one column one row layout and click Ok. You may also select a layout of your choice.
  3. In the Data Controls panel, expand ItemsDC, expand listItemsInFolder(String) and then expand Parameters.
  4. Click and drag folderid to the center facet on the page in the visual editor. From the Create context menu, select Create -> Text -> ADF Input Text. Change the Visible property of the control to false.
  5. In the Data Controls panel, expand ItemsDC, expand listItemsInFolder(String) and then click and drag Item to the center facet below the ADF Input Text control (invisible). Select Create -> Table/List View -> ADF Table.
  6. In the Create Table dialog, change the Component To Use for all columns to ADF Output Text and click Ok.
  7. Open the Source tab for the index1.jspx file and locate the "#{}" column. Comment the existing code for the ADF Output Text and replace it with a link control. To do this, just expand ItemsDC in the Data Controls panel, click and drag listItemsInFolder(String) to just after the code you just commented. Select Create -> Method -> ADF Link. Drag and drop a setPropertyListener component inside the ADF Link control. Set the attributes as shown below.
  8. Scroll down the Source window and remove the last two columns for file and folder.
STEP 6: Save and run the project
  1. Save all the files.
  2. Set the JVM Argument.
  3. In the Projects panel within the Applications window, select the ViewController project, expand Web Content, right-click index1.jspx and click Run.
NOTE: You will need an Oracle Documents Cloud Services subscription and account for this example. Please note that these code snippets should be used for development and testing purposes only, as such it is unsupported and should not be used on production environments.

Sunday Mar 22, 2015

Drag and drop file upload using HTML5 (YUI3)

I have seen a lot of ADF applications provide drag and drop file upload capabilities. I was wondering if there was an easy way to have this on the Content Server. If you are familiar with the UI components on the Content Server, you will know that it relies a lot on YUI.

In this example, I will use YUI3 Uploader to provide drag and drop multiple file upload capability on the Content Server. I will create a simple HTML file and check it into the Content Server. Accessing it from the content server using will show a form and you will be able to upload files. If you want to have Content Server like pages, you can modify this HTML file to insert IDOC includes and save it as a HCSP file.
Upload Example Screenshot

I have used the example provided by Yahoo "Example: Multiple Files Uploader with POST Variables and Server Data Retrieval" and modified it to upload files to a Content Server.

First and foremost, you will require the following lines to include YUI3 libraries and stylesheets.
JavaScript and Stylesheet Includes

Second, create a form to capture some metadata. In this example, we will apply these metadata values to all files being uploaded together. You can also move this form to the uploader table to set metadata at the file level.
Metadata Input Form

Third, load the Uploader and the JSON libraries. Also, the Content Server expects the file bytes to be uploaded using the primaryFile field name.
Load YUI Libraries and create Instance

Fourth, set the POST variables or the metadata to be assigned to the files. In this example, we will use the same values for all files. You can have different metadata for individual files too.
Set Metadata as POST Variables

Fifth and finally, once the checkin is complete, we need to parse the JSON data and then display the Content ID.
Process Data returned from the Content Server

You can download the HTML (file_upload.htm) here.


  • According to the announcement here, Yahoo has stopped development on YUI. However, you should be able to use the concepts used here with other frameworks.
  • If your browser does not support HTML 5, for example IE <= 9, you will need to use the flash component which requires additional configuration not discussed here.
  • This uploader is not supported on iOS devices.

Saturday Mar 21, 2015

WebCenter Content in the Enterprise

I stumbled upon this diagram I created some time back showing the different WebCenter Content modules and how they fit into the enterprise. Since then, the product branding has changed, so made some updates and posted it here.

For the sake of simplicity, only Oracle WebCenter Content products are shown here. Oracle Forms Recognition is not part of the suite but is shown for completeness. There are out-of-the-box integrations/solutions with other Oracle Fusion Middleware products like WebCenter Portal and SOA/BPM Suite which are not shown here.

Saturday Mar 07, 2015

RIDC using Oracle Java Stored Procedures

Have you faced a situation where you have a database table filled with content in a BLOB column and you want to migrate them into the Oracle Content Server. If you have and you want to write a PL/SQL procedure to loop through the records and check-in the content directly into the Content Server, you can use the Oracle JVM that is configured with an Oracle Database. Then you can load your RIDC libraries and your RIDC code into the database as schema objects and then write a Java Stored Procedure.

In this example, I will explain how use a table with content in a BLOB column and check them into the Content Server. We will use two approaches, one to save the file to the disk and then checkin, and the other to keep the file in memory and checkin. Note that the in memory solution should not be used with large files.

The first step is to check if your Oracle Database has Oracle JVM enabled. Usually, it is enabled by default, otherwise, you can find instructions to enable it here.

The second step is to grant certain permissions to the schema user. In this example, I have created a new user, TEST.

EXEC DBMS_JAVA.GRANT_PERMISSION('TEST', '', '*', 'connect, resolve');
EXEC DBMS_JAVA.GRANT_PERMISSION('TEST', '', '/tmp/file1.txt', 'read, write');

The third step and the most complicated one is to load all the required Java libraries and dependencies as database objects. This will include all the jar files that are in the RIDC library as well as the jars that contain all the classes referenced by the RIDC jars. You can download the RIDC library here. The dependency list is extensive and can be a nightmare to build; but Oracle does provide a tool to make things a bit easier.

The ojvmtc tool enables you to resolve all external references, prior to running the loadjava tool. The ojvmtc tool allows the specification of a classpath that specifies the JARs, classes, or directories to be used to resolve class references. When an external reference cannot be resolved, this tool either produces a list of unresolved references or generated stub classes to allow resolution of the references, depending on the options specified. Generated stub classes throw a java.lang.ClassNotfoundException, if it is referenced at runtime.

Please note that you will need to resolve all the dependencies for the entire modules to work. However, for this article we do not need to resolve all dependencies.

The following command will check for references and will generate stub classes for the classes it did not find. I downloaded and placed the RIDC and other jars in the "jars" directory under my home directory.

<dbhome>/bin/ojvmtc -list ~/jars/oracle.ucm.ridc-11.1.1.jar -classpath ~/jars/*.jar -jar dummy.jar -bootclasspath <dbhome>/jdk/jre/lib/rt.jar:<dbhome>/jdk/jre/lib/jce.jar:<dbhome>/jdk/jre/lib/jsse.jar

Now we are ready to load all these libraries into our schema. Run the following command to load all the jar files.

<dbhome>/bin/loadjava -verbose -resolve -user test/<passwd> ~/jars/*.jar

The fourth step is to write your Java class, compile and load it into your database schema. I will use the two methods below to checkin content.

// This method will take the file path and checkin the file
public static String checkinFile(String fPath) {
String dDocName = "";
try {
manager = new IdcClientManager();
client = (IdcClient<IdcClientConfig, Protocol, Connection>) manager.createClient("idc://");

IdcContext userContext = new IdcContext("sysadmin");
DataBinder binder = client.createBinder();
binder.putLocal("IdcService", "CHECKIN_NEW");
binder.putLocal("dDocTitle", "Test File - ABC000001");
binder.putLocal("dDocType", "Document");
binder.putLocal("dSecurityGroup", "Public");
binder.putLocal("dDocAccount", "");
binder.addFile("primaryFile", new TransferFile(new File(fPath)));
ServiceResponse response = client.sendRequest(userContext, binder);
DataBinder responsebinder = response.getResponseAsBinder();
dDocName = responsebinder.getLocal("dDocName");
client = null;
manager = null;
} catch (Exception e) {
// Nothing to do
dDocName = e.getLocalizedMessage();
return dDocName;
// This method will take a BLOB field and checkin in memory
public static String checkinBlob(BLOB bFile, String filename) {
String dDocName = "";
try {
manager = new IdcClientManager();
client = (IdcClient<IdcClientConfig, Protocol, Connection>) manager.createClient("idc://");

// Read the BLOB and create a Input Stream
// Make sure that the files are small as we are using in memory
byte[] filearray = bFile.getBytes(1, (int) bFile.length());
ByteArrayInputStream stream = new ByteArrayInputStream(filearray);

IdcContext userContext = new IdcContext("sysadmin");
DataBinder binder = client.createBinder();
binder.putLocal("IdcService", "CHECKIN_NEW");
binder.putLocal("dDocTitle", "Test File - ABC000002");
binder.putLocal("dDocType", "Document");
binder.putLocal("dSecurityGroup", "Public");
binder.putLocal("dDocAccount", "");
binder.addFile("primaryFile", new TransferFile(stream, filename, bFile.length()));
ServiceResponse response = client.sendRequest(userContext, binder);
DataBinder responsebinder = response.getResponseAsBinder();
dDocName = responsebinder.getLocal("dDocName");
client = null;
manager = null;
} catch (Exception e) {
// Nothing to do
dDocName = e.getLocalizedMessage();

return dDocName;

Run the following command to load the class file.

<dbhome>/bin/loadjava -verbose -f -resolve -user test/<passwd> ~/jars/CheckinFileIntoContentServer.class

Oracle DB Commands

The fifth step is to create PL/SQL functions that use the Java methods from the class we just loaded.

FUNCTION test.checkinFile(fPath IN VARCHAR2)
    NAME ' return java.lang.String';

FUNCTION test.checkinBlob(bFile IN BLOB, filename IN VARCHAR2)
    NAME ', java.lang.String) return java.lang.String';

The sixth step is to create and insert two rows with content into the table.

CREATE TABLE TEST.blob_table (
  filename VARCHAR2(255) NOT NULL,
  filedata BLOB

The seventh and the final step is to loop through the table and checkin the files.

  -- Save the file to a temporary location
  -- and checkin the file
  SELECT filename,
    INTO filename,
    FROM blob_table
   WHERE fileid = 1;
  lbloblen := DBMS_LOB.getlength(vblob);
  lfile := UTL_FILE.FOPEN('TEMP_DIR', 'file1.txt', 'w', 32767);
  WHILE lpos < lbloblen LOOP
    DBMS_LOB.READ(vblob, lamount, lpos, lbuffer);
    UTL_FILE.PUT_RAW(lfile, lbuffer, TRUE);
    lpos := lpos + lamount;
  DBMS_OUTPUT.PUT_LINE ('dDocname: ' || CHECKINFILE('/tmp/' || filename));

  -- IN MEMORY file checkin
  SELECT filename,
    INTO filename,
    FROM blob_table
   WHERE fileid = 2;
   DBMS_OUTPUT.PUT_LINE ('dDocname: ' || CHECKINBLOB(vblob, filename));

After the PL/SQL is executed, you should see two files in your Content Server with metadata that was coded in the Java class.

You can download the source files below:

NOTE: Please note that these code snippets should be used for development and testing purposes only, as such it is unsupported and should not be used on production environments.

Sunday Feb 08, 2015

RIDC using Jython Scripts

Jython is an implementation of Python for the JVM. Jython takes the Python programming language syntax and enables it to run on the Java platform. This allows seamless integration with the use of Java libraries and other Java-based applications. Plus it helps to have a loosely typed interpreted language as it makes writing code much faster.

I have written a set of scripts to execute some core Content Server services to check-in, update, delete content items and to browse, create, delete, link items using FrameworkFolders. You can download the scripts here.

Checkin new Content and a Revision
Update Metadata
Delete a single revision and all revisions
FrameworkFolders: Create Folder
FrameworkFolders: Create Shortcuts
FrameworkFolders: Browse Folders
FrameworkFolders: Copy Items
FrameworkFolders: Move Items
FrameworkFolders: Delete Items
FrameworkFolders: Propagate Metadata
FrameworkFolders: Remove (unfile) content from a folder

NOTE: Please note that these code snippets should be used for development and testing purposes only, as such it is unsupported and should not be used on production environments.

Tuesday Feb 03, 2015

Using Access Control Lists in WebCenter Content

WebCenter Content offers a comprehensive security model using its traditional Security Groups and Account metadata fields. Each content item is assigned to a security group, and if accounts are enabled then content items can also be assigned to an account. Users are assigned a certain level of permission (Read, Write, Delete, or Admin) for each security group and account, which enables them to work with a content item only to the extent that they have permissions to the item's security group and account.

At times, these constructs do not meet the requirements and you have to look at additional security options available within the Content Server. I prefer to choose one or more options in the order listed below. In my opinion, as you start moving down the list, the computational overheard on the Content Server increases (User ACL puts the most overhead).
  1. Security Groups and Roles
  2. Accounts
  3. Supplemental Markings (Records Management)
  4. NeedToKnow Component
  5. Role ACL
  6. Group ACL
  7. Oracle Entitlement Server
  8. User ACL
Follow the instructions below to setup Access Control Lists on your Content Server and configure them.
  1. Login to the Content Server as an Administrator.
  2. Navigate to the Administration -> Admin Server -> General Configuration page.
  3. Under the Additional Configuration Variables section, add the following lines. You can also add the lines directly to the <INSTANCE_HOME>/cs/config/config.cfg file.
    SpecialAuthGroups=<comma separated list of security groups>
    # ZonedSecurityFields=xClbraUserList,xClbraAliasList,xClbraRoleList
    # AccessListPrivilegesGrantedWhenEmpty=true
  4. Restart the Content Server.
  5. Login to the Content Server as an Administrator.
  6. Navigate to the Administration -> Admin Applets -> User Admin applet.
  7. Go to the Aliases tab, and add aliases for the groups that you want to list in the Group Access List metadata. Note that the Group Access List metadata is really a Alias Access List and does NOT correspond to a LDAP group but a Content Server internal Alias.
  8. If you want to use LDAP groups, for your ACLs, you will need to enable the RoleEntityACL component. This component is already installed but needs to be enabled. Restart the Content Server after this change.
  9. Navigate to the Administration -> Admin Applets -> Configuration Manager applet.
  10. Go to the Views tab and locate the ExternalRolesView view. Add the LDAP groups that you want to use for the Role ACL to this list.
NOTE: The User Access List type-ahead field will only display users that have logged into the Content Server at least once. The Group Access List type-ahead field will only display Aliases defined in the Content Server. The Role Access List type-ahead field will only display groups defined in the ExternalRolesView view. You will need to make sure that a corresponding group with the same name exists in LDAP.

Monday Oct 13, 2014

How to: Using the ComponentTool utility to manage Content Server components

I have been asked multiple times, primarily by people who want to implement some sort of a MWaaS for WebCenter Components, how to install and/or enable WebCenter Content Components using a script.

One of the tools you can use to script this activity is the ComponentTool utility, which is installed by default. The executable is located in the <domainhome>/ucm/cs/bin/ directory. The ComponentTool component enables administrators to use a command line to install, enable, and disable components.

I have listed the options and commands available with the ComponentTool utility in the table below:

Activity Command
Enable a Component ComponentTool [-v|-vv] [-t trace_section ] --enable <component_name>

For example,
   <DomainHome>/ucm/cs/bin/ComponentTool -vv --enable ContentFolios
Disable a Component ComponentTool [-v|-vv] [-t trace_section ] --disable <component_name>

For example,
   <DomainHome>/ucm/cs/bin/ComponentTool -v --disable ContentFolios
List Components ComponentTool [-v|-vv] [-t trace_section ] --list-enabled|--list-disabled|--list
Install a New Component ComponentTool [-v|-vv] [-t trace_section ] --install <component_name>.hda|<component_name>.zip [ --preferences <component_name_prefs>.hda ]

For example,
   <DomainHome>/ucm/cs/bin/ComponentTool -vv --install /tmp/
Help ComponentTool [-v|-vv] [-t trace_section ] --help

Thursday Jul 03, 2014

iOS app for WebCenter Content

I have the habit of browsing through the Apple AppStore on my iPhone to discover new apps and give them a try. I usually look for new games but today I thought I will try the app for WebCenter Content. Finding the app was straight forward; I just needed to search for WebCenter Content and a few apps popped up. The first one from Oracle is what I was looking for.

I open the app to get a login screen. It requires a username, password and the URL of the content server you want to connect to. I used the URL in the format http[s]://hostname[:port]/cs/idcplg and soon enough was connected to it.

The app itself is fairly simple, with basic functions for searching (includes full-text), browsing and viewing documents with native device support. I have compiled a few screenshots of the app.

[Read More]

Monday Jun 16, 2014

How to: Skip the WebCenter Content Post-Installation Configuration page

Ever wondered how to perform the Content Post-Installation Configuration silently. I am referring to the additional configuration step just after completing the WebLogic domain configuration. When you start the Content managed server for the first time, you are required to specify the instance location and several other parameters. After entering these values, the managed servers needs to be restarted.

Post Installation Configuration Page for Content Server

What if there was a way you could start the managed server for the first time and begin using the application? Well there is; just follow the instructions below:

  1. After you have created the domain configuration, with one content managed server in my case, do not start the Content managed server yet.
  2. Create a new file, <DOMAIN_HOME>/ucm/cs/bin/autoinstall.cfg. This is the file that gets created once you submit the Post-Installation Configuration page.
  3. This file contains the configuration entries that you enter on the post install page for your instance. Edit the autoinstall.cfg file to add the following mandatory entries:
    • IDC_Name=<name>
    • IDC_ID=<id>
    • AutoInstallComplete=true
  4. Edit the autoinstall.cfg file to append one or more entries to configure your instance.
    • IntradocDir=<path>
    • VaultDir=<path>/vault
    • WeblayoutDir=<path>/weblayout
  5. Start the Content managed server now and log in.

Refer to the IDOC Script Reference Guide for information on these parameters and to discover other parameters that you can use.

NOTE: Please note that these instructions should be used for development and testing purposes only.

Monday Jun 09, 2014

FrameworkFolders support for WebCenter Portal

Oracle WebCenter Content Server includes components that provide a hierarchical folder interface, similar to a conventional file system, for organizing and managing some or all of the content in the repository. We used Contribution Folders (folders_g) which is being replaced by the new Folders (FrameworkFolders) component. The newer FrameworkFolders component fixes a number of limitations that folders_g had and adds a ton of new features. If you have played with the WebCenter Content mobile app, you will notice that it uses FrameworkFolders too.

WebCenter Portal requires the use of the folders_g component. Given the fact that folders_g and FrameworkFolders component do not go well together and must never be enabled together on any system, you could never use the new features if you planned to use integrate Content with Portal. I still remember presenting a demo with a colleague for a client and he was showing off the mobile capabilities in Portal (which are pretty impressive by the way) and was getting all the glory; while I was sitting back wanting to show off the Content app but could not (no FrameworkFolders).

Not any more; Oracle has released bundle patches for both WebCenter Content and Portal in April 2014 which bring home the support for FrameworkFolders. These patches will bring these products to version

You can enable support for FrameworkFolders on new Content and Portal installations where the folders_g component has never been enabled using the following patches:

  • Download and apply the WebCenter Content MLR05 patch 18448219.
  • Download and apply the WebCenter Portal BP3 patch 18085041.
  • Download and apply the WebCenterConfigure component patch 18387955. Before applying this patch on the Content Server ensure that WebCenter Content MLR03 patch 18448219 has already been applied.

You can find detailed instructions on how to enable FrameworkFolders support in the Oracle® Fusion Middleware Installation Guide for Oracle WebCenter Portal 11g Release 1 (

There may be another bundle patches release (version for many FMW products (including WebCenter Portal) in July 2014 which could further enhance the FrameworkFolders support.

Saturday Jun 07, 2014

A strong component keeps everything together

Most of the times you implement a WebCenter Content based system, you require some sort of customization. Sometimes these customizations need a Java class or two, or libraries (for example, the JavaMail API), or Database Objects (like new tables, views, indexes, etc).

I have seen that libraries and Database Objects are usually put in place using manual steps. This means that the library jar files are copied to one of the common classes directory (set in the Content CLASSPATH variable) and/or the database scripts are executed manually. I have also seen people place the custom Java classes in the common classes directory.

While this may seem like an easy solution, think about a scenario where you need to disable or uninstall the component or if you have to upgrade or migrate the system. You have to keep these manual steps documented and execute them every time you encounter the above scenarios. It is very common that some of these manual steps are missed when you have multiple teams and people working on the system.

Here are a few points to ponder upon:

  • Place all your custom Java classes within your component. Create a new directory, say ${COMPONENT_DIR}/classes, and place your code there. You can choose to bundle all your classes into a jar or you can place the entire class directory structure. Add a path entry to the Build Settings so that it is bundled with the component when you build it. You also need to update the Custom Class Path and the Custom Class Path Load Order under the Advanced Build Settings. This will ensure that the system CLASSPATH is updated to add this new directory.
  • Create a new component for any new library that you want to add. Add the appropriate path entries to the Build Settings so that it is bundled with the component when you build it. You also need to update the Custom Class Path, Custom Class Path Load Order and/or the Custom Library Path under the Advanced Build Settings. Enter a comma separated list of features that this component will provide. When you create other components that will use the features exposed by this component, make sure that you specify a dependency to this library component by specifying the comma separated list of features in the Advanced Build Settings.
  • The component wizard allows you to create custom install/uninstall Java code. The wizard will create a install filter class when you check the “Has Install” checkbox on the “Install/Uninstall Settings” tab. Consider using this filter class to create database objects when you install the component and drop the objects when you uninstall the component. If you do a lot of custom component development, consider creating a install/uninstall Java class, which can execute queries defined within the component.

To sum up, whenever you write a new custom component, make sure that you bundle everything within the component.

Wednesday May 21, 2014

WebCenter Portal .8: Extending portal functionality with ADF Taskflows

This post describes how to extend your portal application functionality using ADF Taskflow.[Read More]

Tuesday May 13, 2014

How to: Create a Custom Component to build a new Content Server page and modify the System Menu

The Oracle Content Server provides a framework to create and/or modify functionality through components. Almost everything within the Content Server can be customized using components right from the user interfaces like the checkin screens, to the core content server functionality (involves Java programming).

The best way to create and modify components is to use the Component Wizard utility which is shipped along with the content server. The Component Wizard provides all the tools and resources required to create components as well as bundle them for deployment to different content servers. You may also use Mozilla Firefox with the Web Developer extension, for creating/modifying user interfaces as it is a wonderful tool to check your JavaScripts and CSS. Although, components can be created without the Wizard, I would highly recommend it as it makes the life of the developer easy.

In this post, I will demonstrate how to add a new Navigation Menu item to the content server. The new menu item will display a new content server page that will execute a service to run a query to fetch the list of content types available within the Content Server. After creating and installing the custom component, the Content Server will show additional menus for the new page created (as shown in the screenshot below).

Create a Resource - HTML Include/String to add the new Menu Item

  1. Start the Component Wizard. On the Component List dialog, click on the Add... button.

  2. Name the new component as SampleComponent01 and keep the rest of the values as is.

  3. Click Ok to create the component and open it up in the Component Wizard.
  4. Add a new resource to add the new menu item. Under the Resource Definition tab, click on the Add... button.
  5. In the Add resource dialog, select the Resource - HTML Include/String Type. Accept the defaults for all the other fields.

  6. Click Next.
  7. In the Add HTML Resource Include/String dialog, create a Data Include. This is the new way to edit navigation items in 11g. Please note that prior to 11g, the NavBuilder JavaScript API was used to tweak the navigation items which is now deprecated in 11g. The new method takes advantage of a new data table construct in 11g Idoc Script called Dynamic Data Tables. These allow you to create tables of data in Idoc Script and dynamically change them as opposed to the static table definitions. This is useful for data that changes frequently and may be user specific like the navigation menu.
  8. Select the Data Include checkbox.
  9. Click Finish.
  10. This will create the resource file and will open it up in the Text Editor for editing.
  11. Enter the following code and save the file. The file will look like the image below. Alternatively, you can also use the wizard to create these data includes. The section on the right hand side allows you to create these includes. I prefer the Text Editor method as it is faster.
  12. To view the results, enable the component and restart the Content Server. Go to Options -> Enable and restart the Content Server.
  13. Log in to the Content Server to view the changes.

Create a Query to fetch the list of Content Types

  1. Return to the Component Wizard.
  2. Under the Resource Definition tab, click on the Add... button.
  3. In the Add resource dialog, select the Query Type. Accept the defaults for all the other fields.
  4. Click Next.
  5. In the Add Query Table Information click Next.
  6. In the Add Query dialog, enter the Name and the Query. Here you can also specify parameters for the query just like you would create a PreparedStatement in Java. The query should have "?" for the parameters. Specify the parameters in the Parameters section below. The sequence of the parameters is defined by the order in the Parameters list.
  7. Click Finish.
  8. You can add more queries to the file by directly editing the file or using the wizard options on the right hand side.

Create a Template to display the Resultset

  1. In the Component Wizard, create a template. A template is nothing but a page that will display the final results of a service call. We will create the template before we create the service.
  2. Before starting with the template, we need to layout the page. What we are trying to do here is display the content types as a table. Since we will be executing a query, we need a resultset to loop through the results. Let us say that the resultset name is SC01DOCTYPES for now.
  3. Under the Resource Definition tab, click on the Add... button.
  4. In the Add resource dialog, select the Template Type. Accept the defaults for all the other fields.
  5. In the Add Template Table Information dialog, keep the default details as is and click Next.

  6. In the Add IntradocTemplate dialog, enter the details as given below:
  7. Click Finish.
  8. Click on the Launch Editor... button on the right hand side to open up the newly created template and make the changes shown below.
  9. Save the File and close the external editor. Note that we are looping through the resultset name that we had decided earlier.

Create a Service to execute the query and populate the Resultset

  1. In the Component Wizard, create a new service. This service will execute the query created above and will redirect the results to the new template. The results of the query will be populated into a RESULTSET named above, that is SC01DOCTYPES.
  2. Under the Resource Definition tab, click on the Add... button.
  3. In the Add resource dialog, select the Service Type. Accept the defaults for all the other fields.
  4. In the Add Service Table Information dialog, keep the default data and click Next.
  5. In the Add Service dialog, enter the details as shown below.
  6. In the Actions section, click on the Add... button and fill in the details as shown below. Note that the parameter field has the Resultset name. This will allow the service to populate the query results into a resultset with this name.
  7. Click Ok and Ok again to create the Service.
  8. Restart the Content Server.

Use existing HTML includes to build a standard Content Server page

  1. Return to the Component Wizard and select the template from the Resource Definition list.
  2. Select the SC01_CONTENT_TYPES template from the right hand side box and click on the Launch editor... button at the bottom.
  3. This opens up the template in the text editor. Update the code to include the the following.
  4. What we have done here is include a set to predefined system includes that are used to build any content server page.
  5. Restart the content server.
  6. Log in to the Content Server to view the component in action. Just use the link, http://localhost:16200/cs/idcplg?IdcService=SC01_GET_DOCTYPES(make sure that you replace localhost:16200 with the hostname and port of your instance) and view the page to see the results.

Wednesday May 07, 2014

How to: Run Repository Creation Utility (RCU) on Solaris

Many of the Oracle Fusion Middleware components require the existence of schemas in a database prior to installation. These schemas are created and loaded in the database using the Repository Creation Utility (RCU). Repository Creation Utility is a graphical and CLI-based tool used to create and manage Oracle Fusion Middleware database schemas.

At this time, RCU is available for Windows and Linux platforms only.

If you want to run RCU on Solaris, edit the RCU executable, <RCU_HOME>/bin/rcu, and make the following changes:
  • Look for the “#Platform Checking” section, and comment out the "exit" statement
  • Look for the line which specifies the JRE_DIR and update it to point to a Solaris JRE or JDK
After making these changes, set the SQLPLUS_HOME variable to point to any ORACLE_HOME and export it before running RCU.

Now you will be able to run RCU on Solaris and create the database objects for Oracle Fusion Middleware.

NOTE: Please note that these instructions should be used for development and testing purposes only, as such it is unsupported and should not be used on production environments.

Tuesday May 06, 2014

Timeout error starting OHS with OAM WebGates on Oracle Solaris (SPARC)

Oracle Access Manager provides single sign-on (SSO), authentication, authorization, and other services to registered agents (in any combination) protecting WebCenter resources. A Web server, Application Server, or any third-party application must be protected by a WebGate or mod_osso instance that is registered with Oracle Access Manager as an agent to enforce policies. The agent acts as a filter for HTTP requests.

This document relates to the following versions of the products:

  • Oracle Web Tier Utilities:
  • OAM WebGates for OHS:

When you try to install and configure Oracle Web Tier Utilities with Oracle OAM WebGates for OHS on Oracle SuperCluster (or Solaris SPARC), the installation and initial configuration may go fine in the beginning. However, once you start putting in your directives for OAM protected resources, you may notice that the OHS component does not start up as it used to.

The opmnctl startall and opmnctl stopall commands take longer than usual with the following error messages. You may also notice that the OHS and OPMN log files do not contain much information.

  user1@hostname1:~$ /u01/oracle/ohs_inst/ohs_server02/bin/opmnctl startall

  opmnctl startall: starting opmn and all managed processes...


  opmn id=hostname1:6701

  Response: 0 of 1 processes started.

  ias-instance id=ohs_server02






  --> Process (index=1,uid=118965811,pid=13118)

  time out while waiting for a managed process to start



The culprit is the webgate.conf include in the httpd.conf file and removing it will resolve the issue. However, now you cannot use OAM for SSO.

You may want to try out the steps in MOS Note 1614464.1 to edit the file; but this may not resolve the issue. I was able to start the OHS server after modifying the file, but got a blank (empty) response when I tried to access the application URLs. I would suggest that you read through the rest of the blog and try the solution below.

The fix to this problem is to add the following entry, where IP_Address is the IP address of the local machine, in /etc/hosts on which Oracle HTTP Server is being installed:

IP_ADDRESS stafas12

Yes, you need to put in this value which may be entirely unrelated to you network configuration into the /etc/hosts file to fix the issue.

You can refer to page 57 in the Oracle Fusion Application Release Notes 11.1.7 in MOS Note 1582125.1 for more details. This document also contains the list of other known issues and their resolutions.


Welcome to my blog. I use this site to share my experience as well as tips and tricks on Oracle Fusion Middleware products.



« August 2015