ATG Slots Scenarios and Targeters

Slots are Nucleus components,Container that show personalized 
content to the users.These containers are filled with
contents,Targeters and scenarios are used to deliver the personaliszed contents.Slots have the capability
to store a cached list of items from scenarios.

In ACC under Components by path slots can be located under /atg/registry/slots ,Slots like other components can have
all the three scopes,but the default scope is session,the

scope can be persisted so items added in one session will 
be there when the user starts a new session.

Targeters can also be used to select content that is 
personalized for the user.This is knowledge-driven 
personalization and Work with scenarios to deliver dynamic personalized content.Scenarios use Targeters to fill slots.

With slots: best performance, because business rules are 
executed once, when the scenario runs and slots cache the 
output.The content can also be changed over time
(added to, removed from).

Make use ofContent and Profile Groups,Grouping provides 
Rule re-use, Rule nesting Use of rules in Scenarios and 
it will be ease for maintenance.

ATG Scenario Internal Working

BCC site status inaccessible Agent Production in error state

The Error Message showing in BCC

BCC Site Inaccessible error message

The error logs is showing the below message

/atg/epub/DeploymentServer Failed to connect to agent
'Production'. This agent not allowed to be absent for 
a deployment. The server will continue attempts to 
intialize the connection. Set loggingDebug to true for 
continued exception and stacktrace logging.


This happens when the target/Production instance is down for some 
reason or the RMI configuration which points to the
target/Production instance may not be correct one.


If this is happening  due to target/Production instance down 
then we can restart the target/Production Server,Other wise 
correct the RMI configuration from the BCC agent configuration page
and reinitialise.

Verify the RMI Port in file.Usually this file will be located in the path C:\ATG\ATG10.2\home\servers\ATGProduction\localconfig\atg\dynamo\,make sure the RMI port in the file matches with the port number specified in the URL while configuring the ProdAgent in BCC.

This will solve the issue.

See Tweak BCC Snapshot

BCC Search Indexing Configurations

Navigate to BCC -> http://host:port/atg/bcc


After login you will see 'Operations' tab under which you can see Search Administration option.

Expand the ‘Search Administration’ under the ‘Operations’ tab.

Click on ‘Browse Search Projects’ under Search Administration,
Click on ‘New Search Project’ button.

Enter the Search Project Name and Description under
‘General’ label,Search Project Name: Test_Search_Sebastian.

Description:Any meaningful description(Example:Search Index).

Click on the ‘Create Search Project’ button.

click the ‘Add Content’ button under the ‘Content for Indexing’ label,Specify the Content Name. You can give any name (Ex:Content_Sebastian) and select ‘ATG Repository’
from the content Type dropdown.

In the IndexingOutputConfig Path textbox, type the relative path  /atg/commerce/search/ProductCatalogOutputConfig of ProductCatalogOutputConfig located in C:\ATG\ATGXXX\home\
localconfig\atg\commerce\search directory.Select the Remote
option in the Location.

Host Machine: This is  the name of  your computer,
You can get the computer name by right clicking on the ‘My Computer’ then select the ‘Properties’ and click on the ‘Computer Name’ tab.

Port: Write the rmi port number 18860.

Click on the ‘Add Content’ Button.


But before indexing, you need to open the ACC and start some components.Open the ACC with help of URL: http://host:port/dyn/admin

User name: admin
Password : admin

Click ‘Pages and Components’, and select ‘Components by Path’.

Navigate to atg -> commerce-> search
Start the following components


For starting the component, right click on the component and click on ‘start component’.

For Indexing.Click on the indexing inside the project(Test_Search_Sebastian), project,Now you can
click on the ‘Build Index’ button Click on ‘show detail’
and check the progress of indexing.If build indexing
is successful, we can see the index files in our DeployShare
Folder at this location:  C:\ATG\ATGXXX\SearchXXX\DeployShare

See also the Module wise configurations

ATG Search Commerce Module Configurations

Commerce Module
We need to keep certain files on the below location for the 
Search functionality to work.You need put the below
three files in the location ->
     This is a xml file where you will specify the indexing  
siteName=staging environment 0 (TestSearchProj)
If BCC is running in a different machine, then only the following file is required in C:\ATG\ATGXXX\Commerce_Module\config\atg\ search\es (otherwise remove the file)
# /atg/search/es/SearchServer
# IP address of the machine where BCC is running

Put the below file in the location - C:\ATG\ATGXXX\Commerce_Module\config\atg\ search\ routing

Make sure the under C:\ATG\ATGXXX\Commerce_Module\config\ atg\dynamo has the following entries.

ATG Search BCC Module Configurations

BCC Module (BCC Server)

Put the below three files on this location ->C:\ATG\ATGXXX\BCC_Module\config\atg\commerce\search


This is a xml file where you will specify the indexing parameters.

siteName=staging environment 0 (TestSearchProj)

Make sure the under C:\ATG\ATGXXX\BCC_Module\config\atg\dynamo has the following entries.

Make sure the following files/folders present in the following location C:\ATG\ATGXXX\BCC_Module\config\atg\search\
Config folder -

repository folder -
routing folder – This folder has repository sub-folder,

repository sub-folder (C:\ ATG\ATGXXX\BCC_Module\config\atg\search\routing\repository )-

Make sure the under C:\ATG\ATGXXX\BCC_Module\config\atg\search\ service has the below content.


Make sure the under C:\ ATG\ATGXXX\BCC_Module\config\atg\searchadmin has the below content.



Important note: If you are adding new products/SKUs into BCC, the same products wouldn’t appear in the search results unless bulk-indexing is done via Search Project Administration in BCC.

Before you start the indexing, both the commerce and merchandiser server should be running successfully. Then, create a folder in C:\ATG\ATGXXX\SearchXXX with name ‘DeployShare’ and make it sharable.The path of this directory is specified in the Launching Service Component.

See the configurations for Commerce Module

ATG Search Configurations for Commerce and BCC Module

Module to include in build & manifest files

Commerce Module

Manifest-Version: 1.0
ATG-Config-Path: config/
ATG-Required: DAF.Search.Query DafEar.Admin DCS.Search DCS.Search.CustomCatalogs.common DAF.Search.Query.Search DAF.Search.Routing DAF.Search.Base DAF.Search.common DAF.Search.Index DAF.Search.Topics PublishingAgent 


<target name="create-search-ear">
 <delete dir="BCC_Module"/>
 <assemble-ear dynamoRoot="C:\ATG
 \ATGXXX "dynamoModules="DAS,DPS,DCS,DSS,DafEar.Admin,,DCSUI.Search,B2CCommerce.Versioned,PubPortlet,
 overwrite="true" destinationFile="C:\jboss-X.X.X.GA\server
 \server_instance_folder\deploy\BCC_Module.ear" />

Manifest-Version: 1.0
ATG-Config-Path: config/
ATG-Required: B2CCommerce.Versioned DCS.CustomCatalogs
ATG-J2EE: j2ee-apps/BCC_Module
ATG-EAR-Module: j2ee-apps/BCC_Module

See the Search Module Configurations also

Commerce Module
BCC Module

BCC Work flow changes not reflecting

Workflow changes not reflecting in particular(Production/Testing) environments.


You need to Stop CA first then,copy the workflowProcessManager.xml file to your localconfig like below.


Process Editor Server Information

Make sure the serverName and drpPort for the particular instance is correct. Otherwise workflow will not work.

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

You can also find the hostname:drp-port from the component
/atg/dynamo/service/ServerName.The serverName() method of
this component will return these values.

You can also refer other BCC issues here

BCC Manage Snapshot functionality
BCC Delete Meta Data Files

BCC Deleting Meta Data Files and Fix for CA Server taking long time to Start

Below are the queries to delete projects which are in
pending deployments stage and Meta data files from the CA database.

Delete from epub_deployment; -- Deleting pending deployment.
DELETE FROM das_depl_depldat;-- Deleting Meta data files from BCC.
DELETE FROM das_depl_options;
DELETE FROM das_depl_repmaps;
DELETE FROM das_depl_item_ref;
DELETE FROM das_depl_progress;
DELETE FROM das_thread_batch;
DELETE FROM das_deploy_data;
DELETE FROM das_dd_markers;
DELETE FROM das_deploy_mark;
DELETE FROM das_rep_mark;
DELETE FROM das_file_mark;
DELETE FROM das_dep_fail_info;
DELETE FROM das_deployment;

Fix in case CA server taking time to start.

Stop CA Server
delete the entries from the table das_gsa_subscriber.
Start CA Server

Also see how to solve BCC snapshot mismatch issue.

B2B and B2C differences in ATG


Selling has made to some corporates like some departments or to some companies
Since this is based on corporates,the corresponding Promotions also based on this.
We have custom catalogs comes along with B2B implementation,and these catalogs often can be customised for each buying companies.
Payments is generally made through invoicing or through purchase
Orders can be done at a regular intervals(recurring).
Order restriction can be imposed based on several factors,like role,
order approval chain etc.


Targeted to individual customers.
Since this is based on individuals,the corresponding Promotions also based on individual activity.
Catalogs are Regional and very less restrictions on Order.
Payments generally through credit card and gift certificates.
Orders will be one-time.

See the functional difference also

Functional difference between B2B and B2C Modules

There are some functionalities which is specific to B2B only that are not there in B2C.Those are listed below in the table format.

Roles & Organisation
Custom Catalogs
Price Lists
Split Shipping/Payment
Purchase Orders/Invoice Generation
Order Approvals
Saved Orders
Scheduled Orders

Since B2C is targeted for individual consumers
we dont have contracts there,also in B2C we generally pay through
credit card or gift certificate,so we dont have the concept of Purchase Orders or Invoice,similiary there is no much Order 
approvals flow in B2c module.

See also the basic difference between B2B and B2C modules

atg form handler basics

Whenever if you are creating a custom form handler,make sure it extend GenericFormHandler class.

Your custom form handler must define properties successUrl and errorUrl with the respectieve getters and setters methods.

Other than this every property submitted with this formhandlers 
must have the respectieve getters and setters methods.

Each submit button should have a prexx(), handlexxx() and validate() methods

The prexxx() method will be void most of the cases,but if you need
to specifically clear the formException vector,in case of session
scoped components you can add your logic here.

validate method should validate the properties as per the requirement,incase of validation failure,create a new DropletException and add it to the formException Vector.
eg:super.addFormException(new DropletFormException(msg, "key"));

The flow will be something like this,handlexxx()-prexxx()-return super.checkFormRedirect(successUrl,errorUrl,request,response).

ATG Transaction Best Practices Dos and Donts

Creation and Updation of Repository Items must be enclosed
with a  Transaction block.

Reading Items from Repository does not require a transaction.

if we are doing multiple operations and is dependant on each other,then we must use a single transaction,this is to either

commit or roll back the entire transaction,other wise each
operation has to be enclosed in a separate transaction block.

Use the finally block to end the transaction,this will ensure
our statement will get executed even an Exception is thrown.

Dont try to call nested methods inside one transaction,this will not serve the purpose.

Dont use any complex logic,inside the transaction,like below.

Bad Practice

try {
      MutableRepositoryItem newItem =
      float price = calculateOrdertotal(order);

Best Practice

     float price = calculateOrdertotal(order);
     if(price != null){
     try {
      MutableRepositoryItem newItem =                               
      newItem.setPropertyValue(“price”, price);

Try to minimise your code inside the transaction block.

Don’t use forward use redirect if you have code which opens a transaction, encounters an error flagging the transaction for rollback, to an error URL. Some app-server executes the rendering of the forward in the context of the transaction that was rolled back. If that is the case, a rollback exception occurs.

Also see Form Handler Best Practices

Add a shopping cart button to the product page

Make sure you have ATG running with your Application 
We are adding a jsp page fragment called addcart.jsp.
This fragment will use two parameters passed from other jsp,
skuInfo.jsp - skuId and productId.

Add the form and inputs required to add an item to the order, 
as shown in the sample code below:

<dsp:input type="hidden"
bean="CartModifierFormHandler.catalogRefIds" paramvalue="skuId"/>
<dsp:input type="hidden" bean="CartModifierFormHandler.productId"
<dsp:input type="text" size="5"
bean="CartModifierFormHandler.quantity" value="1"/>
<dsp:input type="hidden"
<dsp:input type="submit"
bean="CartModifierFormHandler.addItemToOrder" value="Add to Cart"/>

Don't forget to import the
/atg/commerce/order/purchase/CartModifierFormHandler component.

Make sure you pass the following parameters to the cart page:

Test the cart button by clicking it from a product page.

To verify that the sku was added to the current order object, navigate 
to /atg/dynamo/servlet/sessiontracking/SessionManager. Find your browser
session and expand it to navigate to and open your session-scoped copy of /atg/commerce/ShoppingCart. Click to select the ShoppingCart's current
property. Click the ellipsis button to open the current order object. 
Check that the totalCommerceItemCount matches the number of items you 
added to the cart.

Tip: You could also use the order number shown here to look up the 
     information saved about this order in the Orders Repository.

ATG Integrate Reviews and Rating Module

Lets assume we have an external Reviews and Rating module with us for integration.The first thing we need to do is, include this module in ourrunAssembler.

runAssembler yourApp.ear -m your_module ReviewsAndRating DSS  DafEar DafEar.Admin

This module will basically helps us to read and write reviews for your product as shown below.

Once the user navigated to the products page,he can see an option to add that product to the CART,but before that he has now the option to check the ratings and review for this product,and if he is satisfied by the ratings and review he can go ahead and add it to CART.

There will be basically two links,one for 'Reading all Reviews' and 'Write a Review'.

ATG Write Reviews and Rate Products

There will be basically three levels of Rating we can provide.

1. User Rating
2. Rate Product
3. Customer Satisfactor Rating

While writing reviews and rating the product,you can also mention the Product name in the title and write a detailed review which would be considered as the most important part in this functionality.These information will be stored in the Ratings and Reviews tables and will be shown to the customers who want to buy that product.There will be a link provided to Read Reviews

ATG Read Reviews and Ratings

Here you can read reviews and ratings of the Product you are going to purchase,For testing purpose i am showing only one 
record ,ideally will have a lots of reviews and ratings  for a particular product.

We are seeing the feedback given by one of the customers of this Product(Black Berry Phone).

Rating and Reviews is going to become an unavoidable option for Ecommerce Application as the customers can gather lot of trusted information/opinions about the product they were going to buy from the Application site itself instead of wasting time in the Internet and other medias,sounds great isn't it ?
Related Posts Plugin for WordPress, Blogger...