<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- edited with XML Spy v2.5 NT  - http://www.xmlspy.com -->
<!--
     DTD for the eShell Mapper Configuration File, Version 1.0

     To support validation of your mapper configuration file, include the following
     DOCTYPE element at the beginning (after the "xml" declaration):

     <!DOCTYPE mapper-config SYSTEM
       "http://www.capco.com/eshell/dtds/mapper-config_1_0.dtd">
-->
<!-- ========== Defined Types ============================================= -->
<!-- A "Boolean" is the string representation of a boolean (true or false)
     variable.
-->
<!ENTITY % Boolean "(true|false)">
<!-- A "ClassName" is the fully qualified name of a Java class that is
     instantiated to provide the functionality of the enclosing element.
-->
<!ENTITY % ClassName "CDATA">
<!-- An "Integer" is a character string consisting solely of numeric digits,
     optionally preceeded by a minus sign, that can be converted to a
     32-bit integer.
-->
<!ENTITY % Integer "CDATA">
<!-- A "InstanceName" is the identifier of an object instance, such as a converter.
     It must conform to the rules for a Java identifier.
-->
<!ENTITY % InstanceName "CDATA">
<!-- A "PropName" is the name of a JavaBeans property, and must begin with
     a lower case letter and contain only characters that are legal in a
     Java identifier.
-->
<!ENTITY % PropName "CDATA">
<!-- ========== Top Level Elements ======================================== -->
<!-- The "mapper-config" element is the root of the configuration file
     hierarchy, and contains nested elements for all of the other
     configuration settings. Attributes defines general settings for
     the mapper. The following attributes are defined:

     mapperClass            Fully qualified class name of the Mapper implementation
                     class to use (must extend com.capco.eshell.mapper.Mapper).
                     Defaults to "com.capco.eshell.mapper.Mapper".

     mappedObjectClass            Fully qualified class name of the MappedObject
                     class to use (must extend com.capco.eshell.mapper.MappedObject).
                     Defaults to "com.capco.eshell.mapper.MappedObject".

     mappingWithConverterClass Fully qualified class name of the Mapping implementation
                     class to use for standard mappings (those using a converter).
                     It must extend com.capco.eshell.mapper.MappingWithConverter.
                     Defaults to "com.capco.eshell.mapper.MappingWithConverter".

     fieldMappedWithConverterClass Fully qualified name of the class to instantiate
                     for fields of a standard mapping. It must extend
                     com.capco.eshell.mapper.FieldMappedWithConverter.
                     Defaults to "com.capco.eshell.mapper.FieldMappedWithConverter".

     mappingWithMapperClass Fully qualified class name of the Mapping implementation
                     class to use for mappings using a nested mapper.
                     It must extend com.capco.eshell.mapper.MappingWithMapper.
                     Defaults to "com.capco.eshell.mapper.MappingWithMapper".

     fieldMappedWithMapperClass Fully qualified name of the class to instantiate
                     for fields of a mapping using a nested mapper. It must extend
                     com.capco.eshell.mapper.FieldMappedWithMapper.
                     Defaults to "com.capco.eshell.mapper.FieldMappedWithMapper".
-->
<!ELEMENT mapper-config (validators?, converters?, mappers? )>
<!ATTLIST mapper-config id             ID              #IMPLIED>
<!ATTLIST mapper-config mapperClass                                 %ClassName;      "com.capco.eshell.mapper.Mapper">
<!ATTLIST mapper-config mappedObjectClass                      %ClassName;      "com.capco.eshell.mapper.MappedObject">
<!ATTLIST mapper-config mappingWithConverterClass         %ClassName;      "com.capco.eshell.mapper.MappingWithConverter">
<!ATTLIST mapper-config fieldMappedWithConverterClass   %ClassName;      "com.capco.eshell.mapper.FieldMappedWithConverter">
<!ATTLIST mapper-config mappingWithMapperClass             %ClassName;      "com.capco.eshell.mapper.MappingWithMapper">
<!ATTLIST mapper-config fieldMappedWithMapperClass       %ClassName;      "com.capco.eshell.mapper.FieldMappedWithMapper">
<!-- The "validators" element describes a set of validator objects which will be
configured according to the nested "validator" elements found inside.
-->
<!ELEMENT validators ( validator* )>
<!ATTLIST validators id             ID              #IMPLIED>
<!-- The "validator" element describes an instance of a validator class to be instantiated
and initialized. When loading the configuration file, each defined validator is created and
initialized, and then registered using the name provided in the "name" attribute.
The following attributes are defined:

     name            The name of the validator. This name uniquely identifies a validator
                     instance.  [REQUIRED]
     className            Fully qualified Java class name of the implementation
                     class (must implement com.capco.eshell.mapper.Validator).
                     [REQUIRED]
-->
<!ELEMENT validator (set-property*)>
<!ATTLIST validator id             ID              #IMPLIED>
<!ATTLIST validator className      %ClassName;      #REQUIRED>
<!ATTLIST validator name               %InstanceName;  #REQUIRED>
<!-- The "converters" element describes a set of converter objects which will be
configured according to the nested "converter" elements found inside.
-->
<!ELEMENT converters ( converter* )>
<!ATTLIST converters id             ID              #IMPLIED>
<!-- The "converter" element describes an instance of a converter class to be instantiated
and initialized. When loading the configuration file, each defined converter is created and
initialized, and then registered using the name provided in the "name" attribute.
The following attributes are defined:

     name            The name of the converter. This name uniquely identifies a converter
                     instance.  [REQUIRED]
     className            Fully qualified Java class name of the implementation
                     class (must implement com.capco.eshell.mapper.Converter).
                     [REQUIRED]
-->
<!ELEMENT converter (set-property*)>
<!ATTLIST converter id             ID              #IMPLIED>
<!ATTLIST converter className      %ClassName;      #REQUIRED>
<!ATTLIST converter name               %InstanceName;  #REQUIRED>
<!-- The "mappers" element describes a set of mapper objects which will be configured
according to the nested "mapper" elements found inside.
-->
<!ELEMENT mappers ( mapper* )>
<!ATTLIST mappers id             ID              #IMPLIED>
<!-- The "mapper" element describes an instance of a mapper class to be instantiated and
initialized. When loading the configuration file, each defined mapper is created and
initialized, and then registered using the name provided in the "name" attribute.
The following attributes are defined:

     name            The name of the converter. This name uniquely identifies a converter
                     instance.  [REQUIRED]

     className            Fully qualified Java class name of the implementation
                     class to use (must extend com.capco.eshell.mapper.Mapper).
                     Defaults to "com.capco.eshell.mapper.Mapper".

     stateClassName            Fully qualified Java class name of the implementation
                     class to use for storing the mapper state (must extend
                     com.capco.eshell.mapper.MapperState).
                     Defaults to the value set in the attribute of the "mapper-config" root element.
-->
<!ELEMENT mapper (set-property*, display-name?, description?, set-property*, mapped-objects, mappings )>
<!ATTLIST mapper id             ID              #IMPLIED>
<!ATTLIST mapper name                       %InstanceName;  #REQUIRED>
<!ATTLIST mapper className              %ClassName;      #IMPLIED>
<!ATTLIST mapper stateClassName      %ClassName;      #IMPLIED>
<!-- The "mapped-objects" element describes a set of objects that are participating in a
mapping. Each participating object is defined in a nested "mapped-object" element.-->
<!ELEMENT mapped-objects (set-property*, mapped-object+ )>
<!ATTLIST mapped-objects id             ID              #IMPLIED>
<!-- The "mapped-object" element describes an object participating in the mapping.
Before using a mapper, each participating object should be initialized with
a reference to an actual object instance. A participating object is uniquely identified
within a mapper by a name provided in the "name" attribute.
The following attributes are defined:

     name            The name of the object. This name uniquely identifies a participating
                     object. [[REQUIRED]

     getter          The fully qualified name of the getter class to use for getting a
                      field from this participating object (must be implementing 
                      com.capco.eshell.mapper.Getter). If no class is specified, the Struts
                      PropertyUtils.getProperty() method is used. This setting can be
                      overriden in each individual mapping (through a similar attribute
                      in the "source" element).

     setter          The fully qualified name of the setter class to use for setting a
                      field on this participating object (must be implementing 
                      com.capco.eshell.mapper.Setter). If no class is specified, the Struts
                      PropertyUtils.setProperty() method is used. This setting can be
                      overriden in each individual mapping (through a similar attribute
                      in the "dest" element).

     create          Set to "true" if this object should be created when one of its field
                     is set fo the first time, or "false" otherwise, in which case a valid
                     object reference must be set before using the mapper. Default is
                     "false". If set to "true", the creator class is invoked with the value
                     of the "objectClass" attribute passed as argument, or null if it is
                     not set.

     objectClass  The fully qualified name of the class to instantiate for creating an
                      instance of this participating object. This class name is passed as
                      an argument to the "creator" class. When not specified, the creator
                      class receives a null value as parameter.

    className            Fully qualified Java class name of the implementation
                     class to use (must extend com.capco.eshell.mapper.MappedObject).
                     Defaults to the value set in the attribute of the "mapper-config" root element.
-->
<!ELEMENT mapped-object (set-property*, creator?)>
<!ATTLIST mapped-object id             ID              #IMPLIED>
<!ATTLIST mapped-object name               %InstanceName;  #REQUIRED>
<!ATTLIST mapped-object getter              %ClassName;       "com.capco.eshell.mapper.util.JavaBeanGetter">
<!ATTLIST mapped-object setter              %ClassName;       "com.capco.eshell.mapper.util.JavaBeanSetter">
<!ATTLIST mapped-object create             %Boolean;            "false">
<!ATTLIST mapped-object objectClass     %ClassName;       #IMPLIED>
<!ATTLIST mapped-object className      %ClassName;       #IMPLIED>
<!-- The "creator" element specifies the class to use for creating an instance of the
participating object. This class is only used if the "create" attribute of the parent
mapped-object element is set to "true". If no class is specified and the "create"
attribute is set to "true", the default constructor of the participating object is called.
The following attributes are defined:

     className  The fully qualified name of the creator class to use for creating an
                      instance of this participating object (must be implementing 
                      com.capco.eshell.mapper.Creator). 

-->
<!ELEMENT creator ( set-property* )>
<!ATTLIST creator id             ID              #IMPLIED>
<!ATTLIST creator className      %ClassName;      "com.capco.eshell.mapper.util.JavaBeanCreator">
<!-- The "mappings" element describes a set of mappings between fields of the
participating mapped objects. Each mapping is defined in a nested "mapping" element.
A special kind of mapping is one that makes the use of another mapper. These
special mappings are defined in a nested "nested-mapper" element.
The following attributes are defined:

     iteratorClass            Fully qualified Java class name of the iterator implemention
                     class (must implement com.capco.eshell.mapper.MappingsIterator).
                     The execution of a mapper corresponds to the execution of each of
                     its mapings  in the order given by this iterator. When not specified, 
                     the order in which mappings are declared in this element defines the
                     order in which they are executed.
-->
<!ELEMENT mappings ( (mapping|nested-mapper)+ )>
<!ATTLIST mappings id             ID              #IMPLIED>
<!ATTLIST mappings iteratorClass     %ClassName;       #IMPLIED>
<!-- The "mapping" element describes a mapping between fields of object participating
in the mapping. Such mapping make the use of a converter instance that
takes all the source values and creates an object that is then used to populate
all the destination fields. Source values and destination fields are defined within nested
"source" and "dest" elements.
IMPORTANT: the order in which source values are declared in this element defines their
order in the array of object passed to the converter as argument.

The following attributes are defined:

    converter        The name of the converter to use. This name must be the name
                     of a converter instance registered in the "converters" element of the
                     mapper.  If not provided, the first source field or object is just copied
                     to the destination(s) specified. The name "copy" cannot be used as it
                     is the name of the default converter.

    name        The name of this mapping. Named mapping can be retrieved by their
                     name, making it possible to execute them in a order that is different
                     from the order in which they are declared in the configuration file.
                     If not provided, the mapping is "anonymous" and can only be
                     retrieved by its position in the configuration file.

    required    Set to "true" if  the source values cannot be all null. Defaults to "true".

    optional     Set to "true" if  the source values can be all null. Defaults to "false".

    setToNull  Set to "true" to set the dest fields to null when all source values arel null.
                     Defaults to "true".

    className            Fully qualified Java class name of the implementation
                     class to use (must extend com.capco.eshell.mapper.MappingWithConverter).
                     Defaults to the value set in the attribute of the "mapper-config" root element.
-->
<!ELEMENT mapping (set-property*, source+, dest+, validation? )>
<!ATTLIST mapping id             ID              #IMPLIED>
<!ATTLIST mapping name                   %InstanceName;     #IMPLIED>
<!ATTLIST mapping converter            %InstanceName;     "copy">
<!ATTLIST mapping required               %Boolean;     "true">
<!ATTLIST mapping optional                %Boolean;     "false">
<!ATTLIST mapping setToNull              %Boolean;     "true">
<!ATTLIST mapping className          %ClassName;     #IMPLIED>
<!-- The "nested-mapper" element is a special mapping whereby source values
become the participating objects of a nested mapper. This nested mapper takes
the role of a converter: once the nested mapper has been executed, one of its
participating object becomes the result of this mapping and will be used to populate
all the destination fields defined in this mapping.

The following attributes are defined:

    mapperName    The name of the nested mapper. This name must be the name
                     of a mapper instance registered in the "mappers" element of this
                     configuration file.  [REQUIRED]

    resultObjectName The name of the nested mapper participating object that should
                    be considered as the result value of this mapping. This name must be the name
                    of a "mapped-object" defined in the nested mapper.  [REQUIRED]

    className            Fully qualified Java class name of the implementation
                     class to use (must extend com.capco.eshell.mapper.MappingWithMapper).
                     Defaults to the value set in the attribute of the "mapper-config" root element.
-->
<!ELEMENT nested-mapper ( set-proprety*, source+, dest+, validation?  )>
<!ATTLIST nested-mapper id             ID              #IMPLIED>
<!ATTLIST nested-mapper mapperName NMTOKEN #REQUIRED>
<!ATTLIST nested-mapper resultObjectName NMTOKEN #REQUIRED>
<!ATTLIST nested-mapper className          %ClassName;     #IMPLIED>
<!-- The "source" element defines a source value that is part of a mapping.
The following attributes are defined:

    objectName    The name of the source object. This name must be
                     the name of a "mapped-object" registered for this mapper. If not
                     specified, this defaults to "source".

    fieldName    The name of a field on the source object. When not provided, the
                    participating object itself is used as a source value.

    getter          The fully qualified name of the getter class to use for getting this
                      field  (must be implementing com.capco.eshell.mapper.Getter).
                      If no class is specified, the getter for the participating object
                      is used. This attributes overrides the value specified for the
                     corresponding mapped-object  (through a similar attribute
                      in the "mapped-object" element).

    mapperObjectName The name of the nested mapper participating object that should
                    be associated with this source value. This name must be the name
                    of a "mapped-object" defined in the nested mapper.  This attribute
                    is only allowed and required for "source" elements that are within a
                    "nested-mapper" element.

    className     Fully qualified Java class name of the implementation  class to use.
                    This class must extend com.capco.eshell.mapper.FieldMappedWithConverter
                    when within a "mapping" element,  or it must extend
                    com.capco.eshell.mapper.FieldMappedWithMapper when within a "nested-mapper" element.
                    Defaults to the value set in the attribute of the "mapper-config" root element.
-->
<!ELEMENT source (set-property*)>
<!ATTLIST source id             ID              #IMPLIED>
<!ATTLIST source objectName     %InstanceName;   "source">
<!ATTLIST source fieldName        %PropName;   #IMPLIED>
<!ATTLIST source mapperObjectName  %InstanceName;   #IMPLIED>
<!ATTLIST source getter              %ClassName;      #IMPLIED>
<!ATTLIST source className          %ClassName;     #IMPLIED>
<!-- The "dest" element defines the destination of a mapping.
The following attributes are defined:

    objectName    The name of the destination object. This name must be
                     the name of a "mapped-object" registered for this mapper. If not
                     specified, this defaults to "dest".

    fieldName    The name of a field on the destination object. When not provided,
                    object value resulting of this mapping becomes the object registered
                    with the name in the "objectName" attribute.

    setter          The fully qualified name of the setter class to use for setting
                      this field (must be implementing com.capco.eshell.mapper.Setter).
                      If no class is specified, the setter for the participating object
                      is used. This attributes overrides the value specified for the
                     corresponding mapped-object  (through a similar attribute
                      in the "mapped-object" element).

    className            Fully qualified Java class name of the implementation
                     class to use. This class must extend com.capco.eshell.mapper.FieldMappedWithConverter
                     when within a "mapping" element,  or it must extend
                     com.capco.eshell.mapper.FieldMappedWithMapper when within a "nested-mapper" element.
                     Defaults to the value set in the attribute of the "mapper-config" root element.
-->
<!ELEMENT dest (set-property*)>
<!ATTLIST dest id             ID              #IMPLIED>
<!ATTLIST dest fieldName        %PropName;   #IMPLIED>
<!ATTLIST dest objectName     %InstanceName;   "dest">
<!ATTLIST dest setter              %ClassName;  #IMPLIED>
<!ATTLIST dest className      %ClassName;     #IMPLIED>
<!-- The "validation" element contains the validation to be applied before executing the
converter or nested mapper. The body of this element must be following the grammer
defined in the package com.capco.eshell.mapper.parser.
-->
<!ELEMENT validation (#PCDATA)>
<!ATTLIST validation id             ID              #IMPLIED>
<!-- The "set-property" element specifies the name and value of an additional
     JavaBeans configuration property whose setter method will be called
     on the object that represents our surrounding element.  This is especially
     useful for initializing converter instances.
     The following attributes are defined:

     property        Name of the JavaBeans property whose setter method
                     will be called. [REQUIRED]

     value           String representation of the value to which this
                     property will be set, after suitable type conversion.
                     [REQUIRED]
-->
<!ELEMENT set-property EMPTY>
<!ATTLIST set-property id             ID              #IMPLIED>
<!ATTLIST set-property property       %PropName;      #REQUIRED>
<!ATTLIST set-property value          CDATA           #REQUIRED>
<!-- ========== Subordinate Elements ====================================== -->
<!-- The "description" element contains descriptive (paragraph length) text
     about the surrounding element, suitable for use in GUI tools.
-->
<!ELEMENT description (#PCDATA)>
<!ATTLIST description id             ID              #IMPLIED>
<!-- The "display-name" element contains a short (one line) description of
     the surrounding element, suitable for use in GUI tools.
-->
<!ELEMENT display-name (#PCDATA)>
<!ATTLIST display-name id             ID              #IMPLIED>
<!-- The "icon" element contains a small-icon and large-icon element which
     specify the location, relative to the Struts configuration file, for small
     and large images used to represent the surrounding element in GUI tools.
-->
