When your application creates a profile marker, the only information you are required to provide is a value to the key
property. You may prefer that your profile markers conform to stricter standards, for example: all markers must have a key
value of at least six characters. Or, your validation requirements may be based on application-specific business logic that is unrelated to marker properties. Create a validation class that enforces the validation standards appropriate for your profile markers.
The validation standards you define might vary based on the type of profile marker: profile markers with key
X must have a value for key
and value
where as profile markers with key
Y must have a Date value for expirationDate
, which is a custom property you defined. You must match each validation component to a key
; there is no way to create one validation component for all profile markers created by a given Profile Marker Manager.
Follow these steps to define new validation standards:
Create a class for each set of validation standards. This class should implement the
atg.markers.MarkerValidatorContainer
interface. Create a component of each class.Update the Profile Marker Manager
markerValidators
map property to use each validation component you defined: set the key to the profile markerkey
value and thevalue
to a validation component. For example:
markerValidators=X=/atg/KeyXValidator,Y=/atg/KeyYValidator
Toggle the Profile Marker Manager
alwaysValidate
property totrue
only if you have defined a validation component for each possiblekey
. If not, keep this set tofalse
: those profile markers that are mapped to validation components will use them regardless.If your validation standards require profile marker properties in addition to
key
,value
, anddata
to be populated, add those property names to the Profile Marker Manager componentrequiredExtendedProperties
property.