ATG Framework and Components
ATG Framework and Components
Pawan Modi
[email protected]
ATG Page 1
ATG Framework and Components
Table of Contents
ABBREVIATION 7
ATG 8
Introduction 8
ATG Architectures 8
Component Centric Model 8
Model View Controller MVC 8
Design Patterns followed in ATG 8
ATG Platform 9
ATG Dynamo Port Map 9
Module Dependencies 10
ATG Components 11
Dynamo Application Framework (DAF) 11
Dynamo Personalization Server (DPS) 11
Dynamo Scenario Server (DSS) 11
ATG Portal 11
ATG Commerce 12
ATG Content Administration (ATG Publishing) 12
ATG Merchandising 13
ATG Search 13
ATG CSC (Commerce Service Center) 13
ATG Outreach and Campaign Optimizer 13
ATG Control Center (ACC) 13
ATG Business Control Center (BCC) 14
Components 18
Create / Modify Components 18
Component Properties File 18
CONFIGPATH Environment Variable 19
Component Scope 19
Component Logging 19
GLOBAL.properties 19
Linking Property Values 19
ATG Page 2
ATG Framework and Components
Repositories 21
Repository 21
Repository Item 22
Types of Repository in ATG 23
Item Descriptor 23
Repository View 27
Java Interfaces & Classes 27
Steps in Setting up a SQL Repository 28
Working with Repositories 29
Form Handlers 35
Form Handler Beans 35
Form Handler Methods 35
Exception Handling in Form Handler 35
Displaying error messages on page 35
ATG Out-of-the Box Form Handlers 36
Example of Using a FormHandler 36
Steps in writing Custom Form Handler 36
Example of Custom Form Handler (Java Code) 37
Example of Custom Form Handler (JSP Code) 37
SimpleSQLFormHandler 38
RepositoryFormHandler 38
ProfileFormHandler 38
SearchFormHandler 38
/atg/userprofiling/B2CProfileFormHandler 38
atg.b2bcommerce.profile.B2BcommerceProfileFormHandler 38
atg.commerce.profile. CommerceProfileFormHandler 38
ShoppingCartModifier,ExpressCheckoutFormHandler, CartModifierFormHandler 38
ATG Page 3
ATG Framework and Components
ATG COMMERCE 53
Profile Management 55
Profile Repository 55
Profile Form Handlers 55
B2C Profile Form Handler 56
B2B Commerce Profile Form Handler 56
Profile Tools and Property Manager 56
Create User Profile 57
Create Profile Group 57
Current Location Property 57
Catalog Management 58
Product Catalog 58
Extending default Product Catalog 58
Category Product and SKU 58
Catalog Navigation 59
Navigation History and Breadcrumbs 59
Custom Catalogs 60
Order Management 61
ATG Order Components (OTB) 61
ATG Order Java Interfaces 62
ATG Order Java Classes 63
Customizing OrderTools 65
Order Repository 69
/atg/userprofiling/Profile.transient Error! Bookmark not defined.
Pre-checkout Process 70
ATG Page 4
ATG Framework and Components
Checkout Process 74
ExpressCheckout/Expedited Checkout 74
Complex checkout 74
Simple Checkout 74
Order Pipeline 75
Running a processor chain 76
User defined Processor Pipeline 76
Tags in Pipeline Definition File 77
Transaction Handling 77
Payment Process 78
Payment Pipeline chain 78
Order Fulfillment 79
Promotions 85
Attributes to manage promotions 85
eCoupon 86
Coupon FormHandler 86
Gift certificate 86
Gift certificate FormHandler 86
Extra Info 88
/atg/userprofiling/B2CProfileFormHandler 88
/atg/commerce/catalog/CatalogNavHistory 88
/atg/commerce/ShoppingCart 88
OrderManager 88
Order Repository 88
Profile Repository 89
Product Catalog 89
ATG Page 5
ATG Framework and Components
sortProperties 89
Repository 92
SEORepository 92
SitemapRepository 92
SEO Components 93
JumpServlet 96
JumpServlet Configuration 96
URL Optimization 97
JSP Coding 97
Component Configuration 97
Appendix 109
Droplets 109
Form Handlers 111
ATG Page 6
ATG Framework and Components
Abbreviation
LM Load Manager
CM Connection Module
UDP User Datagram Protocol alternative protocol to TCP/IP, (usually used for broadcasting)
ATG Page 7
ATG Framework and Components
ATG
Introduction
ATG is the worldwide leader in the E-commerce solutions. ATG product suite has enabled the vendors
to enable their e-commerce commercial capabilities.
ATG Architectures
ATG follows architecture listed below.
Component Centric - The Dynamo Web applications are collected out of individual Java Bean
components, which are configured and linked together with .properties files.
MVC - Model View Controller architecture is a standard design pattern that separates an
application into three main components: the model, the view, and the controller.
This model makes it possible for us to build Dynamo applications by configuring pre-built components
instead of writing a lot of Java code from scratch.
View - The view gives the presentation of the model. The view can access the model getters only.
Controller - The controller takes action on the user input and creates, sets the model.
ATG Page 8
ATG Framework and Components
ATG Platform
The ATG Platform and its suite of products is a flexible, Java-based development environment for
building personalized applications for the Web and other communication channels (e-mail messaging,
wireless devices, etc.). The platform and its related products, include Dynamo Application Server, ATG
Portal, ATG Commerce, ATG Content Administration, and the ATG Control Center.
ATG Page 9
ATG Framework and Components
Module Dependencies
ATG application often depends on other modules which are started automatically when your module is
started. These dependencies are declared in the module manifest file at location <module-
name>/META-INF/MANIFEST.MF.
The list show above will include DSS at a minimum. If our application uses facilities provided by other
application layers (e-commerce) then we will need to include those modules in the list as well. Note that
we only need to include the top-level module, all additional modules required by the top modules will
automatically be started.
E.g. If our application requires DSS, which requires DPS, then we need to specify only DSS not DPS.
ATG Page 10
ATG Framework and Components
ATG Components
The ATG Platform includes the following core components:
Nucleus
Repositories
Tag libraries
This portable framework is designed to run on the industrys leading J2EE application servers, including
ATGs own Dynamo Application Server (DAS), IBM WebSphere and BEA WebLogic.
visitor profiling
content targeting
ATG Portal
ATG Portal provides a customizable framework for building personalized Web portals for specific user
communities.
ATG Page 11
ATG Framework and Components
A company, for example, might create separate portals for employees, customers, and partners, each
providing access to different content and services. The Portal Application Framework (PAF) is used by
developers to create and administer portals and the individual gears that render content and features (a
stock ticker or discussion forum, for example) within portal pages.
ATG Portal comes with a set of page template and baseline gears that you can use for your own portals.
ATG Commerce
ATG Commerce includes everything we need to build and manage personalized ecommerce Web sites.
ATG Consumer Commerce provides business-to-consumer (B2C) storefront development with following
features.
Profile Management
Order Management
Pricing
Inventory
Customer Service
ATG Business Commerce adds support for following business-to-business (B2B) transactions.
The system maintains the versions for the changes made to publishable assets. It keeps track of multiple
versions of publishable assets (scenarios or catalog items, for example) within specific publishing
projects. Content administration provides following tools.
Workflow editor
Deployment to Production
ATG Page 12
ATG Framework and Components
Using the workflow editor, you can define how each project moves through the various stages of the
publishing process i.e. content creation, editing, check-in, approval, QA and deployment on the live site.
ATG Merchandising
ATG Merchandising application runs on top of ATG Publishing and ATG Commerce. It provides a way to
Commerce Business users for creating and maintaining versioned content of various items like
ProductCatalog, Personalization targeters etc.
ATG Search
ATG Search is a leading search engine which lets users find in the information they wanted. The
response time of the search engine is very less. The features of ATG Search include.
Industry-specific lexicons
ATG Commerce Service Center helps in increasing revenues and profits by turning the service center into
sales center. It provides a smooth customer service experience. ATG Commerce Service Center is
customer service application which can be customized and deployed.
ATG Knowledge and Response Management accumulate and provide CRM related information.
ATG Page 13
ATG Framework and Components
The ACC provides application developers, page designers, site administrators, business managers, and
other members of your project team with point-and-click access to the tools they need for building and
maintaining ATG applications.
The ATG Business Control Center is the primary interface for performing ATG Content Administration
tasks, including the creation and deployment of Web site content.
Note: Content groups can be created via both i.e. ACC & BCC.
These components include user segments, content targeters, and content groups.
Profiles Management
Management of the profiles required by ATG Business Control Center users, including their organization
and role assignments.
The ATG Business Control Center is also used as the starting point for launching several ATG applications
including the following
ATG Merchandising
ATG Outreach
ATG Page 14
ATG Framework and Components
Our application server handles tasks like session management, load balancing, clustering, and SNMP
monitoring etc. But DAF supplies additional following facilities for application development and
deployment.
Nucleus
Nucleus is an ATG component container.
Nucleus is the central registry for the JavaBeans that contain our application-level logic.
It creates and configures Dynamo components and organizes them into a hierarchical
namespace so they can be referenced by other components.
By reading the various configuration files associated with each component, Nucleus figures out
what components to use in an application, what their initial properties are, and how they
connect to each other.
Nucleus is the mechanism that creates and configures new components, then gives these
components a place to "live" so they can be found by other components.
The components are stored in the Nucleus which is representing the components in a
hierarchical structure and the components are looked up using the request.resolveName(alias
name) method.
In Nucleus, every component has a unique name. Components are organized into a hierarchy,
similar to a file system. This results in component names such as
/atg/dynamo/service/Scheduler and gives Nucleus the ability to resolve relative names, such
as.../service/Scheduler. Furthermore, Nucleus components are JavaBeans, affording all the
advantages of the JavaBeans standard.
The Pages and Components task area in the ATG Control Center shows all of the components
currently registered in Nucleus (by module or by path) and provides templates to help we create
new ones, either from existing Dynamo classes or our own Java classes.
When it comes to configuring components for our application, we can use the built-in
Component Editor to specify initialization parameters and the way the components link
together. The ACC creates the necessary configuration files automatically.
DAF also provides a Web-based component browser, as part of the Dynamo Administration
interface that we can use to examine and modify components in a running Nucleus application.
ATG Page 15
ATG Framework and Components
Tag libraries
Originally the presentation language used by the framework was JHTML. There are lots of
custom tags provided in JHTML to access the dynamo components.
When JSP become the presentation language for java, the DAF framework provides the DSP tag
library to access Nucleus components and render dynamic content from our Java Server Pages
(JSPs).
DAF also includes a Core tag library that provides generic tags for flow control, manipulating
data and handling transactions.
Form Handlers
Form handlers are specialized Nucleus components that can be embedded in our JSPs to do
form validation and based on the results do certain actions like inserting into database,
forwarding the user to some other JSP page etc.
Using Form Handlers is the way to achieve Service to Workers (push based) approach of MVC2
design pattern.
DAF comes with a set of ready-made Form handlers like ProfileFormHandler,
ShoppingCartModifier etc. that we can use in your pages either directly or customize them using
the extension points given.
Repository API
The Repository API (atg.repository.*) is a data access layer that defines a generic representation
of a data store.
ATG support SQL repository, LDAP repository, Composite repository & Versioned repository.
Whenever ATG applications needs to load, store, or query a data store, they make the
appropriate calls through this API. The API then accesses the underlying data storage device,
translating the API calls into whatever calls are needed to access that particular data store.
Implementations of the Repository API exist to access data stores such as relational databases,
LDAP systems, and content management systems.
ATG Page 16
ATG Framework and Components
In addition, the Composite Repository feature enables us to consolidate multiple data sources
and make them available to our application as a single, queryable repository.
The Secured Repository Adapter provides fine-grained access control to repository item
descriptors, individual repository items, and even individual properties through the use of
Access Control Lists (ACLs).
ATG Page 17
ATG Framework and Components
Components
Components in ATG are a public java class with appropriate properties with set/get methods.
Additionally a component comes with .properties file that specify the class name and the scope and also
any default values. The properties file also contains any dependency injections of other components.
This .properties file must be placed under CONFIGPATH of the ATG.
The name of the component is the full path name of the .properties file under the configpath starting
with a /. For example, /com/vam/firstbean. CONFIGPATH variable is computed dynamically during
startup based on the modules started, their order of startup and based on the entry in the
MANIFEST.MF file of every module started.
Code reusability
Container independent
Note: In ATG, a component have one of the 3 scopes i.e. Global, Session, Request.
Using any of the above approach, we can browse components, set properties (single and multi-value),
link / unlink components.
Full component name are unique, containing folder names followed by simple component name,
separated by forward slashes like /atg/dynamo/service/SMTPEmail.
ATG Page 18
ATG Framework and Components
Component properties file mainly contain class, description & scope information of a component. Class
is a name of java class with package. Description is a short description of component and scope tell
about the component scope.
ATG looks for component properties file in directories specified by CONFIGPATH environment variable.
CONFIGPATH actually points to many folders and Nucleus reads entire CONFIGPATH left to right. So
every matching properties file is loaded.
If the same property value is defined in two files, the last value overrides previous values. It is called
configuration layering.
Component Scope
In ATG, a component can have any one of these scope.
Component Logging
Component can log information about their status. Logging can be done on per-component, per-module
or per-application basis. ATG support log levels i.e. error, warning, info, debug. Default log level is info.
Log files are generated <jboss>/server/atg/logs
GLOBAL.properties
GLOBAL.properties is a special properties file, not associated with any specific component this is often
used to set logging levels for a set of components.
ATG Nucleus can link the property of one component to the value of other component. To do this, we
need to append a ^ to the name of the property we want to set. Finally, enter the component name
and property name whose value is to be copied.
ATG Page 19
ATG Framework and Components
For example if there is a second bean whose age property is dependent on firstbean age property, then
the properties file of second bean will look like shown below, where firstbean is a nucleus name relative
to secondbean.
ATG Page 20
ATG Framework and Components
Repositories
ATG provides an easy to use and powerful object relational mapping (ORM) persistence framework. It
supports numerous databases, including Oracle and DB2, as well as popular open source databases such
as and MySQL. It uses reflection primarily to determine the java bean properties and does not need the
developer to code any POJO also.
Repository
The data access layer that defines a generic representation of a data store. Repositories access the
underlying data storage device through a connector, which translates the request into whatever calls
are needed to access that particular data store. Connectors for relational databases and LDAP
directories are provided out-of-the-box. Connectors use an open, published interface, so additional
custom connectors can be added if necessary.
A repository is a collection of repository items. Each repository connects to a single data store. But
application & subsystems in Dynamo can use different repositories or share the same repository.
The repository is not the data store itself instead, it is a collection of JavaBeans whose properties can be
found and stored in the data store. The mission of the repository is to provide a mechanism to retrieve
the data elements and a run-time representation of the available Meta information about each object.
Repository Items - Each employee would have a corresponding repository item. Repository item
is corresponding to row in database table. Repository item is made of properties. These
properties correspond roughly to columns of a table
Item Descriptors - An employee item descriptor would specify all of the properties that an
employee repository item could possess.
Repository Queries - An application can build queries that return the appropriate employee.
ATG Page 21
ATG Framework and Components
Repository Item
Repository items are like a JavaBeans. Their properties are determined dynamically at runtime. The
properties in a particular repository item depend on the type of item. One item might represent the user
profile (name, address, phone number) while another may represent the meta-data associated with a
news article (author, keywords, synopsis).
Each repository item is made of properties. These properties store the data that makes up a repository
item. Each property has a name, such as id, firstName, or lastName etc.
In the SQL repository, these properties correspond roughly to columns of a table. The properties
available to a type of repository item are defined in the repositorys item descriptors.
So the purpose of the Repository interface system is to provide a unified way for data access. For
example, developers can use targeting rules with the same syntax to find people or content.
Each repository item must have an identifier, which is called a repository ID. The repository ID must
uniquely identify the repository item from all other repository items of the same type. So each item
descriptor must specify the columns that act as the repository ID (which will usually be the same as the
tables primary key. If we dont define an id property in the item descriptor, then the id property must
use the default data-type, which is string.
For example, In the SQL repository, a repository item often corresponds to a row in a table. In the SQL
profile repository, each user profile is a repository item.
ATG Page 22
ATG Framework and Components
1. SQL Repositories - use ATGs Generic SQL Adapter (GSA) connector to perform a mapping
between ATG and data stored in a SQL database. It can be used to access content, user profiles,
application security information, and more.
2. LDAP Repository - Uses the Dynamo LDAP connector to access user data in an LDAP directory.
3. Composite Repository - provides a means for using more than one data store as the source for a
single repository.
4. Versioned Repositories - an extension of the GSA used in ATG Publishing. This is to maintain
versions of repository items.
Item Descriptor
Each repository item type is described by a Repository item descriptor (which has a one-to-one
correlation with RepositoryView). The item descriptor gives a name to the type, and also describes the
properties for that type. The name of each property is defined in the item descriptor, as well as the class
of the Java object used to represent that type (Integer, String, etc.). The item descriptors exposed by a
repository depend on a combination of the underlying data store and the configuration of the
repository.
For example, In the SQL repository, each database table might have its own repository item descriptor.
Or another alternative might join multiple tables into a single item descriptor.
Also Repositories can support multiple item descriptors. For example, a SQL repository instance that
supports a commerce application might have different item descriptors representing users, products,
product categories, orders, etc.
Item-Descriptor Relationships
One to One Represented by auxiliary tables.
The multi-column-name attribute ensures that the ordering of the multivalues are maintained.
The column specified by the multi-column-name attribute is used for multi-valued properties of data-
types array, map, and list and is not used for sets (which are unordered). For map type properties, the
ATG Page 23
ATG Framework and Components
values in the column specified by the multi-column-name attribute must be a string. For list or array
type properties, these values should be an integer or numeric type, and must be sequential.
Xml-Combine
Xml combine tag is use to extend default catalog (product catalog).
xml-combine="replace"
xml-combine="remove"
xml-combine="append"
xml-combine="append-without-matching"
xml-combine="prepend"
xml-combine="prepend-without-matching"
Cascade attribute
The SQL repository uses the cascade attribute to better handle hierarchical properties with either the
item-type or component-item-type attributes. The cascade attribute can take one or more values i.e.
insert, update, or delete.
Cascade Insert
If a repository item has a property with the item-type attribute and the cascade="insert" attribute set,
then when the item is created following action executes.
A new item of the type declared by the item-type attribute is also created and
The cascade="insert" attribute is typically used with cascade="update" and cascade="delete" so that
management of this item is completely automatic. The item is created, added, updated, and deleted
along with the parent item. The cascade="insert" attribute is ignored for properties that use
component-item-type.
Cascade Update
If a repository item has a property that refers to other items and that has the cascade="update
attribute set, then.
ATG Page 24
ATG Framework and Components
When we call addItem(), any new (transient) items referenced by this property are added
automatically to the repository and
When we call updateItem, any referenced items that have been modified are automatically
updated. Any referenced items that are new (transient) items are added.
Cascade Delete
If a repository item has a property with the cascade="delete" attribute set, then when you remove the
repository item, any items that are referenced by the property will also be removed. Also, when you
remove a reference to this item, the item is automatically removed.
Special care must be taken in cascade delete in one-to-many relationships. Do not use cascade="delete"
in properties on the many side of the relationship that refer to items on the one side of the
relationship.
The item on the one side of the relationship cannot be deleted safely, since multiple items may be
referring to it.
For example, suppose you have an item descriptor named company with an employee property that
references many repository items defined by an employee item descriptor.
The employee item descriptor itself defines a company property. In this one-to-many relationship, the
employee property in the company item descriptor could use cascade="delete". But the company
property in the employee item descriptor should not use cascade="delete", since deleting one employee
item would then delete the company item that is referenced by the remaining employee items.
Derived properties
In a SQL repository, we can have derived properties. This feature enables one repository item to derive
property values from another repository item or from another property in the same repository item.
Transient Properties
The SQL repository allows us to define transient attributes for a repository item. Transient attributes
are never stored or read from the persistent data store. They are readable and writable, but not
queryable.
ATG Page 25
ATG Framework and Components
A transient property can be specified by defining a <property> tag that is not associated with any
database table, but which is instead a direct child of an <item-descriptor> tag.
For example, suppose you have a query like this job = manager AND sal = 5555
If query caching is enabled, the first time this query is issued, the result set is retrieved from the
database and stored in the query cache. Then, the next time this same query is issued, the SQL
repository can retrieve the result set from the cache, rather than needing to access the database.
Cache Invalidation
Item cache entries are invalidated when that item is updated & affected queries are also invalidated. In
addition, whenever an item of a given item type is added to or removed from the repository, all queries
are invalidated in the query cache for that item descriptor.
Cache Modes
The SQL repository implements several different modes of caching. Which mode is to be chosen
depends on the nature of your Dynamo application.
No Caching (disabled)
Simple Caching - caching is handled separately in each VM, with no invalidation events to
synchronize updates from different server instances. By default, the SQL repository uses simple
caching. Simple mode is better if the application is running on only one JVM and is not clustered
across.
Locked Caching - read and write locks are used to synchronize the caches.
ATG Page 26
ATG Framework and Components
By default, the SQL repository uses simple caching. To enable a different cache mode for an item
descriptor, set the cache-mode attribute in the item-descriptor tag of the repository definition file.
Note:
Simple mode is better if the application is running on only one JVM and is not clustered across.
If the ATG applications are deployed on a cluster of servers, then we have to go in for either
Locked caching or Distributed Caching.
For repositories like ProfileAdapterRepository, where at the most one server alone will be
handling the updates, it is better to use Locked caching because we have single server & many
modules wants to try operation at the same time.
Repository View
atg.repository.RepositoryView
If you do not have an exact repository ID, you can search for items in the repository through a
RepositoryView. Item descriptors and RepositoryViews often have a one-to-one relationship and often
have the same name. You can find out what views are available through the viewNames property of the
Repository component. This is useful if you need to build a system to navigate and view the entire
contents of a repository. The IDs for items in different item types might not overlap. There might be no
view that can return all items in the repository, but if there is, it is the default view. If you need to use
the default view, you can use the view named by the defaultViewName property. Alternatively, you can
create properties for your own services that allow you to explicitly name the view your code is
interested in using. After you have a name, you can retrieve that view through the RepositoryView
getView(String pName) method. From this returned object you can build and execute a query.
atg.repository.Repository
The atg.repository.Repository interface is the base definition of any repository implementation. This
interface provides methods to access RepositoryItems, RepositoryViews and ItemDescriptors,
corresponding to the three main elements of the repository.
atg.repository.RepositoryItem
The atg.repository.RepositoryItem interface is the immutable interface that represents an
element from a repository.
ATG Page 27
ATG Framework and Components
After a repository item is created, but before it is added to the database, you can change its
repository ID by changing the value of the id property.
Once the item has become persistent, you can no longer change the ID.
atg.repository.RepositoryView
atg.repository.QueryBuilder
Sets of repository items can be gathered by queries, which you can build using the
atg.repository.QueryBuilder interface.
This QueryBuilder object can be obtained from the repository views queryBuilder property.
Once a query is built, each RepositoryView implementation translates the internalized data
structure into its native query language, for example SQL, and then return an array of repository
items that match the supplied query criteria.
Once a query is built from the QueryBuilder, it is executed via the various executeQuery
methods defined in the RepositoryView interface.
an array of RepositoryItems, for elements that match the where clauses of the query,
or
Add the necessary item-descriptors in the XML file and map them to the appropriate tables.
Make the GSARepository java class into a global component by defining a .properties file and
configure the properties like DataSource, Definition file etc.,
Use the startSQLRepository command line tool to test out the repository and get the DDL
structure.
ATG Page 28
ATG Framework and Components
Retrieving Item
We can retrieve items from the repository using the following methods.
Creating Item
We can create items using the following two methods.
Note Above methods creates a MutableRepositoryItem. This does not insert the item into the
Repository. The item exists only in the memory.
Adding Item
Once an item is created using create item method, we can turn it to a persistent repository item use the
addItem method.
Removing Item
Removing item persistently, just pass the ID and ItemDescriptor name of the item to the removeItem
method. The items property values will be deleted and will no longer be accessible from the repository.
Updating Item
The MutableRepository updates a repository item transactionally in three steps.
ATG Page 29
ATG Framework and Components
3. Above changes will not be reflected in the repository until the final updateItem operation is
invoked. Save the changes with the updateItem method. This method extracts all the changes
required for the item and updates the item in the data store. Depending on how you have
configured transactional behavior, the update can be committed immediately, or the update
may happen automatically when the associated transaction commits. If there was any type of
error, a RepositoryException is thrown.
ATG Page 30
ATG Framework and Components
DAF (Dynamo Application Framework) comes with a set of ready-made (out-of-the-box) Droplets that
can be used. The user can create their own droplets based on their need. They are referred as Custom
Droplets.
Advantages of Droplets
We can include multiple droplets in a single page.
Parameters can be passed between different droplets. For examples - ForEach, Switch, IsNull,
IsEmpty etc.
ATG Page 31
ATG Framework and Components
Droplet Parameters
Input parameters
Output parameters
Open parameters
Open parameters contain the data that is rendered by the servlet bean.
Marked by dsp:oparam tags, and specify code to execute at different stages of servlet
processing.
ATG Page 32
ATG Framework and Components
Identify the appropriate Input parameters that can be passed to droplet and the OPARAMS the
droplet will render and also the various output parameters the droplet will set in the request.
Write the BeanInfo class and define all the necessary parameters in that.
Make the droplet into a component using the ATG Component Browser.
Embed the droplet in a JSP page using the <dsp:droplet ..> tag and pass the necessary
parameters.
Us the OPARAM tags to mix the HTML content and the dynamic values returned by the droplet.
ATG Page 33
ATG Framework and Components
TargetingForEach
TargetingForEach droplet uses the RootCategories targeter to find root categories.
ItemLookupDroplet
ATG Page 34
ATG Framework and Components
Form Handlers
Form handlers are specialized nucleus components that embedded in JSPs to do form validation and
based on the results do certain actions like inserting into database, forwarding the user to some other
JSP page etc. The form handler checks the validity of the data, check for errors, and determines what
action to take (e.g., submits the data, direct the user to a different page, display an error message, etc.)
Direct interaction with SQL database e.g. Storing and retrieving information from database.
Using Formhandlers we can associate various inputs to the nucleus components. User can create their
own Formhandlers based on their need. They are referred as Custom FormHandlers.
formExceptions: A vector of the exceptions that occurred when the form is processed.
ATG Page 35
ATG Framework and Components
ProfileFormHandler Connect forms with user profiles stored in a profile repository. Creating,
modifying and deleting user profiles.
CartModifierFormHandler Used to process an order such as adding to cart, modifying cart etc.
Provide the appropriate handleXXX methods e.g. handleCreate(), handleUpdate() etc. Each
Handler method will be triggered by a corresponding dsp:input submit button from the JSP
page.
Provide either a Map data structure to hold the form data or provide individual fields with
appropriate set/get methods.
Write the validation logic inside the handler methods and return appropriate Boolean codes.
ATG Page 36
ATG Framework and Components
Populate validation errors, if any, into the formExceptions Vector or proceed to do the business
logic.
ATG Page 37
ATG Framework and Components
SimpleSQLFormHandler
SimpleSQLFormHandler for working with form data that is stored in a SQL database.
RepositoryFormHandler
RepositoryFormHandler for saving repository data to a database.
ProfileFormHandler
ProfileFormHandler class to connect forms with user profiles stored in a profile repository.
SearchFormHandler
SearchFormHandler for specifying properties available to a search engine. You can also extend these and
other form handler classes to handle the specific needs of your application.
/atg/userprofiling/B2CProfileFormHandler
atg.b2bcommerce.profile.B2BcommerceProfileFormHandler
atg.commerce.profile. CommerceProfileFormHandler
ShoppingCartModifier,ExpressCheckoutFormHandler,
CartModifierFormHandler
These form handlers are used to manage the Shopping Carts.
ATG Page 38
ATG Framework and Components
session tracking
page compilation
Every request sent to the Dynamo server is dispatched to the servlet pipeline. The request is delivered
to the servlet at the head of the pipeline. The pipeline is started by Page filter and most requests
handled by Nucleus are dispatched to the PageFilter or DynamoProxyServlet. Each servlet in turn
performs its specific function on the request. Each servlet is also given a pointer to the next servlet in
the pipeline. When a servlet is done acting on the request, it can pass the request to the next servlet.
This linked-list of servlet is called the servlet pipeline. This provides the flexibility of customizing the
pipeline through configurable components.
ServletUtil
This class (atg.servlet.ServletUtil) is used to import the information of Dynamo specific requests or
response. For example, to access the state object parameter, jsp should use following sample code.
ATG Page 39
ATG Framework and Components
Types of Pipelines
There are two request-handling pipelines used by Dynamo.
DAF Servlet Pipeline - It is used to handle the JSP request. This pipeline is for customer
application jsp request.
DAS Servlet pipeline - It is used to handle JHTML request. Because JHTML is a proprietary
language, it relies on the page compiler provided in the DAS servlet pipeline to generate JHTML
into a servlet thats rendered as HTML by the application server.
The application server follows the following path for processing the request.
1. When a user performs an action that prompts a response, the application server creates an
instance of the HttpServletRequest and HttpServletResponse.
2. Based on the directories and file extension of the requestURI, the application server uses servlet
and filter mappings defined in web.xml to determine the next resource to call.
3. By default, PageFilter is mapped to handle JSP requests. When the application server invokes
PageFilter, it checks the request and response for a reference to a Dynamo request and
response pair.
ATG Page 40
ATG Framework and Components
4. The pair does not exist; PageFilter will start the DAF servlet pipeline by calling DynamoHandler,
the first servlet in the pipeline.
5. The DAF servlet pipeline will process through a series of servlets that modify the request and
response by extracting path information and providing session, user, and security information.
Note: ATG Business commerce pipeline includes additional components more than ATG Consumer
Commerce.
pageFilter is use only in DAF request handling pipeline. It is responsible to handle jsp pages. pageFilter
call an instance of DynamoHandler a first servlet in a pipeline. Now it is a responsibility of
DynamoHandler to generate DynamoHttpServletRequest wrapping generic HttpServletRequest.
The application server follows the following path for processing the request.
1. A call for a page in the dyn directory, which holds all JHTML pages, causes the application server
to invoke DynamoProxyServlet, which is responsible for starting the DAS servlet pipeline by
calling DynamoHandler.
2. The DAS servlet pipeline performs the same request and response handling tasks as the DAF
servlet pipeline.
3. One task common to both pipelines is the compiling of JHTML pages by PageCompileServlet,
one of the servlets in the pipeline.
4. By default, no filters are involved in request-handling process; if you create custom servlet
filters, they will be invoked before DynamoProxyServlet.
Note:-
Although DynamoHandler does the same thing in both pipelines but a different version of
DynamoHandler is used for each request type.
ATG Page 41
ATG Framework and Components
The main difference between the DAS and DAF servlet pipelines is that the DAS servlet pipeline
automatically compiles the page from JHTML to Java, whereas the DAF servlet pipeline relies on the
application server to handle the complete page compilation process.
In order to write custom pipeline servlet, needs to implement an interface i.e. PipelineableServlet.
Create a component using this servlet. The components created by these servlets should be globally
scoped and configured to the pipeline.
The PipelineableServlet interface has two subinterfaces that provide additional mechanisms for
determining the next component to invoke.
InsertableServlet
Servlets that implement the InsertableServlet interface have an insertAfterServlet property that
enables the servlet to insert itself in a specific spot in the pipeline. The key advantage of this mechanism
is that it does not require modifying any existing servlets in the pipeline compared to
PipelineableServlet.
Example: if we want to insert a servlet i.e. Servlet1a, between two servlets i.e. Servlet1 & Servlet2 in the
pipeline.
ATG Page 42
ATG Framework and Components
If Servlet1a implements PipelineableServlet, you can reroute the pipeline by changing the value of the
Servlet1.nextServlet property pointing to Servlet1a rather than Servlet2, and set Servlet1a.nextServlet to
point to Servlet2.
Servlet1a is able to do this because it effectively sets its own nextServlet property to the value of
Servlet1s nextServlet property and rewrites Servlet1s nextServlet property to point to Servlet1.
2. Define it as a component in the Nucleus hierarchy of this servlet. It does not really matter where
you put your servlet in the component hierarchy.
3. Set the insertAfterServlet property of your servlet to point to the path of the pipeline servlet
you want your servlet to follow in components property file.
4. For example, if you want your servlet to follow the DynamoServlet in the pipeline, use
ATG Page 43
ATG Framework and Components
DispatcherPipelineableServlet
DispatcherPipelineableServlet interface provides a mechanism for conditionally branching the pipeline.
This interface includes a dispatcherServiceMap property that is a Map of possible servlets to invoke
next, depending on some condition.
key1, list1<servlets>
key2, list2<servlets>
If key2 is matching the condition then servlets from list2 will be invoked in sequence.
For example, the MimeTypeDispatcher servlet determines which servlet to invoke depending on the
MIME type of the request.
ATG Page 44
ATG Framework and Components
Example: If a customer registers, but doesn't log in within two weeks, then send them a reminder e-mail
offering a 10% discount toward their first purchase.
By analyzing the data collected from scenarios, we can fine-tune our business initiatives and the site's
overall design to best meet the needs of our customers.
Scenarios are event-driven. Event element defines what the site visitor does, an Action element defines
what the system does in response. A scenario anticipates and tracks the actions of the people who visit
our Web site and responds appropriately by tailoring the content of the site, offering price promotions,
or sending targeted e-mail messages.
Scenario server itself is event driven. Events in DAF are just JMS messages and therefore the scenario
server acts as a MessageSink. We can configure it to listen to various events (by default, it receives all
the standard Dynamo events).
When a scenario is created or modified in the ACC, its definition is saved in the scenario registry (located
at the Nucleus path /atg/registry/data/scenarios) as a file with the extension .sdl.
ATG Page 45
ATG Framework and Components
Slots
Slots are Nucleus components that can be used to display and manage dynamic content on Web site.
Targeting servlet beans are used to include slots in site pages and scenarios are used to fill them with
content. Slots are more powerful and flexible than targeters. Example, slots have better caching
capabilities than targeters, which can make displaying content faster.
Slots have better caching capabilities, which can make displaying content faster. Scenarios use slots to
manage the delivery of dynamic content. For example, scenarios allow us to set up an empty slot that
generates its own request for content when a site visitor displays the page.
The process of creating and setting up a slot has the following steps.
2. Add an appropriate targeting servlet bean (for example, TargetingForEach) to the page or pages
where you want the slot to appear. In the Targeter property of the bean, specify the slot
component.
3. Create a scenario that specifies the content you want to display in the slot and defines the
circumstances in which the content appears.
ATG Page 46
ATG Framework and Components
Ideally, a Web site should recognize that we are looking at a particular category of information, and
show the related products, services, and information for that category. This concept called as
personalization. Personalized Web sites customize the behavior, content, and presentation of the site
to fit each visitor's characteristics and preferences. Some Web applications explicitly segment their users
into several affinity groups (such as visitors and members, or investors and brokers), and associate
different content with each group of users.
When the World Wide Web was first developed, one big problem was trying to find valuable information.
There was not much content published, and searching for the right piece of information was difficult. To
make finding the sparse information easier, companies such as Yahoo started creating indexes of all the
available content, and Web sites started including site maps among their pages.
Most Web sites today have their own search engines, because the amount of content on even a single
site is too vast to navigate by means of a site map.
Personalization
ATG Personalization lets you customize content for specific users and events, primarily through two
mechanisms.
Slots that display their content in the context of certain events, or scenarios.
DPS Repository
Dynamo SQL Profile Repository - It is pre-configured default repository for DPS. Using this, we can
store, modify and query user profile data in a SQL database. Example is
/atg/userprofiling/ProfileAdapterRepository.
Dynamo LDAP Profile Repository - Using this, we can store, modify and query user profile data in LDAP
(Lightweight Directory Access Protocol) directory.
Content Repository - A content repository is a collection of content items managed by a single system
such as a relational database, file system, or third-party content management system. A content
ATG Page 47
ATG Framework and Components
repository typically serves as a source of content items to be displayed to a user, either directly or as an
element in a page.
Note: Since the GSARepository class implements both the atg.repository.Repository interface and the
atg.repository.content.ContentRepository interface. So a repository can contain multiple repository item
types. So a single repository can contain both content repository items (arranged in a hierarchical
structure with folders that can contain repository items and other folders) and non-content repository
items (arranged in a flat structure).
One and only one item descriptor that defines repository items that act as folders (the folder
item descriptor) and
One or more item descriptors that define content repository items (the content item
descriptors).
DPS makes profiles persistent by storing them in a database. DPS includes two implementations of the
Dynamo Repository API for accessing stored profile data.
Keeping track of profile attributes makes it possible to segment site visitors into target audiences called
profile groups. Business managers create profile groups by defining business rules in the Targeting >
Profile Groups window of the ATG Control Center. Once we create a profile group, we can use it to
define our targeting rules and scenarios (if we have DSS installed).
ATG Page 48
ATG Framework and Components
Profile Properties
The profile contains properties that describe the person's characteristics. There are two kinds of profile
properties. Usually, the system updates profile properties automatically. We do not have to change
them. But Control Center provides options that let us view the profiles in the repository. We can also
use them to add, edit, and delete profiles if necessary.
Explicit Properties Explicit properties are provided by site visitors when they fill registration form to
become a member of your site. Examples of explicit properties are a person's name and address.
Implicit Properties - Implicit properties are information that the system gathers about visitors by
tracking their behavior at your site. Example is a list of recently browsed Web pages is an implicit
property.
SimpleContentProcessor
This doesnt do any processing on the passed in message content, but simply uses the content as is to
set the javax.mail.Message content. The MIME type of the content in the Message is specified by the
services contentType property. Example, if contentType is text/html the rendered page is sent as
HTML and if the contentType is text/plain it will be sent as simple text (no word wrapping).
HtmlContentProcessor
HtmlContentProcessor a more sophisticated implementation of MessageContentProcessor. This does
the following jobs.
ATG Page 49
ATG Framework and Components
Content Management
The term content refers to discrete units of information (a news article or a banner image, for example)
available for display to Web site visitors, either directly or as an element in a Dynamo Server Page. Each
unit of content, or content item, is associated with a particular type of media (an HTML or XML file, a
GIF file, a PDF document, etc.) and has meta-data that describe its characteristics.
Content data is also stored in searchable repositories. A content repository is a collection of content
items managed by a single system such as a relational database, file system, or third-party content
management system.
Once we set up a content repository, we can run queries against meta-data attributes to search for and
manage particular content items. We can also run targeting operations against the content attributes to
match content items with visitor profiles.
Similar to profile groups, we can organize content items into logical groupings called content groups by
defining business rules in the Targeting > Content Groups window of the ATG Control Center. Once we
create a content group, we can use it to define our targeting rules and scenarios (if we have DSS
installed).
Content targeters are the business rules created using the ACC. In the DPS rule-based system, business
managers create rule sets that control how content is displayed on the Web site. Business rules define
the content that we show to each profile group.
ATG Page 50
ATG Framework and Components
Content targeter relates the content group with the profile group.
To display targeted content, site must include content targeters that define the rules that determine
which users see what content. You can create targeters through the Content window of the Control
Center.
TargetingRange displays a range of items, such as the third through the seventh.
TargetingArray
The first four of these servlet beans perform fundamentally similar operations. Each one uses a
targeter to gather a set of items from a content repository, and renders the content items on the
page. They differ only in whether they display all of the items returned by the targeter, or just a
specific subset.
We can disable this behavior for any targeting servlet bean by setting one or both of the following
parameters in the servlet.
Note - If we have ATG Scenarios, we can use scenarios instead of targeting rules to control the content
that we display to each profile group.
ATG Page 51
ATG Framework and Components
ATG Page 52
ATG Framework and Components
ATG Commerce
ATG Commerce module provides the foundational packages for online store. It handles pricing,
inventory, fulfillment, merchandising, targeted promotions, and customer relationships. ATG supports
both B2C by ATG Consumer Commerce and B2B by ATG Business Commerce.
Profile management
Product Catalog
Inventory management
ATG Page 53
ATG Framework and Components
Order Fulfillment
ATG Page 54
ATG Framework and Components
Profile Management
Profile management is the extension of Personalization functionality. The following are the extensions
of personalization.
Profile Repository
Profile Repository
Describes the attributes that ATG Commerce adds to the user Item Descriptor to support gift lists, wish
lists, promotions, address books, credit card collection and other minor features.
The Personalization modules Profile Repository is an instance of the Generic SQL Adapter. It is located
in /atg/userprofiling/ProfileAdapterRepository. The Personalization module defines a base user Item
Descriptor in it. This user has many general attributes defined, such as first and last name, e-mail
address, date of birth and home address. It adds several attributes to the user Item Descriptor to
support gift lists, wish lists, promotions, address books, credit card collection and other minor features.
The following operations are performed by overriding the addPropertiesOnLogin, postCreateUser and
postLoginUser methods from the ProfileFormHandler.
ATG Page 55
ATG Framework and Components
2. During the registration and login process, any shopping carts (Orders) created before logging in
are changed to be persistent. If the users persistent profile contains any old shopping carts
(Orders in an incomplete state), these shopping carts are loaded into the users session.
3. After log in, the PricingModelHolder component is reinitialized to cache all the promotions that
the persistent user has accumulated during previous sessions.
The B2CProfileFormHandler also provide handler methods to check up creditcards for their format and
there is a converter to print the Credit card number masked.
We can use the Profile.transient property to check up whether the user is logged in or not and act
accordingly.
Note: Any custom profile property that is added by us, must be handled in our FormHandler component
which will extend the B2CProfileFormHandler. The userProfile.xml can be extended to add more
properties.
In B2B, it is extended to include the concept of addition or removal of CostCenters for B2B sites.
ATG Page 56
ATG Framework and Components
Example: The shipping addresses are managed by the Commerce Profile Tools component. This
extension of the tools component provides methods to create, delete and update profile repository
shipping addresses as well as to retrieve all shipping addresses.
Example: The shipping address property names are stored in CommercePropertyManager. This provides
a convenient central location to store property names that may change depending on the site.
Returning registered members can log in with their user names and passwords. Once they log in,
members can access the My Profile page that allows them to maintain personal and commerce
profiles and to track their order information.
Administrators can view and manipulate user profile data using the Profile interface in the ACC.
This interface enables them to search, create, edit, duplicate, and delete user profiles.
ATG Page 57
ATG Framework and Components
Catalog Management
Product Catalog
The Product Catalog is a primary component in the Commerce Application. It is a repository containing
repository items like category, products, media, etc. This provides an organizational framework to a
commerce site. ATG Commerce includes a default catalog which can be extended as per the need.
Catalog repository items can be edited using ATG Control Center (ACC).
In ATG Commerce, the product catalog is an ATG repository and the various elements of the catalog
(such as categories, products, and images) are repository items. The product catalog is built by adding
new repository items and defining relationships between them.
Xml-combine is used to extend the default catalog. These extensions can be created to add properties
to categories, products and skus. But new tables must be created in the database to accommodate the
extended properties.
xml-combine="replace"
xml-combine="remove"
xml-combine="append"
xml-combine="append-without-matching"
xml-combine="prepend"
xml-combine="prepend-without-matching"
A product is a navigational end-point in the catalog. But, customers purchase a SKU and not a product.
A product may have several different SKUs associated with it, representing varieties, sizes, and colors.
ATG Page 58
ATG Framework and Components
For example, a product that represents a specific shirt might have many associated SKUs, representing
different combinations of size and color
Catalog Navigation
A catalog home page displays a list of root categories. ATG provide targeters to find root categories.
Category is considered to be a root category if their root category property is set to true.
Developers can use TargetingForEach droplet which uses the RootCategories targeter to find root
categories.
Categories, products and skus can be displayed using CategoryLookup, ProductLookup and SKULookup
droplets respectively.
ATG Commerce provides CatalogNavHistory component to track the customers path through the
catalog. The component is placed under /atg/commerce/catalog/CatalogNavHistory. The component
uses the following input parameters.
1. navAction - operation to be performed on the stack. Options are push, pop and jump. A blank
navAction is treated as push.
2. navCount - to detect use of the Back button and should be passed in with any link that leads to
a page that uses breadcrumbs.
ATG Page 59
ATG Framework and Components
Custom Catalogs
Custom catalogs are an important feature for commerce websites. It is needed to provide information to
particular customers or companies. The Product Catalog can be altered to create a number of sub-
catalogs representing the smallest section of the inventory that the customers want to view.
Step 2: Configure the product catalog repository to use the custom catalog xml file. Define the path of
this repository in the productCatalog.properties file.
Step 3: To keep the atg.repository.servlet. ItemLookupDroplet from returning an item that is not in the
current catalog, change the following servlet beans.
/atg/commerce/catalog/CategoryLookup.properties
/atg/commerce/catalog/SkuLookup.properties
/atg/commerce/catalog/ProductLookup.properties
$class=atg.commerce.catalog.custom.CatalogItemLookupDroplet
ATG Page 60
ATG Framework and Components
Order Management
ATG Order management supports functionality like
Order History
Shopping cart
Shopping Cart is an Order in incomplete state.
Order
Orders are in process. Customers can have an unlimited number of orders in existence at one time.
Order Holder
This class maintains the current Order object as well as a collection of saved Order objects. The
component that utilizes OrderHolder is /atg/commerce/ShoppingCart, a session-scoped component
whose handleXXX methods add, delete, and switch between carts
Order Repository
Repository to store the Order details
Order Manager
There is a business layer class called as OrderManager which takes care of
creating/loading/refreshing/updating the orders. This component in turn interacts with the Pipeline
processors. Order Manager interacts with the pipeline processors.
ATG Page 61
ATG Framework and Components
Pipeline
Includes a sequence of Pipeline processors to do the job in a fine grained transactionally aware manner
for order submission and payment. This pipeline contains the sequence of processors for order
submission and payment.
Payment Manager
There is a component called as PaymentManager which in turns interfaces with Payment Pipeline to talk
to the third-party payment gateways to ensure that the CreditCard authorization/debit is handled
seamlessly.
Form Handlers
CartModifierFormHandler, ShoppingCartModifier, ExpressCheckoutFormHandler etc. are used to
manage the Shopping Carts
Droplets
RepriceOrderDroplet, PriceEachItem, PriceItem etc. which are used to display the price of the SKUs.
OrderTools
OrderTools contains a set of properties that you can use to customize the purchase process. The default
property settings should be suitable for most sites, but can be changed.
Order
The Order interface represents the delivery and payment information for a collection of items. An Order
contains CommerceItems, ShippingGroups, PaymentGroups, and Relationships.
CommerceItem
The CommerceItem interface represents information about a product to be purchased. A
CommerceItem contains the SKU (also called the catalogRefId) and the quantity of the item purchased.
ShippingGroup
The ShippingGroup interface contains information about the delivery of a collection of CommerceItem
objects. A ShippingGroup could contain a physical delivery address.
PaymentGroup
The PaymentGroup interface contains payment information, shipping costs, and tax information for
each item or the entire Order. This includes information such as a credit card number, an expiration
date, and the amount to be charged.
ATG Page 62
ATG Framework and Components
Relationship
The Relationship interface represents an association between two or more of the commerce objects
listed above, such as the relationship between a CommerceItem and a ShippingGroup.
HandlingInstruction
The HandlingInstruction interface describes special handling for a CommerceItem within a given
ShippingGroup. Gift wrapping is an example of HandlingInstruction.
Order Classes
OrderImpl: This class implements Order. It contains data structures for managing collections of
other commerce objects. It manages collections of CommerceItem, ShippingGroup,
PaymentGroup, and Relationship objects.
Item Classes
CommerceItemImpl: This class implements CommerceItem. It stores the data about a specific
item in an Order.
Shipping classes
ShippingGroupImpl -This class implements ShippingGroup. It stores the data describing where
and how to ship CommerceItems, as well as the Relationships to items in the shipping group.
This class provides no functionality itself.
There are 2 subclasses which have actual implementation called HardgoodShippingGroup and
ElectronicShippingGroup.
Payment Classes
PaymentGroupImpl - This class implements PaymentGroup. It stores the payment information
for CommerceItems, shipping costs, and tax. It also can contain Relationships to those items,
shipping costs, or tax costs in the PaymentGroup.
ATG Page 63
ATG Framework and Components
This class provides no functionality itself, but is used through the CreditCard and GiftCertificate
subclasses.
Relationship classes
ShippingGroupCommerceItemRelationship - When this Relationship is added to a
ShippingGroup and CommerceItem, the CommerceItem is shipped using the information in the
ShippingGroup. This Relationship object itself contains data such as the quantity to be shipped.
Handling Classes
HandlingInstructionImpl - This class implements HandlingInstruction. It contains a
ShippingGroup ID, CommerceItem ID, and quantity, as well as data about what quantity of
CommerceItems in which ShippingGroups need special handling. This class provides no
functionality itself, but should be used through a subclass like GiftlistHandlingInstruction.
ATG Page 64
ATG Framework and Components
Address classes
There are two classes atg.core.util.Address and atg.core.util.ContactInfo. These objects are referenced
when a user checks out. We need to extend these objects to track additional information about your
users if needed.
atg.core.util.Address
atg.core.util.ContactInfo
These classes address Properties like firstName, middleName, lastName, address1, address2, City,
state,country, postalCode, ownerId and ContactInfo Properties like phoneNumber, faxNumber, email.
OrderTools
OrderManager
CommerceItemManager
ShippingGroupManager
HandlingInstructionManager
PaymentGroupManager
OrderQueries
SimpleOrderManager
Customizing OrderTools
OrderTools need to be customized when the order module is extended. The OrderTools component is
located in Nucleus at /atg/commerce/order/.
ATG Page 65
ATG Framework and Components
orderTypeClassMap
This property defines the type-to-class name mapping for Order objects. You can have more than one
type of Order object. When creating a new Order, a string is passed as a parameter to the create
method. (For example, the string default could be passed.) This constructs an instance of an Order
class that is mapped to that string.
commerceItemTypeClassMap
This property defines the type-to-class name mapping for CommerceItem objects. You can have more
than one type of CommerceItem object. When creating a new CommerceItem, a string is passed as a
parameter to the create method. (For example, the string default could be passed.) This constructs an
instance of a CommerceItem class that is mapped to that string.
shippingTypeClassMap
This property defines the type-to-class name mapping for ShippingGroup objects. You can have more
than one type of ShippingGroup object. When creating a new ShippingGroup, a string is passed as a
parameter to the create method. (For example, the string hardgoodShippingGroup could be passed.)
This constructs an instance of a ShippingGroup class that is mapped to that string.
paymentTypeClassMap
This property defines the type-to-class name mapping for PaymentGroup objects. You can have more
than one type of PaymentGroup object. When creating a new PaymentGroup, a string is passed as a
parameter to the create method. (For example, the string creditCard could be passed.) This constructs
an instance of a PaymentGroup class that is mapped to that string.
ATG Page 66
ATG Framework and Components
relationshipTypeClassMap
This property defines the type-to-class name mapping for Relationship objects. You can have more than
one type of Relationship object. Relationships are not created directly by a user. Relationships are
created by methods based on the type of relationship that the method needs.
The relationshipTypeClassMap property maps a name to a class. It is used to configure the class type
that will be instantiated when a request to construct a relationship is made. By overriding the default
values, you can customize the environment to use a Relationship class you have subclassed.
beanNameToItemDescriptorMap
This property maps a bean name to an OrderRepository item descriptor name. When saving an Order,
the processors that contain the code for saving look for an OrderRepository item descriptor with the
same name as the bean class. The beanNameToItemDescriptorMap property contains this mapping.
All objects that can be mapped to an item descriptor are listed in the beanNameToItemDescriptorMap.
The format is <bean name>=<repository item descriptor>. The example below demonstrates how a
mapping is defined in the properties file. The following code defines the default values.
ATG Page 67
ATG Framework and Components
defaultOrderType
This property defines the default Order type. In the example below, the default type is defined as the
string default, which in turn maps to a class in the orderTypeClassMap property. The following code
defines the default value.
defaultCommerceItemType
This property defines the default CommerceItem type. In the example below, the default type is defined
as the string default, which in turn maps to a class in the commerceItemTypeClassMap property. The
following code defines the default value.
defaultShippingGroupType
This property defines the default ShippingGroup type. In the example below, the default type is defined
as the string hardgoodShippingGroup, which in turn maps to a class in the shippingTypeClassMap
property. The following code defines the default value.
defaultShippingGroupAddressType
This property defines the default ShippingGroupAddressType. To customize your address information
you need to subclass RepositoryContactInfo and use your new class name for the
defaultShippingGroupAddressType.
defaultPaymentGroupType
This property defines the default PaymentGroup type. In the example below, the default type is defined
as the string creditCard , which in turn maps to a class in the paymentTypeClassMap property. The
following code defines the default value.
defaultPaymentGroupAddressType
This property defines the default PaymentGroupAddressType. To customize your address information
you need to subclass RepositoryContactInfo and use your new class name for the
defaultPaymentGroupAddressType.
ATG Page 68
ATG Framework and Components
Order Repository
The Order Repository is the layer between ATG Commerce and the database server. The repository is
where Orders are saved after processing and stored in between customers visits to your site. It is
implemented using a SQL repository.
The beanNameToItemDescriptorMap property of the OrderTools component maps the Order Repository
item descriptors to Bean names. In ATG Commerce, the processors that save and load an Order look for
an item descriptor that is mapped to the corresponding commerce object class; the
beanNameToItemDescriptorMap property contains this mapping.
In ATG Consumer Commerce, this base file is combined with an additional definition file that is located
at <ATG9.0dir>/B2CCommerce/config/atg/commerce/order/orderrepository.xml.
In ATG Business Commerce, this base file is combined with an additional definition file that is located
at<ATG9.0dir>/B2BCommerce/config/atg/commerce/order/orderrepository.xml
ATG Page 69
ATG Framework and Components
Pre-checkout Process
Shopping cart Creation
The shopping cart can be implemented by following steps.
4. Above repository Ids are passed as hidden parameters in form. These Ids goes to
cartModifierFormhandler when user submits form by clicking add to cart button.
5. These values are passed to the as hidden fields when the user pushes the Add To Cart submit
button provided by us.
PurchaseProcessFormHandler
This abstract class defines the very general FormHandling functionality that the purchase process
formhandlers require, including Transaction management, PipelineChain execution, central
configuration, and error processing.
PurchaseProcessHelper
PurchaseProcessHelper contains the common functionality required by the purchase process form
handlers as well as commerce web services.
ATG Page 70
ATG Framework and Components
Order Creation
There are many api exposed by OrderManager to create an order. The type of order created depends on
an api used to create an order. OrderManager internally uses OrderTool api to create order. The
orderType parameter decides the type of order to be created. If orderType parameter is null then
defaultOrderType is created using OrderTool. We need to pass profileId to createOrder() method for
creating the order.
OrderHolder class maintains the current Order object as well as a collection of saved Order objects. The
component that utilizes OrderHolder is /atg/commerce/ShoppingCart, a session-scoped component
whose handleXXX methods add, delete, and switch between carts.
Multiple shopping carts can be implemented by using the handleCreate method of the OrderHolder
class. This method creates a new Order and sets it as the currentOrder in the OrderHolder. Any
previously existing Order object is placed into the collection of saved carts.
Saving Order
Many of the methods in CartModifierFormHandler call OrderManager.updateOrder() to save the Order
in its present state to the Order Repository.
Modify Order
It provides methods to modify an Order by catalogRefId of CommerceItem.
handleSetOrder()
handleRemoveItemFromOrder()
handleMoveToPurchaseInfo() This method checks for any modification in the order then it
starts the checkout process.
ATG Page 71
ATG Framework and Components
RepriceOrder
The handleAddXXX and handleRemoveXXX methods of CartModifierFormHandler automatically reprice
the Order whenever the user makes changes to it. These handle methods internally calls
createRepriceParameterMap() method of PurchaseProcessFormhandler to reprice an order.
However, if the users make changes to their orders through other purchase process form handlers that
do not reprice orders, such as the form handlers that create and manage shipping groups, then
RepriceOrderDroplet servlet bean is used to reprice the Order before displaying its price to the user.
The calls to getPropertyValue() and setPropertyValue() retrieve and set the values of properties directly
on the repository item objects; they are part of the atg.commerce.order.ChangedProperties interface.
The commerce object that supports the ChangedProperties interface, every get() method needs to call
the getPropertyValue() method, and similarly every set() method needs to call the setPropertyValue()
method.
This reduces the amount of processing when the OrderManager.updateOrder() is called to save order to
repository. This enhances the performance because we set the value directly to repository item and
saving the only property that is actually changed. Call to getPropertyValue("PropertyName") retreive the
property directly from repository item and eliminate the need to create member variable in the class
that are not changed.
ATG Page 72
ATG Framework and Components
Advantages
Reduces the amount of processing when OrderManager.updateOrder() is called to save the
Order to the repository.
Enhances the performance because we set the values directly to the repository item and save
the properties only that have actually been changed in the class. The call to
getPropertyValue("shortDescription") retrieves the property directly from the repository item
and eliminates the need to create a member variable in the class to store the value.
ATG Page 73
ATG Framework and Components
Checkout Process
Checkout process is initiated when the order is submitted. ATG supports following 3 types of checkout.
2. Complex checkout
3. Simple checkout
ExpressCheckout/Expedited Checkout
Express checkout supports the use of only a single profile HardgoodShippingGroup and a single profile
CreditCard for a given Order. It retrieves the predefined shipping group and payment group at runtime
automatically from user profile. We can manage and expedite the pre-checkout process for Orders using
the ExpressCheckoutFormHandler.
commitOrder - used to submit the current Order for checkout. The method then calls the
OrderManager.processOrder() method, which executes the processOrder pipeline.
Complex checkout
Provides several form handlers to support a checkout process that uses any number or type of shipping
group and payment group. Also Separate form handlers exist to support the following tasks:
Simple Checkout
It is same as Express checkout but expects the user to fill in the shipping and payment group during
checkout.
ATG Page 74
ATG Framework and Components
Order Pipeline
Order pipeline is used to process order. Order processing occurs when a customer has supplied all the
necessary information for the Order and has submitted it for checkout.
4. Each processor after execution returns a status code and determines which processor in the
chain to execute next.
5. The Pipeline Manager enables us to dynamically add and remove processors and chains of
processors.
ATG Page 75
ATG Framework and Components
The runProcess() method is called on the head PipelineLink object of the processor chain and it is
responsible for following tasks.
3. Returning the return code to the PipelineChain. If status code is 0 then it tell PipelineManager to
stop this chain or if the code is other then 0 then it calls the next processor to execute.
Four methods are called before and after the call to runProcess() in the PipelineProcessor to handle the
transaction in the following order
preChainTransaction()
postChainTransaction()
preLinkTransaction()
postLinkTransaction()
The runProcess() method is called between these methods and the call is returned to the PipelineChain
with a return value. If the return value is 0 (PipelineProcessor.STOP_CHAIN_EXECUTION), it tells the
PipelineManager that execution for this chain should be stopped. If the return value is other than o,
then it calls the next processor to execute.
XML file
Pipeline Manager can be initialized with a set of processor chains at startup using an XML configuration
file called a pipeline definition file. It is a simple way to construct and manage the global
PipelineManager without writing code. CommercePipeline.xml is the sample pipeline definition file
provided.
A processor in a pipeline can be extended by overriding runProcess() method, and can be configured in
the pipeline. ACCs PipelineEditor is used for creating, deleting or modifying the Pipelines graphically.
atg.service.pipeline API
Any non-globally scoped Pipeline Managers need to be created using the API.
ATG Page 76
ATG Framework and Components
PipelineManager
The top level tag that encloses a definition of a Pipeline Manager.
PipelineChain
Tag defining a given processor chain in the Pipeline Manager.
transaction - the default transactional mode of all the processors in this chain
classname - the full name of a Java class which is to be instantiated and used as the
PipelineChain object. The default is atg.service.pipeline.PipelineChain. The value must be this
class or a subclass of it.
resultclassname - the full name of a Java class which is to be instantiated and used as the
PipelineResult object
Pipelinelink
Defines a processor within the chain and names it.
Processor
The name of the Pipeline Processor object.
Transition
A reference to the next link to be executed mapped by a return value.
Transaction Handling
The valid transaction modes are as follow.
TX_REQUIRED
TX_REQUIRES_NEW
TX_SUPPORTS
TX_NOT_SUPPORTED
TX_MANDATORY
ATG Page 77
ATG Framework and Components
Payment Process
The Payment Process is handled by payment pipelines and payment pipeline is called by
PaymentManager. It manages the authorization, debit, and credit of PaymentGroups in an Order, and it
tracks the results of those payment operations using PaymentStatus objects.
A seperate payment pipeline is defined for each type of payment group i.e. creditcard, giftcertificate and
storecredit. PaymentManager consist of methods like authorize(), credit() and debit(). These methods
take the order object and one paymentgroup or list of paymentgroup as parameters. It performs
payment operation by calling appropriate payment pipeline according to paymentgroup passed as
parameter.
creditCardProcessorChain - pipeline handles authorization, debit, and credit work for the
atg.commerce.order.CreditCard
giftCertificateProcessorChain - pipeline handles authorization, debit, and credit work for the
atg.commerce.order.GiftCertificate class.
1. First processor - Aggregates the information required to performing the requested payment
action and creates an XXXInfo object for use in that action.
Example for CreditcardProcessorChain, the action is CREDIT and the CreditCardInfo is the action
object.
2. Second processor - Performs the actual operation authorizing, debiting, or crediting the
appropriate payment method.
ATG Page 78
ATG Framework and Components
Note:
By default a single pipeline exists to perform authorize, debit, and credit actions for a single
PaymentGroup type. ATG supports to split them into separate pipelines if it needs to be handled
differently.
Order Fulfillment
ATG Commerce provides extension points to link the Commerce system with any Fulfillment system.
One of the processor in the commerce pipeline called as sendOrderFulfillmentMessage can be
configured to send out a JMS message to the designated fulfillment system. ATG commerce comes with
a simple implementation of a Fulfillment system that can be accessed via the Dynamo Admin UI.
ATG Page 79
ATG Framework and Components
Standard Prices
Standard prices are the prices specified for the product in the catalog. The prices specified with the
catalog are list price and sales price. The list price is the full, undiscounted price of a product. The sales
price represents actual selling price for an item on sale.
The boolean property On Sale indicates whether the item is on sale or not. The system uses this flag to
determine the base price of the item.
Promotional prices
Promotional price is the price after applying the promotions or discounts. Different prices can be offered
depending on circumstances such as timing, other products being purchased, or the customer's profile
by calculating dynamically using a combination of standard prices and promotions.
PriceItemDroplet
Component used is /atg/commerce/pricing/PriceItem
Use to display the amount price that is calculated dynamically by the pricing engine for a
particular user at a particular time. It calculates different prices for the same item depending on
whether that item is displayed alone (for example, in the product template page of the catalog)
or in the context of the shopping cart of an item dynamically.
PriceItem takes a SKU repository item as its item parameter. It outputs an element parameter
that is of type CommerceItemImpl that is renamed to SKU using the elementName parameter
RepriceOrderDroplet
Component used is /atg/commerce/order/purchase/RepriceOrderDroplet
ATG Page 80
ATG Framework and Components
It is use to reprice an order by sending a required parameter which specified pricing operation
to execute. Pricing operations are defined in the atg.commerce.pricing.PricingConstants
interface.
Pricing services comprises of following two components. These components work together to determine
prices for catalog items, total orders, sales tax, and shipping.
1. Pricing Engines
2. Pricing Calculators
Pricing Engine
Pricing engine is mainly responsible for following three tasks.
Pricing calculators
Pricing calculators are responsible for the following tasks.
3. Determine price using the information received from the engines and from the qualifier.
Pricing Objects
Items
List Price property of the product catalog is used to specify the list price of an item. Pricing services uses
the list price to calculate the new price based on the promotions or discounts applied on it.
ATG Page 81
ATG Framework and Components
Order
It calculates the total cost of an order and apply any discount that is applicable (for example, a customer
might have a coupon offering a 10% discount on a total order).
Shipping price
It calculates the price of shipping for an order and apply discounts if applicable.
Tax
It calculates the sales tax for an order. Alternatively, sites can use a third-party system such as
CyberSource or TAXWARE to handle tax calculations.
2. The pricing engine applies its configured precalculators. A precalculator modifies a price without
using any associated promotions.
For example, a site could use a list price precalculator or an order subtotal precalculator to
establish a base price to which subsequent calculators will apply a discount.
All the precalculators (defined in ItemPricingEngine) are executed in order. This includes the
following.
3. The pricing engine accesses the current customers profile and retrieves any promotions listed in
the activePromotions property of the profile.
4. The pricing engine builds a list of global promotions. It builds the list by using its
globalPromotionsQuery property to query the Promotions repository, searching for any
promotion given to all customers (global).
5. The resulting lists are concatenated. The pricing engine processes one at a time. It applies
promotions by priority.
6. The pricing engine applies its configured PostCalculators, which make any necessary
modifications to the price after any discounts have been applied.
ATG Page 82
ATG Framework and Components
Pricing Calculators
Shipping calculators
All the shipping Calculators in our application are configured as preCalculators for ShippingPricingEngine
at /atg/commerce/pricing/ShippingPricingEngine.properties (corresponding java class
com.ebg.sec.order.pricing.SECShippingPriceEngineImpl).
Tax calculators
Similarly, all the Tax calculators are configured as preCalculators for TaxPricingEngine at
/atg/commerce/pricing/TaxPricingEngine.properties (corresponding java class
com.ebg.sec.order.pricing.SECTaxPriceEngineImpl).
Shipping and Tax Pricing Engines calculate the shipping cost and tax (as applicable) using configured
Shipping and Tax Calculators, respectively. getPreCalculators() method of
com.ebg.sec.order.pricing.SECShippingPriceEngineImpl returns an array of configured shipping
calculators , while getPreCalculators() method of com.ebg.sec.order.pricing.SECTaxPriceEngineImpl
returns an array of configured tax calculators.
SECShippingPriceEngineImpl
SECShippingPriceEngineImpl extends atg.commerce.pricing.ShippingPricingEngineImpl, the component
for SECShippingPriceEngineImpl is available at /atg/commerce/pricing/ShippingPricingEngine. Following
calculators are configured as its pre Calculators.
SECShippingCalculatorImpl_en_US
The component for this calculator is available at
/atg/commerce/pricing/SECShippingCalculatorImpl_en_US. Following method calculate the
shipping cost for particular order.
SECShippingDiscountCalculator_en_US
The component for this calculator is available at
/atg/commerce/pricing/SECShippingDiscountCalculator_en_US. Following method of this
calculator calculates the discounted shipping cost for particular order.
ATG Page 83
ATG Framework and Components
SECTaxPriceEngineImpl
SECTaxPriceEngineImpl extends atg.commerce.pricing.TaxPricingEngineImpl , the component for
SECTaxPriceEngineImpl is available at /atg/commerce/pricing/TaxPricingEngine. Following calculators
are configured as its pre Calculators.
SECTaxProcessorTaxCalculator_en_US
The component for this calculator is available at
/atg/commerce/pricing/SECTaxProcessorTaxCalculator_en_US. Following method of this calculator
calculates the applicable tax.
SECTaxDiscountCalculator_en_US
The component for this calculator is available at
/atg/commerce/pricing/SECTaxDiscountCalculator_en_US. Following method of this calculator
calculates the applicable tax.
ATG Page 84
ATG Framework and Components
Promotions
ATG supports dynamic set up of offers or promotions on specific products or groups of products. Users
can set up promotions from ACC. Promotions are stored in the Promotions repository, which is one of
the default ATG Commerce repositories.
Promotions can be any kind such as fixed price off, percentage off or in terms of another free product,
free shipping etc. The system also treats coupons as a type of promotion. Examples of promotions are.
Promotions can be applied at 4 levels based on the priority set. By default, the following is the priority
level to apply promotions.
Item level
Order level
Shipping level
Tax level.
ATG scenarios support the set up of cross sell and up sell features.
activePromotions
Stores the list of promotions that can be used by the user in pricing their orders.
usedPromotions
Stores any promotions used in an order.
inactivePromotions
Stores promotions that can no longer be used. A promotion would be moved into the inactive list.
ATG Page 85
ATG Framework and Components
eCoupon
Coupons are a type of promotion (20% of an order over $100, for example) sent to specific customers.
Customers redeem coupons by entering a claim code during the checkout process. You can use the ATG
Control Center or BCC to manage coupon repository items.
1. Create a promotion.
Coupon FormHandler
SECCouponFormHandler
Class com.ebg.sec.order.formhandler.SECCouponFormHandler extends
atg.commerce.promotion.CouponFormHandler. SECCouponFormHandler is the java class created to
handle coupon addition and removal from an order.
Gift certificate
Gift certificate represents another mode of payment, just like credit card payment. Gift certificates allow
a customer to pay for all or part of a purchase using a prepaid amount. By providing gift certificates as
an option for your customers, you can increase sales and attract new business.
2. ATG Commerce fulfills the purchase for Customer A (and sends a notification e-mail to
Customer B as part of the fulfillment process).
3. Customer B uses (claims) the gift certificate to pay for all or part of an order.
SECPurchaseProcessFormHandler
Class com.ebg.sec.order.formhandler.SECPurchaseProcessFormHandler is the java class created to
handle gift certificate addition to an order.
ATG Page 86
ATG Framework and Components
ATG Page 87
ATG Framework and Components
Extra Info
/atg/userprofiling/B2CProfileFormHandler
Component is use to handle user specific operations like login, registration logoff etc.
It is extended from atg.commerce.profile. CommerceProfileFormHandler class.
It contains a Map property by name editValue that holds extra properties like Shipping
Address etc.
It also contains handler methods to check up credit cards for their format and there is a
converter to print the Credit card number masked.
/atg/commerce/catalog/CatalogNavHistory
Component to track the customers path through the catalog.
This component takes the following input parameters.
o navAction defines the operation type to be performed on stack. Options are push,
pop & jump. A blank navAction is treated as push.
o navCount
/atg/commerce/ShoppingCart
Shopping cart component is a session-scoped component whose handleXXX methods add,
delete, and switch between carts.
This component utilizes an object of OrderHolder class which contains the current order as well
as saved order objects.
OrderManager
Order manager is a business layer component which takes care of creating, loading, refreshing,
updating the orders.
This component also interacts with the pipeline processors.
Order Repository
Order repository stores an order details.
ATG Page 88
ATG Framework and Components
Profile Repository
Product Catalog
The Product Catalog is a primary component in the Commerce Application.
It is a repository containing repository items like category, products, media, images etc.
ATG Commerce application comes with a default product catalog which can be extended as per
business need.
Catalog repository items can be edited using ATG Control Center (ACC).
A product catalog is a hierarchical tree of categories and products.
Default product catalog xml file is /atg/commerce/catalog/ProductCatalog.
Default product catalogs can be extended to meet business needs.
o Xml-combine tag is used to extend the default catalog.
o Extensions can be created to add properties to categories, products and skus.
o New tables must be created in the database to accommodate the extended properties.
The main item types for the catalogs are categories, products and SKUs (Stock Keeping Units).
A product is a navigational end-point in the catalog. However, customers purchase a SKU and
not a product.
A product may have several different SKUs associated with it, representing varieties, sizes, and
colors.
Custom Catalog
Custom catalog is repository needed to provide information to particular customers or companies.
sortProperties
the sortProperties property of this component holds the property whose values determine the sort
order. By default, items are sorted by display name in alphabetical order.
A string that specifies how to sort the list of repository items. This parameter is specified as a comma
separated list of property names. The first name specifies the primary sort, the second specifies the
secondary sort, etc. If the first character of each keyword is a -, this sort is performed in descending
order. If it is a + or it is not a -, it is sorted in ascending order.
ATG Page 89
ATG Framework and Components
Note: This parameter is only valid for repository items, it will not work with enumerated data-types.
ATG Page 90
ATG Framework and Components
ATG out of box supports following SEO techniques to improve the ranking of our site.
Url Optimization
Disclaimer
SEO is vast topic and is not restricted to the techniques discussed here. This section is demonstrating the
SEO capabilities that ATG has implemented and supported.
ATG Page 91
ATG Framework and Components
Repository
ATG SEO makes use of two repositories i.e. SEORepository & SitemapRepository to store SEO
information. Kindly refer Repository section to know basic about repositories.
SEORepository
All SEO related data is stored & maintain in SEO repository. This repository is extensible and can be
customized according to your project needs. The path of this repository is /atg/seo/SEORepository.
SitemapRepository
All sitemaps related information is stored in SitemapRepository. The path of this repository is
/atg/sitemap/SitemapRepository
ATG Page 92
ATG Framework and Components
SEO Components
ATG has defined several components to fetch information from SEO and Sitemap repositories and
render SEO friendly pages for search engine robots. Following is the list of important components used
for SEO. Kindly refer Droplet section to know basic about droplets.
ATG Page 93
ATG Framework and Components
ATG Page 94
ATG Framework and Components
ATG Page 95
ATG Framework and Components
JumpServlet
Jump servlet is the servlet placed in DAFPipeline which sense for keyword jump in request URL. If
found then request will be processed by JumpServlet. As mentioned earlier that we show optimized
URLs to search engine robots. These optimized URLs contain jump keyword.
We make sure that search engine is indexing optimized URLs only and same is shown to user. Hence
user comes to our website with optimized URLs (i.e. with the keyword jump) and JumpServlet translate
this URL to original (non-optimized) URL to process user request.
Example:
http://mywebsite.com/root/jump/productname/productDetail/prod450074
JumpServlet translate the above URL in to non-optimized URL like shown below to process the request.
http://mywebsite.com/root/US/standardPDP/pdp.jsp?productId=prod450074&skuId=sku400068
JumpServlet Configuration
Jump Servlet component is present at path /atg/dynamo/servlet/dafpipeline. Jump servlet needs to be
defined in web.xml of commerce application.
Whenever request comes via indirect URL (optimized URL with jump keyword) then jump servlet
translate it to direct URL. Jump Servlet uses direct URL template to translate indirect URL to direct URL.
Note: - Direct URL means non-optimized URL and indirect URL means optimized URL with jump keyword.
Also add jump servlet to initial.properties so that servlet is ready to serve with the server startup.
ATG Page 96
ATG Framework and Components
URL Optimization
URL optimization technique is to create neat and clean URL for robot visitor. If system detects the visitor
is search engine crawler then application renders optimized URLs (clean URL). This increases the
possibility of improving the ranking of page. We can achieve Url Optimization using following steps.
Make sure your URL contains important keywords such that it matches user search teams. Try to include
product name & important attributes in URL.
JSP Coding
When robot crawl the page then we have to show clean URLs. Following component on the JSP checks
for user agent (i.e. human or robot) and renders the URLs accordingly.
Considering that we are generating the URL for a category here. Param element showing in following
example is the category object.
Same coding snippet will be used to generate optimized URL for Product. If user agent is robot than URL
looks like below.
http://mywebsite.com/mycontextroot/jump/Motorola-Milestone/productDetail/prod450074
Note: - URL formed above is perfectly according the indirect template defined for Product and Category.
We will discuss these components in coming section.
Component Configuration
In order to achieve URL optimization we have to configure the bunch of components.
CategoryIndirectTemplate
This component gets called when CatalogItemLink droplet executed on JSP. Configurations of important
attributes are shown below.
ATG Page 97
ATG Framework and Components
urlTemplateFormat
This property defines the format of indirect (optimized URL) URL. Example is shown above. Point to
remember here is it should contain keyword jump. As JumpServlet looks for keyword jump in the URL
and if found then convert the URL to direct (non-optimized) URL for the processing.
http://mywebsite.com/mycontextroot/jump/MobilePhone/categorycat170064
indirectRegex
This property defines the regex for your URL format. It checks if URL formed according to regular
expression defined here. This is mostly for validation purpose and to ensure that URL format and regex
are in sync.
regexElementList
This property is to support above two properties i.e. urlTemplateFormat & indirectRegex. We use item
in URL format. Hence we define the item here. What is the source of item and how to get their value.
In above example you can see that item is defined as Category and that is coming from ProductCatalog
repository.
Note: - There are many other properties available in this component. Kindly check the ATG document
for complete list of attributes
CategoryDirectTemplate
This component is used to generate direct URL (non-optimized) for human users. As user visit the page
on the site then CatalogItemLink droplet gets executed. This droplet checks the user profile and makes
internal call to respective template (Direct or Indirect) component to form and render URL.
If the visitor is human user then CatalogItemLink droplet makes call to CategoryDirectTemplate to form
direct URL. Following is the configuration of this component.
ATG Page 98
ATG Framework and Components
CategoryTemplateMapper
This component keeps the list of URL templates defined in the system. We can define custom Direct /
Indirect URL template component. These template components will not be considered to form desired
URL unless they are listed in templates property of CategoryTemplateMapper for item type Category.
Kindly see the configuration below.
templates
This property is list type of property that contains the list of templates defined. Templates get resolved
by using the item type and visitor profile.
Example: if visitor is human and item is category then CategoryDirectTemplate will be used to form URL
hence direct URL (non-optimized) gets formed.
But if visitor is robot (crawler) and item is category then CategoryIndirectTemplate will be used to form
URL hence indirect URL (optimized) gets formed.
Note: - We have discussed above URL optimization for Item type Category. We need same set of
components and configuration for Item type Product. Hence I am not documenting the configuration for
Product item. Following are the name of important components for item type Product.
ProductDirectTemplate
Refer CategoryDirectTemplate section above.
ProductIndirectTemplate
Refer CategoryIndirectTemplate section above.
ProductTemplateMapper
Refer CategoryTemplateMapper section above.
ATG has created all SEO components considering two basic Item types i.e. Product and Category
because we mostly want to optimize the URL of product and category items. If the project requirement
is also to optimize the URL of custom items (other than Product and Category) then you can define
similar set of components by using the existing OOB java classes and do the configuration to generate
respective direct and indirect URLs.
ATG Page 99
ATG Framework and Components
Due to large number of pages in the website, it is not feasible to provide data manually for these tags for
every page exist. We can populate or update these tags dynamically from BCC (publishing).
SEO tag repository is used to store meta tag data i.e. keywords, description and title for every page
exist in the website. This data will be retrieved and meta tags will be populated with the relevant
keywords, description and title information. Primary key to retrieve this data from the SEO repository is
url of the page.
Admin user has to populate meta tag data very first time in SEO repository from BCC (publishing) for
every page in the website.
JSP Coding
JSP coding is needed to fetch meta tag data i.e. title, keyword and description information for given
page. Here the key to fetch this data from SEO repository is the page URL. Idea here is to generate meta
tags for every main JSP with unique title, description and keyword information. If we dont provide
unique data to title, description and keyword for given pages then Crawler consider them all as a single
page though their body content is different & therefore ranking of the page comes down.
This data will be controlled by merchandising user from BCC (publishing) application.
You can create a JSP fragment with the following piece of code and include the same in the header
section of all other JSPs. In this way same code snippet can be used and effort can be saved.
You can further tweak the above code by appending the product / category name in title information
coming from repository. You can fetch information from repository like shown above and append
product name in it. By appending product name in title and description, you are making the virtual
unique pages & increasing the chance of getting indexed.
Example
Assume ProductDetail page is served by productDetail.jsp in your WAR. Same JSP is used to render the
information for Nokia and Motorola products. This JSP has meta tags (title etc). As shown above, by
appending the product name in title information coming from SEO Repository, we are making many
unique virtual pages at run time.
Pages rendered for different products consider as unique page because their title are different. Hence
crawler will index them all. That means the number of pages in your website is equal to number of
products in your catalog. That also means search engine have found tons of valuable information in
website for indexing.
But if we dont append product name than title looks same for all products hence crawler consider them
as single (same) page though they are showing different products information.
Canonical URL
Canonical URLs are the outcome of the process of normalization of the URLs to make them consistent
across the site. The process includes converting unfriendly URL to SEO friendly URL so that search
engines index the page with the product name appearing in URL.
For example:
For SEO using Canonical URLs technique, application should specify the link tag on product detail page
which specifies the canonical URL on the page. This link tag can be specified like below,
The canonical URL is similar to static URL. When a web spider accesses the page using static URLs it finds
a link on the page and gets indexed. Human user gets this URL as search results (search engine) and they
comes to the site by clicking the same, jump servlet translate this URL to dynamic URL (non-optimized)
and request is processed.
JSP Coding
We have to put canonical URL on product detail page and category summary page. Idea here is to have
direct URL for product detail page and category summary page for web spider.
Put the following piece of code in header section of Product Detail JSP and category summary page.
Component Configuration
You need to configure component i.e. CanonicalItemLink droplet to render canonical URL for product
item type. Refer following configuration and put this configuration in CanonicalItemLink droplet
component.
itemDescriptorNameToUrlTemplateMap
This is map property that contains item to indirect template mapping. Hence if item is Product then
ProductIndirectTemplate component is used to form canonical URL. Same applies for item type
Category.
defaultRepository
It takes reference of repository where item belongs to.
Sitemap Generation
Sitemaps are files stored on a web server that list the URLs of useful pages available in our website, so
web spiders are able to identify site content without relying exclusively on their ability to crawl and
parse the pages. Sitemaps are not an official standard, but they are supported by many search engines,
including Google, Yahoo and MSN.
Sitemap is an xml file that list URLs of all pages in your website. It contains basic information like URL,
lastModified, changeFrequency and priority about the page. Sample entry in sitemap xml is shown
below.
Sitemap Configuration
We need to create & configure certain components to generate appropriate sitemap xml files for our
commerce website. As commerce website always have long list of categories and infinite products. It is
good to generate unique URLs for all these items and put them all in sitemap xml file. More URLs in
sitemap drives more indexing of data from the site and increases the chance of higher ranking.
1. Create component XXXXSiteMap at the following path in your ATG module. Here XXXX stands
for your application context root in capital letters.
<ATG_HOME>/YourModule/config/atg/registry/webappregistry/XXXXSiteMap.properties
2. Now add following configuration in the above created component properties file.
3. Create component XXXXWebApp at the following path in your ATG module. Here XXXX stands
for your application context root in capital letters.
<ATG_HOME>/YourModule/config/atg/registry/webappregistry/XXXXWebApp.properties
Here XXXXEar is the name of application EAR and xxxx is context root of application.
<ATG_HOME>/YourModule/config/atg/sitemap/ProductSitemapGenerator.properties.
sitemapFilePrefix Prefix for your Sitemap xml file. Sitemap file must have no more than 50,000
URLs and must be no larger than 10MB (10,485,760 bytes). If we list more pages (URL) than this
limitation, then generator will split information into several files with names
sitemapFilePrefix_1.xml, sitemapFilePrefix_2.xml and so on.
changeFrequency - How frequently the page is likely to change. Valid values are: always, hourly,
daily, weekly, monthly, yearly, never.
Priority - The priority of this URL relative to other URLs on your site. Valid values range from 0.0
to 1.0.
urlPrefix - URL prefix with protocol, host, port and context path. Context path should not be
included here if webApp property is specified.
Template - Generator uses this template to construct sitemap URL for repository item of type
ItemDescriptorName Both direct and indirect templates can be set here. Use indirect template
to generate sitemap with optimized URLs for repository items.
<ATG_HOME>/YourModule/config/atg/sitemap/CategorySitemapGenerator.properties.
Note: - You need to configure this component according to your environment setup.
Here property staticPages maintains the list of static pages in your website.
<ATG_HOME>/YourModule/config/atg/sitemap/SitemapIndexGenerator.properties.
If we define new Generator (for new item type) then it is mandatory to add the same in
sitemapGenerators list property of this component else sitemap will not be generated for new
Generator added.
Property warDir is the property that takes absolute path of folder to place sitemap xml files
generated. Ideally this should be the root of your application WAR.
10. Now configure final component i.e. SitemapWriterService. This component is responsible for
writing down the sitemaps data in to XML files at the configured path.
We are done with all required configuration for sitemap. Now we are ready to generate first set of
Sitemap xmls. Refer following section for the same.
http://mywebsite.com/dyn/admin
4. After the generation of the sitemap, invoke the Sitemap Writer service to write to xml files.
5. Now you can find the SiteMap xml files are generated at the configured path. To know the path,
check the value of warDir property of component SitemapGeneratorService.
Appendix
Droplets
Following are the extensively used droplets. Please refer the ATGPageDevGuide.pdf for the detail.
atg.droplet.ErrorMessageForEach
Displays error messages that occur during a form submission. (ATGPageDevGuide.pdf, 257)
atg.droplet.For
Displays a single output the number of times specified. (ATGPageDevGuide.pdf, 261)
atg.droplet.ForEach
Displays each element of an array. (ATGPageDevGuide.pdf, 263)
atg.repository.servlet.ItemLookupDroplet
Looks up an item in one or more repositories based on the items ID, and renders the item on the page.
(ATGPageDevGuide.pdf, 280)
atg.targeting.RepositoryLookup
Looks up an item in a specific repository, based on the items ID, and renders the item on the page.
(ATGPageDevGuide.pdf, 320)
atg.repository.servlet.RQLQueryForEach
Constructs an RQL query and renders its output parameter once for each element returned by the
query. (ATGPageDevGuide.pdf, 322)
atg.droplet.Switch
Displays one of several possible outputs, depending on input parameter value. (ATGPageDevGuide.pdf,
340)
atg.droplet.TableForEach
Displays each element of an array, arranging the output in a two-dimensional format.
(ATGPageDevGuide.pdf, 342)
atg.targeting.TargetingArray
TargetingArray differs from the others in that it does not format the output of the targeting operation.
Instead, you must use another servlet bean to format the outputCategoryLookup.
(ATGPageDevGuide.pdf, 350)
atg.targeting.TargetingFirst
Displays the first n items, where n is a number you specify. (ATGPageDevGuide.pdf, 352)
atg.targeting.TargetingForEach
Displays all of the items returned by the targeter. (ATGPageDevGuide.pdf, 355)
atg.targeting.TargetingRandom
Displays n items chosen randomly. (ATGPageDevGuide.pdf, 358)
atg.targeting.TargetingRange
Displays a range of items, such as the third through the seventh. (ATGPageDevGuide.pdf, 360)
ProductLookup
SkiwLookup
CatalogItemLookupDroplet
RepriceOrderDroplet
PriceEachItem
PriceItem
ShippingGroupsDroplet
PaymentGroupsDroplet
PriceItemDroplet
RepriceOrderDroplet
/atg/commerce/gifts/GiftlistLookupDroplet
/atg/commerce/gifts/GiftlistDroplet
atg.commerce.gifts.GiftitemDroplet
Form Handlers
SimpleSQLFormHandler
ShoppingCartModifier
ExpressCheckoutFormHandler
CartModifierFormHandler
GiftListFormHandler
GiftListSearch