<?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.

  $Id: dialog-config.xml 462838 2006-10-11 16:08:36Z rahul $

-->

<!--

  Dialog definitions for Shale Use Cases Example Web Application

-->

<!DOCTYPE dialogs PUBLIC
  "-//Apache Software Foundation//DTD Shale Dialog Configuration 1.0//EN"
  "http://struts.apache.org/dtds/shale-dialog-config_1_0.dtd">

<dialogs>


  <!-- Log On / Create Profile Dialog -->
  <dialog                name="Log On"
                        start="Check Cookie">

    <action              name="Check Cookie"
                       method="#{profile$logon.check}">
      <transition     outcome="authenticated"
                       target="Exit"/>
      <transition     outcome="unauthenticated"
                       target="Logon Form"/>
    </action>

    <view                name="Logon Form"
                       viewId="/profile/logon.jsp">
      <transition     outcome="authenticated"
                       target="Exit"/>
      <transition     outcome="create"
                       target="Create Profile"/>
    </view>

    <subdialog           name="Create Profile"
                   dialogName="Edit Profile">
      <transition     outcome="success"
                       target="Exit"/>
    </subdialog>

    <end                 name="Exit"
                       viewId="/usecases.jsp"/>

  </dialog>


  <!-- Edit Profile Dialog -->
  <dialog                name="Edit Profile"
                        start="Setup">

    <!-- Global transitioh definitions -->
    <transition       outcome="cancel"
                       target="Cancel"/>
    <transition       outcome="finish"
                       target="Finish"/>

    <action              name="Setup"
                       method="#{profile$edit.setup}">
      <transition     outcome="success"
                       target="Page 1"/>
    </action>

    <view                name="Page 1"
                       viewId="/profile/profile1.jsp">
      <transition     outcome="next"
                       target="Page 2"/>
    </view>

    <view                name="Page 2"
                       viewId="/profile/profile2.jsp">
      <transition     outcome="next"
                       target="Page 3"/>
      <transition     outcome="previous"
                       target="Page 1"/>
    </view>

    <view                name="Page 3"
                       viewId="/profile/profile3.jsp">
      <transition     outcome="next"
                       target="Exit"/>
      <transition     outcome="previous"
                       target="Page 2"/>
    </view>

    <action              name="Cancel"
                       method="#{profile$edit.cancel}">
      <transition     outcome="success"
                       target="Exit"/>
    </action>

    <action              name="Finish"
                       method="#{profile$edit.finish}">
      <transition     outcome="password"
                       target="Page 1"/>
      <transition     outcome="success"
                       target="Exit"/>
      <transition     outcome="username"
                       target="Page 1"/>
    </action>

    <end                 name="Exit"
                       viewId="/usecases.jsp"/>

  </dialog>


</dialogs>
