Portlet Factory, Version 6.1.2


 

Creating a handler definition

You can create a new handler definition by copying an existing handler definition file and saving it with a different name. To create a new handler definition:

  1. Copy one of the existing handler definitions in IBM® WebSphere Portlet Factory's WEB-INF/config/selection_handlers directory.

  2. Save the copied file with a new name, such as account_type_handler.xml.

  3. Set the values of the following elements:

    1. Handler. This is the name of the handler, which will be used as the display name in the Profile Manager to allow the user to select a handler for their profile set.

    2. Description A short description that specifies the functionality of the handler.

    3. Selection Set the class attribute to the name of the class that extends the BaseSelectionHandler class. Include the full package name (for example, com.acme.AccountTypeSelectionHandler).

    4. Optional: Properties These are name/value pair properties that will be passed as a map to the init(..) method of your ProfileSelection and SegmentList implementation classes.

    5. Optional: SegmentList class Set the class attribute to the name of the class that implements the SegmentList interface. The Profile Manager uses this class to get the list of segments for this handler. Include the full package name (for example, com.acme.AccountSegmentList).

    The following code sample is the handler definition file for the File Segment Handler:

    <Handler name="File Segment Handler">
    <Description>Handler that maps users to a segment using mapping data from a simple xml file.</Description>
    <Selection class="com.bowstreet.profiles.FileSegmentSelectionHandler">
    <Properties>
    <Property name="file">factory/profile_segment_data/segments.xml</Property>
    </Properties>
    </Selection>
    <SegmentList class="com.bowstreet.profiles.FileSegmentSelectionHandler" />
    </Handler>

    Note: As is the case with the FileSegmentSelectionHandler class, you can implement the ProfileSelection and SegmentList interfaces in the same class and specify that class as both the Selection class and SegmentList class.

Parent topic: About setting the profile selection handler


Library | Support |