ATG Config Path

This is generally "config" folder in your ATG module.(If you used the default setting)The Config path define in file "MANIFEST.MF" in "META-INF" folder of your ATG module.

NOTE: nucleus specific properties are prefixed by a $ sign. (for example; $scope=global or $class=com.jungle.Animal)

Setting Properties
Properties can be set using "=" sign or ":" sign. For example:-
Name=Lion
Age:15
Also, array/collection properties can be set in comma separated format. For example, a java class defines a property
ArrayList careList; //In java code follows...
In this case, the value of list carsList can be set using configuration files in comma-separated format as:-
carsList=Honda, Skoda, Mercedes
 Or, we can write in multiple lines, we can do this by adding "\" at the end of each line as Like:-
Carslist=\
      Honda,\
      Skoda,\
      Mercedes,\


NOTE: white-spaces are ignored in the beginning and end of a line. Also, in below case, white-spaces are ignored.(Name=Lion and Name=  Lion) are treated in the same way. (White-space before and after "=" is ignored. Same would be the case, if we use ":" in place of "=")

Similar to how collection/array properties are set in configuration files, we can also set properties which implement the "Map" interface. For a map property specified in java file:-
Map carMap; //In Java
carMap=\
      Honda=affordable,\
      Skoda=costly,\
      Mercedes=in-my-dreams
The above block initializes the "carMap" map, with above key-value pairs.
A component can also refer to another component depending on .For example, there is a component "/atg/commerce/Weather" which needs to be used (and referenced) by our "animal" component. As discussed earlier, "Weather" component's configuration file must be placed in config-path, inside the folder structure /atg/commerce/Weather.properties.
In this case, Animal.java should look like:-
Public class Animal{
String name;
int age;

Weather weather;
And the configuration file (Animal.properties) would look like below. Please note the "weather" property. It contains the full path of the Weather component.
$class=Animal
Name=Lion
Age=15

Weather=/atg/commerce/Weather

No comments: