Portlet Factory, Version 6.1.2
FileSegmentSelectionHandler
You use the File Segment Selection handler to select a profile for a user by matching their segment data to a matching profile segment within a specified profile set. The segment data for this handler is read in from an XML file that contains the mapping information.
Here is an example of the structure of the segment mapping data file that maps users to segments:
<segments> <segment name="Gold"> <user userID="msmith"/> </segment> <segment name="Silver"> <user userID="bjones"/> </segment> <segment name="English"> <user userID="msmith"/> <user userID="bjones"/> </segment> </segments>In the file above:
- segment name
- Defines and names a segment. Each segment can have zero or more users defined.
- user userID
- Maps the user to the parent segment element. The user ID is the name the user specified when authenticating themselves to the server.
The definition file for this handler is in located in: J2EERoot/WEB-INF/conf/selection_handlers/filesegmenthandler.xml.
The content of the handler definition file is as follows:
<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>The FileSegmentSelectionHandler implements both the ProfileSelection and SegmentList interfaces so it is specified as the Selection class and the SegmentList class.
The "file" property specified is relative to the J2EERoot\WEB-INF directory.
Parent topic: Using sample handlers
Library | Support |