Sets cannot be used as property types

I create a JavaBean with a Set property because I wanted to enforce that there were only unique values in that Set.  However when I tried to use this JavaBean with a properties file, Nucleus complained it could not resolve the elements of the Set property.  When I changed the property to be a List or a String [] Nucleus had no problem.

Here is the properties file.

$class=com.betweengo.droplet.VerifyImages
$scope=request

# supported image dimensions
supportedImageDimensions=75x90,88x31,120x90

ATG Support pointed me to the Property Types subsection of the Using Nucleus
section of the ATG Programming Guide.  Specifically only these simple types are supported.  I am not sure why Set was excluded.

boolean
byte
char
short
int
long
float
double
java.lang.Boolean
java.lang.Byte
java.lang.Character
java.lang.Short
java.lang.Integer
java.lang.Long
java.lang.Float
java.lang.Double
java.lang.String
java.util.List
java.util.Map
java.util.Locale

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? GenericFormHandler.java
  7. When creating droplets what ATG base class do you extend? DynamoServlet.java
  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.

ATG does not allow property values with commas for String[] properties

Typically when you have a property of Strings, either an array or a collection, you would set them like this:

foos=hello,good-bye,this is a test

In the above example if the foos property is of type String [], then ATG initializes foos to { “hello”, “good-bye”, “this is a test” }.

However if one of the String’s has a comma in it then this method won’t work because ATG will treat the comma as a delimiter. For example if foos is configured like this:

foos=hello,good-bye,this is a test\, a big test

then foos is initialized to { “hello”, “good-bye”, “this is a test”, “a big test” }

To get around this apparent limitation, which is documented in Bug #29380, ATG provides a class called atg.core.util.StringList. If you set the type of the foos property to StringList and configure it like this:

foos=hello,good-bye,this is a test,, a big test

then fools will be initialized to { “hello”, “good-bye”, “this is a test, a big test” }. Note that “,,” is the method for escaping commas when using StringList.