WebCenter Content a.k.a UCM integration with WebCenter portal via Content Presenter Task flow and WebCenter Site studio

Posted: August 29, 2014 in ADF, WebCenter 11g
Tags: , , , , ,

What is WebCenter Content Presenter task Flow?

The WebCenter Portal Architecture as recommended by Oracle leverages WebCenter Content to maintain, publish and manage content.  The Content Presenter task flow provided by Oracle, allows you to select an Oracle Site Studio file, a single item of content, multiple content items, query for content, or select content based on the results of a WebCenter Personalization Conductor scenario, and then select a template to render the content on a page in a WebCenter Spaces application.

Using WebCenter Content Site Studio is one of many ways to integrate content in portal (Others being Content Data Controls, REST APIs, Document Services).This document explains the basics and delves into a Proof of Concept for the same. Oracle recommends that you use Content Presenter ADF templates to integrate Site Studio and WebCenter Portal instead of Site Studio region templates.

Over all process for this POC contains below steps:

WebCenter Content/UCM Set up for site studio

 

There are certain steps required in WebCenter Content to enable site studio integration

  • Below Components MUST be enabled in WebCenter Content for site studio to work in line with portal.
  • Folders_g
  • DBSearchContainsOpSupport
    DynamicConverter
  • WebCenterConfigure
  • LinkManager
  • Site Studio components (Site Studio, Site Studio External Applications)
  • WebCenterConversions component

 

Please read here on how to enable these components

http://docs.oracle.com/cd/E17904_01/doc.1111/e10792/c04_components.htm#CSMSP748

 

  • Creating Connection in JDEV:

Create the connection in JDEV as below. Use RIDC socket, and make sure Identity Propagation is enabled. RIDC port by default is 4444.

my content server connection

 

Installing Site Studio for Creating Site Studio Regions

Log in with the administrator, go to My Content Presenter and click on My Downloads. Click on the Site Studio link and install it.

If you get something like: The application has failed to start because the side-by-side configuration is incorrect. Please see the application event log for more details.

 

Please download and install Microsoft Visual C++ 2008 SP1 Redistributable Package (x86 or 64 depending upon the processor architecture (you can check in My Computer properties)

Now when you launch the Studio, on your local create the connection to site studio
Press the New button to open the New Connection popup:

NEW SS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Specify the server CGI URL. If you have installed UCM locally, the URL should be something like this: http://mycontentserver:port/cs/idcplg. The port is the port at which your content server runs e.g 16200

Create a new site to store all Portal material so press New next to the Site Label dropdown list.
E.g. for Employee write Employee.

 

Step 1 Create Site Studio region

 Create Elements

 

A region in site studio could have many types of elements depending upon content e.g. a News Item could  have a Title, Description, Text, Image etc.

Launch the site studio from the windows.

In the site that you create (e.g Employee) Select the Element Definitions  à New

Here we have different types of elements.

For this POC we will select a plain text and a Wysiwyg . Element which allows HTML to be published.

WySiwyg element

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Select the plain text, you can see you will get a below.

Specify the ContentId.  E.g ID for element can start with E_XX

Give the Title as below and Click Assign Info. You will this in the Element Definitions

Select the Type as Type:(Required:) System – System configuration, templates, settings

checkin form1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Similarly create a new Wysiwyg for News Description

element list

 

 

Create Region Definition

In Site Studio select Region Definitions from the Site Assets.

Press the create new button and select Region Definition:

rd

 

 

 

 

Give  Metadata as below:

checkin form2

 

Add elements to the region:

 

Once assigned the information the region should appear in the list. Right click on it and select edit. This opens the popup that allows us to assign the elements. Press the Add button.

Here we specify the Content ID the we can reference from our template in WebCenter.

Specify a name, label and select the element.

add elements to region

 

 

 

 

 

 

 

 

 

 

 

 

 

Similarly Add the Description and we are done creating a site studio REGION 🙂

adde element to region 2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Now that we are done with the Site Studio Templates, we are going to create the WebCenter Content Presenter Templates in the JDeveloper WebCenter Portal.

See the next section.

 

Step2 Create WebCenter Content Presenter templates

List Item template

We will now create a List Item Template. Depending on your needs, the approach you take to defining Content Presenter display templates will vary. Typically, you define display templates for specific single items of content, then define a multiple content item display template that includes calls to the single item display templates. Examples of single content items for which you may want to create Content Presenter display templates are:

  • Individual items to display with a specific look and feel on a page.
  • Different views of a specific type of item (such as short and detailed views of an article).
  • Different versions of a similar item (such as Press Releases that may be formatted differently for different groups, using a different set of properties).

Create a fragment as below

create template def

 

 

 

 

 

 

 

 

 

 

 

 

 

<?xmlversion = ‘1.0’?>

  1. <jsp:rootxmlns:jsp=”http://java.sun.com/JSP/Page” version=”2.1&#8243;
  2. xmlns:af=”http://xmlns.oracle.com/adf/faces/rich&#8221;
  3. xmlns:dt=”http://xmlns.oracle.com/webcenter/content/templates&#8221;>
  4. <dt:contentTemplateDefvar=”node”>
  5. <af:panelGroupLayout layout=”vertical” id=”pgl3″>
  6. <af:panelGroupLayout layout=”horizontal” valign=”top” id=”pgl4″>
  7.  <af:outputText value=”#{node.propertyMap[‘RD_EMPLOYEE_NEWS:title’].asTextHtml}”
  8.       id=”ot4″ escape=”true”
  9.       inlineStyle=”font-size:14px; font-weight:bold;”/>
  10. </af:panelGroupLayout>
  11. <af:panelGroupLayoutlayout=”horizontal” valign=”top” id=”pgl5″>
  12. <af:outputText value=”#{node.propertyMap[‘RD_EMPLOYEE_NEWS:description’].asTextHtml}”
  13.            escape=”false” id=”ot5″/>
  14. </af:panelGroupLayout>
  15. </af:panelGroupLayout>
  16. </dt:contentTemplateDef>
  17. </jsp:root>

 

 

The line 5 is important here. We have used the content template definition which specifies the definition of the template.

This tells the template that it will be a single node template. The var represents the actual content that contains all the metadata of the content. That node contains a properyMap with all the metadata. This can be accessed by providing the name of the metadata field. In order to retreive the actual content of the data file from Site Studio we need to provide the name of the region definition and the field of the definition so node.propertyMap[‘RD_EMPLOYEE_NEWS:title’] will return the content of the title field from the RD_TRAINING region definition.

 

This is a standard way of accessing a region and an element within a region.

 

Now we need to create a portal resource. Right click the file and select Create a Portal Resource

Give the View ID. It’s very Important as it will be used to refer the content template within the list template Definition while iterating.

 

create portal resource

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Now we will create a List Template

List Template

create list template

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  1. <?xmlversion = ‘1.0’?>
  2. <jsp:rootxmlns:jsp=”http://java.sun.com/JSP/Page” version=”2.1&#8243;
  3. xmlns:af=”http://xmlns.oracle.com/adf/faces/rich&#8221;
  4. xmlns:dt=”http://xmlns.oracle.com/webcenter/content/templates&#8221;
  5. xmlns:f=”http://java.sun.com/jsf/core&#8221;>
  6. <dt:contentListTemplateDefvar=”nodes”>
  7. <af:panelGroupLayout layout=”vertical” id=”list” valign=”top”>
  8.  <af:iterator var=”node” value=”#{nodes}”>
  9. </af:iterator>
  10. <f:facet name=”separator”>
  11.    <af:spacer id=”sp1″ height=”10px”/>
  12.  </f:facet>
  13. </af:panelGroupLayout>
  14. </dt:contentListTemplateDef>
  15. </jsp:root>
  1.       <dt:contentTemplate node=”#{node}” view=”employeenewslistitem”
  2.                 nodesHint=”#{nodes}” id=” employeenewslist”/>

This code is also quite straight forward. In the beginning we tell the template that it will be multi node template by using:

  1.  <dt:contentListTemplateDef var=”nodes”>

We use an iterator to loop all the nodes passed to the template by the content presenter.

Then we referencing another template is done by using following code:

  1. <dt:contentTemplate node=”#{node}” view=”employeenewslistitem “
  2.  nodesHint=”#{nodes}” id=” employeenewslist”/>

We pass the actual node to it and the view attribute should hold the value specified in the View ID attribute from the portal resource.

Also create a portal resource from that template and call it employeenewslist:

 

create portal resource2

Step3 Adding content presenter task flow and a page

 

Now that we have built the SS templates and the CP templates, we will add a CP task flow.

Create a jspx file that will render the content via the templates and the taskflow

create jspx page

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Drag and drop the content presenter on the content facet and select Region from the context menu.

Specify following parameters to the taskflow

tf params

 

 

 

 

 

 

 

 

 

 

  • taskflowInstId: this you can choose. It should be unique within the page.
  • dataSourceType: ${‘dsTypeQueryExpression’} this tells the content presenter that the datasource will be a query.
  • datasource: ${‘SELECT * FROM ora:t:IDC:GlobalProfile WHERE ora:p:xRegionDefinition LIKE \’RD_EMPLOYEE_NEWS\’ order by ora:p:dCreateDate asc’} This query is a CMIS query.  This query will return all content where the xRegionDefinition contains RD_EMPLOYEE_NEWS. Note there is an order by clause for the create date. This needs to a sortable field in WebCenter Content/UCM. You can do this by going to the admin applets as below.
  • templateView: ${’employeenewslist’}This is the value specified in the View ID of the second template (when we created the portal resource. This way we tell the content presenter to use that specific template.
  • <dt:contentTemplate node=”#{node}” view=”employeenewslistitem “
  •  nodesHint=”#{nodes}” id=”employeenewslist”/>

 

UCM field

 

 

 

 

 

 

 

  1. <?xmlversion=’1.0′ encoding=’UTF-8′?>
  2. <jsp:rootxmlns:jsp=”http://java.sun.com/JSP/Page” version=”2.1&#8243;
  3.        xmlns:f=”http://java.sun.com/jsf/core&#8221;
  4.        xmlns:h=”http://java.sun.com/jsf/html&#8221;
  5.        xmlns:af=”http://xmlns.oracle.com/adf/faces/rich&#8221;>
  6. <jsp:directive.page contentType=”text/html;charset=UTF-8″/>
  7. <f:view>
  8.   <af:document id=”d1″>
  9.     <af:form id=”f1″ usesUpload=”true”>
  10.       <af:pageTemplate value=”#{bindings.pageTemplateBinding.templateModel}”id=”pt1″>
  11.         <f:facet name=”content”>
  12.           <af:panelGroupLayout id=”pnl” layout=”vertical”>
  13.           <af:goLink id=”create”   destination=”http://mycontentserver:port/cs/resources/wcm/custom/sitestudio/contentwizard/webcenter/contentwizard.hcsp?dDocType=Document&amp;cpRegDef=RD_EMPLOYEE_NEWS&amp;dSecurityGroup=Public&amp;cpIframe=true&amp;forceLogin=1&#8243;
  14.              targetFrame=”_blank” text=”Create New”/>
  15.           <af:region value=”#{bindings.doclibcontentpresenter1.regionModel}”
  16.                     id=”r1″/>
  17.           </af:panelGroupLayout>
  18.         </f:facet>
  19.       </af:pageTemplate>
  20.     </af:form>
  21.   </af:document>
  22. </f:view>
  23. </jsp:root>

 

Link to Site studio to open up

 

Note that we have added a link to site studio to be able to create the news items from the portal. This will open the site stuio from the WebCenter Content

http://mycontentserver:port /cs/resources/wcm/custom/sitestudio/contentwizard/webcenter/contentwizard.hcsp?dDocType=Document&cpRegDef=RD_EMPLOYEE_NEWS&dSecurityGroup=Public&cpIframe=true&forceLogin=1

Note the parameters here, we are passing the Referenec to the region definition.

 

Add the Page to navigation

This is straight forward. Add the page to the pages.xml to be shown in the menu.

run yor portal 1

 

 

 

 

 

 

 

When you click the Create New you will be asked to logon. This is because we do not have the SSO between the Portal and the Content

Choose New Contributor Data File

new contribn data file

 

 

 

 

 

 

 

 

This will load the Content metadata check in form. Imagine I am creating content for announcement. Enter details as shown for Content id and Title

check in form for new content

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Click next and select “Edit Item Now”

edit content now

 

 

 

 

 

 

 

 

 

 

 

This will load the site studio for creating the item. Fill in the details and click Save and Close

ss with data

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Note-  if the window does not close you can use the X on browser

Come back and refresh the screen on the portal as below

You will see the content

run the portal final

 Security Considerations

  • WebCenter Portal and Content MUST share same LDAP/ Authentication source
  • For public content users will be able to see the content even if not local/global content user but for performing content editing user would need to be mapped
  • All users are authenticated through external security and are considered external Content Server users. The first time users log in to the Content Server system through Oracle WebLogic Server, they are added to the Content Server database, and administrators can view the external user information through the Repository Manager. External users are not automatically included in Content Server user lists, such as the Author field on a content Check In page.
  • You can make the users local or global and create Roles and Accounts with Permissions to control security
  • Additional we need to explore the use of Credential Mapping to map the external roles to content server roles.

Please read more here:

 

http://docs.oracle.com/cd/E23943_01/doc.1111/e10792/c05_security.htm#CDDJAAJB

http://docs.oracle.com/cd/E23943_01/doc.1111/e10792/c05_security.htm#BGBEDJFI

 

google-site-verification: google97481851e41a08b7.html

Leave a comment