<?xml version="1.0" encoding="UTF-8"?>
<!--
 This file is part of the Meeds project (https://meeds.io/).

 Copyright (C) 2020 - 2025 Meeds Association contact@meeds.io

 This program 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 3 of the License, or (at your option) any later version.
 This program 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 program; if not, write to the Free Software Foundation,
 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-->
<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>
