Sun Java System Portal Server 7.1 Developer's Guide

ProviderEditTypes Interface

The ProviderEditTypes interface defines the edit types that can be returned from the Provider.getEditType() method. The edit type informs a client of a provider object what it can expect to be returned from the provider’s getEdit() method. The edit type can be EDIT_COMPLETE or EDIT_SUBSET.

See the Javadocs for more information on the methods in this interface.

PropertiesFilter Class

The PropertiesFilter abstract class, when extended, can describe a specific filter criteria. To implement a specific filter, one must minimally implement the getCondition() and match() methods in the PropertiesFilter abstract class.

Out of the box, the Portal Server software includes filters based on locale and client. The locale and client filter extend the PropertiesFilter abstract class and includes an implementation of the getCondition() and match() methods in the PropertiesFilter class. See the Javadoc for more details.

TypedException

TypedException is a Public Application Programming Interface (API), which the users can implement to create a user defined exception class. This interface helps to generate context related error messages rather than generic error messages. The user exception that implements TypedException can be thrown from the JSP incase of any error and the desktopservlet can display the proper error template according to the exception type set in the user exception.

The exception types defined in the TypedException interface are:

Provider Exceptions

The Desktop expects a provider to only throw ProviderException or a subclass of the ProviderException. For correct operation, a provider must only throw expected exception type. That is:

Exceptions from providers are logged in PortalServer-DataDir/portals/portal-ID/logs/portal-instance/portal.0.0.log file. Note that this file is created only if there is an error.

ProviderException Class

The ProviderException is a generic superclass for all provider related exceptions.

AsciiFormInputExpectedException Exception

The AsciiFormInputExpectedException will be thrown from Provider.processEdit() method when something other than ASCII only encoded form input is sent to it.

InvalidEditFormDataException Exception

The InvalidEditFormDataException is thrown from the Provider.processEdit() method when there is an error in the data input by the user. If thrown, the Desktop will send back the same Edit page, and will attach the exception’s message as a parameter to the URL. For example, if the exception is:

throw new InvalidEditFormDataException("Error Error");

the Desktop will redirect back to the same Edit page, adding the error message to the URL error parameter:

error=Error Error

The edit page wrapper then looks for the error parameter in the URL and if present, displays the message (or the value of the error parameter) at the top of the page in red.

UnknownEditTypeException Exception

The UnknownEditTypeException may be thrown from Provider.getEditType() method if an unknown or undefined edit type is encountered.