<?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.
-->
<configuration
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
    xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">

  <component>
    <key>io.meeds.portal.permlink.service.PermanentLinkService</key>
    <type>io.meeds.portal.permlink.service.PermanentLinkServiceImpl</type>
  </component>

  <component>
    <type>org.exoplatform.web.WebAppController</type>
    <init-params>
      <value-param>
        <name>controller.config</name>
        <value>${gatein.portal.controller.config}</value>
      </value-param>
    </init-params>
  </component>

  <component>
    <type>org.exoplatform.upload.UploadService</type>
    <init-params>
      <value-param>
        <name>upload.limit.size</name>
        <description>Maximum size of the file to upload in MB</description>
        <value>${exo.uploadLimit:10}</value>
      </value-param>
    </init-params>
  </component>

  <component>
    <type>org.exoplatform.download.DownloadService</type>
    <init-params>
      <value-param>
        <name>download.resource.cache.size</name>
        <description>Maximun number of the download can be in the cache</description>
        <value>500</value>
      </value-param>
    </init-params>
  </component>

  <component>
    <type>org.exoplatform.web.url.URLFactoryService</type>
    <component-plugins>
      <component-plugin>
        <name>navigation.urlfactory.plugin</name>
        <set-method>addPlugin</set-method>
        <type>org.exoplatform.web.url.navigation.NodeURLFactoryPlugin</type>
      </component-plugin>
      <component-plugin>
        <name>navigation.urlfactory.plugin</name>
        <set-method>addPlugin</set-method>
        <type>org.exoplatform.portal.url.component.ComponentURLFactoryPlugin</type>
      </component-plugin>
      <component-plugin>
        <name>navigation.urlfactory.plugin</name>
        <set-method>addPlugin</set-method>
        <type>org.exoplatform.web.url.simple.SimpleURLFactoryPlugin</type>
      </component-plugin>
    </component-plugins>
  </component>

  <external-component-plugins>
    <target-component>org.exoplatform.services.listener.ListenerService</target-component>
    <component-plugin>
      <name>org.exoplatform.web.GenericHttpListener.sessionDestroyed</name>
      <set-method>addListener</set-method>
      <type>org.exoplatform.upload.UploadSessionListener</type>
    </component-plugin>
  </external-component-plugins>

  <external-component-plugins>
    <target-component>org.exoplatform.web.WebAppController</target-component>
    <component-plugin>
      <name>LoginHandler</name>
      <set-method>register</set-method>
      <type>org.exoplatform.web.login.LoginHandler</type>
      <init-params>
        <value-param>
          <name>login.jsp.path</name>
          <value>${exo.login.jsp.path:/WEB-INF/jsp/login/login.jsp}</value>
        </value-param>
        <value-param>
          <name>username.case.insensitive</name>
          <value>${exo.auth.case.insensitive:true}</value>
        </value-param>
      </init-params>
    </component-plugin>
    <component-plugin>
      <name>UploadHandler</name>
      <set-method>register</set-method>
      <type>org.exoplatform.web.handler.UploadHandler</type>
      <init-params>
        <value-param>
          <name>public-access-restriction</name>
          <value>${exo.portal.uploadhandler.public-restriction:true}</value>
        </value-param>
      </init-params>
    </component-plugin>
    <component-plugin>
      <name>LogoutHandler</name>
      <set-method>register</set-method>
      <type>org.exoplatform.web.logout.LogoutHandler</type>
    </component-plugin>
    <component-plugin>
      <name>DownloadHandler</name>
      <set-method>register</set-method>
      <type>org.exoplatform.web.handler.DownloadHandler</type>
    </component-plugin>
    <component-plugin>
      <name>DefaultRequestHandler</name>
      <set-method>register</set-method>
      <type>org.exoplatform.web.handler.DefaultRequestHandler</type>
    </component-plugin>
    <component-plugin>
      <name>PermanentLinkRequestHandler</name>
      <set-method>register</set-method>
      <type>io.meeds.portal.web.handler.PermanentLinkRequestHandler</type>
    </component-plugin>
    <component-plugin>
      <name>PortalRequestHandler</name>
      <set-method>register</set-method>
      <type>org.exoplatform.portal.application.PortalRequestHandler</type>
    </component-plugin>
    <component-plugin>
      <name>PortalDraftRequestHandler</name>
      <set-method>register</set-method>
      <type>io.meeds.portal.web.handler.PortalDraftRequestHandler</type>
    </component-plugin>
    <component-plugin>
      <name>PortalTemplateRequestHandler</name>
      <set-method>register</set-method>
      <type>io.meeds.portal.web.handler.PortalTemplateRequestHandler</type>
    </component-plugin>
    <component-plugin>
      <name>ScriptRequestHandler</name>
      <set-method>register</set-method>
      <type>org.gatein.portal.controller.resource.ResourceRequestHandler</type>
    </component-plugin>
    <component-plugin>
      <name>SkinRequestHandler</name>
      <set-method>register</set-method>
      <type>org.exoplatform.portal.resource.SkinResourceRequestHandler</type>
    </component-plugin>
    <component-plugin>
      <name>StaticResourceRequestHandler</name>
      <set-method>register</set-method>
      <type>org.exoplatform.portal.application.StaticResourceRequestHandler</type>
    </component-plugin>
  </external-component-plugins>

</configuration>
