Documente Academic
Documente Profesional
Documente Cultură
Art Technology Group (ATG) was an independent Internet technology company specializing
in eCommerce software and on-demand optimization applications until its acquisition by Oracle
on January 5, 2011. ATG continues to be based in Cambridge, Massachusetts and operates under
its own name as a subsidiary of Oracle. The company is a provider of eCommerce software and
related on-demand commerce optimization applications. ATG's solutions provide merchandising,
marketing, content personalization, automated recommendations, and live-help
services. (Source WIKI).
Benefits of E-commerce
Customer Benefits – Wide choice of products and services, Convenience, Instant Information
availability and Delivery, Product Feedbacks and blogs, Customization and personalization, etc
Major modules like DAS, DAF, DPS, DSS were explained in the bottom link.
components-of-atg-platform
Remaining modules like DCS, BCC, etc were explained in short in the below mentioned table.
The following tables list the module names for the main Oracle ATG Web Commerce applications, demos, and
reference applications. This is not an exhaustive list of all Oracle ATG Web Commerce modules.
Module Description
Adds missing administrative accounts for the ATG Control Center. For more information,
Admin.Init
see the Managing Access Control chapter.
Resets the default login accounts for the ATG Control Center. For more information, see
Admin.Reset
the Managing Access Control chapter.
Enables the Oracle ATG Web Commerce platform to use Oracle ATG Web Commerce
DAF.Search Search to index and search content from product catalogs and other repositories. See
the ATG Search Administration Guide.
Module Description
Enables an Oracle ATG Web Commerce server to accept connections from the ATG
DAS-UI Control Center.
Note: This module must be running if you want to use the ATG Control Center.
Runs the ATG Control Center in the same JVM used by the application server that the
DCC Nucleus-based application is running on. For more information, see the ATG Installation and
Configuration Guide.
DSSJ2EEDemo Oracle ATG Web Commerce Adaptive Scenario Engine demo (Quincy Funds).
Repository Loader. Takes files that are stored in a file system, converts them into
RL repository items, and loads the items into the repository. To learn more, see the ATG
Repository Guide.
Browser-based administration interface for Oracle ATG Web Commerce’s SQL JMS
SQLJMSAdmin
message system. For more information, seeUsing the SQL-JMS Administration Interface.
The Oracle ATG Web Commerce Business Control Center. Includes the
BizUI
Home page functionality.
Publishing web agent. Runs on the production and staging web servers
PublishingWebAgent and performs web content deployment operations by communicating
with the ATG Content Administration server.
Publishing.base
ATG Content Administration. See the ATG Content Administration Programming
Module Description
Supplies the portlets that make up the Oracle ATG Web Commerce
Business Control Center interface. Including this module also causes
PubPortlet thePublishing.base, AssetUI, and BizUI modules to be included.
Include this module to perform most basic tasks in ATG Content
Administration, such as product evaluation.
Portal Modules
Module Description
Portal Application Framework (PAF). At a minimum, you must include this module
Portal.paf to use Oracle ATG Web Commerce Portal. To learn more about the PAF, see
theATG Portal Administration Guide.
Portal.gear-name
Includes the specified gear or portlet. For example, if you create a gear
Portal.portlet-
name called productprices, include the modulePortal.productprices.
B2BCommerce Note: To run ATG Commerce, you must use one and only one of the following
modules:B2BCommerce,B2BCommerce.Versioned, B2CCommerce,
orB2CCommerce.Versioned.
Note: To run ATG Commerce, you must use one and only one of the following
modules:B2BCommerce,B2BCommerce.Versioned, B2CCommerce,
orB2CCommerce.Versioned.
Note: To run ATG Commerce, you must use one and only one of the following
B2CCommerce modules:B2BCommerce,B2BCommerce.Versioned, B2CCommerce,
orB2CCommerce.Versioned.
Note: To run ATG Commerce, you must use one and only one of the following
B2CCommerce.Versio
modules:B2BCommerce,B2BCommerce.Versioned, B2CCommerce,
ned
orB2CCommerce.Versioned.
Provides tools for dealing with abandoned orders and shopping carts.
DCS.AbandonedOrder
Services
Including this module also includes DCS and its modules.
Enables ATG Commerce to use ATG Search to index and search content from
DCS.Search
product catalogs and other repositories. See the ATG Search Administration Guide.
Use instead of DCS module if running ATG Commerce with ATG Merchandising.
DCS.Versioned
Including this module also includesPublishing.base, DCS, and their
modules.
ATG component:
In ATG any Public Class/JavaBean Associated with a properties file is called as anATG component. Ideally speaking
the properties file of a component stores the configuration values like, class name it is associated with, Scope,
Dependency injections, some other Default values that are used in the java classes. It must be under the ATG
configPath.
The properties files read by Nucleus must follow a format that is recognized by the
class java.util.Properties. The rules for the format are as follows:
propertyName=propertyValue
propertyName:propertyValue
2. White space that appears between the property name and property value is ignored.
3. Lines that start with the comment characters !or# are ignored. Blank lines are also ignored.
4. The property value is generally terminated by the end of the line. White space following the
property value is not ignored, and is treated as part of the property value
5. A property value can span several lines if each line is terminated by a backslash (‘\’) character.
Example:
targetCities=\
Detroit,\
Chicago,\
Los Angeles
6. The characters newline, carriage return, and tab can be inserted with characters \n, \r, and \t,
respectively
8. UNICODE characters can be entered as they are in a Java program, using the \u prefix
ATG Nucleus:
A container that holds all these ATG components is nothing but ATG Nucleus. It is the core of the entire ATG system.
By reading the .properties files associated with each component, Nucleus figures out which components are to be used
in an application,initializes them to their default values,and decides how they connect to each other. This model
makes it easier for the developers to build ATG applications by configuring and using the in-built components instead
of writing Java code from scratch.
Basic ATG Nucleus Operations (In Detail) / How ATG Nucleus Works :
Nucleus performs one basic operation: resolving component names. Given the name of a component, Nucleus does its best to
find or create that component and return it.
Within Nucleus, certain components can contain other components, forming a component hierarchy. For example, given the
name /services/logs/FileLogger, Nucleus resolves it by looking for components in the following locations:
1. Looks in the root container for the services component.
2. Looks in the services container for the logs component.
3. Looks in the logs container for the FileLogger component.
Name resolution is not a difficult task. Nucleus shows its real power by creating components and hooking them up to
other components automatically. This function is invoked when Nucleus is asked to resolve a name of a component
that does not yet exist.
For example:
On startup, Nucleus is given a configuration path—a list of configuration directories that contain
the configuration files of various components. Within the configuration directories, Nucleus
expects to find a configuration file that uses the component name.
For example, to create the component /services/custom/CustomFile, which does not exist in
the nucleus components, and say, the configuration root directory
is <ATG10.1dir>/DAS/config, Nucleus looks forCustomFile’sconfiguration in:
<ATG10.1dir>/DAS/config/services/custom/CustomFile.properties
In Simple words: It creates and configures Nucleus components and organizes them into a
hierarchical namespace, essentially giving them a place to live so they can be referenced by other
components.
Nucleus gives a place to live for all its components. For managing their life span, it uses a
variable named "scope" for all its components. As, it is a nucleus property, it is preceded by $
sign.
A component’s properties should always point to objects whose scope is equal to or greater than its own.
Thus, global-scope component properties should only point to objects that also have global scope;
session-scope component properties should only point to objects that have global or session scope;
while request-scope component properties can point to objects of any scope, including request.
Droplet:
In simple Droplet is a combination of Servlets and javaBeans. You can embed these
droplets in your JSPs to display dynamic content. These droplets can be nested and pass
parameters between themselves. These Droplets are also called as DynamoServlets.There
are lot many out-of–box droplets provided by ATG.They are categorized into
Standard Servlet Beans
Some of them include:
IsEmpty
IsNull
ProtocolChange
Range
Redirect
Switch
TableForEach
TableRange
BeanProperty
Cache
Compare
CurrencyFormatter
ErrorMessageForEach
For
ForEach
Format
Repository Servlet Beans
Some of them include:
ItemLookupDroplet
NavHistoryCollector
PipelineChainInvocation
PossibleValues
RelationalViewDroplet
RQLQueryForEach
RQLQueryRange
SQLQueryForEach
SQLQueryRange
NodeForEach
NodeMatch
DOM
XML Transform
• Output Parameters
– Output parameters are parameters whose values are set by the Servlet bean
• Open Parameters
- Open parameters contain the HTML that is rendered by the servlet bean. The HTML that an
open parameter renders is marked off by beginning and ending dsp:oparam tags. This HTML
can include dynamic elements, such as dsp:valueof tags, for displaying the values of output
parameters
Parameter Scope :
o In general, the values of input, output, and open parameters apply only within the servlet bean that uses them ie.,
Private Scope.
o A parameter used by a servlet bean is undefined outside the beginning and ending dsp:droplet tags.
o The value of a page parameter applies everywhere on the page, including within the servlet bean (page scope).
o If the servlet bean has a parameter with the same name as the page parameter, the servlet bean parameter value
overrides the page value, but only within the servlet bean
Steps to create a Custom Droplet:
Step 1: Create a new ATG module. In Source folder create a Droplet class.
Step 2: Create a Properties file for the Droplet in the config folder
Example: TestDroplet.properties
Step 3: Droplet class should extend javax.servlet.Servlet or atg.servlet.DynamoServlet class
Step 4:Implement the service method of the Servlet
Example:
Step 6: Access your jsp from Browser. You will see the output.
WRITING CUSTOMIZED DROPLETS WITH PARAMETERS:
}
You can Create Droplets with Parameters also. Try it out and Post a
comment for any Queries.
Droplet:
In simple Droplet is a combination of Servlets and javaBeans. You can embed these
droplets in your JSPs to display dynamic content. These droplets can be nested and pass
parameters between themselves. These Droplets are also called as DynamoServlets.There
are lot many out-of–box droplets provided by ATG.They are categorized into
Standard Servlet Beans
Some of them include:
IsEmpty
IsNull
ProtocolChange
Range
Redirect
Switch
TableForEach
TableRange
BeanProperty
Cache
Compare
CurrencyFormatter
ErrorMessageForEach
For
ForEach
Format
ItemLookupDroplet
NavHistoryCollector
PipelineChainInvocation
PossibleValues
RelationalViewDroplet
RQLQueryForEach
RQLQueryRange
SQLQueryForEach
SQLQueryRange
NodeForEach
NodeMatch
DOM
XML Transform
• Output Parameters
– Output parameters are parameters whose values are set by the Servlet bean
• Open Parameters
- Open parameters contain the HTML that is rendered by the servlet bean. The HTML that an
open parameter renders is marked off by beginning and ending dsp:oparam tags. This HTML
can include dynamic elements, such as dsp:valueof tags, for displaying the values of output
parameters
Parameter Scope :
o In general, the values of input, output, and open parameters apply only within the servlet bean that uses
them ie., Private Scope.
o A parameter used by a servlet bean is undefined outside the beginning and ending dsp:droplet tags.
o The value of a page parameter applies everywhere on the page, including within the servlet bean (page
scope).
o If the servlet bean has a parameter with the same name as the page parameter, the servlet bean parameter
value overrides the page value, but only within the servlet bean
Steps to create a Custom Droplet:
Step 1: Create a new ATG module. In Source folder create a Droplet class.
Step 2: Create a Properties file for the Droplet in the config folder
Example: TestDroplet.properties
Step 3: Droplet class should extend javax.servlet.Servlet or atg.servlet.DynamoServlet class
Step 4:Implement the service method of the Servlet
Example:
Step 6: Access your jsp from Browser. You will see the output.
}
You can Create Droplets with Parameters also. Try it out and Post a
comment for any Queries.
Form Handlers:
In many web applications users input are taken from the forms.A form may need to
handle user input in a variety of formats, check input for validity, handle errors, and pass input
to a servlet for processing or to a database for storage. ATG java classes that process these forms
are none other than Formhandlers.
• We can create forms in JSP Pages that set values of properties of Nucleus components directly
when the form is submitted.
• For more complex form handling operations, setting the values of properties directly is not
always desirable. It is generally preferable to first submit the form to a form handler.
• The form handler can evaluate the validity of the data, check for errors, and determine what
action to take (e.g., submit the data, direct the user to a different page, display an error message,
etc.)
• Often when you use a form handler, the form input fields are associated with properties of the
form handler rather than the component you ultimately want to modify
A form handler class must include one or more handler methods. A handler method is typically invoked when the
user clicks the submit button, and handles the processing of the form. Depending on the purpose of the form handler,
it can have several different handler methods that each perform a different operation. For example, a form handler
that works with user profiles might have separate handler methods for creating the profile, modifying the profile, and
logging the user in.
If the form uses FormHandler, the exceptions that occurred while processing the form are
stored in the following properties.
• formError : A Boolean that is true if any errors occurred when the form was processed.
• formExceptions : A vector of the exceptions that occurred when the form is processed.
• 2.tag convertors (if any) will be applied(Note: Tag converters are converter classes that are used to convert the data
from input/ to output)
• 3.preXXX()
• 4.handleXXX()
• 5.postXXX()
• 6.afterSetXXX()
Use this droplet to loop through and display the error messages that are generated by a form:
<dsp:oparam name=“output”>
<dsp:valueof param=“message”/><br>
</dsp:oparam>
</dsp:droplet>
atg.droplet.EmptyFormHandler
atg.droplet.GenericFormHandler
atg.droplet.TransactionalFormHandler
EmptyFormHandler
TransactionalFormHandler
You can create a form handler by extending one of these classes or any of their subclasses.
Some of the classes that extend the base class in ATG API are:
SimpleSQLFormHandler for working with form data that is stored in a SQL database.
ProfileFormHandler class to connect forms with user profiles stored in a profile repository
In The above example the submit is given to LoginBean.login (note “l” is small in “login”) so the
LoginBean java class will call handleLogin() method (note “l” is Caps for “handle Method”).
Step ii: create properties file for the java class. Content will be similar to:
$class=managedBeans.LoginBean
$scope=global
JAVA STEPS:
Step 2: Provide the appropriate handlexxx methods. Each Handler method will be triggered by
corresponding dsp:input submit button from the jsp page.
Step 3: Provide either a Map data structure to hold the form data or provide individual fields
Step 4: Write the desired codes and return the Boolean codes appropriately.
13 comments:
Anonymous said...
create properties file for the java class. Content will be similar to:
$class=managedBeans.LoginBean
$scope=global
I have a question
Where i create the property file and how to name the property file
25 November 2013 at 22:24
you can give any name. but make sure this name is the component you refer to in jsp
28 November 2013 at 08:03
you have to place it in config folder. and the path must be the same path u specified in your jsp.
Say you refer /xx/yy/zz/sampleBean in your jsp, then in "config" folder create xx folder, in that xx folder
create yy folder, again in that yy folder create zz folder and keep your properties file there.
Here in this scenario sampleBean.properties file must be created.
in that if u specify
$class=somePackage.SomeClass
in that properties file you have to create
"SomeClass" in "somePackage" in source(src folder).
28 November 2013 at 08:23
Anonymous said...
@SuppressWarnings("unused")
private String getUsername() {
return username;
}
@SuppressWarnings("unused")
private void setUsername(String username) {
this.username = username;
}
@SuppressWarnings("unused")
private String getPassword() {
return password;
}
@SuppressWarnings("unused")
private void setPassword(String password) {
this.password = password;
}
@SuppressWarnings("unused")
private String getMessage() {
return message;
}
private void setMessage(String message) {
this.message = message;
}
......
}
in jsp
dsp:input type="text" bean="/com/verizon/zubair/LoginBean.username" dsp:input
Properties
$class=com.verizon.zubair.LoginBean
$scope=global
The ATG platform supports JSPs as its primary authoring format/front end. The ATG has two tag libraries namely:
JSTL
DSP
For More details on JSTL Tag Library: refer to (Oracle Docs or Tutorials Point)
List of DSP taglibrary tags are explained in previous post (Click here for DSP
tags details)
CurrencyFormatter (/atg/dynamo/droplet/CurrencyFormatter) --
TheCurrencyFormatter servlet bean takes a numeric value and displays that value as a currency amount,
formatting it based on the locale. The formatting includes the currency symbol, the placement of the symbol, and the
delimiters used. For example, if the value passed in is 20000, and the locale is en_US, the servlet bean formats the
value as $20,000.00; if the locale is de_DE, the servlet bean formats the value as 20.000,00 DM.
ErrorMessageForEach(/atg/dynamo/droplet/ErrorMessageForEach) --
The ErrorMessageForEach servlet bean takes a vector of form exceptions and, for each exception, displays an
appropriate error message. The exceptions are of classatg.droplet.DropletException, or a subclass of this
class. The vector of exceptions can either be passed automatically by the request that produces the exceptions, or
specified explicitly using the exception’s input parameter. For example, any form handler of
class atg.droplet.GenericFormHandler (or a subclass of this class) has a property
named formExceptions which is a vector of the exceptions that occurred while processing the form. To pass
these exceptions to the ErrorMessageForEach servlet bean, you can use a tag like this:
<dsp:param name="exceptions" bean="MyFormHandler.formExceptions"/>
Data base layer can be of any type, it can be LDAP, SQL or File System Connector. When ever there is a change in
these DB selection, to avoid source code or java changes ATG introduced a concept called Data any where
architecture, which is also known as ATG Repository API.
In Short, A Repository API is a data access layer that defines a generic representation of a data store.
A data store may contain many diverse types of objects. The repository is not the data store
itself; instead, it is a collection of Java Beans whose properties can be found and stored in the
data store.
With the ATG Data Anywhere, the application logic created by developers uses the same
approach to interact with data regardless of the source of that data. One of the most powerful
aspects of this architecture is that the source of the data is hidden behind the ATG Repository
abstraction. It is easy to change from a relational data source to an LDAP directory as none of
the application logic needs to change. After data is retrieved from a data source, it is
transformed into an object-oriented representation. Manipulation of the data can be done
using simple getPropertyValueand setPropertyValue methods.
The ATG Data Anywhere Architecture offers several advantages over the standard data access
methods such as Java Data Objects (JDO), Enterprise Java Beans (EJB), and Java Database Connectivity (JDBC).
– SQL Repositories - use ATG’s Generic SQL Adapter (GSA) connector to perform a mapping between ATG and data stored in a SQL
database. can be used to access content, user profiles, application security information, and more.
– SQL Profile Repository - included in the ATG Personalization module. Uses the Generic SQL Adapter connector to perform a
mapping for user data contained in a SQL database.
– LDAP Repository - Uses the Dynamo LDAP connector to access user data in an LDAP directory.
– Composite Repository - provides a means for using more than one data store as the source for a single repository.
Repository Architecture
The repository provides a mechanism to retrieve the data elements, and creates a run-time representation of the
available metadata for each object. This goal is achieved through three main conceptual parts of the Repository API:
1. Repository Items
A repository is a collection of repository items. A repository item is a JavaBean component
that implements atg.repository.RepositoryItem or one of its sub-interfaces, and corresponds to the
smallest uniquely identifiable entity in the underlying data store. In the SQL repository, for example, a repository
item often corresponds roughly to a row in a table.
Properties:
Each repository item is composed of named properties that store the item’s data—for example, id, firstName,
and lastName. In the SQL repository, these properties generally correspond to table columns.
2. Item Descriptors
Each repository item belongs to an item type that is defined by a Repository item descriptor. An item
descriptor implements the atg.repository.RepositoryItemDescriptor interface and can
subclassatg.repository.ItemDescriptorImpl. An item descriptor provides the following information:
Repository item descriptors depend on a combination of the underlying data store and the configuration of the
repository.
3. Repository Queries
All repositories have the ability to execute queries. A query is a request to find all items of a particular item
type that fits a certain set of criteria. Those criteria are specified in terms of the item type’s properties.
The Repository API can express a wide variety of queries, including queries that match patterns in text, query through
collections, or even query through complex values. Queries can also specify the order in which to return results, and
can specify which results from a large result set to return.
Queries can be built and executed with the Repository API. For complex queries, this can be a tedious task. In these
cases, or in cases where the Repository API should not be used directly, queries can be represented in a textual form
called Repository Query Language (RQL).
Mutable Repository
•The base interfaces of a repository define an immutable data store. It provides a read-only version of the elements contained
in the repository.
•Mutable Repository is extension of the Repository interfaces that provide facilities to create, update, and remove items from a
repository
•atg.repository.Repository
–This interface provides methods to access RepositoryItems, RepositoryViews and ItemDescriptors corresponding to the
three main elements of the repository
•atg.repository.RepositoryView
–RepositoryView can be used to search for items in repository when you don’t have an exact repository ID
–Item descriptors and RepositoryViews often have a one-to-one relationship and often have the same name
–viewNames property of the Repository component gives the list of views available for the Repository
–Default View returns all items of the Repository which can be accessed by defaultViewName property
•atg.repository.RepositoryItem
–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
–The ItemDescriptor that describes the dynamic bean info about the item is available through the ItemDescriptor property
–getPropertyValue(String pPropertyName) method can be used to retrieve the attributes of the RepositoryItem
•atg.repository.MutableRepository
–createItem
•createItem(String pDescriptorName)
•createItem(String pId, String pDescriptorName).
–addItem
•RepositoryItem addItem(MutableRepositoryItem pItem)
–removeItem
•removeItem(String pId, String pDescriptorName)
–updateItem
•Fetch a mutable version of the repository item through the getItemForUpdate and getItemsForUpdate methods. These
methods return instances of MutableRepositoryItem. This interface extends RepositoryItem
–setPropertyValue(String pPropertyName, Object pPropertyValue)
•Use the setPropertyValue method of MutableRepositoryItem to change as many properties as you wish. These changes will not be
reflected in the repository until the final updateItem operation is invoked.
•Save the changes with the updateItem method. This method extracts all the changes required for the item and updates the item in
the data store. Depending on how you have configured transactional behavior, the update can be committed immediately, or
the update may happen automatically when the associated transaction commits
• The ATG Dynamo SQL repository can be used to connect ATG applications to a SQL database
• The SQL repository is implemented through the atg.adapter.gsa package. (GSA stands for "Generic SQL Adapter")
• The main Dynamo component in the SQL repository is an instance of the atg.adapter.gsa.GSARepository class, which
implements the interfaces atg.repository.MutableRepository and atg.repository.content.ContentRepository and which
extends the class atg.repository.RepositoryImpl
• Whenever you need to create a new SQL repository instance, you should instantiate the
atg.adapter.gsa.GSARepository class
Data Types in Definition file of ATG, SQL data type and Java object mappings are shown in below table:
Primary Table:
• Each item descriptor must have one and only one primary table.
• The primary table is specified using the type="primary" XML attribute in a <table> tag.
• The primary table must define a column or columns that store the repository ID.
• This column is specified using the id-column-names attribute.
<table name="user" type="primary" id-column-name="id">
properties...
</table>
• Use “id-column-names” if the primary keys are more than one.
Auxiliary Table:
• To specify a relationship of one to one, we will use auxiliary tables. The Auxiliary table is specified using the
type="auxiliary" XML attribute in a <table> tag.
• Example: Each user has a single address. For the purposes of this example, the user information is stored in a
separate table from the user’s address information.
• The columns in the id-column-names attribute of auxiliary table must be listed in the same order as they are in the
id-column-names attribute of the primary table.
<item-descriptor name="user">
</table>
<table name="dps_address" type="auxiliary" id-column-names="id">
<property name="address1"/>
<property name="city"/>
<property name="state"/>
<property name="zip"/>
</table>
</item-descriptor>
Multi Table:
• To specify a relationship of many to one, many to many we will use auxiliary tables.
• The Multi table is specified using the type="multi" XML attribute in a <table> tag.
• The multi-column-name attribute ensures that the ordering of the multi-values are maintained. The column
specified by the multi-column-name attribute is used for multi-valued properties of data type array, map, and list and
is not used for sets (which are unordered). For map type properties, the values in the column specified by the multi-
column-name attribute must be a string. For list or array type properties, these values should be an integer or
numeric type, and must be sequential.
• As with auxiliary tables, the ordering of the ID column names is important. The columns specified by this attribute
must list table columns in the same order as the id-column-names attribute of the primary table.
• The <property> tag for a multi-valued property sets the following attributes:
data-type is set to One of the following: array,set,map,list
For example:
<property ... data-type="array" ..
component-data-type is set to A primitive data type such as int, string, etc..
SQL repository does not support references to binary types
For example:
<property name="interests" column-name="interest" data-type="array" component-data-type="string"/>
component-item-type is set to The item descriptor name of the referenced repository items
For example:
<property name="..." column-name="designers" data-type="array"
component-item-type="user"/>
By default, null values are not allowed in multi-valued properties. You can specify to allow
null values at two levels:
• Enable all multi-valued properties in a repository to accept null values by setting the repository property
allowNullValues to true
• Allow null values for an individual property by setting its <property> tag attribute allowNullValues to true
In general, auxiliary and multi tables should not have REFERENCES constraints that point to
each other. Instead, each of these tables can have a REFERENCES constraint that points to the
primary table for the repository item. This limitation exists because the SQL repository processes
insert and delete statements for auxiliary and multi tables in the same order. As a result, if you
specify REFERENCES constraints between an auxiliary and a multi table or vice versa, a
constraint error results on the insert or the delete.
Best Practices
•Define primary key of table as String or Long
•Incase we need to have composite primary key which has more than 1 key, Add a new id column as part of the primary key
•Normalize the data model and introduce redundancy where ever is required
Efficient database access is important to many ATG applications. You should design an
application so it requires minimal access to the data base and ensures data integrity. An
intelligent caching strategy is central to achieving these goals.
Item Caches
Item caches hold the values of repository items, indexed by repository IDs. An item cache entry is invalidated
when that item is updated. The scope of an entry’s invalidation depends on its caching mode.
Query Caches
Query caches hold the repository IDs of items that match given queries. When a query returns repository items whose
item descriptor enables query caching, the result set is cached as follows:
The query cache stores the repository IDs.
The item cache stores the corresponding repository items.
A query cache entry can be invalidated for two reasons:
A cached item property that was specified in the original query is modified.
Items of a queried item type are added to or removed from the repository.
If query caching is enabled, the first time this query is issued, the result set is retrieved from the database and stored
in the query cache. Then, the next time this same query is issued, the SQL repository can retrieve the result set from
the cache, rather than needing to access the database.
Cache Modes
The SQL repository implements several different modes of caching. Which mode is to be chosen depends on the
nature of your Dynamo application. We can set the default caching mode on each item descriptor in a repository.
Each property’s definition can override the cache mode of its item-descriptor.
The caching modes implemented in the SQL repository are:
• No Caching (disabled)
When caching is disabled for an item, its property values are cached only during the current transaction, and only if
the transaction requires one or more of that item’s properties. This ensures a consistent view of item data while the
transaction is in progress. Thus, multiple calls to getPropertyValue() for the same property within the same
transaction require only one database query. Cached item properties are reloaded from the datastore for each
transaction.
• Inherited
You can set a property to inherit the default caching mode by setting its cache-mode attribute to inherit. This setting
can be useful when a property’s caching mode is set to disabled at one point in the configuration path and you want to
reset the property to the default caching mode at a later point.
• Simple Caching (caching is handled separately in each VM, with no invalidation events to synchronize updates
from different server instances).
A server obtains changes to an item’s persistent state only after the cached entry for that item is invalidated. This
mode is suitable for read-only repositories such as product catalogs, where changes are confined to a staging server,
and for architectures where only one server handles a given repository item type.
• Locked Caching (read and write locks are used to synchronize the caches)
A multi-server application might require locked caching, where only one ATG instance at a time has write access to
the cached data of a given item type. You can use locked caching to prevent multiple servers from trying to update the
same item simultaneously.
Prerequisites
Locked caching has the following prerequisites:
Item descriptors that specify locked caching must disable query caching by setting their query-cache-size attribute
to 0.
A repository with item descriptors that use locked caching must be configured to use a ClientLockManager
component; otherwise, caching is disabled for those item descriptors. The repository’s lockManager property is set to
a component of type atg.service.lockmanager.ClientLockManager
At least one ClientLockManager on each ATG instance where repositories participate in locked caching must be
configured to use ServerLockManager.
A ServerLockManager component must be configured to manage the locks among participating ATG instances.
• Distributed Caching (caching with cache invalidation events) types of distributed caching are
a. Distributed TCP caching (uses TCP to broadcast cache invalidation events to all servers )
b. Distributed JMS caching (uses JMS to broadcast cache invalidation events to all servers )
c. Distributed hybrid caching (uses Both)
Distributed TCP
The following requirements apply:
Real-time access to item changes
Infrequent updates to cached items
Modest number of item caches to monitor
Distributed JMS
The following requirements apply:
Reliable delivery of invalidation messages
Infrequent updates to cached items
Large number of item caches to monitor
Distributed hybrid
The following requirements apply:
Real-time access to item changes
Large number of cached items to monitor across many clients
Infrequent updates to cached items
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:
<item-descriptor name="profile" cache-mode="locked">
3. Include RQL queries in <query-items> tags in the XML repository definition file mainly
used for unit testing queries
All of the standard comparison operators can be used, as well as logical operators like
AND, OR, and NOT
Collection Queries
Use the INCLUDES, INCLUDES ANY, or INCLUDES ALL operators only for
querying multi- valued properties
Is Null Queries
Seeing whether an expression evaluates to null should be done with an IS NULL
query. For example
Count Expressions
COUNT (addresses) > 3
ID-based Queries
ID IN { ["dept2", "emp345"], ["dept2", "emp346"], ["dept2", "emp347"] }
Order By Directives
age > 30 ORDER BY firstName SORT ASC CASE IGNORECASE
Range Directives
age > 30 RANGE 40+10
Parameterized Field Queries
Catalogs: Catalogs are a container for a navigational structure made up of categories. Catalogs can
contain links to subcatalogs and to categories.
Categories: Categories have properties that link them to other categories and to products. They can also
link to other catalogs.
Products : Products have properties that link them to other products and to SKUs (stock-keeping
units).Contain links for text and images used to describe a group
of SKUs
SKU : is the actual unit that is shipped to the user, Pricing is generally done at SKU level. A product can have several
different SKUs associated with it, representing varieties, sizes, and colors.
Categories do not, “contain” products, nor do products “contain” SKUs. Rather, the objects are peers that are linked
together through their various properties
When a user starts a session on an ATG server, a new profile object is created. The profile object starts off empty if
anonymous. If the user logs in, the information stored about that user in the Profile Repository is loaded into the
profile object on the server. From this point onward, changes to the profile object will be saved in the Profile
Repository at designated times.
The profile object may contain information gathered before the user logged in, and this information is merged while
the login is done based on the requirements.
GROUP USERS:
Customizations to Profile:
A profile can be customized in N number of ways.
In Detail:
When a customer accesses a JSP page that has slot, that slot requests content. The Slot calls a scenario which contains
rules that tells which Targeter to run. Targeter determines the appropriate content for the customer. The Scenario
returns the content to the JSP page and the slot is populate.
Both WishList and GiftList in ATG is implemented using gift list repository in ATG.
Primary differences between wish list and gift list are explained
below:
Wish list for a user is nothing but list of his favorite items. User can store his favorite items for his future purchases.
Gift list for a user is explained in the below example:
Say user is having his wedding on some date, and he is interested in getting some particular things as gifts, then he
will populate giftlist and share it with different other users in our application.
WISHLIST GIFTLIST
User is associated with only one wishlist. There can be ‘N ’ number of lists associated with user
Wishlist is Private to the User. And only user can Giftlist can be made public or private based on the
purchase items from his wish list interest of the user. Only public list can be shared to
other users. Other users can purchase items for the
owner of that list.
Wishlist will not have any shipping address associated Giftlist will have a shipping address associated with it.
with it.
By default a wishlist is created for ATG user User has to create his giftLists
Public Giftlists of others can be viewed using
‘OtherGiftlists’
Giftlist Repository:
The Giftlists repository is the layer between Oracle ATG Web Commerce and the database itself. It provides an
interface to the database layer to persist gift list information. The Giftlists repository uses the SQL Repository
implementation. The Giftlists repository is defined in the giftlists.xml definition file, located in the
Commerce configuration path at /atg/commerce/gifts/. This XML file defines item descriptors for gift lists
and gift list items.
The /atg/commerce/gifts/GiftlistFormHandler accepts input from the customer to create, update and
delete gift lists, as well as to add items to and remove items from gift lists. Properties in the handler are used to store
user input for processing, as well as to store success and failure URLs for redirect after processing. Some handle
methods have pre- and post- methods defined to make it easier to extend the methods.
The /atg/commerce/gifts/GiftlistSearch form handler searches the repository for gift lists. The form
handler uses input from the customer, such as owner name, event name, event type and state, to find gift lists
published by other customers.
ATG Scheduler
If the Dynamo application want to perform a task at regular intervals of time or a period of time it
includes a scheduler service (atg.service.scheduler.Scheduler) which executes the appropriate services
at specified times.
Dynamo also includes
a SingletonSchedulableService,atg.service.scheduler.SingletonSchedulab
leService, which enables multiple Dynamo servers to run the same scheduled service, while
guaranteeing that only one instance of the service performs the scheduled task at a time. This provides
some protection from server failures, as the loss of one Dynamo server does not prevent the scheduled
service from running on another Dynamo server.
To make sure that your task starts automatically with dynamo Start :
Add your component to one of the inital arrays in an Initial component.
In initial.properties add your scheduler component created to initialServices property.
If you want to run the schedulers manually you can do it from dyn/admin.
Example Scheduler:
The application path for REST URLs, which is the portion of the URL that follows the hostname and
port number, starts with /rest/. The REST MVC framework uses /model.The Legacy REST framework
uses /bean, /repository or /service, depending on the component used.
For example:
http://servername:port/rest/model/atg/commerce/order/purchase/CartMo
difierActor/addItemToOrder
HTTP requests and responses are the way that the ATG REST Web Services communicate. The
following HTTP methods are used and supported by ATG REST Web Services:
Method Explanation
Use this method to return data.
Examples of the values you may get are repository item and Nucleus
GET
component property values, RQL query results, repository items, and
Nucleus components.
Use this method to invoke functionality or make changes to your Oracle
ATG Web Commerce platform server.
POST
For example, you may invoke methods, update Nucleus component
properties, and create repository items.
(Legacy REST Only) Use this method to make changes to your Oracle
ATG Web Commerce platform server.
PUT
For example, you may update repository item and Nucleus component
property values.
DELETE (Legacy REST Only) Use this method to remove repository items.
Returning Data
ATG REST Web Services returns the results of operations that you perform in an HTTP response
message body. The output data can be returned in either JavaScript Object Notation (JSON) or
eXtensible Markup Language (XML) format.
After adding the REST module to current module list in CIM follow the steps given in
integration-of-atg-with-rest-webservices
When using REST services, you want to prevent the processing of malicious site requests. Oracle ATG
Web Commerce platform uses a request parameter_dynSessConf, which contains a session
confirmation number, to verify that a request is legitimate. For further information on session
confirmation numbers, and the warnings that occur if the request is not legitimate
Actor Types
The REST MVC API’s modular and extensible functionality is based on actors, which uses a number of
different types of actors to perform a variety of functions.
The atg.service.actor.Actor interface contains the following actor types that perform
specific actions or provide configurations.
Component Actor – You use this actor to set component property values or invoke methods on
a component, or to read component property values
Droplet Actor – Use this actor when you want to invoke droplets and output data from the
droplet to the ModelMap. Inputs are mapped to the dropletinput parameter. Other types of
actors can be nested in the oparamparameter of a DropletActor
Form Actor – Use this actor to set up form handler inputs and submit a form
JSP Actor – This actor invokes a JSP page and adds the JSP response or JSP-defined variables
to the ModelMap
Nested Actor – These actors allow you to invoke actor-chains from within other actor-chains,
helping to define modular units of work that can be combined and extended.
Variable Actor – The VarActor enables you to set variables in the actor context
Bean Filtering
The BeanFilterService filters the properties of a java bean or repository item and converts beans
into a map of properties. The BeanFilterService reads XML definition files that define which
properties of a Java class or repository item should be included in the filtered view of the object. The
XML definitions include ways to remap property names and transform properties.
By default, the BeanFilterService is applied to the ModelMap by the REST MVC framework
before generating a JSON or XML response. However, you can filter objects at any time. For example,
you can use the BeanFilterService as aComponentActor to filter a repository item before
adding it to the ModelMap.
vii. Create a new folder “Versioned” inside your new module (MyShop/Versioned).
xii. After build, once BCC server is up with no errors, if we are not able to open bcc page, we need
to do the below things:
a. In <ATG-DIR>/home/localconfig/atg/dynamo/service/jdbc/ (create one if you don’t find it!)
folder
create new files FakeXADataSource.properties and JTDataSource.properties.
In FakeXADataSource.properties, add below lines:
$class=atg.service.jdbc.FakeXADataSource
URL=jdbc:oracle:thin:@localhost:1521/xe
user=publishing_username
password=publishing_password
driver=oracle.jdbc.xa.client.OracleXADataSource(driver class)
In JTDataSource.properties, add below lines
$class=atg.service.jdbc.MonitoredDataSource
dataSource=/atg/dynamo/service/jdbc/FakeXADataSource
b. Run <ATG-DIR>/BIZUI/install/importBizui.bat
NOTE: While running, if you get any SQLExceptions w.r.t drivers, we should add
CLASSPATH with driver(ojdbc14.jar) path and add the path(path to ojdbc14.jar) to
PATH variable.
eg: defaultLocale = en_IN (for india) this locale will return currency code as INR.
Thursday, 14 November 2013 Products Not Getting Displayed for Anonymous user in ATG, Products
Not Getting Displayed in ATG 0 comments
Products Not Getting Displayed in ATG / Products Not Getting
Displayed for Anonymous user in ATG
If you are not able to see the products in the module you created in ATG or Products Not Getting
Displayed and no error is there in your server console then:
Probably this might be because of null value in the default catalog in the profile when it is
getting created. to overcome this:
2. In CatalogTools.properties add
eg: defaultCatalogId=catalog20004
Thursday, 14 November 2013 How to add a Sku to cart, How to display products and skus in
ATG, How to display Sku images, ProductLookUp droplet,SKUlookUp Droplet 1 comments
Use the Following Out Of the BOX Atg droplets to display. Code Snippet is as shown bellow:
<dsp:a href="categoryNavigation.jsp">
</dsp:a>
</dsp:oparam>
</dsp:droplet>
</dsp:page>
categoryNavigation.jsp:
<dsp:oparam name="output">
<dsp:droplet name="/atg/dynamo/droplet/ForEach">
<dsp:oparam name="output">
<br />
<dsp:a href="categoryNavigation.jsp">
</dsp:oparam>
</dsp:droplet>
<dsp:droplet name="/atg/dynamo/droplet/ForEach">
<dsp:oparam name="output">
<ul>
<br />
<dsp:valueof param="childProduct.id" />
<dsp:valueof param="childProduct.displayName" />
<dsp:valueof param="childProduct.childSKUs" />
<dsp:droplet name="/atg/dynamo/droplet/ForEach">
<dsp:param name="array" param="childProduct.childSKUs" />
<dsp:param name="elementName" value="childSKU" />
<dsp:oparam name="output">
<li> <dsp:valueof param="childSKU.id" />
<dsp:valueof param="childSKU.displayName" />
<dsp:valueof param="childSKU.listPrice" />
<img src='/walletshop<dsp:valueof param="childSKU.largeImage.url"/>'/>
<dsp:form id="addSku" action="categoryNavigation.jsp">
<dsp:input
bean="/atg/commerce/order/purchase/CartModifierFormHandler.addItemCount" value="1"
type="hidden"/>
<dsp:input
bean="/atg/commerce/order/purchase/CartModifierFormHandler.addItemToOrderSuccessURL"
value="/walletshop/catagrydisplay.jsp" type="hidden"/>
<dsp:input
bean="/atg/commerce/order/purchase/CartModifierFormHandler.addItemToOrderErrorURL"
value="/walletshop/errors.jsp" type="hidden"/>
<dsp:input
bean="/atg/commerce/order/purchase/CartModifierFormHandler.items[0].productId"
paramvalue="childProduct.id" type="hidden"/>
<dsp:input
bean="/atg/commerce/order/purchase/CartModifierFormHandler.items[0].quantity"
type="hidden" value="1" />
<dsp:input
bean="/atg/commerce/order/purchase/CartModifierFormHandler.items[0].catalogRefId"
paramvalue="childSKU.id" type="hidden" />
<dsp:input
bean="/atg/commerce/order/purchase/CartModifierFormHandler.pageFlow" value="true"
type="hidden" />
<dsp:input
bean="/atg/commerce/order/purchase/CartModifierFormHandler.addItemToOrder" value="add"
type="hidden"/>
<input type="submit" value="Submit"/>
</dsp:form>
</li>
</dsp:oparam>
</dsp:droplet>
</ul>
</dsp:oparam>
</dsp:droplet>
</dsp:oparam>
</dsp:droplet>
</dsp:page>
Tuesday, 13 August 2013 ATG Scheduler, Example ATG Scheduler,Scheduling a Task in ATG 0 comments
ATG Scheduler
If the Dynamo application want to perform a task at regular intervals of time or a period of time it includes a
scheduler service (atg.service.scheduler.Scheduler) which executes the appropriate services at specified times.
Dynamo also includes
a SingletonSchedulableService,atg.service.scheduler.SingletonSchedulableService,
which enables multiple Dynamo servers to run the same scheduled service, while guaranteeing that only one instance
of the service performs the scheduled task at a time. This provides some protection from server failures, as the loss of
one Dynamo server does not prevent the scheduled service from running on another Dynamo server.
Scheduling a Task in ATG:
In order to schedule a task, a component needs a pointer to the Scheduler, which is usually set as a component
property. The component schedules a new task by calling addScheduledJob on the Scheduler. The Scheduler
executes the job as scheduled.
When the Scheduler executes a job, it calls performScheduledTask on the object that performs the task, which
must implementatg.service.scheduler.Schedulable. Typically, the component that schedules the task
is also the Schedulable component that executes it, but this is not strictly required.
When a component schedules a task, it must provide the Scheduler with the following information:
A name for the scheduled job; used only for display to the administrator.
The name of the component scheduling the job; used only for display to the administrator.
The Schedulable object that handles the job; typically, the same as the component that schedules the job.
A flag that indicates how to run the job:
o In a separate thread.
o In the same thread as other scheduled services.
o In a dedicated, reusable thread.
If a job runs in the same thread as other services, no other scheduled services can run until the job finishes. If the job
is long and expensive, it should run in a separate thread. If the job is short, it should run in the same thread.
The Schedulethat indicates when the job should run. This is specified as an object that
implements atg.service.scheduler.Schedule. The scheduler package provides a set of
useful Schedule types, including schedules that represent an event at a specific time, schedules that represent
periodic events, and schedules that represent events based on the calendar—for example, on the 1st and 15th of every
month. Usually the Schedule is passed in as a property. All of this information is encapsulated in
a ScheduledJob object, which is passed to the Scheduler’saddScheduledJob()method.When a job is added
to the Scheduler, the Scheduler returns an integer job ID, which you can later use to reference that job. For example,
to stop a scheduled job, you can call removeScheduledJob on the Scheduler, passing in the ID of the job to stop.
To make sure that your task starts automatically with dynamo Start :
Add your component to one of the inital arrays in an Initial component.
In initial.properties add your scheduler component created to initialServices property.
If you want to run the schedulers manually you can do it from dyn/admin.
Example Scheduler: