Creating a Single Item Content Presenter Template in WebCenter Portal 12c (12.2.1)

Computer Programming WCP

Creating a Single Item Content Presenter Template in WebCenter Portal 12c (12.2.1)

By: Abhinand Shankar | Technical Architect

The WebCenter Portal (WCP) implementations I have worked on include an integration with WebCenter Content (WCC). WCC managed the creation of the content items through Site Studio. WCP handled the presentation that covered the content on the web page that was finally rendered. This was done through Content Presenter Templates.

In 11g, the round trip development of the templates involved downloading a DesignWebCenterSpaces application that was preconfigured for managing the assets. The release of 12c brought changes to this process. JDeveloper is now built in with the application template to create the portal assets.

When creating a portal asset project, you have the option to select the asset type as Content Presenter Template.

WCP 1

This generates the project and all the necessary artifacts.

WCP 2

In this example, SampleContentPresenter.jsff contains the actual code. You can deploy the asset to the portal managed server directly from JDeveloper or create an AAR file and upload it. It is now available when configuring a Content Presenter task flow on the portal.

WCP 3

You will notice that the template is available only when the content source is a list of items and not for a single item. A look at assetDef.xml shows that it is created as a list template by default.

WCP 4

The application creation wizard does not give you an option to select the type of template. Therefore, attempting to update assetDef.xml throws an error.

In order to create a presenter template for a single item, create the application with the defaults and deploy it to the managed server. Log into portal administration and from the assets page download the template. Explode the archive and you should see a file called asset-entities.xml under the folder contentPresenter-s-gsr90079447_922e_48ff_a483_0c496a20c1c9 (the folder name contains a guide).

Asset-entities.xml contains the definition for the template and is by default as shown below:

WCP 5

Update this section as follows:

WCP 6

Make sure to update the jsff file to use the tag for a single item content presenter template.

WCP 7

Archive the files and deploy the AAR file. The template should now be available for a single content item.

WCP 8

Note: After deploying the template, you may have to uncheck the available box and then check it again before it shows up in the drop down.

 

Contact Abhinand or TekStream Today