<!--

    Copyright (C) 2009 eXo Platform SAS.
    
    This is free software; you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as
    published by the Free Software Foundation; either version 2.1 of
    the License, or (at your option) any later version.
    
    This software is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    Lesser General Public License for more details.
    
    You should have received a copy of the GNU Lesser General Public
    License along with this software; if not, write to the Free
    Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
    02110-1301 USA, or see the FSF site: http://www.fsf.org.

-->

<binding>
  <mapping name="param" class="org.exoplatform.webui.config.Param">
    <value name="name" field="name"/>
    <value name="value" field="value"/>
  </mapping>

  <mapping name="init-params" class="org.exoplatform.webui.config.InitParams">
    <collection item-type="org.exoplatform.webui.config.Param" field="params" usage="optional"/>
  </mapping>

  <mapping name="validator" class="org.exoplatform.webui.config.Validator">
    <value name="type" field="type"/>
    <structure usage="optional" field="initParams"/>
  </mapping>

  <mapping name="event" class="org.exoplatform.webui.config.Event">
    <value name="event-name" field="name"/>
    <value usage="optional" name="execution-phase" field="phase"/>
    <structure usage="optional" field="initParams"/>
    <collection field="listeners" usage="optional" item-type="java.lang.String">
      <value name="listener" style="element"/>
    </collection>
  </mapping>


  <mapping name="event-interceptor" class="org.exoplatform.webui.config.EventInterceptor">
    <value name="type" field="type"/>
    <structure usage="optional" field="initParams"/>
    <collection field="interceptors" usage="optional" item-type="java.lang.String">
      <value name="interceptor" style="element"/>
    </collection>
  </mapping>


  <!-- component object mapping -->

  <mapping name="ui-component-config" class="org.exoplatform.webui.config.metadata.ComponentMetaData">
    <value name="id" field="id" style="attribute" usage="optional"/>
    <value name="type" field="type"/>
    <value name="lifecycle" field="lifecycle" usage="optional"/>
    <value name="template" field="template" usage="optional"/>
    <value name="decorator" field="decorator" usage="optional"/>

    <structure usage="optional" field="initParams"/>

    <collection item-type="org.exoplatform.webui.config.Validator"
                name="validators" field="validators" usage="optional"/>
    <collection item-type="org.exoplatform.webui.config.Event"
                name="events" field="events" usage="optional"/>

    <collection item-type="org.exoplatform.webui.config.EventInterceptor"
                name="event-interceptors" field="eventInterceptors" usage="optional"/>
  </mapping>

  <mapping name="application" class="org.exoplatform.webui.config.Application">
    <structure usage="optional" field="initParams"/>
    <value name="ui-component-root" field="uiroot"/>
    <value name="state-manager" field="stateManager"/>
    <collection item-type="java.lang.String"
                name="application-lifecycle-listeners" field="lifecycleListeners" usage="optional">
      <value name="listener" style="element"/>
    </collection>

    <collection item-type="org.exoplatform.webui.config.Event"
                name="events" field="events" usage="optional"/>
  </mapping>

  <!-- jsf-configuration object mapping -->
  <mapping name="webui-configuration" class="org.exoplatform.webui.config.WebuiConfiguration">
    <collection field="annotationClasses" name="annotation-classes"
                usage="optional" item-type="java.lang.String">
      <value name="class" style="element"/>
    </collection>

    <collection item-type="org.exoplatform.webui.config.metadata.ComponentMetaData"
                field="components" usage="optional"/>

    <structure usage="optional" field="application"/>
  </mapping>
</binding>
