There are several ways available to integrate content from UCM in Web Applications. The best known one is probably through the WebCenter Document Services (taskflows that can directly be embedded in ADF weg pages), using the Content Repository connection and Data Control. This approach requires a WebCenter License. Another ways is purely programmatic, through the RIDC API. This way is demonstrated by Andrejus in his article http://andrejusb.blogspot.com/2010/12/oracle-ucm-11g-remote-intradoc-client.html. The RIDC way requires a little more work to integrate into the web application. The RIDC API is also available through web services.
Another way that is based on the Open WCM tags makes it very to integrate content in web pages – an not just the content itself: also the functionality to edit the content from within the context of the run-time web pages.
This article describes how to use the Open WCM tags to embed resources that are maintained in the UCM Content Server in ADF Faces applications.
Environment
The environment in which these steps are carries out consists of a server with WebLogic 11gR1 PS3 and UCM 11g R1 PS3 Content Server. SiteStudio is installed and enabled on the Content Server. Note: this entails a number of specific steps (outlined in http://download.oracle.com/docs/cd/E14571_01/doc.1111/e14495/configucm.htm#CIAHGGHE).
JDeveloper 11gR1 PS3 is used, with the Site Studio, RIDC and WCM extensions added to the base installation.
Note: these extensions are shipped as part of the UCM 11g product:
[Middleware_11gR1PS3_HOME]\Oracle_ECM1\ucm\Distribution\SiteStudioExternalApplications\jdev
Note: WebCenter extensions are not required!
Create and Configure Application with OpenWCM inside
Open JDeveloper. Create a new application, just a Generic Application.
Name the application ContentRichApp.
Create a project with the same name. Choose Site Studio Technology for the project:
Also select ADF Faces as a Project Technology.
Click Finish to complete the wizard. You may want to inspect the files and folder structure that are created upon initialization of the project. An important file is wcm-config.xml that will hold some essential configuration around OpenWCM and SiteStudio Contributor.
Next, create a SiteStudio Connection to the UCM Content Server.
Configure the connection:
When the wizard is closed, right click the new connection and add it to the project:
The next step is to configure the Site that provides the overall container for the content management aspects of this ADF application. Open the wcm-config.xml file:
The Content Server Connection should be displayed:
Click on the green plus icon to create a new site. I have named it ContentRichApp:
Press the OK button.
Next, we need to configure the security settings we need to contact the Content Server at run time. Open the weblogic.xml file:
Then create a new Security Role Assignment for the Role WCMContributor. Assign it to a principle (a user) that matches a principle that exists in your content server. For example weblogic, the administrator of the WLS server running the Content Server.
Developing the Web Page with embedded content
With all configuration done, it is time to create a page in our application. From the New Gallery, create a new JSF (jspx) page:
Note: when we make use of SiteStudio templates, we would probably also Register our page as a Site File. More on that in a later article.
We have several WCM tags at our disposal (see http://download.oracle.com/docs/cd/E14571_01/doc.1111/e13650/ssxa_taglibs.htm#BABHHCEI).
These tags can retrieve (meta)data on content resources as well as embed the resources themselves in our web page. The placeholder tag can be used to not only add the content inline but also provide ‘design time at run time’ facilities that allow inline editing of the content resources or replacement of resources. This allows content editors to edit the content of the application at run time, in the context of the application.
Let’s start with a brief snippet, that retrieves meta data on a content item whose content id was determined through the Content Server web interface. This meta-data is stored in the requestScope and subsequently referenced in the EL expression used for the source attribute of an ADF Faces image component.
<wcm:url type="resource" url="XPVMLOCAL16200000031" var="url"/> <af:image source="/#{requestScope.url}" id="i1" />
Note the slash in the source attribute.
Note that the wcm namespace needs to be declared in the JSPX page:
xmlns:wcm="http://www.oracle.com/jsp/wcm"
This is step one – that brings content server resources into the ADF application. Without programming – and without having to bring WebCenter into the mix.
However, things can get much more interesting when the SiteStudio Contributor is leveraged as well. Through the contributor, resources can be manipulated and edited, inline from within the application. The placeholder tag provides a good way to enlist the contributor.
For example:
<af:panelBox id="pb3" text="News Flash" > <wcm:placeholder actions="EPRISUTMN" name="News of the day"/> </af:panelBox>
Initially, there is no News Flash content.
However, when the page runs and is brought into contributor mode – using CTRL+Shift+F5 – the Site Studio Contributor opens and allows editing of the content items in the page:
Login as weblogic or another user on the Content Server.
The page reappears, in Site Studio Contribution mode. Every placeholder element with the appropriate actions configuration is available for editing.
In future articles we take a closer look at the contribution mode and what we can do in it. We will also see how content resources that are MS Office Documents can be displayed inline (very cool). Additional examples of the integration of content and wcm-tags in ADF Faces will be discussed.
Resources
Demo application ContentRichApp: ContentRichApp.zip.
Installing and Configuring Site Studio on Oracle Content Server (Fusion Middleware Installation Guide for Oracle Enterprise Content Management Suite 11g Release 1 (11.1.1))
http://download.oracle.com/docs/cd/E14571_01/doc.1111/e14495/configucm.htm#CIAHGGHE
SiteStudio Tag Library – http://download.oracle.com/docs/cd/E14571_01/doc.1111/e13650/ssxa_taglibs.htm#BABHHCEI
Tutorial for Building SiteStudio Web Site – http://download.oracle.com/docs/cd/E14571_01/doc.1111/e13650/ssxa_creatingsites.htm#sthref489
Hello Lucas,
The article is good and insteresting too. I’m writing to you, because I want to upload files from ADF Faces to UCM in a BPM Project. I don’t know if exists WCM-tags in ADF Faces to do it. Could you tell me if it possible to upload files from ADF Faces to UCM using WCM-tags?. If not possible, Could I use RIDC API?. We don´t have Web Center installed.
Greetings.
Hi Adam,
Â
I do not know about anyone who made that work. I am sorry.
Â
Lucas
This post got me up and running pretty quickly. I am now trying to accomplish the same result in JDeveloper 11gR2. I know the plugins are not supported, but I have migrated all the appropriate configuration and deployed the required shared libraries. But it is throwing a FileNotFoundException every time it tries to pull content from content server. The file it is trying to ‘open’ appears to be the deployment directory in weblogic for the application. It is very strange. Do you know of anyone who has gotten this to work?
Thanks,
Adam
Great post! But I have a problem when I enter in contribution mode (ctrl+shift+f5). After login in I receive an error “Cannot find faces context” and I have to add “faces” to the url mannualy.
Lucas I can’t figure about UCM content server but ur post has given me a peek insight into the nitty-gritty of it Thanks for sharing