<?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>
    <type>org.exoplatform.portal.config.DynamicPortalLayoutService</type>
    <init-params>
      <value-param>
        <name>forceIgnoreStoredLayout</name>
        <description>Whether ignore or not persisted layout to retrieve dynamic layout if exists</description>
        <value>${exo.portal.stored.layout.ignore:false}</value>
      </value-param>
    </init-params>
  </component>

  <component>
    <type>org.exoplatform.settings.rest.SettingResource</type>
  </component>

  <external-component-plugins>
    <target-component>org.exoplatform.services.organization.OrganizationService</target-component>
    <component-plugin>
      <name>group.portal.config.listener</name>
      <set-method>addListenerPlugin</set-method>
      <type>org.exoplatform.portal.config.GroupPortalConfigListener</type>
    </component-plugin>
  </external-component-plugins>

  <external-component-plugins>
    <target-component>org.exoplatform.services.listener.ListenerService</target-component>
    <component-plugin>
      <name>org.exoplatform.portal.mop.service.LayoutService.portalConfigUpdated</name>
      <set-method>addListener</set-method>
      <type>org.exoplatform.portal.config.MetaPortalConfigUpdateListener</type>
    </component-plugin>

    <component-plugin>
      <name>org.exoplatform.portal.mop.navigation.navigation_created</name>
      <set-method>addListener</set-method>
      <type>org.exoplatform.web.portal.RefreshCurrentUserPortal</type>
    </component-plugin>
    <component-plugin>
      <name>org.exoplatform.portal.mop.navigation.navigation_updated</name>
      <set-method>addListener</set-method>
      <type>org.exoplatform.web.portal.RefreshCurrentUserPortal</type>
    </component-plugin>
    <component-plugin>
      <name>org.exoplatform.portal.mop.navigation.navigation_destroyed</name>
      <set-method>addListener</set-method>
      <type>org.exoplatform.web.portal.RefreshCurrentUserPortal</type>
    </component-plugin>
  </external-component-plugins>

  <external-component-plugins>
    <target-component>org.exoplatform.groovyscript.text.TemplateService</target-component>
    <component-plugin>
      <name>UIPortalApplication-Start-head</name>
      <set-method>addTemplateExtension</set-method>
      <type>org.exoplatform.groovyscript.text.TemplateExtensionPlugin</type>
      <init-params>
        <values-param>
          <name>templates</name>
          <description>A template that will be imported in head of pages
                    to define caching strategies of resources using Service Worker,
                    preload resources and Manifest definition</description>
          <value>war:/groovy/portal/webui/workspace/UIPortalPreloadResources.gtmpl</value>
        </values-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>

</configuration>
