Sunteți pe pagina 1din 8

Q-Difference between dsp and dspel tags

Ans: Ans: The DSP tag library tags support runtime expressions, such as

references to scripting variables. These tags use a id attribute to name the


scripting variables they create.
The DSPEL tag library tags support JSTL Expression Language (EL) elements
that are also evaluated at runtime. These tags often produce a result object
named by the var attribute.
For custom tags we need to write the properties file and a class file to define
the functions. We need to include a tag file with extension .tld. (tag library
definition) and in the droplet include the path of the tag uri
Q-What is a TAG Library in ATG Dynamo?
Ans: ATG tag library is like a jsp standard library. The only difference is that

ATG framework has provides his own tag libraries like DSP/DSPEL/CORE.
Q-Transactions Modes in ATG
Ans:

Mode

Description

Required

Indicates that a transaction must be in place in the demarcated area. If a


transaction is already in place in the area, nothing further is done. If no
transaction is in place, one is created when the demarcated area is entered
and ended when the demarcated area ends.

RequiresNe
w

Indicates that all activity within the demarcated area must occur in its own
separate transaction. If no transaction is in place in the area, a transaction is
created at the beginning of the demarcated area and ended at the end of the
demarcated area. If a transaction is in place when the demarcated area is
entered, that transaction is suspended, and a new transaction is begun; at
the end of the demarcated area, the new transaction is ended, and the
original transaction is resumed.

NotSupport
ed

Indicates that a transaction must not be in place in the demarcated area. If


no transaction is in place in the area, nothing further is done. If there is a
transaction in place when the demarcated area is entered, that transaction is
suspended, then resumed at the end of the demarcated area.

Supports

This mode does nothing. If a transaction is in place when the demarcated


area is entered then that transaction remains in place. Otherwise, the area is
executed without a transaction in place.

Mandatory

Throws an exception if a transaction is not in place when the demarcated


area is entered. This mode does not create a transaction; it is used to verify
that a transaction is in place where the developer expects.

Never

Throws an exception if there is a transaction in place when demarcated area


is entered. This mode does not end or suspend any existing transactions; it is
used to verify that a transaction is not in place where the developer does not
expect one.

Q-Transaction Demarcation
Ans: Enclosing of transactional behavior is called transaction demarcation.
Transaction demarcation always wraps a sequence of actions, such as a
single request, a single method, or a section of code within a method. The
demarcation initializes some transactional behavior before the demarcated
area begins, then ends that transactional behavior when the demarcated area
ends. The application server uses these demarcations to determine the
appropriate calls to theTransactionManager object.

Q- Order States

State Name

Description

APPROVED

The approval process for the order is complete, and the order has b
approved.

FAILED

The order failed.

FAILED_APPROVAL

The approval process for the order is complete, and the order has b
rejected.

INCOMPLETE

The order is in the purchase process.

NO_PENDING_ACTION

The order has been fulfilled, and processing of the order is complete
shipping groups in the order are in a NO_PENDING_ACTION or REMO
state, and order payment has been settled.

PENDING_APPROVAL

The order requires approval (or an additional approval) by an autho


approver.

PENDING_CUSTOMER_A
CTION

Processing of the order requires the customers attention for some r


such as an incorrect customer address.

PENDING_CUSTOMER_R
ETURN

This is an unused state. It is placed in the list of states for the conve
those who might want to implement this state.

PENDING_MERCHANT_A
CTION

Processing of the order requires merchant attention for some reason


the failure of a payment group in the order.

PENDING_REMOVE

A request was made to remove the order. The order is placed in this
until all shipping groups in the order are set to a PENDING_REMOVE

PROCESSING

The order is being processed by Fulfillment.

QUOTED

This is an unused state. It is placed in the list of states for the conve
those who might want to implement this state.

REMOVED

The order has been removed successfully.

SUBMITTED

The order has completed the purchase process and has been submi
Fulfillment.

TEMPLATE

The order is a template order used by a scheduled order.

Ans: The following table describes the possible states of an Order:

Q- Add item to order


Ans: A ForEach servlet bean is used to iterate over the SKUs of the product

and populate the drop-down list, which is associated with the catalogRefIds
property of the CartModifierFormHandler. Additionally, the user can specify in
a textbox a quantity of the selected SKU to add to the cart, which is
associated with the quantity property of the CartModifierFormHandler.
When the user clicks the Add To Cart submit button, the form is processed,
the properties of CartModifierFormHandler are set, and the
handleAddItemToOrder method ofCartModifierFormHandler is invoked. The
handleAddItemToOrder method adds the quantity (specified in
CartModifierFormHandler.quantity) of the selected SKU (specified in
CartModifierFormHandler.catalogRefIds and identified by repository ID) to the
current Order and then reprices the Order.

Q- Difference between Item Cache and Query cache


Ans: For each item descriptor, an SQL repository maintains two caches:
a.ItemCache
b.QueryCache

Item caches hold the values of repository items, indexed by repository IDs.
Item caching can be explicitly enabled for each item descriptor.
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:

Q- What are different modes caching


Ans: Caching modes are set at the item descriptor level, through the tags
cache-mode attribute. The default caching mode is simple caching. To set a
different caching mode on an item descriptor, set cache-mode to one of the
following values:
Simple
Locked
Distributed (distributed TCP caching)
distributedJMS (distributed JMS caching)
distributedHybrid (distributed hybrid caching)

Q- Inserting servlets in the request pipeline


All servlets in a pipeline implement PipelineableServlet interface of
atg.servlet.pipeline package.Servlets that implement PipelineableServlet
have a nextServlet property that points to the nextcomponent to invoke.
In order to write custom pipeline servlet, needs to implement an interface i.e.

PipelineableServlet.Create a component using this servlet. The components


created by these servlets should be globallyscoped and configured to the
pipeline.
You can write custom pipeline servlet by extending the
atg.servlet.pipeline.PipelineableServletImplclass. This class implements all
Servlet methods, so we need to override the service method. This
classdefines a property called nextServlet of type Servlet, which specifies the
next servlet in the pipeline.When your servlet finishes processing, it passes
the request and response objects to the servletspecified by this property, by
invoking a method called passRequest.

The PipelineableServlet interface has two subinterfaces that provide


additional mechanisms fordetermining the next component to invoke

InsertableServlet
Servlets that implement the InsertableServlet interface have an
insertAfterServlet property that enables the servlet to insert itself in a specific
spot in the pipeline. The key advantage of this mechanismis that it does not
require modifying any existing servlets in the pipeline compared to
Pipelineable Servlet.
Example: if we want to insert a servlet i.e. Servlet1a, between two servlets
i.e. Servlet1 & Servlet2 in the pipeline.
If Servlet1a implements Pipelineable Servlet, you can reroute the pipeline by
changing the value of theServlet1.nextServlet property pointing to Servlet1a
rather than Servlet2, and set Servlet1a.nextServlet to point to Servlet2.
But if Servlet1a implements InsertableServlet, all you have to do is set
Servlet1a.insertAfterServlet to point to Servlet1, and Servlet1a will
automatically be spliced into the pipeline right after Servlet1 and before
Servlet2.
Servlet1a is able to do this because it effectively sets its own nextServlet
property to the value of Servlet1s nextServlet property and rewrites
Servlet1s nextServlet property to point to Servlet1.
Steps to Create InsertableServlet
Following steps involve creating & adding an InsertableServlet to the servlet
pipeline.
1. Write a servlet e.g. MyServlet, extending InsertableServletImpl.

2. Define it as a component in the Nucleus hierarchy of this servlet. It does


not really matter whereyou put your servlet in the component hierarchy.
3. Set the insertAfterServlet property of your servlet to point to the path of
the pipeline servletyou want your servlet to follow in components
property file.
4. For example, if you want your servlet to follow the DynamoServlet in the
pipeline, use
insertAfterServlet=/atg/dynamo/servlet/pipeline/DynamoServlet
5. Add the path to your servlet to the initialServices property of
/atg/dynamo/servlet/Initial
Q-Types of Pipelines
There are two request-handling pipelines used by Dynamo.
DAF Servlet Pipeline - It is used to handle the JSP request. This pipeline is for
customerapplication jsp request.
DAS Servlet pipeline - It is used to handle JHTML request. Because JHTML is a
proprietarylanguage, it relies on the page compiler provided in the DAS
servlet pipeline to generate JHTML into a servlet thats rendered as HTML by
the application server.

Q-Request Processing by DAF Servlet Pipeline

Ans: When a JSP page is requested, the DAF servlet pipeline runs through the
set of servlet shown below.
The application server follows the following path for processing the request.
1.When a user performs an action that prompts a response, the application
server creates an instance of the HttpServletRequest and
HttpServletResponse.
2.Based on the directories and file extension of the requestURI, the
application server uses servlet and filter mappings defined in web.xml to
determine the next resource to call.
3.By default, PageFilter is mapped to handle JSP requests. When the
application server invokes PageFilter, it checks the request and response for a
reference to a Dynamo request and response pair.

4.The pair does not exist; PageFilter will start the DAF servlet pipeline by
calling DynamoHandler ,the first servlet in the pipeline.
5.The DAF servlet pipeline will process through a series of servlets that
modify the request andresponse by extracting path information and providing
session, user, and security information.
6.The last servlet in the pipeline is TailPipelineServlet. It is responsible for
callingFilterChain.doFilter(), which invokes the next filter defined in web.xml.

Note: ATG Business commerce pipeline includes additional components more


than ATG Consumer Commerce.

pageFilter is use only in DAF request handling pipeline. It is responsible to


handle jsp pages. pageFilter call an instance of DynamoHandler a first servlet
in a pipeline. Now it is a responsibility of DynamoHandler to generate
DynamoHttpServletRequest wrapping generic HttpServletRequest.

Request Processing by DAS Servlet Pipeline


DAS is used to handle JHTML request. The pipeline runs through the set of
servlet. As JHTML is aproprietary language, it relies on the page compiler
provided in the DAS servlet pipeline to generate JHTML into a servlet thats
rendered as HTML by the application server.
DynamoProxyServlet is used in DAS pipeline instead of pageFilter.
DynamoProxyServlet make call toDynamoHandler to start DAS pipeline.
The application server follows the following path for processing the request.
1.A call for a page in the dyn directory, which holds all JHTML pages, causes
the application serverto invoke DynamoProxyServlet, which is responsible for
starting the DAS servlet pipeline bycalling DynamoHandler.
2.The DAS servlet pipeline performs the same request and response handling
tasks as the DAFservlet pipeline.
3.One task common to both pipelines is the compiling of JHTML pages by
PageCompileServlet,one of the servlets in the pipeline.

4.By default, no filters are involved in request-handling process; if you create


custom servletfilters, they will be invoked before DynamoProxyServlet.
Note:-Although DynamoHandler does the same thing in both pipelines but a
different version of DynamoHandler is used for each request type.
PageFilter calls /atg/dynamo/servlet/dafpipeline/DynamoHandler to start the
DAF servlet pipeline for JSP requests.
DynamoProxyServlet calls /atg/dynamo/servlet/pipeline/DynamoHandler to
start the DAS servlet pipeline for JHTML requests.
The main difference between the DAS and DAF servlet pipelines is that the
DAS servlet pipeline automatically compiles the page from JHTML to Java,
whereas the DAF servlet pipeline relies on the application server to handle
the complete page compilation process.

Q: Adding a new processor in the commerce pipeline


Ans:
1.create you processor class and component. Custom processor should
should be an implemnetation of the pipelineprocessor

S-ar putea să vă placă și