This action might not be possible to undo. Are you sure you want to continue?
ATG Framework and Component Pawan Modi email@example.com
ATG Framework and Components
ATG FRAMEWORK & COMPONENTS
ATG is the worldwide leader in the E-commerce solutions. This document describes ATG framework to build e-commerce application.
ATG Page 1
ATG Framework and Components
Table of Contents
Introduction ATG Architectures Component Centric Model Model View Controller – MVC Design Patterns followed in ATG ATG Platform ATG Dynamo Port Map Module Dependencies ATG Components Dynamo Application Framework (DAF) Dynamo Personalization Server (DPS) Dynamo Scenario Server (DSS) ATG Portal ATG Commerce ATG Content Administration (ATG Publishing) ATG Merchandising ATG Search ATG CSC (Commerce Service Center) ATG Outreach and Campaign Optimizer ATG Control Center (ACC) ATG Business Control Center (BCC) Dynamo Application Framework (DAF) Nucleus Tag libraries Dynamo Servlet Beans (Droplets) Form Handlers Repository API Components Create / Modify Components Component Properties File CONFIGPATH Environment Variable Component Scope Component Logging GLOBAL.properties Linking Property Values
8 8 8 8 8 9 9 10 11 11 11 11 11 12 12 13 13 13 13 13 14 15 15 16 16 16 16 18 18 18 19 19 19 19 19
ATG Framework and Components
Repositories Repository Repository Item Types of Repository in ATG Item Descriptor Repository View Java Interfaces & Classes Steps in Setting up a SQL Repository Working with Repositories Droplets (Dynamo Servlet Beans) Advantages of Droplets How to use Droplets in a JSP Droplet Parameters Important ATG Out-of-the Box Droplets Steps in writing a Droplet TargetingForEach CategoryLookup, ProductLookup , SKULookup ItemLookupDroplet RepriceOrderDroplet, PriceEachItem, PriceItem Form Handlers Form Handler Beans Form Handler Methods Exception Handling in Form Handler Displaying error messages on page ATG Out-of-the Box Form Handlers Example of Using a FormHandler Steps in writing Custom Form Handler Example of Custom Form Handler (Java Code) Example of Custom Form Handler (JSP Code) SimpleSQLFormHandler RepositoryFormHandler ProfileFormHandler SearchFormHandler /atg/userprofiling/B2CProfileFormHandler atg.b2bcommerce.profile.B2BcommerceProfileFormHandler atg.commerce.profile. CommerceProfileFormHandler ShoppingCartModifier,ExpressCheckoutFormHandler, CartModifierFormHandler ATG Controller Framework (Servlet Pipeline) Request Handling by Servlet pipeline DynamoHttpRequest and DynamoHttpResponse ServletUtil Types of Pipelines Request Processing by DAF Servlet Pipeline
21 21 22 23 23 27 27 28 29 31 31 31 32 32 33 34 34 34 34 35 35 35 35 35 36 36 36 37 37 38 38 38 38 38 38 38 38 39 39 39 39 40 40
ATG Framework and Components Request Processing by DAS Servlet Pipeline Customize Pipeline Servlet InsertableServlet Steps to Create InsertableServlet DispatcherPipelineableServlet ATG Scenarios (DSS) Difference between Scenarios & Targeters Slots Dynamo Personalization Server (DPS) Personalization Message Content Processor Content Management 41 42 42 43 44 45 45 46 47 47 49 50 ATG COMMERCE ATG E-Commerce Functional Components Profile Management Profile Repository Profile Form Handlers B2C Profile Form Handler B2B Commerce Profile Form Handler Profile Tools and Property Manager Create User Profile Create Profile Group Current Location Property Catalog Management Product Catalog Extending default Product Catalog Category Product and SKU Catalog Navigation Navigation History and Breadcrumbs Custom Catalogs Order Management ATG Order Components (OTB) ATG Order Java Interfaces ATG Order Java Classes Customizing OrderTools Order Repository /atg/userprofiling/Profile.transient Pre-checkout Process ATG 53 54 55 55 55 56 56 56 57 57 57 58 58 58 58 59 59 60 61 61 62 63 65 66 66 67 Page 4 .
ATG Framework and Components Shopping cart Creation Order Creation Multiple orders creation for an user Saving Modifying Repricing Orders Extending Purchase Process ChangedProperties Java Interface Checkout Process ExpressCheckout/Expedited Checkout Complex checkout Simple Checkout Order Pipeline Running a processor chain User defined Processor Pipeline Tags in Pipeline Definition File Transaction Handling Payment Process Payment Pipeline chain Order Fulfillment Pricing and Promotions PricingModel Droplet for displaying price ATG Pricing Services Pricing Engine Pricing calculators Pricing Objects Price Calculation Flow Pricing Calculators Pricing Engine implementation Promotions Attributes to manage promotions eCoupon Coupon FormHandler Gift certificate Gift certificate FormHandler Extra Info /atg/userprofiling/B2CProfileFormHandler /atg/commerce/catalog/CatalogNavHistory /atg/commerce/ShoppingCart OrderManager Order Repository Profile Repository Product Catalog ATG 67 67 68 68 69 69 71 71 71 71 72 73 73 74 74 75 75 76 77 77 77 78 78 78 78 79 80 80 82 82 83 83 83 83 85 85 85 85 85 85 86 86 Page 5 .
ATG Framework and Components sortProperties 86 ATG SEARCH ENGINE OPTIMIZATION (SEO) TECHNIQUES Disclaimer Repository SEORepository SitemapRepository SEO Components JumpServlet JumpServlet Configuration URL Optimization JSP Coding Component Configuration Meta Tag Implementation JSP Coding Canonical URL JSP Coding Component Configuration Sitemap Generation Sitemap Configuration Steps to Generate Sitemap Appendix Droplets Form Handlers 88 88 89 89 89 90 93 93 94 94 94 97 97 99 99 99 101 101 105 106 106 108 ATG Page 6 .
ATG Framework and Components Abbreviation DAS DAF DSS DPS DRP GSS LM CM RMI DCC SBS UDP Dynamo Application Server Dynamo Application Framework Dynamo Scenario Server Dynamo Personalization Server Dynamo Request Protocol Server Global Scenario Server Load Manager Connection Module Remote Method Invocation Dynamo Control Center Session Backup Server User Datagram Protocol alternative protocol to TCP/IP. MIB packet services ATG Page 7 . (usually used for broadcasting) SNMP Simple Network Management Protocol.
The view gives the presentation of the model. It also Provides guidelines to create & implement components that can work together to form the application. ATG product suite has enabled the vendors to enable their e-commerce commercial capabilities.The Dynamo Web applications are collected out of individual Java Bean components.Model View Controller architecture is a standard design pattern that separates an application into three main components: the model. ATG Page 8 . specified the structure of the interfaces and the mechanisms by which it interacts with the container and other components.The controller takes action on the user input and creates. which are configured and linked together with . Controller . It is not aware of the view or controller. MVC2 in a Service To Workers Strategy (a push based MVC) by formhandlers. Component Centric Model Defines the basic architecture of a component. Dependency Injection or IoC (Inversion Of Control) used by nucleus to resolve inter dependencies between components. ATG Architectures ATG follows architecture listed below. 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. Component Centric .ATG Framework and Components ATG Introduction ATG is the worldwide leader in the E-commerce solutions. the view.properties files. and the controller. Design Patterns followed in ATG • • • MVC2 in a Dispatcher View Strategy (a pull based MVC) used by Droplets.The model contains the state of the application. View . The view can access the model getters only. MVC . Model View Controller – MVC Model . sets the model.
The platform and its related products. and the ATG Control Center. ATG Commerce. etc. wireless devices. include Dynamo Application Server.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. ATG Dynamo Port Map ATG Page 9 . ATG Portal. ATG Content Administration.
E. which requires DPS. Note that we only need to include the top-level module. 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. The list show above will include DSS at a minimum.g.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 <modulename>/META-INF/MANIFEST. If our application requires DSS. ATG Page 10 . then we need to specify only DSS not DPS.MF. all additional modules required by the top modules will automatically be started.
ATG Page 11 . IBM WebSphere and BEA WebLogic. – Scenario based personalization ATG Portal ATG Portal provides a customizable framework for building personalized Web portals for specific user communities. test. are available for charting scenario data.ATG Personalization Module DSS – ATG Scenarios Module Dynamo Application Framework (DAF) The Dynamo Application Framework (DAF) is a foundation layer.Dynamo Application Framework (Foundation Layer) DPS . DAF runs on top of (DAS) or leading J2EE application server and supplies essential facilities for application development and deployment viz. enabling to deliver personalized content to customers according to their characteristics and preferences. Data analysis and reporting tools. including ATG’s own Dynamo Application Server (DAS).ATG Framework and Components ATG Components The ATG Platform includes the following core components: • • • DAF . Business processes can be exposed as workflows. including ready-made business chart templates. and fine-tune customer management scenarios that track and respond to customer behavior. – – visitor profiling content targeting Dynamo Scenario Server (DSS) The Scenarios module (DSS) adds advanced scenario-based personalization features to the ATG Platform. business managers can design. Using the scenario editor. Dynamo Personalization Server (DPS) The Personalization module (DPS) provides tools for visitor profiling and content targeting. – – – – Nucleus Repositories Tag libraries Droplets & Form Handlers This portable framework is designed to run on the industry’s leading J2EE application servers.
The system maintains the versions for the changes made to publishable assets. ATG Content Administration (ATG Publishing) ATG Content Administration (earlier known as ATG Publishing) is used for managing the content on the production website. It provides a streamlined system for modifying and deploying content on your site. – – – – – – – Product Catalog management Profile Management Shopping Cart and Checkout Order Management Pricing Inventory Customer Service ATG Business Commerce adds support for following business-to-business (B2B) transactions. ATG Commerce ATG Commerce includes everything we need to build and manage personalized ecommerce Web sites. multiple shipping/billing addresses etc. – – – Workflow editor Content Creation. for example) within specific publishing projects. might create separate portals for employees. Editing. each providing access to different content and services. and partners. for example. ATG Consumer Commerce provides business-to-consumer (B2C) storefront development with following features. requisitions) Account-specific product catalogs Price lists. customers. ATG Portal comes with a set of page template and baseline gears that you can use for your own portals. Content administration provides following tools. It keeps track of multiple versions of publishable assets (scenarios or catalog items. 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. Check-in Approval Deployment to Production Page 12 ATG .ATG Framework and Components A company. – – – B2B payment methods (purchase orders.
It provides a way to Commerce Business users for creating and maintaining versioned content of various items like ProductCatalog. The response time of the search engine is very less. you can define how each project moves through the various stages of the publishing process i. which can be used by the Commerce Call center agents to manage customers. It enables the sales and service agents to efficiently help customers over telephone. The features of ATG Search include. ATG Outreach and Campaign Optimizer ATG Outreach and Campaign Optimizer are used by the marketing people to create promotions. scenarios etc to track visitor behavior and tune the commerce system. editing. ATG Control Center (ACC) ATG Control Center (ACC) is the integrated (stand-alone) user interface for the ATG Relationship Management Platform and its supported products. – – – – – – Processes natural language queries Supports faceted navigation in applications Multiple language support Industry-specific lexicons Automated indexing features Generating reports is easy using ATG Customer Intelligence ATG CSC (Commerce Service Center) ATG CSC (Commerce Service Center) is a web based application that also integrates a ticketing system. ATG Commerce Service Center helps in increasing revenues and profits by turning the service center into sales center. approval. ATG Search ATG Search is a leading search engine which lets users find in the information they wanted. email or other means of ATG Commerce. check-in. Orders etc. ATG Knowledge and Response Management accumulate and provide CRM related information. ATG Page 13 . ATG Commerce Service Center is customer service application which can be customized and deployed.e. ATG Merchandising ATG Merchandising application runs on top of ATG Publishing and ATG Commerce. content creation. It provides a smooth customer service experience. QA and deployment on the live site. Personalization targeters etc. website.ATG Framework and Components Using the workflow editor.
and other members of your project team with point-and-click access to the tools they need for building and maintaining ATG applications. Management of ATG Personalization Assets You use the ATG Business Control Center to create and manage the components that are responsible for delivering personalized Web site content (content that changes dynamically for each site visitor). ACC & BCC. These components include user segments. including their organization and role assignments. ATG Business Control Center (BCC) The ATG Business Control Center is a browser-based interface that allows marketers and others senior people to create and edit many of the elements required to maintain an ATG-based Web site. and content groups. content targeters. including the creation and deployment of Web site content. 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 Service applications ATG Page 14 . Note: Content groups can be created via both i. business managers. site administrators. The activities can be performed in the ATG Business Control Center are divided into the following general areas.e. page designers. ATG Content Administration The ATG Business Control Center is the primary interface for performing ATG Content Administration tasks. Profiles Management Management of the profiles required by ATG Business Control Center users.ATG Framework and Components The ACC provides application developers.
. load balancing. clustering. and how they connect to each other. Nucleus is the mechanism that creates and configures new components. such as. 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. Nucleus figures out what components to use in an application. By reading the various configuration files associated with each component. Furthermore. either from existing Dynamo classes or our own Java classes. every component has a unique name. similar to a file system. Nucleus components are JavaBeans. It creates and configures Dynamo components and organizes them into a hierarchical namespace so they can be referenced by other components. as part of the Dynamo Administration interface that we can use to examine and modify components in a running Nucleus application./service/Scheduler. what their initial properties are. then gives these components a place to "live" so they can be found by other components. Nucleus is the central registry for the JavaBeans that contain our application-level logic. we can use the built-in Component Editor to specify initialization parameters and the way the components link together. This results in component names such as /atg/dynamo/service/Scheduler and gives Nucleus the ability to resolve relative names. affording all the advantages of the JavaBeans standard.ATG Framework and Components Dynamo Application Framework (DAF) The ATG Platform is supported by a foundation layer called the Dynamo Application Framework (DAF) that runs on top of our application server. In Nucleus. Nucleus allows developers to build applications in a component-oriented manner. 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.resolveName(“alias name”) method.. DAF also provides a Web-based component browser. Our application server handles tasks like session management. The ACC creates the necessary configuration files automatically. Page 15 • • • • • • • • ATG . When it comes to configuring components for our application. Components are organized into a hierarchy. But DAF supplies additional following facilities for application development and deployment. Nucleus • • • Nucleus is an ATG component container. and SNMP monitoring etc.
Composite repository & Versioned repository. • • Dynamo Servlet Beans (Droplets) Dynamo Servlet Beans are specialized Nucleus components that can be embedded in our JSPs to display dynamic content. • • Repository API • • • The Repository API (atg. DAF also includes a Core tag library that provides generic tags for flow control. DAF comes with a set of ready-made Form handlers like ProfileFormHandler. forwarding the user to some other JSP page etc. Page 16 • ATG . Implementations of the Repository API exist to access data stores such as relational databases. Whenever ATG applications needs to load. The API then accesses the underlying data storage device.repository. ATG support SQL repository. Java programmers and page designers can work independently and applications are easier to maintain. LDAP systems. ShoppingCartModifier etc. or query a data store.ATG Framework and Components Tag libraries • Originally the presentation language used by the framework was JHTML. 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. Droplets are based on MVC2 Dispatcher View (pull based) design pattern. Dynamo Servlet Beans minimizes the amount of Java code that has to appear in HTML and the amount of HTML that has to be hard-coded into Java classes and also enables the developer to take a “Dispatcher View” approach of MVC2 Design pattern. translating the API calls into whatever calls are needed to access that particular data store. Using Form Handlers is the way to achieve “Service to Workers” (push based) approach of MVC2 design pattern. store. DAF comes with a set of ready-made Dynamo Servlet Beans that you can use in your pages.*) is a data access layer that defines a generic representation of a data store. and content management systems. When JSP become the presentation language for java. There are lots of custom tags provided in JHTML to access the dynamo components. they make the appropriate calls through this API. the DAF framework provides the DSP tag library to access Nucleus components and render dynamic content from our Java Server Pages (JSPs). LDAP repository. that we can use in your pages either directly or customize them using the extension points given. As a result.
ATG Framework and Components • • In addition. queryable repository. The Secured Repository Adapter provides fine-grained access control to repository item descriptors. and even individual properties through the use of Access Control Lists (ACLs). individual repository items. the Composite Repository feature enables us to consolidate multiple data sources and make them available to our application as a single. ATG Page 17 .
a component have one of the 3 scopes i. If the same property value is defined at different level i.MF file of every module started. Manually by editing the . separated by forward slashes like /atg/dynamo/service/SMTPEmail. DPS/DSS ATG Local ConfigApplication Config ATG Page 18 . we can browse components. Session. Global. Properties are name value pair. The name of the component is the full path name of the . Note: In ATG. This .ATG Framework and Components Components Components in ATG are a public java class with appropriate properties with set/get methods.properties file that specify the class name and the scope and also any default values.properties file under the configpath starting with a “/”. Using ATG Control Center (ACC) browser. It is called configuration layering. ATG local config level & application config level then value from application config level will be taken. Request. Using any of the above approach. • • • • Code reusability Reduced development time Container independent Entire application behavior can be changed by modifying one/some of the components.properties extension. Additionally a component comes with . CONFIGPATH variable is computed dynamically during startup based on the modules started. containing folder names followed by simple component name. Create / Modify Components We can create / modify component and configure initial properties by – – – Using the eclipse ATG component browser plug-in. Full component name are unique.properties file. The properties file also contains any dependency injections of other components. For example. their order of startup and based on the entry in the MANIFEST.e. Component Properties File Properties file is a text file and named with the component name (including full path) following by . set properties (single and multi-value).e. Use of components gives following advantages. link / unlink components.properties file must be placed under CONFIGPATH of the ATG. /com/vam/firstbean.
Component Logging Component can log information about their status. the last value overrides previous values. Logging can be done on per-component. Global (default) – for everyone. ATG looks for component properties file in directories specified by CONFIGPATH environment variable. Log files are generated <jboss>/server/atg/logs Individual component can turn on/off their logging. Request – only to send response for a request. description & scope information of a component. Linking Property Values In a system containing many components. Default log level is info. but not changed in the other components. If the same property value is defined in two files. we need to append a “^” to the name of the property we want to set. warning. Class is a name of java class with package. Session – for individual session. it is possible for several components to be initialized with the same property values. debug. ATG Page 19 . enter the component name and property name whose value is to be copied. Finally. not associated with any specific component this is often used to set logging levels for a set of components. So we want to link the property of a component to other component. E. So every matching properties file is loaded. info. CONFIGPATH Environment Variable ATG looks for component properties file in directories specified by CONFIGPATH environment variable. Component Scope In ATG. Description is a short description of component and scope tell about the component scope. per-module or per-application basis. To do this. GLOBAL. It is called configuration layering.ATG Framework and Components Component properties file mainly contain class.g. ATG Nucleus can link the property of one component to the value of other component. CONFIGPATH=<atgroot>\B2CAppearal\config CONFIGPATH actually points to many folders and Nucleus reads entire CONFIGPATH left to right. error. a component can have any one of these scope. ATG support log levels i.properties is a special properties file.properties GLOBAL.e. If we configure (set value) these properties independently then this can lead to the confusion for the administrator if the value is changed in one component.
ATG Framework and Components For example if there is a second bean whose age property is dependent on firstbean age property. ATG Page 20 . where firstbean is a nucleus name relative to secondbean. then the properties file of second bean will look like shown below.
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. which translates the request into whatever calls are needed to access that particular data store. as well as popular open source databases such as and MySQL. But application & subsystems in Dynamo can use different repositories or share the same repository. Repository item is made of properties. Each repository connects to a single data store. including Oracle and DB2. It supports numerous databases. Repositories access the underlying data storage device through a connector. Repository item is corresponding to row in database table.Each employee would have a corresponding repository item. Page 21 ATG . A repository is a collection of repository items. Repository The data access layer that defines a generic representation of a data store.An employee item descriptor would specify all of the properties that an employee repository item could possess.ATG Framework and Components Repositories ATG provides an easy to use and powerful object relational mapping (ORM) persistence framework. Following are the main conceptual parts of the Repository API. Connectors for relational databases and LDAP directories are provided out-of-the-box. Connectors use an open. These properties correspond roughly to columns of a table Item Descriptors . Repository Items .An application can build queries that return the appropriate employee. so additional custom connectors can be added if necessary. It uses reflection primarily to determine the java bean properties and does not need the developer to code any POJO also. Repository Queries . 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. published interface.
The repository ID must uniquely identify the repository item from all other repository items of the same type. or lastName etc. such as id. In the SQL profile repository. The properties in a particular repository item depend on the type of item. which is string. developers can use targeting rules with the same syntax to find people or content. ATG Page 22 . For example. These properties store the data that makes up a repository item. then the id property must use the default data-type. keywords. In the SQL repository. Each property has a name. firstName. which is called a repository ID. phone number) while another may represent the meta-data associated with a news article (author. address. Each repository item is made of properties. For example. If we don’t define an id property in the item descriptor. a repository item often corresponds to a row in a table. Each repository item must have an identifier. So each item descriptor must specify the columns that act as the repository ID (which will usually be the same as the table’s primary key.ATG Framework and Components Repository Item Repository items are like a JavaBeans. So the purpose of the Repository interface system is to provide a unified way for data access. these properties correspond roughly to columns of a table. In the SQL repository. each user profile is a repository item. synopsis). One item might represent the user profile (name. The properties available to a type of repository item are defined in the repository’s item descriptors. Their properties are determined dynamically at runtime.
SQL Repositories . LDAP Repository . each database table might have its own repository item descriptor. and list and is not used for sets (which are unordered). 4. An item descriptor implements the atg. The item descriptors exposed by a repository depend on a combination of the underlying data store and the configuration of the repository. For example. and also describes the properties for that type. 2. 3. Item Descriptor Each repository item type is described by a Repository item descriptor (which has a one-to-one correlation with RepositoryView). as well as the class of the Java object used to represent that type (Integer. In the SQL repository. Composite Repository .ATG Framework and Components Types of Repository in ATG The following Repository models exist in ATG. String. product categories.repository. a SQL repository instance that supports a commerce application might have different item descriptors representing users. One to Many – Represented by ‘multi’ tables Many to Many – achieved using an intermediate table. orders. Item-Descriptor Relationships • • • One to One – Represented by ‘auxiliary’ tables. map. the ATG Page 23 .use ATG’s Generic SQL Adapter (GSA) connector to perform a mapping between ATG and data stored in a SQL database.provides a means for using more than one data store as the source for a single repository.Uses the Dynamo LDAP connector to access user data in an LDAP directory.ItemDescriptorImpl. Or another alternative might join multiple tables into a single item descriptor. etc. user profiles.). For example. This is to maintain versions of repository items. and more.an extension of the GSA used in ATG Publishing.repository. The column specified by the multi-column-name attribute is used for multi-valued properties of datatypes array. products. The name of each property is defined in the item descriptor. Also Repositories can support multiple item descriptors. Versioned Repositories . The item descriptor gives a name to the type. The multi-column-name attribute ensures that the ordering of the multivalues are maintained.RepositoryItemDescriptor interface and may subclass atg. For map type properties. 1. etc. It can be used to access content. application security information.
– – A new item of the type declared by the item-type attribute is also created and The property is set to point to the other item created. The cascade="insert" attribute is typically used with cascade="update" and cascade="delete" so that management of this item is completely automatic. updated. then.e. For list or array type properties. The cascade attribute can take one or more values i. The item is created. or delete.ATG Framework and Components values in the column specified by the multi-column-name attribute must be a string. these values should be an integer or numeric type. and must be sequential. ATG Page 24 . Xml-Combine Xml combine tag is use to extend default catalog (product catalog). then when the item is created following action executes. Cascade Insert If a repository item has a property with the item-type attribute and the cascade="insert" attribute set. • • • • • • 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. Cascade Update If a repository item has a property that refers to other items and that has the cascade="update” attribute set. insert. update. and deleted along with the parent item. added. The cascade="insert" attribute is ignored for properties that use component-item-type.
ATG Page 25 . any referenced items that have been modified are automatically updated. but not queryable. 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. Any referenced items that are new (transient) items are added. This feature enables one repository item to derive property values from another repository item or from another property in the same repository item. They are readable and writable. But the company property in the employee item descriptor should not use cascade="delete". any new (transient) items referenced by this property are added automatically to the repository and When we call updateItem. the employee property in the company item descriptor could use cascade="delete". any items that are referenced by the property will also be removed. we can have derived properties. since multiple items may be referring to it. The item on the “one” side of the relationship cannot be deleted safely.ATG Framework and Components – When we call addItem(). then when you remove the repository item. For example. Transient Properties The SQL repository allows us to define transient attributes for a repository item. In this one-to-many relationship. Also. 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. Item-Descriptor Hierarchy (Inheritance) Item-descriptors also allow inheriting data from parent table. since deleting one employee item would then delete the company item that is referenced by the remaining employee items. There exists an auxiliary relationship between the parent and child item-descriptors. when you remove a reference to this item. – Cascade Delete If a repository item has a property with the cascade="delete" attribute set. Transient attributes are never stored or read from the persistent data store. The parent item-descriptor specifies/restricts the child item-descriptors that can inherit it by specifying the sub-type-property attribute. Fetching the child repository item will automatically fetch data from the parent table as well. Derived properties In a SQL repository. the item is automatically removed. Special care must be taken in cascade delete in one-to-many relationships.
caching is handled separately in each VM. the first time this query is issued. all queries are invalidated in the query cache for that item descriptor. For example. In addition. rather than needing to access the database. Locked Caching . Which mode is to be chosen depends on the nature of your Dynamo application. Item Caches & Query Caches Each item descriptor in a SQL repository has its own separate item cache and query cache. the SQL repository uses simple caching. Simple mode is better if the application is running on only one JVM and is not clustered across. • • No Caching (disabled) Simple Caching . with no invalidation events to synchronize updates from different server instances. Cache Modes The SQL repository implements several different modes of caching. Cache Invalidation Item cache entries are invalidated when that item is updated & affected queries are also invalidated. suppose you have a query like this job = manager AND sal = 5555 If query caching is enabled. the next time this same query is issued.ATG Framework and Components A transient property can be specified by defining a <property> tag that is not associated with any database table. Then. but which is instead a direct child of an <item-descriptor> tag. We size and flush caches separately for separate item types. the result set is retrieved from the database and stored in the query cache.read and write locks are used to synchronize the caches. The query cache holds the repository IDs of items that match particular queries in the cache. By default. Query caching is turned off by default. It is indexed by the repository item IDs. Page 26 • ATG . The item cache holds property values for repository items. whenever an item of a given item type is added to or removed from the repository. the SQL repository can retrieve the result set from the cache.
ATG Framework and Components • Distributed Caching - caching with cache invalidation events.
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.
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.
Java Interfaces & Classes
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.
• The atg.repository.RepositoryItem interface is the immutable interface that represents an element from a repository. Each RepositoryItem is uniquely identified through its repositoryId property.
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.
• 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 view’s 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.
Above methods return either – an array of RepositoryItems, for elements that match the “where” clauses of the query, or null, if no elements could be found.
Steps in Setting up a SQL Repository
• • • Write a Repository definition XML file following the DTD of the gsa-template tag. 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. Create the necessary tables in the database.
ATG Framework and Components • Add the repository to the ContentRepositories component, initialRepositories property if the repository has to be started automatically during the ATG startup, or just leave it. The repository component will be started when an application component accesses it, the first time.
Working with Repositories
We can retrieve items from the repository using the following methods.
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.
Once an item is created using create item method, we can turn it to a persistent repository item use the addItem method.
Removing item persistently, just pass the ID and ItemDescriptor name of the item to the removeItem method. The item’s property values will be deleted and will no longer be accessible from the repository.
The MutableRepository updates a repository item transactionally in three steps. 1. Fetch a mutable version of the repository item through the getItemForUpdate or getItemsForUpdate methods. These methods return instances of MutableRepositoryItem.
This method extracts all the changes required for the item and updates the item in the data store. Object pPropertyValue) to update the property value. MutableRepositoryItem has a method setPropertyValue(String pPropertyName. Save the changes with the updateItem method. 3.ATG Framework and Components 2. If there was any type of error. Use this method to change as many properties as you wish. the update can be committed immediately. or the update may happen automatically when the associated transaction commits. Depending on how you have configured transactional behavior. Above changes will not be reflected in the repository until the final updateItem operation is invoked. a RepositoryException is thrown. ATG Page 30 .
For examples . • Using droplets using following tag. It minimizes the amount of Java code that has to appear in HTML and the amount of HTML that has to be hard-coded into Java classes. Switch. • Passing parameters to droplet. IsEmpty etc.ATG Framework and Components Droplets (Dynamo Servlet Beans) Droplet is a Servlet Bean to dynamically generate HTML from a Java Object. • • Droplets can be nested Parameters can be passed between different droplets. DAF (Dynamo Application Framework) comes with a set of ready-made (out-of-the-box) Droplets that can be used. IsNull. They are referred as Custom Droplets. The user can create their own droplets based on their need. ATG Page 31 . Advantages of Droplets We can include multiple droplets in a single page. How to use Droplets in a JSP • Import droplets using following statement.ForEach.
formatting it based on the locale Displays error messages that occur during a form submission Displays one or more text values. depending on the relative value of its two input parameters Displays a numeric value as a currency amount. formatting them based on locale Displays one of two possible outputs. depending on whether its input parameter is null Function Displays a subset of the elements of an array Redirects the user to the specified page ATG Page 32 . Marked by dsp:oparam tags. Important ATG Out-of-the Box Droplets Name For ForEach Compare CurrencyFormatter ErrorMessageForEach Format IsEmpty IsNull Name Range Redirect Function Displays a single output the number of times specified Displays each element of an array Displays one of a set of possible outputs. depending on whether its input parameter is empty Displays one of two possible outputs. and specify code to execute at different stages of servlet processing.ATG Framework and Components Droplet Parameters • Input parameters – – • Passed to the servlet bean Usually used by the java code to process Output parameters – – Set by the servlet bean Used on the JSP’s to display dynamic content • Open parameters – – Open parameters contain the data that is rendered by the servlet bean.
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. • • • • Example of Custom Droplet (Java Code) ATG Page 33 .DynamoServlet class. arranging the output in a two-dimensional format Displays a subset of the elements of an array..ATG Framework and Components Switch TableForEach TableRange RQLQueryForEach RQLQueryRange Displays one of a set of possible outputs.> tag and pass the necessary parameters. depending on the value of its input parameter Displays each element of an array. Make the droplet into a component using the ATG Component Browser. Us the OPARAM tags to mix the HTML content and the dynamic values returned by the droplet. Override the service() method and provide the logic there.servlet. arranging the output in a two-dimensional format Constructs an RQL query and renders its output parameter once for each element returned by the query Constructs an RQL query of a SQL database and renders its output parameter for a selected subset of the elements returned by the query Steps in writing a Droplet • • • Write a java class extending the atg. Embed the droplet in a JSP page using the <dsp:droplet .
CategoryLookup. SKULookup Categories. ProductLookup and SKULookup droplets respectively. ItemLookupDroplet RepriceOrderDroplet. ATG Page 34 .ATG Framework and Components Example of Custom Droplet (JSP Code) TargetingForEach TargetingForEach droplet uses the RootCategories targeter to find root categories. ProductLookup . products and sku’s can be displayed with the help of CategoryLookup. PriceItem These droplets are used to display the price of the SKUs. PriceEachItem.
Form Handler Methods A form handler class must include one or more handler methods. Any property that generates an exception. These exceptions are stored in following properties. Exception Handling in Form Handler As mentioned.g. submits the data. • • • • Displaying live value of the component’s property. “ErrorMessageForEach”. These are properties which can be set by the input elements in a form. User can create their own Formhandlers based on their need. Displaying error messages on page Check for the value of “formError” Boolean & render the error or exception using droplet i. and determines what action to take (e. Direct interaction with SQL database e. The form handler checks the validity of the data. ShoppingCartModifier etc. propertyExceptions: A read-only property that returns a dictionary of subproperties. formExceptions: A vector of the exceptions that occurred when the form is processed. Using Formhandlers we can associate various inputs to the nucleus components. The beans can be use for output also. etc. ATG Page 35 .e. check for errors. A handler method is typically invoked when the user clicks the submit button and handles the processing of the form. E.g.e. This droplet is used to display the errors occurred during form Handling. display an error message. direct the user to a different page. FormHandler can have several methods depending on its purpose. FormHandler used to create a profile can have methods for creating profile..) Following are the use cases of form handlers. They are referred as Custom FormHandlers. – – – formError: A Boolean i. The form handler can evaluate the validity of the data and check for errors if any. Form Handler Beans These beans have their getters and setters. deleting profile etc. forwarding the user to some other JSP page etc. modifying profile. Example is ProfileFormHandler.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. Storing and retrieving information from database. Dynamically setting values to component’s properties. the corresponding subproperty in the propertyExceptions contains that exception.g. FormHandler is used to handle errors and exceptions. true if any errors occurred. one for each property set by the form.
Provide the appropriate handleXXX methods e. Each Handler method will be triggered by a corresponding dsp:input submit button from the JSP page. • • ATG Page 36 . Provide either a Map data structure to hold the form data or provide individual fields with appropriate set/get methods. handleCreate().droplet.GenericFormHandler base class. CartModifierFormHandler Used to process an order such as adding to cart. Saving repository data to a database. modifying cart etc. Connect forms with user profiles stored in a profile repository. Creating. QueryFormHandler Specifying properties to Search Engine.g. Example of Using a FormHandler Steps in writing Custom Form Handler • • Create a java class extending the atg.ATG Framework and Components ATG Out-of-the Box Form Handlers Name SimpleSQLFormHandler RepositoryFormHandler ProfileFormHandler Function Works with form data that is stored in a SQL database. handleUpdate() etc. Also used to obtain refinements from existing data. modifying and deleting user profiles. Write the validation logic inside the handler methods and return appropriate Boolean codes.
The handler method will contain logic to do the validations and handling errors. ATG Page 37 . • Example of Custom Form Handler (Java Code) In the following code sample. handleAddData() is handler method and name is handler bean.ATG Framework and Components • Populate validation errors. Forward the user to the appropriate success URL. the input MyFormHandler. if any. When user clicks on submit button the handleAddData() method of MyFormHandler Java class get called which will process data and transfer control to the successURL specified in form action. Example of Custom Form Handler (JSP Code) In following sample code. The data is processed and control is redirected to the successURL specified in the form. into the formExceptions Vector or proceed to do the business logic.name is bean used to set the value after the form is submitted.
ProfileFormHandler ProfileFormHandler class to connect forms with user profiles stored in a profile repository.commerce.B2BcommerceProfileFormHandler atg.b2bcommerce.ATG Framework and Components SimpleSQLFormHandler SimpleSQLFormHandler for working with form data that is stored in a SQL database. CommerceProfileFormHandler ShoppingCartModifier.profile. CartModifierFormHandler These form handlers are used to manage the Shopping Carts.profile. RepositoryFormHandler RepositoryFormHandler for saving repository data to a database. /atg/userprofiling/B2CProfileFormHandler atg. You can also extend these and other form handler classes to handle the specific needs of your application.ExpressCheckoutFormHandler. ATG Page 38 . SearchFormHandler SearchFormHandler for specifying properties available to a search engine.
For example. Each step may depend on additional information being available about the request.e. Every request sent to the Dynamo server is dispatched to the servlet pipeline. When a servlet is done acting on the request. The controller is called as servlet pipeline while is formed by a sequence of separable independent steps. it can pass the request to the next servlet.servlet. It is a mutable class whereas HttpServletrequest is immutable.DynamoHttpServletRequest. Each servlet is also given a pointer to the next servlet in the pipeline. to access the state object parameter. This linked-list of servlet is called the servlet pipeline.servlet.DynamoHttpServletResponse that allows you to change properties of the HttpServletResponse. so order does matter. such as setPathInfo or setPathTranslated. such as status code. jsp should use following sample code. response pair called DynamoHttpServetRequest and DynamoHttpServletResponse. DynamoHttpServletrequest provides methods that allow us to change the properties of the request. This class implements HttpServletRequest. DynamoHandler create this object by wrapping generic HttpServletRequest object. • DynamoHttpServletResponse: There is also a corresponding atg. ATG Page 39 . – – session tracking page compilation Request Handling by Servlet pipeline Request handling can usually be broken down into a series of independent steps. DynamoHttpServletRequest object is created by DynamoHandler i. DynamoHttpRequest and DynamoHttpResponse The Dynamo server provides specific request. The linked list of these servlet called as request-handling pipeline. Each servlet in turn performs its specific function on the request. The sequence of the steps is important because each step might depend on additional information about the request. The pipeline is started by Page filter and most requests handled by Nucleus are dispatched to the PageFilter or DynamoProxyServlet.servlet. The request is delivered to the servlet at the head of the pipeline. • DynamoHttpServletRequest: atg. such as the output stream and access its values. This provides the flexibility of customizing the pipeline through configurable components.ServletUtil) is used to import the information of Dynamo specific requests or response. Major tasks of Servlet Pipeline include. a first servlet in pipeline. Each of the steps is made by a single Nucleus service which implements the Servlet interface.ATG Framework and Components ATG Controller Framework (Servlet Pipeline) ATG controller framework is used to handle the HTTP requests. ServletUtil This class (atg.
Following figure also depicts the common servlets contained in the DAF Pipeline. When the application server invokes PageFilter. the application server creates an instance of the HttpServletRequest and HttpServletResponse. 3. The application server follows the following path for processing the request. the DAF servlet pipeline runs through the set of servlet shown below. 2.It is used to handle the JSP request. This pipeline is for customer application jsp request. 1. PageFilter is mapped to handle JSP requests. By default. ATG Page 40 . it checks the request and response for a reference to a Dynamo request and response pair. • Request Processing by DAF Servlet Pipeline When a JSP page is requested. • DAF Servlet Pipeline . Because JHTML is a proprietary language. the application server uses servlet and filter mappings defined in web. it relies on the page compiler provided in the DAS servlet pipeline to generate JHTML into a servlet that’s rendered as HTML by the application server.xml to determine the next resource to call. When a user performs an action that prompts a response. Based on the directories and file extension of the requestURI. DAS Servlet pipeline .ATG Framework and Components Types of Pipelines There are two request-handling pipelines used by Dynamo.It is used to handle JHTML request.
DynamoProxyServlet is used in DAS pipeline instead of pageFilter. 1. Request Processing by DAS Servlet Pipeline DAS is used to handle JHTML request. It is responsible to handle jsp pages. 2. which holds all JHTML pages. Note:Although DynamoHandler does the same thing in both pipelines but a different version of DynamoHandler is used for each request type. Note: ATG Business commerce pipeline includes additional components more than ATG Consumer Commerce. 4. The application server follows the following path for processing the request. one of the servlets in the pipeline. which invokes the next filter defined in web. As JHTML is a proprietary language. By default. The last servlet in the pipeline is TailPipelineServlet. which is responsible for starting the DAS servlet pipeline by calling DynamoHandler. DynamoProxyServlet make call to DynamoHandler to start DAS pipeline. A call for a page in the dyn directory.doFilter(). The pair does not exist. if you create custom servlet filters. The pipeline runs through the set of servlet. causes the application server to invoke DynamoProxyServlet.xml. Now it is a responsibility of DynamoHandler to generate DynamoHttpServletRequest wrapping generic HttpServletRequest. PageFilter will start the DAF servlet pipeline by calling DynamoHandler. 6. 3. the first servlet in the pipeline. pageFilter is use only in DAF request handling pipeline. 5. pageFilter call an instance of DynamoHandler a first servlet in a pipeline. no filters are involved in request-handling process.ATG Framework and Components 4. One task common to both pipelines is the compiling of JHTML pages by PageCompileServlet. It is responsible for calling FilterChain. they will be invoked before DynamoProxyServlet. it relies on the page compiler provided in the DAS servlet pipeline to generate JHTML into a servlet that’s rendered as HTML by the application server. user. The DAF servlet pipeline will process through a series of servlets that modify the request and response by extracting path information and providing session. ATG Page 41 . and security information. The DAS servlet pipeline performs the same request and response handling tasks as the DAF servlet pipeline.
Example: if we want to insert a servlet i. “PipelineableServlet”. which specifies the next servlet in the pipeline. 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.PipelineableServletImpl class.servlet. This class defines a property called nextServlet of type Servlet. The components created by these servlets should be globally scoped and configured to the pipeline. whereas the DAF servlet pipeline relies on the application server to handle the complete page compilation process.ATG Framework and Components • PageFilter calls /atg/dynamo/servlet/dafpipeline/DynamoHandler to start the DAF servlet pipeline for JSP requests. by invoking a method called passRequest. Create a component using this servlet. so we need to override the service method.e.e. Servlet1 & Servlet2 in the pipeline. Servlets that implement PipelineableServlet have a nextServlet property that points to the next component to invoke. The key advantage of this mechanism is that it does not require modifying any existing servlets in the pipeline compared to PipelineableServlet. it passes the request and response objects to the servlet specified by this property. Servlet1a. The PipelineableServlet interface has two subinterfaces that provide additional mechanisms for determining the next component to invoke.e. Customize Pipeline Servlet All servlets in a pipeline implement “PipelineableServlet” interface of atg.pipeline.servlet. ATG Page 42 . This class implements all Servlet methods.pipeline package. You can write custom pipeline servlet by extending the atg. between two servlets i. The main difference between the DAS and DAF servlet pipelines is that the DAS servlet pipeline automatically compiles the page from JHTML to Java. • DynamoProxyServlet calls /atg/dynamo/servlet/pipeline/DynamoHandler to start the DAS servlet pipeline for JHTML requests. needs to implement an interface i. When your servlet finishes processing. In order to write custom pipeline servlet.
insertAfterServlet to point to Servlet1.ATG Framework and Components If Servlet1a implements PipelineableServlet.g. 3. all you have to do is set Servlet1a. Set the insertAfterServlet property of your servlet to point to the path of the pipeline servlet you want your servlet to follow in component’s property file. MyServlet. 2. But if Servlet1a implements InsertableServlet. and set Servlet1a. Steps to Create InsertableServlet Following steps involve creating & adding an InsertableServlet to the servlet pipeline. use 5. Define it as a component in the Nucleus hierarchy of this servlet. and Servlet1a will automatically be “spliced” into the pipeline right after Servlet1 and before Servlet2. Write a servlet e. For example. you can reroute the pipeline by changing the value of the Servlet1.nextServlet property pointing to Servlet1a rather than Servlet2. if you want your servlet to follow the DynamoServlet in the pipeline.nextServlet to point to Servlet2. 4. extending InsertableServletImpl. Add the path to your servlet to the initialServices property of /atg/dynamo/servlet/Initial ATG Page 43 . Servlet1a is able to do this because it effectively sets its own nextServlet property to the value of Servlet1’s nextServlet property and rewrites Servlet1’s nextServlet property to point to Servlet1. 1. It does not really matter where you put your servlet in the component hierarchy.
For example.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. list1<servlets> key2. the MimeTypeDispatcher servlet determines which servlet to invoke depending on the MIME type of the request. key1. depending on some condition. list2<servlets> If key1 is matched then servlets from list1 will be invoked in sequence. If key2 is matching the condition then servlets from list2 will be invoked in sequence. ATG Page 44 .
Targeters Targeters are not event based. Targeters don’t use slots. data analysis and reporting to the Dynamo framework. use scenarios. 3 4 ATG Page 45 . its definition is saved in the scenario registry (located at the Nucleus path /atg/registry/data/scenarios) as a file with the extension . then send them a reminder e-mail offering a 10% discount toward their first purchase. we can fine-tune our business initiatives and the site's overall design to best meet the needs of our customers. Events in DAF are just JMS messages and therefore the scenario server acts as a MessageSink.NO Scenarios 1 Scenarios are triggered by events. an Action element defines what the system does in response. logging in).ATG Framework and Components ATG Scenarios (DSS) DSS adds advanced personalization features such as customer management scenarios. Scenarios are event-driven. By analyzing the data collected from scenarios. offering price promotions. Event element defines what the site visitor does. but doesn't log in within two weeks. Example: If a customer registers. 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.then" triggers and responses. Slots provide some powerful advantages over targeters (for example. it receives all the standard Dynamo events). 2 The business rules we can set up through If we want to personalize content as a targeters are more flexible in some cases than result of a site visitor's doing something scenarios. Difference between Scenarios & Targeters S. use a highly complex rules to match content to scenario. use targeters. we can set up empty slots that generate their own requests for content). When a scenario is created or modified in the ACC.. Scenarios are represented visually in the ATG Control Center by flow diagrams that describe targeted customer interactions as a series of "if. Scenario server itself is event driven..sdl. For this reason. visitors. if we need to set up specific (for example. or sending targeted e-mail messages. If we want to set up a long-term approach to content and visitor management. Scenarios use a feature called slots to display dynamic content. We can configure it to listen to various events (by default.
Slots have better caching capabilities.ATG Framework and Components Slots Slots are Nucleus components that can be used to display and manage dynamic content on Web site. Scenarios use slots to manage the delivery of dynamic content. For example. TargetingForEach) to the page or pages where you want the slot to appear. ATG Page 46 . Targeting servlet beans are used to include slots in site pages and scenarios are used to fill them with content. 1. scenarios allow us to set up an empty slot that generates its own request for content when a site visitor displays the page. which can make displaying content faster. Create a scenario that specifies the content you want to display in the slot and defines the circumstances in which the content appears. slots have better caching capabilities than targeters. specify the slot component. Add an appropriate targeting servlet bean (for example. The process of creating and setting up a slot has the following steps. Example. Create the slot component. In the Targeter property of the bean. which can make displaying content faster. 3. 2. Slots are more powerful and flexible than targeters.
and Web sites started including site maps among their pages. Using this. primarily through two mechanisms. To make finding the sparse information easier. and presentation of the site to fit each visitor's characteristics and preferences. modify and query user profile data in a SQL database. content. Why personalization is important? When the World Wide Web was first developed. Content Repository . a Web site should recognize that we are looking at a particular category of information.ATG Framework and Components Dynamo Personalization Server (DPS) ATG provides a way to match page content to individuals based on their needs and preferences.Using this. and searching for the right piece of information was difficult. A content ATG Page 47 . This concept called as personalization. Ideally. we can store. and information for that category. or third-party content management system.A content repository is a collection of content items managed by a single system such as a relational database. which is the process of displaying different content to each site visitor depending on his or her preferences and requirements. Personalized Web sites customize the behavior. ATG Personalization Module (DPS) provides features that are specifically designed to support Web site personalization. services. one big problem was trying to find valuable information. companies such as Yahoo started creating indexes of all the available content. file system. Example is /atg/userprofiling/ProfileAdapterRepository.It is pre-configured default repository for DPS. or scenarios. There was not much content published. and associate different content with each group of users. Slots that display their content in the context of certain events. Personalization ATG Personalization lets you customize content for specific users and events. and show the related products. DPS provides a full set of customizable tools for displaying targeted information. we can store. Content targeters that match content to specific users. DPS Repository Dynamo SQL Profile Repository . modify and query user profile data in LDAP (Lightweight Directory Access Protocol) directory. or investors and brokers). because the amount of content on even a single site is too vast to navigate by means of a site map. Most Web sites today have their own search engines. Dynamo LDAP Profile Repository . Some Web applications explicitly segment their users into several affinity groups (such as visitors and members.
Business managers create profile groups by defining business rules in the Targeting > Profile Groups window of the ATG Control Center. If ATG is started with DSS then User Profile Management When a person visits our Web site. Also there are extension methods like preCreateUser(). we can use it to define our targeting rules and scenarios (if we have DSS installed).. such as the name he or she entered in a registration form (a self-reported.scenario.process form input and updating user profiles. or implicit. only the values vary from user to user. either directly or as an element in a page. A SQL content repository must contain following things. preLoginUser(). DPS creates a profile for him or her (based on a profile template) and stores it in a database. So a repository can contain multiple repository item types.content. /atg/userprofiling/ProfileFormHandler . ATG Page 48 .ScenarioProfileFormHandler ScenarioProfileFormHandler is an implementation class. 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). provided. postCreateUser(). DPS makes profiles persistent by storing them in a database. Note: Since the GSARepository class implements both the atg. postLoginUser() etc.ATG Framework and Components repository typically serves as a source of content items to be displayed to a user.repository. 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. 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). attribute). registration. atg.repository. This profile contains a list of properties that describe the person's characteristics. Once we create a profile group. DPS Form Handler This form handlers contains the handler methods to handle the user login. attribute) or the date of the person's last login (a system-generated. or explicit.Repository interface and the atg. All profiles track the same attributes.ContentRepository interface.userprofiling. updation etc.
SimpleContentProcessor and HtmlContentProcessor.e. Optionally. SimpleContentProcessor This doesn’t do any processing on the passed in message content.Implicit properties are information that the system gathers about visitors by tracking their behavior at your site. but simply uses the content as is to set the javax. Usually.ATG Framework and Components Profile Properties The profile contains properties that describe the person's characteristics. Determines whether to send the Message content as “text/html”. and delete profiles if necessary. Example is a list of recently browsed Web pages is an implicit property. But Control Center provides options that let us view the profiles in the repository. 3.Message content. MessageContentProcessor is an abstract class. 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). Performs word wrapping on the plain text version of the content. “text/plain”. Explicit Properties – Explicit properties are provided by site visitors when they fill registration form to become a member of your site. The Personalization module includes two concrete subclasses of MessageContentProcessor i. Example. There are two kinds of profile properties. HtmlContentProcessor HtmlContentProcessor a more sophisticated implementation of MessageContentProcessor. We can also use them to add. Implicit Properties . edit. The MIME type of the content in the Message is specified by the service’s contentType property. the system updates profile properties automatically. We do not have to change them. We can also implement our own content-processing scheme by creating a subclass of MessageContentProcessor that implements all of its methods. ATG Page 49 . Examples of explicit properties are a person's name and address. converts it into content of type “text/plain”. TemplateEmailInfoImpl’s contentProcessor property points to an object of MessageContentProcessor. Message Content Processor MessageContentProcessor is responsible for actually setting the e-mail message content given the rendered message body. or “multipart/alternative” with “text/plain” and “text/html” parts.mail. This does the following jobs. Takes in content of type “text/html”. 1. 2. 4.
HTML content repository can be created from ACC with repository component and its associated DataStore. we can run queries against meta-data attributes to search for and manage particular content items. at a particular time.) and has meta-data that describe its characteristics. In the DPS rule-based system. SQL Content Repository The SQL Content Repository provides access to content stored in a SQL database. Similar to profile groups. Business rules define the content that we show to each profile group. is associated with a particular type of media (an HTML or XML file. XML Content Repository The XML Content Repository provides access to XML files stored in a file system. We can also run targeting operations against the content attributes to match content items with visitor profiles.ATG Framework and Components Content Management The term content refers to discrete units of information (a news article or a banner image. Content data is also stored in searchable repositories. XMLItemDescriptor. and RepositoryPropertyDescriptor components. A content repository is a collection of content items managed by a single system such as a relational database. HTMLItemDescriptor. Content targeters are the business rules created using the ACC. including the XMLRepositoryService component and its associated XMLDataStore. Each unit of content. 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. Content targeters that match content to specific users. or content item. The ACC includes a wizard to help us create components that make up an XML Content Repository. a PDF document. Once we set up a content repository. HTML Content Repository The HTML Content Repository provides access to HTML files stored in a file system. Content Targeter & Targeting Targeting is the process of displaying content items to a particular user. in a particular context. for example) available for display to Web site visitors. file system. Dynamo includes three implementations of Content Repositories. ATG Page 50 . business managers create rule sets that control how content is displayed on the Web site. Once we create a content group. we can use it to define our targeting rules and scenarios (if we have DSS installed). a GIF file. etc. or third-party content management system. either directly or as an element in a Dynamo Server Page. and RepositoryPropertyDescriptor components.
Each one uses a targeter to gather a set of items from a content repository. we can use scenarios instead of targeting rules to control the content that we display to each profile group. TargetingRandom displays n items chosen randomly. TargetingFirst displays the first n items. site must include content targeters that define the rules that determine which users see what content. They differ only in whether they display all of the items returned by the targeter. such as the third through the seventh. TargetingArray The first four of these servlet beans perform fundamentally similar operations. ATG Page 51 . Note . We can disable this behavior for any targeting servlet bean by setting one or both of the following parameters in the servlet. and renders the content items on the page. You can create targeters through the Content window of the Control Center.If we have ATG Scenarios.ATG Framework and Components Content targeter relates the content group with the profile group. To display targeted content. ATG Personalization includes five targeting servlet beans • • • • • TargetingForEach displays all of the items returned by the targeter. where n is a number you specify. TargetingRange displays a range of items. or just a specific subset.
Use following steps to personalize website. group similar content items together. match content groups to profile groups & determine the visitor behavior that we will track and use to update profiles. Preview the site Analyze data and fine tune the personalization ATG Page 52 . Create profile groups. Set up content items. • • • • • • • • Set up visitor profiles. we use the Control Center to Create profile groups. Group content items together Match content items with targeted audiences (profile groups). Track visitor behavior.ATG Framework and Components Steps Involve in Personalization Once we have planned our approach to the relationship between site visitors and content.
ATG support following features for Consumer Commerce. Setting pricing models. Volume Pricing & Tiered pricing ATG Page 53 . Custom catalogs for different users from different organizations. Orders management like canceling. Modular code execution using pipelines ATG support following features for Business Commerce. Shopping carts. gift certificates) Integration with Payment gateways and TAX systems. viewing orders. Catalog navigation & Product/SKU Comparison. Order approvals by other higher authorities. It handles pricing. fulfillment. and customer relationships. Scheduled order for regular buyers. coupons. ATG supports both B2C by ATG Consumer Commerce and B2B by ATG Business Commerce. multiple shopping carts for a user. Inventory management Merchandising(promotions. inventory. merchandising. Exporting an Order as XML.ATG Framework and Components ATG Commerce ATG Commerce module provides the foundational packages for online store. • • • • • • Cost Centers to track internal costs. • • • • • • • • • • • Profile management Product Catalog Product catalog display templates. targeted promotions.
Product catalog services and Navigation Pre-checkout/Purchasing process like Shopping carts Merchandising features like cross-sell.ATG Framework and Components ATG E-Commerce Functional Components ATG is not just a framework but a package where common e-commerce features are provided out of box. Checkout and Payment Processing. up-sell etc. ATG support following e-com functional components. Order Fulfillment ATG Page 54 . Profile Creation and Management. Developers can use these features in their e-com application with minor configurations.
The Personalization module defines a base “user” Item Descriptor in it. wish lists. expirationYear etc. Address based properties like shipping Address. usedPromotions etc.ATG Framework and Components Profile Management Profile management is the extension of Personalization functionality. The following are the extensions of personalization. address books. e-mail address. During login. type. Additionally it also provides properties such as • • • • • Promotions based properties like activePromotions. billingAddress etc. postCreateUser and postLoginUser methods from the ProfileFormHandler. It is located in /atg/userprofiling/ProfileAdapterRepository. ATG Page 55 . Shopping preferences like allowPartialShipping. address books.commerce. promotions.userprofiling. credit card collection and other minor features. 1. such as first and last name. giftLists etc. Profile Form Handlers The ATG Commerce profile form handler (atg. An anonymous user can accumulate promotions in their activePromotions attribute.profile. promotions. the anonymous user’s active promotions are copied into the list of active promotions of the persistent user. date of birth and home address. wish lists.ProfileFormHandler for commerce specific operations. Profile Repository Profile Form Handler Profile Tools and Property Manager Profile Repository Describes the attributes that ATG Commerce adds to the user Item Descriptor to support gift lists. allowExpressCheckout etc. It adds several attributes to the user Item Descriptor to support gift lists. List features like wishList. The Personalization module’s Profile Repository is an instance of the Generic SQL Adapter. This user has many general attributes defined. Payment based properties like CreditCard number. The following operations are performed by overriding the addPropertiesOnLogin.CommerceProfileFormHandler) is a subclass of atg. credit card collection and other minor features.
The userProfile.transient property to check up whether the user is logged in or not and act accordingly. Profile Tools and Property Manager Profile tools & property manager provide additional methods to access commerce specific profile properties such as shipping and billing addresses and credit card information.profile.commerce. In B2B. these shopping carts are loaded into the user’s session. which provides additional access to profile property names specific to Commerce customers that are used by Commerce Profile Tools.userprofiling. Note: Any custom profile property that is added by us. B2C Profile Form Handler It is extending user Profile form handler for B2C Commerce.ATG Framework and Components 2. ATG Commerce profile tools Class atg.ProfileTools. Class /atg/userprofiling/B2CProfileFormHandler extend from atg. Also describes the extensions related to the ATG Commerce Property Manager.profile.profile. 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. If the user’s persistent profile contains any old shopping carts (Orders in an incomplete state). must be handled in our FormHandler component which will extend the B2CProfileFormHandler. 3.CommerceProfileTools is a subclass of atg. the PricingModelHolder component is reinitialized to cache all the promotions that the persistent user has accumulated during previous sessions.xml can be extended to add more properties.CommerceProfileFormHandler class and is injected the component CommerceProfileTools to perform most of the commerce profile related activities. We can use the Profile.b2bcommerce.B2BCommerceProfileFormHandler class that extends the CommerceProfileFormHandler and this is available under B2BCommerce for use. ATG Page 56 . any shopping carts (Orders) created before logging in are changed to be persistent. registration. This also contains a Map property by name ‘editValue’ that holds extra properties like shippingAddress etc. it is extended to include the concept of addition or removal of CostCenters for B2B sites. logoff etc. During the registration and login process. The /atg/userprofiling/B2CProfileFormHandler component is used to handle user specific operations like user login.commerce. B2B Commerce Profile Form Handler ATG Commerce provides a class atg. It provides additional methods to access commerce specific profile properties such as shipping and billing addresses and credit card information. After log in.
checkout. edit. or they can register as members through a registration page. Create User Profile The User Profile can be created by 1. ATG Commerce Property Manager Class atg. Once they log in. It provides additional access to profile property names specific to Commerce customers that are used by CommerceProfileTools. create. This extension of the tools component provides methods to create.PropertyManager. Extending the Commerce profile Form Handler 2. This interface enables them to search. It can be configured to allow anonymous users to visit the site. delete and update profile repository shipping addresses as well as to retrieve all shipping addresses. members can access the My Profile page that allows them to maintain personal and commerce profiles and to track their order information.CommercePropertyManager is a subclass of atg. In a category page. Example: The shipping address property names are stored in CommercePropertyManager. ATG Page 57 .profile. It is an enumerated property type whose choices can be “unknown. • Current Location Property The user profile has a property called currentLocation (/atg/userprofiling/Profile. Members.commerce. shopping_cart.userprofiling. Profile groups or segments to be used to target the specific customers. catalog_search. This provides a convenient central location to store property names that may change depending on the site. store_home. • Returning registered members can log in with their user names and passwords. and delete user profiles. and profile”. Administrators can view and manipulate user profile data using the Profile interface in the ACC.currentLocation) that may be used by complex targeting systems to enable the targeter to know what kind of targeting information is available. we can set the property like shown below. catalog_category. Extending the repository userProfile.xml 3. That enable targeters to know what kind of targeting information is available. Create Profile Group ACC is used to create user groups such as Anonymous users. to browse the catalog and other pages.ATG Framework and Components Example: The shipping addresses are managed by the Commerce Profile Tools component. home. catalog_product. duplicate. Administrators etc.
products and SKU’s (Stock Keeping Units). The location of this XML file is /atg/commerce/catalog/productCatalog. media. It is a repository containing repository items like category. A product catalog is a hierarchical tree of categories and products. • • • • • • xml-combine="replace" xml-combine="remove" xml-combine="append" xml-combine="append-without-matching" xml-combine="prepend" xml-combine="prepend-without-matching" Category Product and SKU The main item types for standard catalogs are categories. representing varieties. and colors. and images) are repository items. The product catalog is built by adding new repository items and defining relationships between them.ATG Framework and Components Catalog Management Product Catalog The Product Catalog is a primary component in the Commerce Application. sizes. A product is a navigational end-point in the catalog. etc. In ATG Commerce. customers purchase a SKU and not a product. A reference to this XML file is found in the /atg/commerce/catalog/ProductCatalog component. A product may have several different SKUs associated with it. ATG Commerce includes a default catalog which can be extended as per the need. products. But. Xml combine tag is use to extend default catalog. These extensions can be created to add properties to categories. ATG Page 58 . But new tables must be created in the database to accommodate the extended properties. the product catalog is an ATG repository and the various elements of the catalog (such as categories.xml Xml-combine is used to extend the default catalog. Extending default Product Catalog ATG Consumer Commerce comes with an XML definition file that contains the information for the standard product catalog. This provides an organizational framework to a commerce site. products. Catalog repository items can be edited using ATG Control Center (ACC). products and sku’s.
2.to detect use of the Back button and should be passed in with any link that leads to a page that uses breadcrumbs. a product that represents a specific shirt might have many associated SKUs. ATG Page 59 . Category is considered to be a root category if their root category property is set to true. ProductLookup and SKULookup droplets respectively. ATG Commerce provides CatalogNavHistory component to track the customer’s path through the catalog. The component uses the following input parameters. pop and jump. These links are called Breadcrumbs. Using these components. Options are push. navCount . Navigation History and Breadcrumbs ATG provides some components to keep a track of the path a customer follows when browsing a website.operation to be performed on the stack. products and sku’s can be displayed using CategoryLookup. The component is placed under /atg/commerce/catalog/CatalogNavHistory. Developers can use TargetingForEach droplet which uses the RootCategories targeter to find root categories. Categories. ATG provide targeters to find root categories. a list of the items the customer visited can be constructed and can be displayed as links so that the customer can navigate back using them. A blank navAction is treated as push. navAction . 1. representing different combinations of size and color Catalog Navigation A catalog home page displays a list of root categories.ATG Framework and Components For example.
The Product Catalog can be altered to create a number of subcatalogs representing the smallest section of the inventory that the customers want to view.ATG Framework and Components Custom Catalogs Custom catalogs are an important feature for commerce websites. ItemLookupDroplet from returning an item that is not in the current catalog. Step 1: Create a new database to accommodate the custom catalog data.properties /atg/commerce/catalog/ProductLookup. Define the path of this repository in the productCatalog.commerce.properties And use the following class: $class=atg. It is needed to provide information to particular customers or companies. Step 2: Configure the product catalog repository to use the custom catalog xml file.custom.catalog.servlet.CatalogItemLookupDroplet ATG Page 60 .properties file. Step 3: To keep the atg.properties /atg/commerce/catalog/SkuLookup. A custom catalog can be setup in following 3 steps. /atg/commerce/catalog/CategoryLookup. change the following servlet beans.repository.
The component that utilizes OrderHolder is /atg/commerce/ShoppingCart.ATG Framework and Components Order Management ATG Order management supports functionality like – – – – – – – Adding. Order Orders are in process. Calculating the promotions if exists Ensuring items are shipped by the preferred method Validating credit card information. normal checkout. Shopping cart Shopping Cart is an Order in incomplete state. Order Holder This class maintains the current Order object as well as a collection of saved Order objects. deleting items to a shopping cart. Few of them are listed below. editing. This component in turn interacts with the Pipeline processors. complex checkout etc Payment Integration with Cybersource. delete. ATG Page 61 . Cybercash Order History – – ATG Order Components (OTB) ATG provide good number of out of box components for Order Management feature. Multiple shopping carts for user Multiple shipping and payment methods Provides various types of checkout like ExpressCheckout/Expedited Checkout. Order Manager interacts with the pipeline processors. Customers can have an unlimited number of orders in existence at one time. 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. a session-scoped component whose handleXXX methods add.
The default property settings should be suitable for most sites. and tax information for each item or the entire Order. Form Handlers CartModifierFormHandler. This includes information such as a credit card number. OrderTools OrderTools contains a set of properties that you can use to customize the purchase process. and the amount to be charged. An Order contains CommerceItems. and Relationships. ExpressCheckoutFormHandler etc. PriceEachItem. A CommerceItem contains the SKU (also called the catalogRefId) and the quantity of the item purchased. CommerceItem The CommerceItem interface represents information about a product to be purchased. A ShippingGroup could contain a physical delivery address. ShoppingCartModifier.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. PriceItem etc. 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. ShippingGroupsDroplet. ATG Page 62 . This pipeline contains the sequence of processors for order submission and payment. are used to manage the Shopping Carts Droplets RepriceOrderDroplet. which are used to display the price of the SKUs. ATG Order Java Interfaces Order The Order interface represents the delivery and payment information for a collection of items. PaymentGroup The PaymentGroup interface contains payment information. shipping costs. PaymentGroups. but can be changed. ShippingGroups. PaymentGroupsDroplet which can help in accumulating necessary information. an expiration date. ShippingGroup The ShippingGroup interface contains information about the delivery of a collection of CommerceItem objects.
It contains data structures for managing collections of other commerce objects. shipping costs. and Relationship objects. HandlingInstruction The HandlingInstruction interface describes special handling for a CommerceItem within a given ShippingGroup.This class implements PaymentGroup. Shipping classes – ShippingGroupImpl -This class implements ShippingGroup.This class implements ShippingGroup and extends ShippingGroupImpl. In addition to storing inherited data. It stores the payment information for CommerceItems. it stores information about how the CommerceItems are to be shipped to a physical street address.ATG Framework and Components Relationship The Relationship interface represents an association between two or more of the commerce objects listed above. – HardgoodShippingGroup . ShippingGroup. as well as the Relationships to items in the shipping group. or tax costs in the PaymentGroup. There are 2 subclasses which have actual implementation called HardgoodShippingGroup and ElectronicShippingGroup. This class provides no functionality itself. and tax. It stores the data describing where and how to ship CommerceItems. PaymentGroup. it stores information about how CommerceItems are to be delivered electronically. It stores the data about a specific item in an Order. such as an e-mail address. such as the relationship between a CommerceItem and a ShippingGroup. It manages collections of CommerceItem. It also can contain Relationships to those items. ElectronicShippingGroup . ATG Order Java Classes Order Classes – OrderImpl: This class implements Order. such as the carrier and postaladdress. shipping costs. Gift wrapping is an example of HandlingInstruction. In addition to storing inherited data. ATG Page 63 . – Payment Classes – PaymentGroupImpl .This class implements ShippingGroup and extends ShippingGroupImpl. Item Classes – CommerceItemImpl: This class implements CommerceItem.
This Relationship object itself contains data such as the amount of the shipping cost to be paid for using the PaymentGroup. it also stores data about which CommerceItems in the Order were added from a gift list. the CommerceItem is paid for using the information in the PaymentGroup. Page 64 – ATG . as well as data about what quantity of CommerceItems in which ShippingGroups need special handling. CommerceItem ID. PaymentGroupCommerceItemRelationship . In addition to storing inherited data. and tax costs are paid for using a gift certificate. – – – Handling Classes – HandlingInstructionImpl . This Relationship object itself contains data such as the amount of the tax cost to be paid for using the PaymentGroup.pShippingGroupRelationship.When this Relationship is added to a PaymentGroup and Order.When this Relationship is added to a PaymentGroup and ShippingGroup. In addition to storing inherited data. the shipping cost is paid for using the information in the PaymentGroup. GiftlistHandlingInstruction . and tax costs are paid for using a store credit. the CommerceItem is shipped using the information in the ShippingGroup. In addition to storing inherited data. but is used through the CreditCard and GiftCertificate subclasses. StoreCredit .This class implements PaymentGroup and extends PaymentGroupImpl. and tax costs are paid for using a credit card. PaymentGroupOrderRelationship . PaymentGroupShippingGroupRelationship . shipping costs.This class implements HandlingInstruction. the tax cost or order cost is paid for using the information in the PaymentGroup. it stores information about how CommerceItems. This class provides no functionality itself.ATG Framework and Components This class provides no functionality itself. it stores information about how CommerceItems. In addition to storing all the basic data that it inherits. but should be used through a subclass like GiftlistHandlingInstruction.When this Relationship is added to a PaymentGroup and CommerceItem. shipping costs. it stores information about how CommerceItems. and quantity. – CreditCard . – – Relationship classes – ShippingGroupCommerceItemRelationship .This class implements PaymentGroup and extends PaymentGroupImpl. This Relationship object itself contains data such as the quantity of the item to be paid for using the PaymentGroup. GiftCertificate .This class implements HandlingInstruction and extends HandlingInstructionImpl. This Relationship object itself contains data such as the quantity to be shipped.When this Relationship is added to a ShippingGroup and CommerceItem. It contains a ShippingGroup ID.This class implements PaymentGroup and extends PaymentGroupImpl. shipping costs.
We need to extend these objects to track additional information about your users if needed.ContactInfo These classes address Properties like firstName. address2.country.core. faxNumber. The methods within these classes are used to make changes to an Order. commerceItemTypeClassMap. defaultPaymentGroupType. City. orderTypeClassMap. address1.core. defaultShippingGroupAddressType. These objects are referenced when a user checks out. defaultShippingGroupType. defaultPaymentGroupAddressType. email. relationshipTypeClassMap. Following are business layer classes – – – – – – – – OrderTools OrderManager CommerceItemManager ShippingGroupManager HandlingInstructionManager PaymentGroupManager OrderQueries SimpleOrderManager Customizing OrderTools OrderTools need to be customized when the order module is extended.core. postalCode. shippingTypeClassMap.util. Business Layer Classes The business layer classes contain the logic and business rules for the purchase process.ContactInfo. ownerId and ContactInfo Properties like phoneNumber.util. – – atg. ATG Page 65 . These methods contain the logic that alters the Order’s data structure and maintains its accuracy.util.util. defaultCommerceItemType.Address atg. middleName.ATG Framework and Components Address classes There are two classes atg. state. lastName.Address and atg. paymentTypeClassMap. defaultOrderType. The following OrderTool properties can be customized.core. The OrderTools component is located in Nucleus at /atg/commerce/order/. beanNameToItemDescriptorMap.
0dir>/B2CCommerce/config/atg/commerce/order/orderrepository. this base file is combined with an additional definition file that is located at<ATG9. this base file is combined with an additional definition file that is located at <ATG9. The base Order Repository definition file <ATG9. ATG Page 66 .transient This user profile property is used to check if a user is logged in or not & act accordingly.0dir>/B2BCommerce/config/atg/commerce/order/orderrepository. the processors that save and load an Order look for an item descriptor that is mapped to the corresponding commerce object class.xml. The beanNameToItemDescriptorMap property of the OrderTools component maps the Order Repository item descriptors to Bean names. is located at In ATG Consumer Commerce. the beanNameToItemDescriptorMap property contains this mapping.xml.xml /atg/userprofiling/Profile. 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.0dir>/DCS/config/atg/commerce/order/orderrepository. In ATG Commerce. In ATG Business Commerce.ATG Framework and Components Order Repository The Order Repository is the layer between ATG Commerce and the database server.
We need to pass profileId to createOrder() method for creating the order. Order Creation There are many api exposed by OrderManager to create an order. Finally handleAddItemToOrder method of CartModifierFormhandler call updateOrder() method of OrderManager Class to save order to repository. 4. handleAddItemToOrder method of CartModiferFormhandler internally PurchaseProcessFormhandler and PurchaseProcessHelper to add items to calls api of order. ATG Page 67 . 7. Above repository Ids are passed as hidden parameters in form. 6. These values are passed to the as hidden fields when the user pushes the “Add To Cart” submit button provided by us. If orderType parameter is null then defaultOrderType is created using OrderTool. OrderManager internally uses OrderTool api to create order. 1. or extending package 2. Repository id of product and sku needs to be passed to cartModifierFormhandler to add the same to cart. CartModifierFormhandler contains many handle methods to add product to shopping cart. When add to cart button is clicked then handleAddItemToOrder method is invoked in CartModifierFormHandler. 8. This method adds item to order. 5. The orderType parameter decides the type of order to be created. 3. This java class has /atg/commerce/order/purchase/CartModifierFormhandler. ProductLookupDroplet and SkuLookupDroplet to retreive product and sku by passing productid and skuId. Shopping cart can be implemented using cartModifierFormhandler cartModifierFormHandler. The type of order created depends on an api used to create an order.ATG Framework and Components Pre-checkout Process Shopping cart Creation The shopping cart can be implemented by following steps. These Ids goes to cartModifierFormhandler when user submits form by clicking add to cart button.
Customers can have an unlimited number of orders in existence at one time. The component that utilizes OrderHolder is /atg/commerce/ShoppingCart. OrderHolder class maintains the current Order object as well as a collection of saved Order objects.commerce. These handle methods internally calls createRepriceParameterMap() method of PurchaseProcessFormhandler to reprice an order. delete. However. ATG Page 68 . such as the form handlers that create and manage shipping groups.OrderHolder in addition to atg. RepriceOrder The handleAddXXX and handleRemoveXXX methods of CartModifierFormHandler automatically reprice the Order whenever the user makes changes to it. and switch between carts.commerce. then RepriceOrderDroplet servlet bean is used to reprice the Order before displaying its price to the user.updateOrder() to save the Order in its present state to the Order Repository. if the users make changes to their orders through other purchase process form handlers that do not reprice orders. This is located in Nucleus at /atg/commerce/order/purchase/CartModifierFormHandler.Order. Saving Order Many of the methods in CartModifierFormHandler call OrderManager. modify or repricing the order we need an instance of CartModifierFormHandler 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.ATG Framework and Components Multiple orders creation for an user Creating multiple orders requires atg. 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. Multiple shopping carts can be implemented by using the handleCreate method of the OrderHolder class. Saving Modifying Repricing Orders In order to save.order.order. a session-scoped component whose handleXXX methods add.
Advantages Reduces the amount of processing when OrderManager.g. they are part of the atg.order. The calls to getPropertyValue() and setPropertyValue() retrieve and set the values of properties directly on the repository item objects. the call to setPropertyValue("shortDescription". This enhances the performance because we set the value directly to repository item and saving the only property that is actually changed. pShortDescription) in the setShortDescription() method causes the shortDescription repository item property to be set directly when the method is called. all commerce objects implements ChangedProperties interface except for atg. The commerce object that supports the ChangedProperties interface.AmountInfo.pricing.commerce. In the example above.updateOrder() is called to save order to repository. ATG Page 69 . every get() method needs to call the getPropertyValue() method. shortDescriptioon. 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. and similarly every set() method needs to call the setPropertyValue() method.ATG Framework and Components Extending Purchase Process Creates a new class called MyCommerceItemImpl by extending CommerceItemImpl and adds a new String properties e.order.ChangedProperties interface.commerce.commerce.AuxiliaryData and all subclasses of atg. ChangedProperties Java Interface The ChangedProperties interface enhances performance when saving an Order to the Order Repository. This reduces the amount of processing when the OrderManager.updateOrder() is called to save the Order to the repository. In ATG Commerce.
ATG Framework and Components 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 70 .
this property is set to repriceOrder. and finally calls commitOrder() to submit the Order for checkout.Associating payment groups with an Order and its items. CreatePaymentGroupFormHandler . Bydefault. PaymentGroupFormHandler . then calls OrderManager. Complex checkout 3. The method then calls the OrderManager. runRepricingProcess . ShippingGroupFormHandler . Simple Checkout It is same as Express checkout but expects the user to fill in the shipping and payment group during checkout. commitOrder . It retrieves the predefined shipping group and payment group at runtime automatically from user profile. 1.Associating shipping groups with an Order and its items. Express Checkout / Expedited Checkout 2.Reprices the Order by running the pipeline specified in ExpressCheckoutFormHandler. ATG Page 71 . Complex checkout Provides several form handlers to support a checkout process that uses any number or type of shipping group and payment group.Creating shipping groups. Also Separate form handlers exist to support the following tasks: CreateShippingGroupFormHandler .Creating payment groups.Submitting an Order for checkout . which executes the processOrder pipeline.used to submit the current Order for checkout. CommitOrderFormHandler .invokes the runRepricingProcess() method to reprice the Order.updateOrder() to save the Order in its present state to the Order Repository. We can manage and expedite the pre-checkout process for Orders using the ExpressCheckoutFormHandler.processOrder() method. It supports the following methods handleExpressCheckout . 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.ATG Framework and Components Checkout Process Checkout process is initiated when the order is submitted.repriceOrderChainId. ATG supports following 3 types of checkout.
processOrder calls the PipelineManager to execute the processOrder pipeline which is configured in Commerce Pipeline. Each processor after execution returns a status code and determines which processor in the chain to execute next. Call to executeValidateForCheckoutChain processor internally calls validateForCheckout pipeline.xml 3. Order processing occurs when a customer has supplied all the necessary information for the Order and has submitted it for checkout. 1.xml located at /<ATG9.processOrder(). 2. The processOrder pipeline first validates an order by calling executeValidateForCheckoutChain processor in the pipeline.0dir>/B2CCommerce/config/atg/commerce/commercepipeline. The Pipeline Manager enables us to dynamically add and remove processors and chains of processors. 4. OrderManager. The processing of an Order begins with a call from FormHandlers (CartModifierFormHandler) to OrderManager. ATG Page 72 . 5. This is a first processor in processorder pipeline and then invokes the sequence of processor in the pipeline.ATG Framework and Components Order Pipeline Order pipeline is used to process order.
executing the processor. 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. deleting or modifying the Pipelines graphically. CommercePipeline. and 3.service. If the return value is 0 (PipelineProcessor. handling the transaction (if required) 2. 1. The runProcess() method is called on the head PipelineLink object of the processor chain and it is responsible for following tasks.xml is the sample pipeline definition file provided.pipeline API Any non-globally scoped Pipeline Managers need to be created using the API. ATG Page 73 .STOP_CHAIN_EXECUTION). It is a simple way to construct and manage the global PipelineManager without writing code. and can be configured in the pipeline. A processor in a pipeline can be extended by overriding runProcess() method.ATG Framework and Components Running a processor chain PipelineManager is responsible to call any processor chain using runProcess method. ACC’s PipelineEditor is used for creating. 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. Pipeline manager start the processor chain by invoking the runProcess() method of first processor in the chain and passes it the user data. it tells the PipelineManager that execution for this chain should be stopped. atg. then it calls the next processor to execute. 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. User defined Processor Pipeline Pipelines can be created/deleted in following two ways. If the return value is other than o. Returning the return code to the PipelineChain.
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.the full name of a Java class which is to be instantiated and used as the PipelineChain object. – – – – – TX_REQUIRED TX_REQUIRES_NEW TX_SUPPORTS TX_NOT_SUPPORTED TX_MANDATORY ATG Page 74 . • • • • name .the default transactional mode of all the processors in this chain classname .pipeline.service.ATG Framework and Components Tags in Pipeline Definition File PipelineManager The top level tag that encloses a definition of a Pipeline Manager. resultclassname .PipelineChain. PipelineChain Tag defining a given processor chain in the Pipeline Manager.(required) the first processor in the chain to be executed transaction . The value must be this class or a subclass of it.(required) the name of the processor chain headlink . Transition A reference to the next link to be executed mapped by a return value. Processor The name of the Pipeline Processor object. Transaction Handling The valid transaction modes are as follow. The default is atg.
ATG Framework and Components Payment Process The Payment Process is handled by payment pipelines and payment pipeline is called by PaymentManager.e. or crediting the appropriate payment method. debit.commerce. 2. and credit of PaymentGroups in an Order. These methods take the order object and one paymentgroup or list of paymentgroup as parameters.Performs the actual operation authorizing.pipeline handles authorization. Payment Pipeline chain Each of the payment pipelines is composed of two processors. It performs payment operation by calling appropriate payment pipeline according to paymentgroup passed as parameter.Aggregates the information required to performing the requested payment action and creates an XXXInfo object for use in that action. creditcard. 1. It manages the authorization. debit.order. Second processor . debit. A seperate payment pipeline is defined for each type of payment group i. • They are configured in paymentGroupToChainNameMap of PaymentManager. Example for CreditcardProcessorChain. and credit work for the atg. PaymentManager consist of methods like authorize().GiftCertificate class.order. credit() and debit(). First processor .pipeline handles authorization. the action is CREDIT and the CreditCardInfo is the action object.commerce.CreditCard giftCertificateProcessorChain . ATG Page 75 . and credit work for the atg. and it tracks the results of those payment operations using PaymentStatus objects. • creditCardProcessorChain . debiting. giftcertificate and storecredit.
ATG Page 76 . and credit actions for a single PaymentGroup type. 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 supports to split them into separate pipelines if it needs to be handled differently.ATG Framework and Components Note: By default a single pipeline exists to perform authorize. ATG commerce comes with a simple implementation of a Fulfillment system that can be accessed via the Dynamo Admin UI. debit. Order Fulfillment ATG Commerce provides extension points to link the Commerce system with any Fulfillment system.
ATG Framework and Components Pricing and Promotions PricingModel Pricing model is a repository item that describes a discount. other products being purchased. It calculates different prices for the same item depending on whether that item is displayed alone (for example. It includes a PMDL rule and the discount type and amount. The sales price represents actual selling price for an item on sale. Every product can have two pricing models. The prices specified with the catalog are list price and sales price. The list price is the full. The boolean property On Sale indicates whether the item is on sale or not. PriceItem takes a SKU repository item as its item parameter. or the customer's profile by calculating dynamically using a combination of standard prices and promotions. Different prices can be offered depending on circumstances such as timing. These two pieces are called the “qualifier” (when) and the “target” (what) and are a part of every promotion. undiscounted price of a product. It also contains information about when the pricing model may be used. in the product template page of the catalog) or in the context of the shopping cart of an item dynamically. Droplet for displaying price 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. Promotional prices Promotional price is the price after applying the promotions or discounts. It outputs an element parameter that is of type CommerceItemImpl that is renamed to SKU using the elementName parameter – RepriceOrderDroplet – ATG Component used is /atg/commerce/order/purchase/RepriceOrderDroplet Page 77 . The ACC and BCC include a discount rule interface for creating rules. The system uses this flag to determine the base price of the item. PMDL (Pricing Model Definition Language) PMDL is used to describe promotions. This includes the discount rules for when a promotion may apply and the rules for what may be discounted. Standard Prices Standard prices are the prices specified for the product in the catalog. ACC is used to set up the prices and promotions for the products in the catalog.
3. sales tax. Invoking the calculators in the correct order. TAX. Determine price using the information received from the engines and from the qualifier. Retrieving any promotions that are available to the site visitor. 2. NO_REPRICE – ATG Pricing Services The pricing services provide a flexible system for personalizing the prices of items in product catalog. ORDER_SUBTOTAL_SHIPPING. 1. and shipping. Pricing services comprises of following two components. Thus the system is granular enough to create a system with the facility of pricing the items differently for different shoppers. Pricing operations are defined in the atg. total orders.ATG Framework and Components – It is use to reprice an order by sending a required parameter which specified pricing operation to execute.pricing. 3. Pricing calculators Pricing calculators are responsible for the following tasks. Pricing services uses the list price to calculate the new price based on the promotions or discounts applied on it. 1. These components work together to determine prices for catalog items. Looking up the price in the catalog by priceList. ORDER. 1. The content for every shopper can be personalized to show different categories and the prices can be tailored dynamically. ORDER_SUBTOTAL_TAX.commerce. ITEMS. ORDER_SUBTOTAL. Pricing Calculators Pricing Engine Pricing engine is mainly responsible for following three tasks.PricingConstants interface. Invoking a qualifier service that identifies the objects to discount. ATG Page 78 . They are ORDER_TOTAL. 2. Pricing Engines 2. SHIPPING. Pricing Objects Items List Price property of the product catalog is used to specify the list price of an item. Determining which calculators generate the price.
2. 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. During checkout. Alternatively. It applies promotions by priority. This includes the following.ATG Framework and Components Order It calculates the total cost of an order and apply any discount that is applicable (for example. • • listPrice (fixed price. ATG Page 79 . 4. The pricing engine applies its configured PostCalculators. All the precalculators (defined in ItemPricingEngine) are executed in order. sites can use a third-party system such as CyberSource or TAXWARE to handle tax calculations. Price Calculation Flow 1. searching for any promotion given to all customers (global). Shipping price It calculates the price of shipping for an order and apply discounts if applicable. The resulting lists are concatenated. which make any necessary modifications to the price after any discounts have been applied. 6. The pricing engine applies its configured precalculators. bulk price. The pricing engine processes one at a time. Tax It calculates the sales tax for an order. A precalculator modifies a price without using any associated promotions. PriceItem servlet bean in a page or from the ATG Commerce PricingTools class calls the pricing engine. The pricing engine builds a list of global promotions. The pricing engine accesses the current customer’s profile and retrieves any promotions listed in the activePromotions property of the profile. It builds the list by using its globalPromotionsQuery property to query the Promotions repository. For example. 5. a customer might have a coupon offering a 10% discount on a total order). tiered price) salePrice (if item is on sale) 3.
commerce. while getPreCalculators() method of com. SECShippingCalculatorImpl_en_US The component for this calculator is available at /atg/commerce/pricing/SECShippingCalculatorImpl_en_US.pricing.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. Shipping and Tax Pricing Engines calculate the shipping cost and tax (as applicable) using configured Shipping and Tax Calculators.sec. Tax calculators Similarly.ebg.ebg. Following method of this calculator calculates the discounted shipping cost for particular order. Pricing Engine implementation SECShippingPriceEngineImpl SECShippingPriceEngineImpl extends atg.order.ebg. SECShippingDiscountCalculator_en_US The component for this calculator is available at /atg/commerce/pricing/SECShippingDiscountCalculator_en_US.sec. getPreCalculators() method of com.SECTaxPriceEngineImpl returns an array of configured tax calculators.order. Following method calculate the shipping cost for particular order.SECShippingPriceEngineImpl returns an array of configured shipping calculators .pricing. respectively.pricing.order. Following calculators are configured as its pre Calculators.sec.properties (corresponding java class com. ATG Page 80 .pricing. the component for SECShippingPriceEngineImpl is available at /atg/commerce/pricing/ShippingPricingEngine. all the Tax calculators are configured as preCalculators for TaxPricingEngine at /atg/commerce/pricing/TaxPricingEngine.sec.ebg.order.SECTaxPriceEngineImpl).pricing.ShippingPricingEngineImpl.SECShippingPriceEngineImpl).
commerce. Following method of this calculator calculates the applicable tax. ATG Page 81 . SECTaxDiscountCalculator_en_US The component for this calculator is available at /atg/commerce/pricing/SECTaxDiscountCalculator_en_US.TaxPricingEngineImpl . SECTaxProcessorTaxCalculator_en_US The component for this calculator is available at /atg/commerce/pricing/SECTaxProcessorTaxCalculator_en_US.pricing. the component for SECTaxPriceEngineImpl is available at /atg/commerce/pricing/TaxPricingEngine. Following method of this calculator calculates the applicable tax.ATG Framework and Components SECTaxPriceEngineImpl SECTaxPriceEngineImpl extends atg. Following calculators are configured as its pre Calculators.
ATG scenarios support the set up of cross sell and up sell features.ATG Framework and Components Promotions ATG supports dynamic set up of offers or promotions on specific products or groups of products. which is one of the default ATG Commerce repositories. Users can set up promotions from ACC. activePromotions Stores the list of promotions that can be used by the user in pricing their orders. the following is the priority level to apply promotions. Specific amount or percentage off a product based on an attribute 6. Promotions are stored in the Promotions repository. • • • • Item level Order level Shipping level Tax level. ATG Page 82 . Free shipping for a specific product Promotions can be applied at 4 levels based on the priority set. inactivePromotions Stores promotions that can no longer be used. Promotions can be any kind such as fixed price off. By default. 2. free shipping etc. Specific amount off a particular product Specific amount off a whole order 3. Free product or free order 7. Percentage amount off a whole order 5. Attributes to manage promotions Following are the three important attributes to manage promotion for each user. 1. Examples of promotions are. The system also treats coupons as a type of promotion. usedPromotions Stores any promotions used in an order. percentage off or in terms of another free product. Percentage amount off a particular product 4. A promotion would be moved into the inactive list.
Methods used in SECCouponFormHandler are as follow. Customer B uses (claims) the gift certificate to pay for all or part of an order.order. Coupon FormHandler SECCouponFormHandler Class com. just like credit card payment. 1.sec. ATG Commerce fulfills the purchase for Customer A (and sends a notification e-mail to Customer B as part of the fulfillment process).ATG Framework and Components eCoupon Coupons are a type of promotion (20% of an order over $100. You can use the ATG Control Center or BCC to manage coupon repository items. Creating an eCoupon is a two step process. handleClaimCoupon() . Gift certificate FormHandler SECPurchaseProcessFormHandler Class com. Customer A purchases the gift certificate on behalf of Customer B. Methods used in SECPurchaseProcessFormHandler are as follow.formhandler.To remove an already applied coupon from the order. for example) sent to specific customers. Customers redeem coupons by entering a claim code during the checkout process.ebg. Processing a gift certificate involves the following steps. Create a promotion. SECCouponFormHandler is the java class created to handle coupon addition and removal from an order.CouponFormHandler. Gift certificate Gift certificate represents another mode of payment.commerce. Create a coupon and associate it with promotion created in step 1. 1.sec. 3.promotion. 2.To claim a coupon code and add it to order.formhandler. By providing gift certificates as an option for your customers.SECPurchaseProcessFormHandler is the java class created to handle gift certificate addition to an order.order. you can increase sales and attract new business. ATG Page 83 .ebg. Gift certificates allow a customer to pay for all or part of a purchase using a prepaid amount.SECCouponFormHandler extends atg. handleRemoveCoupon() . 2.
ATG Page 84 .To claim a gift certificate.ATG Framework and Components handleClaimGiftCertificate() .
Order Repository Order repository stores an order details. refreshing. This component also interacts with the pipeline processors. CommerceProfileFormHandler class. OrderManager Order manager is a business layer component which takes care of creating. It is extended from atg. 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. registration logoff etc.commerce. loading. A blank navAction is treated as push. This component takes the following input parameters. o navAction – defines the operation type to be performed on stack. ATG Page 85 .ATG Framework and Components Extra Info /atg/userprofiling/B2CProfileFormHandler Component is use to handle user specific operations like login. /atg/commerce/catalog/CatalogNavHistory Component to track the customer’s path through the catalog. It contains a Map property by name “editValue” that holds extra properties like Shipping Address etc.profile. updating the orders. This component utilizes an object of OrderHolder class which contains the current order as well as saved order objects. and switch between carts. delete. Options are “push. pop & jump”. o navCount – /atg/commerce/ShoppingCart Shopping cart component is a session-scoped component whose handleXXX methods add.
we can store. sortProperties the sortProperties property of this component holds the property whose values determine the sort order. ATG Page 86 . Default product catalogs can be extended to meet business needs. The first name specifies the primary sort. the second specifies the secondary sort. A product may have several different SKUs associated with it. media. images etc. products and SKU’s (Stock Keeping Units). If it is a + or it is not a -. ATG Commerce application comes with a default product catalog which can be extended as per business need. Dynamo LDAP Profile Repository Using this. Using this. o New tables must be created in the database to accommodate the extended properties. representing varieties. we can store. Catalog repository items can be edited using ATG Control Center (ACC). modify and query user profile data in LDAP (Lightweight Directory Access Protocol) directory. modify and query user profile data in a SQL database. A product catalog is a hierarchical tree of categories and products. this sort is performed in descending order. By default. Custom Catalog Custom catalog is repository needed to provide information to particular customers or companies. If the first character of each keyword is a -. It is a repository containing repository items like category. However. A product is a navigational end-point in the catalog. it is sorted in ascending order. Product Catalog The Product Catalog is a primary component in the Commerce Application. items are sorted by display name in alphabetical order. o Extensions can be created to add properties to categories. sizes. products. This parameter is specified as a comma separated list of property names. The main item types for the catalogs are categories. customers purchase a SKU and not a product. etc. A string that specifies how to sort the list of repository items. products and sku’s. Default product catalog xml file is /atg/commerce/catalog/ProductCatalog. o Xml-combine tag is used to extend the default catalog.ATG Framework and Components Profile Repository Dynamo SQL Profile Repository It is pre-configured default repository for DPS. and colors.
ATG Framework and Components Note: This parameter is only valid for repository items. ATG Page 87 . it will not work with enumerated data-types.
ATG Page 88 . Url Optimization Meta Tag Implementation for JSP. Sitemap Creation & Maintenance We will discuss them in coming sections. Search Engine is referred to the engines used for indexing the websites like Google. Here.ATG Framework and Components ATG Search Engine Optimization (SEO) Techniques Search Engine Optimization technique is used to optimize the site for indexing purpose and to improve the ranking of the page in search engine index. This section is demonstrating the SEO capabilities that ATG has implemented and supported. yahoo. Bing etc. Disclaimer SEO is vast topic and is not restricted to the techniques discussed here. ATG out of box supports following SEO techniques to improve the ranking of our site. Canonical URLs for Products and Categories.
Kindly refer Repository section to know basic about repositories. SitemapRepository All sitemaps related information is stored in SitemapRepository. The path of this repository is /atg/sitemap/SitemapRepository ATG Page 89 . SEORepository & SitemapRepository to store SEO information. This repository is extensible and can be customized according to your project needs.e. The path of this repository is /atg/seo/SEORepository.ATG Framework and Components Repository ATG SEO makes use of two repositories i. SEORepository All SEO related data is stored & maintain in SEO repository.
Kindly refer Droplet section to know basic about droplets. Every URL should be SEO friendly as all the URLs are generated using CatalogItemLinkDroplet.No 1 Droplet Name CatalogItemLink Component Path /atg/repository/seo/CatalogIte mLink Description This Droplet is used to render page with either a static URL (optimized) if the visitor is robot or with dynamic URL if visitor is a human user. In easy term. all the large images on the page will be shown only to the human users and not to the crawlers (robots). This Droplet generates URLs for products mapping directly into the 3 CategoryIndirectTempla te 4 ProductDirectTemplate /atg/repository/seo/ ProductDirectTemplate ATG Page 90 . URLs created via this template should not require forwarding by a jump servlet. /atg/repository/seo/ CategoryIndirectTemplate This Droplet generates static URL for categories based on a predefined template. 2 CategoryDirectTemplate /atg/repository/seo/CategoryDi This Droplet generates URLs for categories mapping directly into rectTemplate the web application. this droplet generates URL for search engine robots. In easy term. S. The URLs generated here are optimized URLs. this droplet creates URL for human users. Also since most of the robots don’t crawl more than 100kb of information from a web page.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.
This component generates category sitemap xml with optimized URLs of all categories available in catalog repository. This component creates XML files 6 CategorySitemapGener ator /atg/sitemaps/CategorySitema pGenerator 7 ProductSitemapGenerat or /atg/sitemaps/ProductSitemap Generator 8 StaticSitemapGenerator /atg/sitemaps/StaticSitemapGe nerator 9 SitemapIndexGenerator /atg/sitemaps/SitemapIndexGe nerator 10 SitemapGeneratorServi ce /atg/sitemaps/SitemapGenerat orService 11 SitemapWriterService /atg/sitemaps/SitemapWriterS ATG Page 91 . this droplet creates url for human users.ATG Framework and Components web application. 5 ProductIndirectTemplat e /atg/repository/seo/ ProductIndirectTemplate This Droplet generates static URL for products based on a predefined template. This xml contain optimized URLs of all categories in product catalog. This component generates sitemap xml with optimized URLs of all static pages like contactUs etc. The URLs generated here are optimized. URLs created via this type of template should not require forwarding by a jump servlet. This component generates product sitemap xml with optimized URLs of all products available in catalog repository. In easy term. In easy term. this droplet generates url for search engine robots. This component manages the process of scheduling and invoking various sitemap generator components. This xml contain optimized URLs of all products in product catalog. This component generates the entries in the SitemapRepository & that will be used to create siteIndex xml file.
This droplet generates canonical url for products and Categories.ATG Framework and Components ervice 12 CanonicalItemLink from SitemapRepository. /atg/repository/seo/ CanonicalItemLink ATG Page 92 .
http://mywebsite. Jump servlet needs to be defined in web. As mentioned earlier that we show optimized URLs to search engine robots.jsp?productId=prod450074&skuId=sku400068 JumpServlet Configuration Jump Servlet component is present at path /atg/dynamo/servlet/dafpipeline.e. We make sure that search engine is indexing optimized URLs only and same is shown to user. If found then request will be processed by JumpServlet.xml of commerce application. Note: . These optimized URLs contain jump keyword. Also add jump servlet to initial.properties so that servlet is ready to serve with the server startup.ATG Framework and Components JumpServlet Jump servlet is the servlet placed in DAFPipeline which sense for keyword “jump” in request URL. Example: URL that is indexed by search engine looks like below. ATG Page 93 . Hence user comes to our website with optimized URLs (i. with the keyword jump) and JumpServlet translate this URL to original (non-optimized) URL to process user request.Direct URL means non-optimized URL and indirect URL means optimized URL with jump keyword. 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.com/root/US/standardPDP/pdp. 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.
human or robot) and renders the URLs accordingly. We can achieve Url Optimization using following steps. Same coding snippet will be used to generate optimized URL for Product. This increases the possibility of improving the ranking of page. Try to include product name & important attributes in URL.e.com/mycontextroot/jump/Motorola-Milestone/productDetail/prod450074 Note: .ATG Framework and Components URL Optimization URL optimization technique is to create neat and clean URL for robot visitor. We will discuss these components in coming section. If user agent is robot than URL looks like below. JSP Coding When robot crawl the page then we have to show clean URLs. Considering that we are generating the URL for a category here. Make sure your URL contains important keywords such that it matches user search teams.URL formed above is perfectly according the indirect template defined for Product and Category. CategoryIndirectTemplate This component gets called when CatalogItemLink droplet executed on JSP. Following component on the JSP checks for user agent (i. If system detects the visitor is search engine crawler then application renders optimized URLs (clean URL). Component Configuration In order to achieve URL optimization we have to configure the bunch of components. Param element showing in following example is the category object. http://mywebsite. ATG Page 94 . Configurations of important attributes are shown below.
http://mywebsite. If the visitor is human user then CatalogItemLink droplet makes call to CategoryDirectTemplate to form direct URL. It checks if URL formed according to regular expression defined here. We use item in URL format. As JumpServlet looks for keyword jump in the URL and if found then convert the URL to direct (non-optimized) URL for the processing. What is the source of item and how to get their value. ATG Page 95 . Hence we define the item here. Kindly check the ATG document for complete list of attributes CategoryDirectTemplate This component is used to generate direct URL (non-optimized) for human users. Following is the configuration of this component. As user visit the page on the site then CatalogItemLink droplet gets executed. In above example you can see that item is defined as Category and that is coming from ProductCatalog repository. regexElementList This property is to support above two properties i. This droplet checks the user profile and makes internal call to respective template (Direct or Indirect) component to form and render URL. Note: . Actual URL looks like below by applying above format. Point to remember here is it should contain keyword jump.ATG Framework and Components urlTemplateFormat This property defines the format of indirect (optimized URL) URL.There are many other properties available in this component.com/mycontextroot/jump/MobilePhone/categorycat170064 indirectRegex This property defines the regex for your URL format. This is mostly for validation purpose and to ensure that URL format and regex are in sync. urlTemplateFormat & indirectRegex.e. Example is shown above.
These template components will not be considered to form desired URL unless they are listed in templates property of CategoryTemplateMapper for item type Category. Note: . We can define custom Direct / Indirect URL template component. ProductTemplateMapper Refer CategoryTemplateMapper section above. templates This property is list type of property that contains the list of templates defined. ProductIndirectTemplate Refer CategoryIndirectTemplate section above. 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. Following are the name of important components for item type Product.We have discussed above URL optimization for Item type Category. We need same set of components and configuration for Item type Product. CategoryTemplateMapper This component keeps the list of URL templates defined in the system. Product and Category because we mostly want to optimize the URL of product and category items.e. Kindly see the configuration below. ATG has created all SEO components considering two basic Item types i. But if visitor is robot (crawler) and item is category then CategoryIndirectTemplate will be used to form URL hence indirect URL (optimized) gets formed. Example: if visitor is human and item is category then CategoryDirectTemplate will be used to form URL hence direct URL (non-optimized) gets formed. ProductDirectTemplate Refer CategoryDirectTemplate section above. Templates get resolved by using the item type and visitor profile. ATG Page 96 .ATG Framework and Components Refer above section to know about property urlTemplateFormat. Hence I am not documenting the configuration for Product item.
e. If we don’t provide unique data to title. it is not feasible to provide data manually for these tags for every page exist. particularly <meta> tags and the <title> tag. We can populate or update these tags dynamically from BCC (publishing). Here the key to fetch this data from SEO repository is the page URL. Primary key to retrieve this data from the SEO repository is url of the page. title. SEO tag repository is used to store meta tag data i. In this way same code snippet can be used and effort can be saved. to raise the ranking of the pages of our site. This data will be controlled by merchandising user from BCC (publishing) application. description and title for every page exist in the website. description and keyword information. Due to large number of pages in the website. ATG Page 97 . keyword and description information for given page. keywords. description and title information. You can create a JSP fragment with the following piece of code and include the same in the header section of all other JSPs. JSP Coding JSP coding is needed to fetch meta tag data i. A common SEO technique is to list key search terms in these tags. Admin user has to populate meta tag data very first time in SEO repository from BCC (publishing) for every page in the website. Idea here is to generate meta tags for every main JSP with unique 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.e.ATG Framework and Components Meta Tag Implementation Web search engines ranking of page is partly based on the words that appear in certain HTML tags. This data will be retrieved and meta tags will be populated with the relevant keywords.
As shown above. by appending the product name in title information coming from SEO Repository. Example For Product “Nokia X101”. This JSP has meta tags (title etc). we are making many unique virtual pages at run time. That means the number of pages in your website is equal to number of products in your catalog.ATG Framework and Components You can further tweak the above code by appending the product / category name in title information coming from repository. By appending product name in title and description. But if we don’t 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. Pages rendered for different products consider as unique page because their title are different. Hence crawler will index them all. You can fetch information from repository like shown above and append product name in it. Same JSP is used to render the information for “Nokia” and “Motorola” products. That also means search engine have found tons of valuable information in website for indexing. you are making the virtual unique pages & increasing the chance of getting indexed. ATG Page 98 .jsp in your WAR. title looks like below Product Detail Page – Nokia X101 Product “Motorola AY203”. title looks like below Product Detail Page – Motorola AY203 Assume ProductDetail page is served by productDetail.
When a web spider accesses the page using static URLs it finds a link on the page and gets indexed. ATG Page 99 .jsp?productId=prd10002 And after normalization same look like this. http://mywebsite. The process includes converting unfriendly URL to SEO friendly URL so that search engines index the page with the product name appearing in URL.com/mycontextroot/ jump/Motorola-Milestone-XT720black/productDetail/prod450074/cat170064"/> The canonical URL is similar to static URL. Component Configuration You need to configure component i.ATG Framework and Components Canonical URL Canonical URLs are the outcome of the process of normalization of the URLs to make them consistent across the site. http://mywebsite. application should specify the link tag on product detail page which specifies the canonical URL on the page.com/mycontextroot/jump/Motorola-Milestone-XT720-black/productDetail /prod450074/cat17006 For SEO using Canonical URLs technique.e.com/mycontextroot/country/productDetails. CanonicalItemLink droplet to render canonical URL for product item type. Idea here is to have direct URL for product detail page and category summary page for web spider. <link rel="canonical" href="http://mywebsite. JSP Coding We have to put canonical URL on product detail page and category summary page. For example: The URL before normalization look like. jump servlet translate this URL to dynamic URL (non-optimized) and request is processed. This link tag can be specified like below. Put the following piece of code in header section of Product Detail JSP and category summary page. Human user gets this URL as search results (search engine) and they comes to the site by clicking the same. Refer following configuration and put this configuration in CanonicalItemLink droplet component.
ATG Page 100 . defaultRepository It takes reference of repository where item belongs to. Hence if item is Product then ProductIndirectTemplate component is used to form canonical URL. Same applies for item type Category.ATG Framework and Components itemDescriptorNameToUrlTemplateMap This is map property that contains item to indirect template mapping.
<ATG_HOME>/YourModule/config/atg/registry/webappregistry/XXXXWebApp. but they are supported by many search engines. More URLs in sitemap drives more indexing of data from the site and increases the chance of higher ranking. Now add following configuration in the above created component properties file. 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. Here XXXX stands for your application context root in capital letters. 3. lastModified.properties ATG Page 101 . Sitemaps are not an official standard. Sample entry in sitemap xml is shown below. so web spiders are able to identify site content without relying exclusively on their ability to crawl and parse the pages. Create component XXXXSiteMap at the following path in your ATG module. Sitemap is an xml file that list URLs of all pages in your website. Sitemap Configuration We need to create & configure certain components to generate appropriate sitemap xml files for our commerce website. including Google. Here XXXX stands for your application context root in capital letters. Here XXXX stands for application context root.ATG Framework and Components Sitemap Generation Sitemaps are files stored on a web server that list the URLs of useful pages available in our website. Create component XXXXWebApp at the following path in your ATG module. <ATG_HOME>/YourModule/config/atg/registry/webappregistry/XXXXSiteMap. Yahoo and MSN. It contains basic information like URL.properties 2. changeFrequency and priority about the page. 1.
webApp .0. If we list more pages (URL) than this limitation.The priority of this URL relative to other URLs on your site. contextCatalog . This component is responsible for generating Sitemap xml for item type Product. never. weekly. urlPrefix . <ATG_HOME>/YourModule/config/atg/sitemap/ProductSitemapGenerator. sitemapFilePrefix_2.How frequently the page is likely to change.485.760 bytes).xml.Type of repository item to retrieve.properties.ATG Framework and Components 4. Here XXXXEar is the name of application EAR and xxxx is context root of application. Valid values range from 0. host. Sample configuration of this component is shown below. sourceRepository . Now configure ProductSitemapGenerator component. Now add following configuration in above created component properties file. Use indirect template to generate sitemap with optimized URLs for repository items. Context path should not be included here if webApp property is specified. Priority . daily.Generator uses this template to construct sitemap URL for repository item of type ItemDescriptorName Both direct and indirect templates can be set here.xml and so on. 5. Sitemap file must have no more than 50. ATG Page 102 . itemDescriptorName . Valid values are: always. This component is present at the following path.URL prefix with protocol. hourly. then generator will split information into several files with names sitemapFilePrefix_1. changeFrequency . yearly.000 URLs and must be no larger than 10MB (10. port and context path. Following attributes are needed to be configured for this component.repository to retrieve information for generator. monthly.Used to retrieve application's context root.catalog id that will be used for resolving derived properties sitemapFilePrefix – Prefix for your Sitemap xml file.0 to 1. Template .
ATG Framework and Components
6. Now configure CategorySitemapGenerator component. This component is responsible for generating Sitemap xml for item Category. The configuration is exactly same as shown above for item type Product. This component is present at the following path.
Note: - You need to configure this component according to your environment setup. 7. Now configure StaticSitemapGenerator component. This component is responsible for generating the sitemap for static pages in your website like contact us etc. Here property staticPages maintains the list of static pages in your website.
ATG Framework and Components
8. Now configure SiteMapIndexGenerator component. This component is responsible for storing the sitemap data in repository. This component also creates a list of sitemaps generated according to the configuration. This is available at the following path.
9. Now configure SitemapGeneratorService component. This component is backbone for generating Sitemaps. This component generates sitemap according to the configuration done in respective generators (i.e. ProductSitemapGenerator etc). 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.
ATG Framework and Components
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.
Steps to Generate Sitemap
1. Make sure commerce (production) server is up and running. Also ensure the access to /dyn/admin application. 2. Go to /dyn/admin application. Provide user and password to enter in to application. http://mywebsite.com/dyn/admin 3. Go to Sitemap Administration Generate sitemap Start service. 4. After the generation of the sitemap, invoke the Sitemap Writer service to write to xml files. Sitemap Administration Write Sitemaps Start service. 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.
TargetingArray TargetingArray differs from the others in that it does not format the output of the targeting operation. atg.targeting.droplet. and renders the item on the page. 350) atg. 322) atg.pdf. (ATGPageDevGuide.pdf.For Displays a single output the number of times specified.pdf. 352) ATG Page 106 .pdf.Switch Displays one of several possible outputs.droplet.ATG Framework and Components Appendix Droplets Following are the extensively used droplets.pdf. 320) atg. where n is a number you specify. 340) atg. you must use another servlet bean to format the outputCategoryLookup.pdf. Please refer the ATGPageDevGuide.ItemLookupDroplet Looks up an item in one or more repositories based on the item’s ID.servlet. (ATGPageDevGuide.TargetingFirst Displays the first n items.droplet.targeting. depending on input parameter value.repository. 261) atg. (ATGPageDevGuide.RepositoryLookup Looks up an item in a specific repository.TableForEach Displays each element of an array.pdf. 342) atg. Instead. (ATGPageDevGuide. arranging the output in a two-dimensional format. (ATGPageDevGuide.pdf. based on the item’s ID.droplet.targeting.droplet.pdf. 280) atg.servlet. (ATGPageDevGuide. and renders the item on the page. (ATGPageDevGuide. 257) atg.pdf. (ATGPageDevGuide.pdf for the detail. 263) atg.repository.ForEach Displays each element of an array. (ATGPageDevGuide. (ATGPageDevGuide.ErrorMessageForEach Displays error messages that occur during a form submission.RQLQueryForEach Constructs an RQL query and renders its output parameter once for each element returned by the query.
TargetingForEach Displays all of the items returned by the targeter. 360) ProductLookup SkiwLookup CatalogItemLookupDroplet RepriceOrderDroplet PriceEachItem PriceItem ShippingGroupsDroplet PaymentGroupsDroplet PriceItemDroplet RepriceOrderDroplet /atg/commerce/gifts/GiftlistLookupDroplet /atg/commerce/gifts/GiftlistDroplet atg.ATG Framework and Components atg.GiftitemDroplet ATG Page 107 . 358) atg.pdf.gifts. (ATGPageDevGuide. 355) atg.TargetingRange Displays a range of items.commerce.targeting.pdf.targeting.pdf.targeting. (ATGPageDevGuide.TargetingRandom Displays n items chosen randomly. such as the third through the seventh. (ATGPageDevGuide.
ATG Framework and Components Form Handlers SimpleSQLFormHandler ShoppingCartModifier ExpressCheckoutFormHandler CartModifierFormHandler GiftListFormHandler GiftListSearch ATG Page 108 .
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue listening from where you left off, or restart the preview.