Handler
From Plex-XML
A Handler in PleXML is a Java Class which maps parameters from a XML Request to a Bean calls the Bean a maps back the output values of the Bean call to a XML Response
Each Handler has to implement the Interface de.bodow.handler.Handler which is the case with the generated Handlers. the base classe de.bodow.plex.handler.BaseHandler implements the Interface already.
for Test purposes there is an implementation which simply maps back the parameters to returnvalues ( de.bodow.handler.EchoHandler)
for Plex Beans Handlers are derived from de.bodow.plex.handler.BaseHandler.
Each generated Handler (see Ant Targets) instantiates the specific Bean, maps the XML parameters, calls the Bean and maps back the results to a <response>-XML-Element:
- checks if the Attribute "name" of the <request>-Element is a valid request-name for this Handler
- instantiates the Bean which encapsulates the call to the Plex Function
- looks for a <parameter>-Element with Attribute name "locale" and set the Locale of the Bean to the value of its Attribute "value"
- tries to map <plex-parameter>-Elements to "set"-Methods of the Bean depending on these attributes:
- name : should contain the name of an input field of the Bean
- value : the value to pass to the input field as text
- format : optional, can contain a date or a number format used to convert the text value to the type of the Input field
- row : optional, if set the the input Field should be part of an Array, then it should be the index in the Array (starting with 1 as usual in Plex )
- calls the bean which means that the encapsulated Plex generated Function is called.
- copies all <parameter> Elements to the <response>-Element
- optionally copies the DOM Node created within the Plex Function into the <response>
- appends an <errorcode>-Element to the <response> with the value of a defined Output-Field or the Plex "*Returned Status"-Field
- maps back Fields of the Bean ( Output AND Input Fields of the Plex Function, see below ) to <returnvalue>-Elements with these Attributes:
- name : the name of the Field
- unformatted : the value of the Field as String
- value : the value of the Field formatted with the Locale of the bean (previously set) and optionally the Format for this Field applied in the <request>
- releases/destroys the Bean after a cleanup

