Thursday, July 23, 2015

Oracle ATG Controller Framework

  •  Introduction to Servlet Pipeline

            Oracle ATG Controller Framework is used to handle how HTTP requests are processed. Basically, It performs tasks like session tracking, page compilation etc. Controller includes series of separable servlets which has its own individual task, so called as Servlet Pipeline.
    This series of steps is dependent very much on sequence in which servlets are placed because of the information flow of request. Each servlet processes the request and may have input to next servlet.
    • Request Processing by Servlet Pipeline

    While processing a request in ATG, every step or task is a Nucleus component which implements Servlet interface. It is organized in linked list kind of data structure and is called a request-handling pipeline.
    Whenever request comes to the pipeline it is handled by the pipeline in a component oriented manner i.e. by having servlets as independent elements.
    ATG Provides Out of the Box pipeline to handle request which is used to process each request to application. It is started by a Page filter and requests which are coming to Nucleus are dispatched to PageFilter or DynamoProxyServlet. And it then follows the order of servlets in series.
    Here, each of these servlets perform their function on the request. Also, servlet is configured with a reference to the next servlet in pipeline. So, when a first servlet is processed on the request, it will pass the request to the next servlet and so on.
    ATG also provides flexibility of customizing the pipeline through components. These components are configurable and use Out of the Box provisions to execute in sequential manner.

    Below is the example of ATG Out of the Box Pipeline.

    • Example with Out of the Box Pipeline
      Dynamo Servlet Pipeline
    • How to customize Servlet Pipeline
    Every servlet in pipeline implement atg.servlet.pipeline.PipelineableServlet interface. 
    When we implement PipelineableServlet, it inherits a nextServlet property. This property is used to point to the next servlet component to invoke. 
    The pipeline components created should be scoped as global. Also, they need to be configured into pipeline.
    PipelineableServlet interface has two subinterfaces.  These two types provide additional features for determining the next component to invoke.
    1. InsertableServlet 

    This interface has a property called insertAfterServlet to enable the servlet to insert itself in a specific position in the pipeline. This mechanism is useful when you donot want to change or modify existing pipeline configurations and insert silently.

    package com.myapp;

    import javax.servlet.*;
    import javax.servlet.http.*;
    import atg.servlet.*;
    import atg.servlet.pipeline.*;
    public class MyServllet extends InsertableServletImpl {

    public MyServlet () {}

    public void service (DynamoHttpServletRequest request,DynamoHttpServletResponse response)throws IOException, ServletException {
    System.out.println ("Inside MyServlet with request " +request.getRequestURI ());
    passRequest (request, response);

    Here, MyServlet will be inserted after DynamoServlet

    2. DispatcherPipelineableServlet 

    This interface provide a mechanism to create branches of servlets using some condition.
    It is possible with dispatcherServiceMap property of this class, which is a map of servlets based on condition.
    Out of the box MimeTypeDispatcher servlet is used to determine which servlet needs to be invoked based on the MIME type of the request.

    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 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" />


    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,

    To Configure this properties file as resource bundle referred by BCC, create a file below with same name and path:

    and provide contents as:


    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>
        <result-list page-size="500"/>
        <asset-type  id="finish" site-filtering="false">


    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" />


    ATG 11.0 Installation with Cim, MySql, Jboss and Endeca

    1. ATG11.0 and Endeca Installed on system
    2. MySQL service is running with default Databases created
    3. JBoss6.1 is downloaded and extracted

    Click on below link to get the doc:

    Sunday, April 5, 2015

    Oracle ATG Commerce Overview

    Oracle ATG Commerce Overview 

    Oracle ATG Commerce provides the platform to build and manage the B2C and B2B websites.

    • Oracle ATG B2C Commerce
      • Product Catalog 
        • Catalog contains hierarchical structure for maintaining Products/SKUs in navigable manner. The Root node is Catalog Folder. Catalog Folder can have child elements, called Catalog. From ATG 10 version onwards ATG has added Site Based catalogs. A catalog may belong to one or more Sites and these sites may point to a single catalog. This structure provides easier way to implement multisite functionality.
        • Further, Catalog may have root categories, categories and subcategories which are of type category item descriptor in terms of product catalog repository. These categories are associated with each other just like a tree or graph like data structure. The relationship between these categories is populated whenever deployment happens on product catalog. This can also be invoked through Oracle ATG Dynamo Administration Console a.k.a. Dyn/Admin. This will populate ancestor categories, parent catalog etc. properties for a category, as well as sub-elements like Product, SKU. 
        • Category or subcategory can have Products. Products are entities which are the units to be displayed on site. Product may contain multiple SKUs (Stock Keeping Units). Customer buys SKUs which have specific properties of Product, like Color, Size, Quantity etc.
      • Profile 
        • Oracle ATG commerce provides OTB profile management module. Profile is required to maintain user data. Profile is associated with user session. User information like Name, Login Information, Shipping and Billing Addresses, Payment Methods, Order Information, Active as well as used Discount or Promotion Information, Purchase History etc.
        • Profile is also used while processing order as well as fulfillment process. 
      • Shopping Cart and Checkout 
        • Shopping Cart is an Order in incomplete state. It contains SKU items which are added by user to bag or cart. It also holds orders for multiple sites in multisite environment. Shopping cart feature allows user to manage items he wants to purchase, like view/change quantity, see/apply discounts or promotions information, in stock/ out of stock information, item information of SKU.
        • In checkout process, Order undergoes few changes like shipping information, billing information, payment information, confirmation. This process is controlled by different formhandlers and commerce pipeline which provides full control of customization of checkout process to developers. Once order is placed it goes to fulfillment system for further processing.

    • Oracle ATG Business Commerce (B2B)
      • B2B Payment methods
        • These are B2B features to provide functionality specific to Business like purchase orders, requisitions.
      • Account-specific product catalogs
        • In B2B there is a need to maintain product catalog at Business Account level i.e. a company may provide customized catalog items to its dealers or distributors. It gives more flexibility in B2B model. 
      • Multiple shipping and billing address
        • B2B features also provide user to have multiple shipping and billing addresses. This information can be maintained by multiple user accounts belonging to same dealer. Profile here is maintained in organized manner, like Organization, Role etc.