Monday, 2 April 2012

ATG Interview Questions 3

1. What is class Heirarchy for ATG Formhandlers?How to create a FormHandler?

At the top of ATG formhandler class heirarchy there exists the DropletFormHandlerinterface. Then come, three different classes provided by Dynamo which extend this interface. They are as below atg.droplet.EmptyFormHandler atg.droplet.GenericFormHandler atg.droplet.TransactionalFormHandler

The EmptyFormHandler is the most simplest to implement. It implements the DropletFormHandler interface and defines blank body implementations of the methods in this interface. GenericFormHandler extends EmptyFormHandler. It defines the simple implementations of the DropletFormHandler interface’s methods and the basic error handling logic. If errors occur in processing a form that uses GenericFormHandler, the errors are saved and exposed as properties of the form handler component. TransactionalFormHandler extends GenericFormHandler, It treats the form processing operation as a transaction. Though the methods invoked by this form handler are processed discretely, but their results are saved simultaneously. The beforeGet and afterGet methods do the transaction management. This establishes the transaction before any of your properties are set or handler methods are called.

Commerce

2. What is an Order ?

Ans : An order is a container for commerce items, shipping groups, payment groups and relationship objects.

3. What is the ShoppingCart ?

It is a session scoped component for holding current and saved orders. The class of ShoppingCart component is OderHolder.

Shopping.current contains the current order.

ShoppingCart.saved contains saved orders.

4. What is a commerce item?

A commerce item is order item which holds the catalogRefId , quantity and productId.

5. What is a SKU?

SKU is a Stock Keeping Unit which is the actual item deliverable.

6. What is the Catalog hierarchy?

Standard Catalog

Category

Product

SKU

Custom Catalog

Catalog

Category

Product

SKU

7. How do you display a Catalog?

Standard Catalog

First, we can use OOTB RootCategories targeter using TargetingForEach droplet which will get all the root categories of the catalog which root property is set to true.

Custom Catalog

We will get the user’s catalog from the Profile.catalog.allRootCategories property and pass to the ForEach droplet.

After getting the root categories in any of the above case, use CategoryLookup droplet to lookup categories, ProductLookup droplet to lookup products, and SKULookup droplet to lookup skus.

We will get the item ids and pass between the pages to display its details. For example, we will pass the categoryId in the anchor tag in home page. When the user clicks on the link, the user will be redirected to the category details Page where we use CategoryLookup droplet by taking the request parameter catoryId. Here will get all the child products. Similarly we will set the productId in the anchor tag and pass it to the product details page where we use ProdyctLookup droplet to display the selected product details.

8. What is the difference between Standard Catalog & Custom Catalog?

The standard catalog is the single catalog shown to all users. Each user sees the same set of categories and products.

The custom catalog allows us to create multiple catalogs which are intended to show differently to different users. We can target a catalog to a specific user or an organization depending upon the business rules.

For example, we can create a separate catalog for each country based on locale. Each locale will be having a separate catalog.

9. What are the steps to create a new commerce item type in the order repository definition?

First in the orderReposiry.xml, create an item descriptor by extending the default commerce item using inheritance concept such specifying super-type and sub-type. And adding the new properties with new table under this item descriptor.

Next we will create a new java bean by extending the CommerceItemImpl and adding setters and getters for the properties created in the new commerce item item descriptor.

Next we will specify the new commerce item details in the OrderTools.properies. We will specify commerceItemTypeClassMap and beanNameToItemDescriptorMap

10. How do u create the newly created commerce item type into the order?

We will setup a map of sku item types to the commerce item types in the CommerceItemManager.properties. Then we will override the CommerceItemManager’s createCommerceItem method. We will take the skuId (catalogRefId) and find its SKU item type and then from this name we will look up the map values in the CommerceItemManager.properties to search for its related commerceItem type to create.

No comments:

Post a Comment

Thanks for your comment. Please be genuine, do not spam, Comments posted with links will be considered as spam.