<?xml version="1.0" encoding="UTF-8"?>

<!--

 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to you under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

-->

<!--

    DTD for dialog definitions used by the "org.apache.shale.dialog2" package.
    To support validation of your configuration file, include the following
    DOCTYPE element at the beginning (after the "xml" declaration):
    
    <!DOCTYPE dialogs PUBLIC
      "-//Apache Software Foundation//DTD Shale Dialog Configuration 1.1//EN"
      "http://shale.apache.org/dtds/dialog-config_1_1.dtd">

-->


<!-- ====================== Top Level Elements ============================= -->


<!-- The "dialogs" element is the root of a single configuration file, and
     contains zero or more "dialog" elements defining the states and transitions
     for a particular dialog.
-->
<!ELEMENT dialogs (dialog*)>


<!-- The "dialog" element defines the states for a particular reusable dialog,
     which itself consists of zero or more states (of particular types).  The
     following attributes are defined:

     className                  Fully qualified class name of the configuration
                                object for this element.
                                [org.apache.shale.dialog.impl.DialogImpl]

     dataClassName              Fully qualified class name of a JavaBean class
                                to be instantiated as the initial value of the
                                "data" property when a new DialogContext is
                                initialized.  [java.util.HashMap]

     name                       Name of this dialog (must be unique among
                                all defined dialogs).

     start                      Name of the starting state for this dialog.
-->
<!ELEMENT dialog ((transition|action|end|subdialog|view|property)*)>
<!ATTLIST dialog                className       CDATA          #IMPLIED>
<!ATTLIST dialog                dataClassName   CDATA          #IMPLIED>
<!ATTLIST dialog                name            CDATA          #REQUIRED>
<!ATTLIST dialog                start           CDATA          #REQUIRED>


<!-- The "action" element represents an action state, which causes the
     invocation of a public method that takes no arguments, and returns
     the logical outcome as a String.  The following attributes are defined:

     className                  Fully qualified class name of the configuration
                                object for this element.
                                [org.apache.shale.dialog.impl.ActionStateImpl]

     name                       Name of this state (must be unique among
                                all states defined for this dialog).

     method                     Method binding expression ("#{...}") that
                                identifies a public method that takes no
                                arguments, and returns a String that represents
                                the logical outcome of this state.
-->
<!ELEMENT action (property|transition*)>
<!ATTLIST action                className       CDATA          #IMPLIED>
<!ATTLIST action                name            CDATA          #REQUIRED>
<!ATTLIST action                method          CDATA          #REQUIRED>


<!-- The "subdialog" element represents a transition to a subordinate
     dialog, saving the current state in the currently executing dialog
     on a stack.  When the subordinate dialog completes, the outcome it
     returns will be used to trigger a transition in this dialog.
     The following attributes are defined:

     className                  Fully qualified class name of the configuration
                                object for this element.
                                [org.apache.shale.dialog.impl.SubdialogStateImpl]

     name                       Name of this state (must be unique among
                                all states defined for this dialog).

     dialogName                 Name of the subordinate dialog to be
                                executed.

-->
<!ELEMENT subdialog (property|transition*)>
<!ATTLIST subdialog             className       CDATA          #IMPLIED>
<!ATTLIST subdialog             name            CDATA          #REQUIRED>
<!ATTLIST subdialog             dialogName      CDATA          #REQUIRED>


<!-- The "view" element represents a view state, which causes the rendering
     of the specified JavaServer Faces view.  When the subsequent submit from
     this view is returned, the outcome returned by whatever action method was
     invoked is returned in order to determine the next transition.  The
     following attributes are defined:

     className                  Fully qualified class name of the configuration
                                object for this element.
                                [org.apache.shale.dialog.impl.ViewStateImpl]

     name                       Name of this state (must be unique among
                                all states defined for this dialog).

     redirect                   Flag indicating that the transition to this
                                view should be done with a redirect, rather
                                than by calling ViewHandler.createView().

     viewId                     View identifier of the JavaServer Faces view
                                that should be rendered.  The logical outcome
                                returned by whatever action handles the
                                subsequent submit from this view will be used
                                to determine the next state transition.

-->
<!ELEMENT view (property|transition*)>
<!ATTLIST view                  className       CDATA          #IMPLIED>
<!ATTLIST view                  name            CDATA          #REQUIRED>
<!ATTLIST view                  redirect        CDATA          #IMPLIED>
<!ATTLIST view                  viewId          CDATA          #REQUIRED>


<!-- The "end" element represents a state that terminates a dialog.  If
     a view identifier is specified, it is rendered; otherwise, it is assumed
     that a parent dialog which invoked the current dialog will be responsible
     for producing the view for the current response.

     className                  Fully qualified class name of the configuration
                                object for this element.
                                [org.apache.shale.dialog.impl.EndStateImpl]

     name                       Name of this state (must be unique among
                                all states defined for this dialog).

     redirect                   Flag indicating that the transition to this
                                view should be done with a redirect, rather
                                than by calling ViewHandler.createView().

     viewId                     View identifier of the JavaServer Faces view
                                that should be rendered (if any).  The logical
                                outcome returned by whatever action handles the
                                subsequent submit from this view will be
                                returned to the parent dialog to drive its
                                own state transition.
-->
<!ELEMENT end (property|transition*)>
<!ATTLIST end                   className       CDATA          #IMPLIED>
<!ATTLIST end                   name            CDATA          #REQUIRED>
<!ATTLIST end                   redirect        CDATA          #IMPLIED>
<!ATTLIST end                   viewId          CDATA          #IMPLIED>


<!-- The "transition" element represents a state transition from the current
     state (in which this "transition" element is nested) to a subsequent
     state.  The following attributes are defined:

     className                  Fully qualified class name of the configuration
                                object for this element.
                                [org.apache.shale.dialog.impl.TransitionImpl]

     outcome                    Logical outcome String returned by the invoked
                                method (for an "action" element), or by the
                                invoked action's action method (for a "view"
                                element).

     target                     State name of the state to which control should
                                be transitioned.  Must match the "name"
                                attribute of a state defined in this dialog.
-->

<!ELEMENT transition (property)*>
<!ATTLIST transition            className       CDATA          #IMPLIED>
<!ATTLIST transition            outcome         CDATA          #REQUIRED>
<!ATTLIST transition            target          CDATA          #REQUIRED>


<!-- The "property" element allows the configuration of an arbitrary property
     of the base class (typically customized via the "className" attribute)
     instanace for the surrounding configuration element.  The following
     attributes are defined:

     name                       Property name to be configured.

     value                      String representation of the value to which
                                this property will be set.  Appropriate type
                                conversion will be applied, based on the type
                                of the underlying property.
-->

<!ELEMENT property EMPTY>
<!ATTLIST property              name            CDATA          #REQUIRED>
<!ATTLIST property              value           CDATA          #REQUIRED>
