Sun Java System Portal Server 6 2004Q2 Developer's Guide |
Chapter 15
Defining Custom Registration ValidatorsThis chapter describes how to develop the registration validator. It contains the following sections:
Implementing the RegistrationValidator Interface
- Implement the RegistrationValidator interface. For example, see Code Example 15-1 for the DefaultRegistrationValidator class implementation:
- Compile the class file. To compile, type:
javac -classpath portal-server-install-root/SUNWps/sdk/wsrp/wsrpsdk.jar:/portal-server-install-root/SUNWam/ lib/am_sdk.jar RegistrationValidatorImplementation.java
When compiling the class file, include the Identity Server SDK JAR file (identity-server-install-root/SUNWam/lib/am_sdk.jar) as it includes the debug class.
Installing the Class FileInstall the class file on the Portal Server host. Deploy it in to the portal war file.
To install via the web container war file:
- Copy your class file into portal’s WAR staging area.
The portal’s WAR staging area is typically /opt/SUNWps/web-src. If you have a standalone class file, copy the file into portal-server-install-root/SUNWps/web-src/WEB-INF/classes directory; if you have a JAR file, copy it into portal-server-install-root/SUNWps/web-src/WEB-INF/lib directory.
- Redeploy the web container. To redeploy, type portal-server-install-root/SUNWps/bin/deploy redeploy -deploy_admin_password password.
You can customize the return codes and then redeploy the web container. See For example, type com.sun.portal.wsrp.producer.registration.validator.impl.RegistrationValidatorImplementation. for more information.
Customizing the Return Codes
- Log in to the Portal Server host and change directories to portal-server-install-root/SUNWps/web-src/WEB-INF/classes directory.
- Modify the WSRP administration module’s properties file, psWSRPProducerAdmin.properties.
- Add entries for the return codes for the newly installed registration validator.
The format of the resource key should be: classname code=message. For example, com.sun.portal.wsrp.producer.registration.validator.impl.RegistrationValidatorImplementation -1=Missing Or Empty Registration Property.
- Redeploy the web application. To redeploy, use the portal-server-install-root/SUNWps/bin/deploy redeploy -deploy_admin_password password command.
Configuring the Producer’s Registration ValidatorTo administer the producer:
- Log in to the administration console and navigate to the producer’s administration page.
To navigate to the producer’s administration page, you must select Services from the View pull-down menu —> WSRP Producers —> Edit Properties for the producer.
- Specify the fully qualified class name of the newly created class file (implementation of the RegistrationValidator interface) in the Registration Validator Class text field and select Save.
For example, type com.sun.portal.wsrp.producer.registration.validator.impl.RegistrationValidatorImplementation.
- If you wish to add, remove or modify the registration properties that the producer defines: