Integrating Oracle WebCenter Content Images into Portal

Prerequisites: Oracle WebCenter Content, UCM, WebCenter Portal, RIDC

When we do large portal site development, we usually store enterprise content and images in content repository. Content repository offers library services, content oracle_wc2check-in / out and versioning, etc., which allows content more manageable and traceable.

A common use case is to present images that store in content repository in portal page directly. Let’s see how we do this under Oracle WebCenter Content and Portal environment.

The idea is to build up a HashMap which holds key-value pairs docName-docURL. When portal page renders, it references to the specific docName key defined in the image tag and loads the image based on the value of docURL from content repository. The HashMap is prepared based on a pre-set properties file which holds image element display name and docName pairs. The properties file is pre-loaded, during the loading, the application retrieves docURL from content repository based on docName, and loads docName-docURL pair into the HashMap mentioned.

First, build a ContentMetadata class which holds the attributes for a content piece defined in WebCenter Content;
Second, build up a UCMContentBundle using HashMap. If the specific key is not available in the HashMap, then load it from WebCenter Content using RIDC API;
Third, load docURL from WebCenter Content through RIDC DOC_INFO_BY_NAME service.

Below is code snippets for your reference: