Wednesday, March 29, 2017

Webcenter 12c: Custom Content Presenter Template (CPT) not availble in edit mode

After updating the Env to 12c, in some cases Custom CPT were not available in edit mode

This was added as Bug 21820565 & support document Doc ID 2136619.1 does mention about fixing this for Single Item CPT.

PFB the fix for Multiple Item CPT as well
  • Create CPT of either Single/Multiple item in Jdeveloper & deploy it to portal server.
  • Export the CPT & delete it from the portal.
  • Extract the .aar file & navigate to contentPresenter<guid> folder.
  • Edit the asset-entities.xml file for below entry: 
For Single Item CPT
<collections>
   <collection name="CustomAttributes" java-type="java.util.Map">
      <entry ord="0">
         <key>view-id</key>
         <value>Single Item CPT</value>
      </entry>
      <entry ord="1">
         <key>content-type-name</key>
         <value>*</value>
      </entry>
      <entry ord="2">
         <key>content-repository</key>
         <value>*</value>
      </entry>
      <entry ord="3">
         <key>template-type</key>
         <value>single</value>
      </entry>
   </collection>
</collections>
For Multiple Item CPT
<collections>
   <collection name="CustomAttributes" java-type="java.util.Map">
      <entry ord="0">
         <key>view-id</key>
         <value>Multiple item CPT</value>
      </entry>
      <entry ord="1">
         <key>category-description-key</key>
         <value>DEFAULT_LIST_CATEGORY_DESC</value>
      </entry>
      <entry ord="2">
         <key>category-description</key>
         <value>Default display templates for multiple content items.</value>
      </entry>
      <entry ord="3">
         <key>category-name</key>
         <value>Default Templates</value>
      </entry>
      <entry ord="4">
         <key>category-name-key</key>
         <value>DEFAULT_LIST_CATEGORY_NAME</value>
      </entry>
      <entry ord="5">
         <key>category-is-default</key>
         <value>true</value>
      </entry>
      <entry ord="6">
         <key>template-type</key>
         <value>list</value>
      </entry>
      <entry ord="7">
         <key>category-id</key>
         <value>oracle.webcenter.content.templates.default.category</value>
      </entry>
   </collection>
</collections>
  • Package the .aar file again & upload it to CPT Assets.

Sunday, August 30, 2015

WebCenter: Comments & Likes for UCM documents

Some requirements need comments & likes functionality to be enabled for content presenter taskflows.

One of the simplest & quickest way is to customize the Document Explorer taskflow, so as to use comments & likes functionality and hide the unwanted portion.

Coming soon.. the sample app.

Sunday, July 26, 2015

WebCenter: Blog Security Issue

Users in same group can edit/delete each other blogs.

According to Doc1961188.1, there is a bug filed for this issue ref# Bug 20323352 - BLOG SECURITIES ISSUES.

Solution:

There is small customization needed for OOTB Blog Digest Viewer, i.e. for edit link change the rendered property to
rendered= "#{(row.editable and 
WCSecurityContext.currentUser[row.createdBy]) or WCSecurityContext.userInScopedRole['Moderator']}" /> 
And for delete link change the rendered property to 
rendered="#{(row.canDelete and 
WCSecurityContext.currentUser[row.createdBy]) or WCSecurityContext.userInScopedRole['Moderator']}" />
The sample application can be downloaded from Google Drive.