Tuesday, July 14, 2015

BCC 11.1 Customization: Adding New item descriptor

Whenever you create a new item descriptor or a repository which can be modified by Merchandiser, it should be present in BCC in order to add, modify and delete items.

As part of ATG 11.1 version, Oracle has provided simple steps to view newly created item-descriptor in BCC Flex UI.

Let us assume, we have created new item descriptor called contentItem in /atg/commerce/catalog/ProductCatalog repository.
(Modified /config/atg/commerce/catalog/custom/customCatalog.xml).

To add a new content item in BCC 11.1 follow below steps :

1. Adding to Content Browse Hierarchy

Location:    <your_module>\config\atg\remote\content\browse\ContentBrowseHierarchy.xml

This will be used to view your item in content browser.

Add below code for contentItem

<?xml version="1.0" encoding="ISO-8859-1" ?>

<browse-hierarchy xml-combine="append">

  <browse-item id="home" xml-combine="append">

    <browse-item reference-id="contentItemDetails"/>
  </browse-item>

<browse-item id="contentItemDetails" label-resource="node.styles.label.contentItem"  is-root="true" >
    <list-definition id="contentItemDetailsId" retriever="query" child-type="/atg/commerce/catalog/ProductCatalog:contentItem">
<retriever-parameter name="query"  value="ALL" />
    </list-definition>
  </browse-item>

</browse-hierarchy>

Here, node.styles.label.contentItem is an property for Label to display in BCC.

You need to create new properties file in your source directory say, com.yourapp.web.resources.RepositoryTemplateResources.properties

To Configure this properties file as resource bundle referred by BCC, create a file below with same name and path:
<your_module>\config\atg\remote\assetmanager\MultiBundleFormatter.properties

and provide contents as:

bundlePaths+=\
     com.yourapp.web.resources.RepositoryTemplateResources

You may add any number of resource bundle values in this property file. But, it is best practice to create separate file for each repository, so that it can be managed separately.

2. Adding to Content Find Configuration

Location: <your_module>\config\atg\remote\content\find\ContentFindConfiguration.xml

This will be used to display newly create item-descriptor in find tab.

Add below contents in xml file for find configuration;

<?xml version="1.0" encoding="UTF-8"?>

<find-configuration site-filtering="true" xml-combine="append">

<asset-family id="contentItem" site-filtering="false">
    <display-name>Content Item</display-name>
    <enable-default-query>true</enable-default-query>
    <enable-filter-as-you-type>true</enable-filter-as-you-type>
    <result-list page-size="500"/>
    <default-asset-type>contentItem</default-asset-type>
    <asset-type  id="finish" site-filtering="false">
      <enable-default-query>true</enable-default-query>
      <enable-filter-as-you-type>true</enable-filter-as-you-type>
      <repository-path>/atg/commerce/catalog/ProductCatalog</repository-path>
      <repository-item-type>contentItem</repository-item-type>
    </asset-type>
</asset-family>

 </find-configuration>

3. Add to Content Tool bar

Location: <your_module>\config\atg\remote\content\toolbar\ContentToolbar.xml

This will be used to display control buttons in toolbar while you are navigating through browse item.
Buttons like add, edit, delete, move, duplicate etc. can be controlled through this xml.

<?xml version="1.0" encoding="ISO-8859-1" ?>
<toolbar xml-combine="append">

<operation-menu id="contentItemMenu">
<toolbar-scope asset-area="contentItem" pane-id="browse"/>
<operation-menu-item id="edit" />
<operation-menu-item id="move"/>
<operation-menu-item divider="true" />
<operation-menu-item id="duplicate" />
<operation-menu-item id="delete" />
<operation-menu-item divider="true" />
<operation-menu-item id="addToProject" />
<operation-menu-item id="export" />
</operation-menu>

</toolbar>



No comments:

Post a Comment