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.