See also: Writing Registry Plugins and Identifier Validation
FooIdentifierValidator
.FooIdentifierValidator
model and a corresponding controller (FooIdentifierValidatorsController
).belongTo CoIdentifierValidator
.SIVController
.foo_identifier_validators
table will be created. There is no add
operation or view required. The skeletal row will point to the parent CO Identifier Validator.foo_identifier_validator/foo_identifier_validators/edit/#
. This will be called immediately after the parent CO Identifier Validator is created.CoIdentifierValidator
has a hasOne
(ie: 1 to 1) relationship with FooIdentifierValidator
.foo_identifier_validators
should include a foreign key to co_identifier_validators:id
.foo_identifier_validators:id
.Identifier Validation Plugins may determine whether or not they should be instantiated. An instantiated Plugin requires configuration information, such as an LDAP server to query. A non-instantiated Plugin does not, such as a Plugin that determines if there are any non-ASCII characters in the identifier.
A plugin declares whether or not it needs to be instantiated in the FooIdentifierValidator model:
public $cmPluginInstantiate = true; |
If a Plugin is instantiated, then
The Plugin must implement a validation routine in the FooIdentifierValidator
model, with the following signature:
public function validate($identifier, $coIdentifierValidator, $coExtendedType, $pluginCfg=null) |
where
$identifier
type. Corresponds to cm_co_extended_types, but for Email Addresses and Identifiers only.If validate
determines the $identifier
to be acceptable/valid, it returns true
. Otherwise, the function should throw an exception in accordance with the type of error.
The message passed with the exception should be a localized string suitable for display to the user.