<?xml version="1.0"?>

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

<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
                              "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">

<!--
  - JavaServer Faces Configuration.
  - All of the entries below are needed only for sample apps.
  -->
<faces-config>

  <!--
    - Hello Application Configuration
    -->

  <managed-bean>
    <managed-bean-name>hello</managed-bean-name>
    <managed-bean-class>org.apache.cocoon.faces.samples.Hello</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
  </managed-bean>

  <navigation-rule>
    <from-view-id>/samples/blocks/faces/hello</from-view-id>
    <navigation-case>
      <from-outcome>flip</from-outcome>
      <to-view-id>/samples/blocks/faces/goodbye</to-view-id>
    </navigation-case>
  </navigation-rule>

  <navigation-rule>
    <from-view-id>/samples/blocks/faces/goodbye</from-view-id>
    <navigation-case>
      <from-outcome>flip</from-outcome>
      <to-view-id>/samples/blocks/faces/hello</to-view-id>
    </navigation-case>
  </navigation-rule>


  <!--
    - Sun's CarStore Demo Application Configuration
    - Includes configuration of two custom components.
    -->

  <component>
    <component-type>DemoArea</component-type>
    <component-class>org.apache.cocoon.faces.samples.components.components.AreaComponent</component-class>
    <property>
      <description>
        Alternate text if we synthesize an ImageArea bean.
      </description>
      <property-name>alt</property-name>
      <property-class>java.lang.String</property-class>
    </property>
    <property>
      <description>
        Hotspot coordinates if we synthesize an ImageArea bean.
      </description>
      <property-name>coords</property-name>
      <property-class>java.lang.String</property-class>
    </property>
    <property>
      <description>
        Shape (default, rect, circle, poly) if we synthesize an ImageArea bean.
      </description>
      <property-name>shape</property-name>
      <property-class>java.lang.String</property-class>
    </property>

    <component-extension>
      <component-family>Area</component-family>
      <renderer-type>DemoArea</renderer-type>
    </component-extension>
  </component>

  <component>
    <component-type>DemoMap</component-type>
    <component-class>org.apache.cocoon.faces.samples.components.components.MapComponent</component-class>
    <property>
      <description>
        Alternate text for the currently selected child AreaComponent.
      </description>
      <property-name>current</property-name>
      <property-class>java.lang.String</property-class>
    </property>

    <component-extension>
      <component-family>Map</component-family>
      <renderer-type>DemoMap</renderer-type>
    </component-extension>
  </component>

  <render-kit>
    <renderer>
      <description>
        Renderer for a org.apache.cocoon.faces.samples.components.components.AreaComponent component.
      </description>
      <component-family>Area</component-family>
      <renderer-type>DemoArea</renderer-type>
      <renderer-class>org.apache.cocoon.faces.samples.components.renderkit.AreaRenderer</renderer-class>

      <attribute>
        <description>
          Context-relative path to an image to be displayed when the
          mouse is not hovering over this hotspot.
        </description>
        <attribute-name>onmouseout</attribute-name>
        <attribute-class>java.lang.String</attribute-class>
      </attribute>
      <attribute>
        <description>
          Context-relative path to an image to be displayed when the
          mouse is hovering over this hotspot.
        </description>
        <attribute-name>onmouseover</attribute-name>
        <attribute-class>java.lang.String</attribute-class>
      </attribute>
      <attribute>
        <description>
          CSS style class to use when rendering this component.
        </description>
        <attribute-name>styleClass</attribute-name>
        <attribute-class>java.lang.String</attribute-class>
      </attribute>
    </renderer>

    <renderer>
      <description>
        Renderer for a org.apache.cocoon.faces.samples.components.components.MapComponent component.
      </description>
      <component-family>Map</component-family>
      <renderer-type>DemoMap</renderer-type>
      <renderer-class>org.apache.cocoon.faces.samples.components.renderkit.MapRenderer</renderer-class>

      <attribute>
        <description>
          CSS style class to use when rendering this component.
        </description>
        <attribute-name>styleClass</attribute-name>
        <attribute-class>java.lang.String</attribute-class>
      </attribute>
    </renderer>
  </render-kit>

  <application>
    <message-bundle>org.apache.cocoon.faces.samples.carstore.bundles.Messages</message-bundle>
    <locale-config>
      <default-locale>en</default-locale>
      <supported-locale>de</supported-locale>
      <supported-locale>fr</supported-locale>
      <supported-locale>es</supported-locale>
    </locale-config>
  </application>

  <!-- Validator -->
  <validator>
    <description>
        Registers the concrete Validator implementation,
        org.apache.cocoon.faces.samples.carstore.FormatValidator with the validator
        identifier, FormatValidator.
    </description>
    <validator-id>FormatValidator</validator-id>
    <validator-class>org.apache.cocoon.faces.samples.carstore.FormatValidator</validator-class>
    <attribute>
      <description>
        List of format patterns separated by '|'.  The validator
        compares these patterns against the data entered in a
        component that has this validator registered on it.
      </description>
      <attribute-name>formatPatterns</attribute-name>
      <attribute-class>java.lang.String</attribute-class>
    </attribute>
  </validator>

  <!-- Converter -->
  <converter>
    <description>
        Registers the concrete Converter implementation,
        org.apache.cocoon.faces.samples.carstore.CreditCardConverter using the ID,
        creditCardConverter.
    </description>
    <converter-id>creditCardConverter</converter-id>
    <converter-class>org.apache.cocoon.faces.samples.carstore.CreditCardConverter</converter-class>
  </converter>

  <!-- =================== Initialize Image Map Hotspot Data ============== -->

  <managed-bean>
    <description>
      Causes the default VariableResolver implementation to instantiate the
      managed bean, NA of the class, org.apache.cocoon.faces.samples.components.model.ImageArea in application
      scope if the bean does not already exist in any scope and initialize the
      shape, alt, and coords properties with the values specified by the
      managed-property elements.
    </description>
    <managed-bean-name> NA </managed-bean-name>
    <managed-bean-class> org.apache.cocoon.faces.samples.components.model.ImageArea </managed-bean-class>
    <managed-bean-scope> application </managed-bean-scope>
    <managed-property>
      <description>
        Initializes the shape property of the managed bean, NA with the value,
        poly.
      </description>
      <property-name>shape</property-name>
      <value>poly</value>
    </managed-property>
    <managed-property>
      <description>
        Initializes the alt property of the managed bean, NA with the value,
        NAmerica.
      </description>
      <property-name>alt</property-name>
      <value>NAmerica</value>
    </managed-property>
    <managed-property>
      <description>
        Initializes the coords property of the managed bean, NA with the value
        specified by the value element.
      </description>
      <property-name>coords</property-name>
      <value>
        53,109,1,110,2,167,19,168,52,149,67,164,67,165,68,167,70,168,72,170,74,172,75,174,77,175,79,177,81,179,80,179,77,179,81,179,81,178,80,178,82,211,28,238,15,233,15,242,31,252,36,247,36,246,32,239,89,209,92,216,93,216,100,216,103,218,113,217,116,224,124,221,128,230,163,234,185,189,178,177,162,188,143,173,79,173,73,163,79,157,64,142,54,139,53,109
      </value>
    </managed-property>
  </managed-bean>

  <managed-bean>
    <description>
      Causes the default VariableResolver implementation to instantiate the
      managed bean, SA of the class, org.apache.cocoon.faces.samples.components.model.ImageArea in application
      scope if the bean does not already exist in any scope and initialize the
      shape, alt, and coords properties with the values specified by the
      managed-property elements.
    </description>
    <managed-bean-name>SA</managed-bean-name>
    <managed-bean-class>org.apache.cocoon.faces.samples.components.model.ImageArea</managed-bean-class>
    <managed-bean-scope>application</managed-bean-scope>
    <managed-property>
      <description>
        Initializes the shape property of the managed bean, SA with the value,
        poly.
      </description>
      <property-name>shape</property-name>
      <value>poly</value>
    </managed-property>
    <managed-property>
      <description>
        Initializes the alt property of the managed bean, SA with the value,
        SAmerica.
      </description>
      <property-name>alt</property-name>
      <value>SAmerica</value>
    </managed-property>
    <managed-property>
      <description>
         Initializes the coords property of the managed bean, SA with the value
         specified by the value element.
      </description>
      <property-name>coords</property-name>
      <value>
        89,217,95,228,100,234,107,239,109,240,109,237,106,231,110,234,113,240,115,246,118,250,125,254,131,256,135,255,140,257,146,263,151,269,157,271,160,273,159,279,157,287,156,294,163,315,168,324,172,329,173,338,172,351,169,368,168,379,167,388,165,399,165,408,170,415,177,420,183,420,183,415,180,408,180,405,186,400,186,395,186,391,188,388,190,384,193,382,196,379,199,377,201,374,201,371,201,366,197,362,197,358,198,354,199,351,199,347,197,344,196,340,194,337,191,335,191,332,194,332,201,332,199,326,193,317,184,310,180,309,179,311,177,314,175,312,174,308,172,305,170,304,171,302,174,298,177,296,177,290,177,288,180,287,183,287,186,287,187,284,188,280,190,279,192,278,191,282,191,286,194,288,196,288,199,286,201,285,204,285,206,285,208,285,206,280,205,279,205,276,205,274,197,270,194,267,191,265,186,262,182,262,177,261,173,261,167,261,165,265,163,266,159,265,157,263,157,260,153,253,149,251,147,251,149,247,149,244,148,240,144,238,141,238,139,241,138,244,137,245,134,246,131,245,130,242,130,238,130,236,130,233,129,230,125,225,123,221,119,221,118,223,117,220,113,219,104,217,101,215,96,215
      </value>
    </managed-property>
  </managed-bean>

  <managed-bean>
    <description>
      Causes the default VariableResolver implementation to instantiate the
      managed bean, gerA of the class, org.apache.cocoon.faces.samples.components.model.ImageArea in application
      scope if the bean does not already exist in any scope and initialize the
      shape, alt, and coords properties with the values specified by the
      managed-property elements.
    </description>
    <managed-bean-name> gerA </managed-bean-name>
    <managed-bean-class> org.apache.cocoon.faces.samples.components.model.ImageArea </managed-bean-class>
    <managed-bean-scope> application </managed-bean-scope>
    <managed-property>
      <description>
         Initializes the shape property of the managed bean, gerA with the value
         poly.
      </description>
      <property-name>shape</property-name>
      <value>poly</value>
    </managed-property>
    <managed-property>
      <description>
        Initializes the alt property of the managed bean, gerA with the value
        Germany.
      </description>
      <property-name>alt</property-name>
      <value>Germany</value>
    </managed-property>
    <managed-property>
        <description>
            Initializes the coords property of the managed bean, gerA with the value
            specified by the value element.
      </description>
      <property-name>coords</property-name>
      <value>
        324,163,323,170,322,172,320,173,320,175,321,176,321,177,321,179,321,180,319,180,318,180,317,182,316,183,315,181,314,181,313,181,312,181,311,180,310,177,310,177,307,176,307,173,307,172,308,170,309,169,309,167,309,166,311,165,311,163,311,161,312,159,314,159,316,160,316,162,318,162,319,162
      </value>
    </managed-property>
  </managed-bean>

  <managed-bean>
    <description>
      Causes the default VariableResolver implementation to instantiate the
      managed bean, fraA of the class, org.apache.cocoon.faces.samples.components.model.ImageArea in application
      scope if the bean does not already exist in any scope and initialize the
      shape, alt, and coords properties with the values specified by the
      managed-property elements.
    </description>
    <managed-bean-name> fraA </managed-bean-name>
    <managed-bean-class> org.apache.cocoon.faces.samples.components.model.ImageArea </managed-bean-class>
    <managed-bean-scope> application </managed-bean-scope>
    <managed-property>
        <description>
            Initializes the shape property of the managed bean, fraA with the value
            shape.
      </description>
      <property-name>shape</property-name>
      <value>poly</value>
    </managed-property>
    <managed-property>
        <description>
            Initializes the alt property of the managed bean, fraA with the value
            France.
      </description>
      <property-name>alt</property-name>
      <value>France</value>
    </managed-property>
    <managed-property>
        <description>
            Initializes the coords property of the managed bean, fraA with the value
            specified by the value element.
      </description>
      <property-name>coords</property-name>
      <value>
        312,178,308,182,310,184,310,187,310,189,309,191,307,192,305,192,304,192,304,193,303,195,302,195,300,194,299,194,297,194,295,193,295,191,295,189,294,186,293,184,292,182,291,181,289,180,288,178,288,176,289,175,292,175,293,176,294,174,296,174,297,174,299,174,299,172,300,170,302,170,304,172,306,173,308,173,310,174
      </value>
    </managed-property>
  </managed-bean>

  <!-- =================== Business Logic Beans ============== -->

  <managed-bean>
    <description>
      Causes the default VariableResolver implementation to instantiate
      the managed bean, CustomerBean of the class, org.apache.cocoon.faces.samples.carstore.CustomerBean
      in session scope if the bean does not already exist in any scope.
    </description>
    <managed-bean-name>customer</managed-bean-name>
    <managed-bean-class>org.apache.cocoon.faces.samples.carstore.CustomerBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
  </managed-bean>

  <managed-bean>
    <description>
      The main backing file mean
    </description>
    <managed-bean-name>carstore</managed-bean-name>
    <managed-bean-class>org.apache.cocoon.faces.samples.carstore.CarStore</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
  </managed-bean>

  <navigation-rule>
    <from-view-id>/samples/blocks/faces/cardemo/chooseLocale.faces</from-view-id>
    <navigation-case>
      <description>
        Any action on chooseLocale should cause navigation to storeFront.faces
      </description>
      <from-outcome>storeFront</from-outcome>
      <to-view-id>/samples/blocks/faces/cardemo/storeFront.faces</to-view-id>
    </navigation-case>
  </navigation-rule>

  <navigation-rule>
    <from-view-id>/samples/blocks/faces/cardemo/storeFront.faces</from-view-id>
    <navigation-case>
      <description>
        Any action that returns "carDetail" on storeFront.faces should
        cause navigation to carDetail.faces
      </description>
      <from-outcome>carDetail</from-outcome>
      <to-view-id>/samples/blocks/faces/cardemo/carDetail.faces</to-view-id>
    </navigation-case>
  </navigation-rule>

  <navigation-rule>
    <from-view-id>/samples/blocks/faces/cardemo/carDetail.faces</from-view-id>
    <navigation-case>
      <description>
        Any action that returns "confirmChoices" on carDetail.faces should
        cause navigation to confirmChoices.faces
      </description>
      <from-outcome>confirmChoices</from-outcome>
      <to-view-id>/samples/blocks/faces/cardemo/confirmChoices.faces</to-view-id>
    </navigation-case>
  </navigation-rule>

  <navigation-rule>
    <from-view-id>/samples/blocks/faces/cardemo/confirmChoices.faces</from-view-id>
    <navigation-case>
      <description>
        Any action that returns "carDetail" on confirmChoices.faces should
        cause navigation to carDetail.faces
      </description>
      <from-outcome>carDetail</from-outcome>
      <to-view-id>/samples/blocks/faces/cardemo/carDetail.faces</to-view-id>
    </navigation-case>
  </navigation-rule>

  <navigation-rule>
    <from-view-id>/samples/blocks/faces/cardemo/confirmChoices.faces</from-view-id>
    <navigation-case>
      <description>
        Any action that returns "customerInfo" on confirmChoices.faces should
        cause navigation to customerInfo.faces
      </description>
      <from-outcome>customerInfo</from-outcome>
      <to-view-id>/samples/blocks/faces/cardemo/customerInfo.faces</to-view-id>
    </navigation-case>
  </navigation-rule>

  <navigation-rule>
    <from-view-id>/samples/blocks/faces/cardemo/customerInfo.faces</from-view-id>
    <navigation-case>
      <description>
        Any action that returns "finish" on customerInfo.faces should
        cause navigation to finish.faces
      </description>
      <from-outcome>finish</from-outcome>
      <to-view-id>/samples/blocks/faces/cardemo/finish.faces</to-view-id>
    </navigation-case>
  </navigation-rule>

</faces-config>
