Configuration Modes
A gear can have up to four configuration modes:
UserConfig
InstanceConfig
InstallConfig
InitialConfig
These modes display forms that allow users, community leaders, and portal administrators to set a gear’s configuration parameters. A gear developer needs to create a link to a UserConfig
form. The remaining three configuration forms are invoked by the PAF’s administration utilities as needed.
Configuration Parameters
Gear configuration parameters are values that control the function or display of the gear. The following list indicates just a few examples of the many possible configuration parameters:
What types of users can edit documents
How many posts to display in a discussion
Which ATG repository to store data in
How often to update values
PAF Configuration Parameters
The PAF provides support for simple (String) configuration parameters, which are defined and registered within the PAF by means of the gear manifest XML file. If your gear requires more complex parameters (for example a list of forums a user is subscribed to), then you will need to implement these within the gear (for example, by means of a custom persistence implementation).
Accessing Configuration Parameters
Configuration parameters can be accessed by methods made available by the GearEnvironment
object created by the InitializeGearEnvironment
tag. The following methods provide access to instance parameters:
public String getGearInstanceParameter(String pName)
(Returns null
if the instance parameter is not found.)
public void setGearInstanceParameter(String pName, String pValue)
The following methods provide access to user parameters:
public String getGearUserParameter(String pName)
public void setGearUserParameter(String pName, String pValue)
When you request configuration parameter values and the parameter has not been set, then a default value will be returned. Default values can be obtained or set with the following methods:
public String getGearUserDefaultValue(String pName)
public void setGearUserDefaultValue(String pName, String pValue)
For more information, refer to the gear interfaces under the atg.portal.framework
package in the ATG API Reference.
GearConfigFormHandler
An extensible Gear Configuration form handler, atg.portal.framework.GearConfigFormHandler
, is provided with the PAF. This form handler can be used for setting gear instance parameters or user parameters. The Alert, Document Exchange, Repository View, and HTML Content (Screenscraper) gears each include examples of classes that extend the GearConfigFormHandler
, including source code.
For instructions on implementing gear configuration forms, refer to the Gear Configuration Page Fragments section in the Creating Gear Page Fragments chapter. For Javadoc on the GearConfigFormHandler
class, see the ATG API Reference.