Creating a validator
Follow these instructions to create a validation plug-in that is much like the
SimpleCampaignValidator
, but prevents the creation of campaigns that are called
"badCampaign2."
Procedure
-
Make a copy of the sample validator SimpleCampaignValidator.java in
<HCL_Unica_Home\Campaign_Home>\devkits\validation\src\com
\unica\campaign\core\validation\samples. Name the copy
MyCampaignValidator.java and leave it in the same directory as the
source. For example:
C:\HCL\Unica\Campaign\devkits\validation\src\com \unica\campaign\core\validation\samples\MyCampaignValidator.java
- Open MyCampaignValidator.java in an editor. Find the word "badCampaign" in the document and replace it with the word "badCampaign2."
- Save the file and close the editor.
-
Build the validators again. For details, see Building the validator. If your application server locks the
validate.jar
file while in use, stop the server before you build the validators. - Reconfigure campaign_config.xml to use your new class: <property name="validationClass" value="com.unica.campaign.core.validation.samples.MyCampaignValidator">
- Test the validator. For details, see Testing the validator configuration.