ATG Consulting Interview

Today I had the most detailed but at same time most interesting ATG consulting interview yet. Here are the questions I was asked with answers when appropriate in italics.

  1. Which versions of ATG have you worked with?
  2. What parts of ATG’s stack have you worked with?
  3. How do you compare ATG with Ruby on Rails?
  4. What is Nucleus?
  5. What is the ATG Repository?
  6. When creating form handlers typically what ATG base class do you extend?
  7. When creating droplets what ATG base class do you extend?
  8. What form handlers and methods do you use during checkout? ShoppingCartFormHandler, numerous handlers like handleMoveToConfirm, etc.
  9. What does a user typically see during checkout? Add to shopping cart, login, billing and shipping address, payment, confirm, confirmation, email confirmation, shipped email.
  10. How do you compare strings in Java? If String a = “hello” and String b= “hello” what is a == b? True, a and b both reference the same constant string.

In another interview I was asked these questions.

  1. What is HTTP? How does it work?
  2. If HTTP is stateless then how does a web application maintain state. Product Display Integration

Last year for Casual Male I did the Product Display Integration (PDI) which allows Casual Male to sell its products on

The integration involved three steps.

  1. Access all the products organized by category using ATG’s GSA Repository.
  2. Export the products into an XML file according to the PDI DTD using the XStream library.
  3. FTP upload to’s servers using Apache Commons Net library.

Persisting Orders

When troubleshooting orders it is really helpful to be able to view the order in the ACC.

By default orders are saved because persistOrders property of the /atg/commerce/ShoppingCart component is set to true. If you don’t see incomplete orders being saved then this means this property is not set to true.

More information on Troubleshooting Order Problems can be found in the ATG Commerce Programming Guide.

DistributorSender startup warning

When starting ATG instances with the DCS module I will often see this warning.

DistributorSender No remote servers configured

This is because in the product catalog two item descriptors, media-internal-binary and media-internal-text, are configured to use the Dynamo content distributor system if it is available. This is documented in the Using Content Distribution with a SQL Content Repository section of the ATG Dynamo Programming Guide.

Since out of the box the Dynamo content distributor system is not configured we see the above warning. To turn it off simply set loggingWarning=false for the /atg/commerce/catalog/ContentDistributorPool component.

Creating Buy N Get M Free Promotions

parents for sale, buy one get one free | FlickrATG’s promotion engine is pretty advanced and relatively easy to use for creating promotions as described in their Creating Promotions section in the Commerce Programming Guide.

ATG’s documentation gives numerous examples of how to create buy N get M free promotions.

For example to create a simple Buy 2 Get 1 Free promotion one would create the following rule.

“For next 2 items whose product is in the category named Foo, discount up to 1 item whose product is in the category named Foo”

The only issue with the above rule is that you cannot set conditions on customers. If you need to set conditions on customers then you have create a rule like this.

“When order contains at least 3 items whose product is in the category named Foo and at most 5 items whose product is in the category named Foo and customer’s name is Frank, discount up to 1 item whose product is in the category named Foo”

Note you will have to create separate promotions for each level, i.e. one for the 3 for 1, one for the 6 for 2, one for the 9 for 3, etc.

Also if you change a promotion I believe you have to restart the ATG server otherwise at least the current customers will still be using the old promotion.

CommerceItem, which one is the SKU ID?

Colors | Flickr

Colors by CurveTo

The CommerceItem has two properties, catalogRefId and catalogId.

I always forget which one is which so I am writing this post so I can remember. I guess it was because some companies have different conventions about SKU’s and products.

ATG Real World
catalogRefId SKU ID
catalogId Product ID

Maybe one day someone will explain the reason for the naming.

Note that sometimes the catalogId is null though I’ve never seen the catalogRefId be null.

You can also try to get the product ID by using the auxiliaryData property. This property has a productId property.