<?xml version="1.0" encoding="ISO-8859-1"?>

<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">
  <external-component-plugins>
    <target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
    <component-plugin>
      <name>new.portal.config.user.listener</name>
      <set-method>initListener</set-method>
      <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
      <description>this listener init the portal configuration</description>
      <init-params>
        <object-param>
          <name>portal.configuration</name>
          <description>description</description>
          <object type="org.exoplatform.portal.config.NewPortalConfig">
            <field name="predefinedOwner">
              <collection type="java.util.HashSet">
                <value>
                  <string>global</string>
                </value>
              </collection>
            </field>
            <field name="ownerType">
              <string>portal</string>
            </field>
            <field name="templateLocation">
              <string>war:/conf/task-addon/</string>
            </field>
            <field name="override">
              <boolean>${exo.tasks.portalConfig.metadata.override:true}</boolean>
            </field>
            <field name="importMode">
              <string>${exo.tasks.portalConfig.metadata.importMode:insert}</string>
            </field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>
  <external-component-plugins>
    <target-component>org.exoplatform.application.registry.ApplicationRegistryService</target-component>
    <component-plugin>
      <name>spaces.portlets.registry</name>
      <set-method>initListener</set-method>
      <type>org.exoplatform.application.registry.ApplicationCategoriesPlugins</type>
      <description>this listener init the portlets are registered in PortletRegister</description>
      <init-params>
        <value-param>
          <name>merge</name>
          <value>true</value>
        </value-param>
        <object-param>
          <name>spacesApplications</name>
          <description>description</description>
          <object type="org.exoplatform.application.registry.ApplicationCategory">
            <field name="name">
              <string>spacesApplications</string>
            </field>
            <field name="displayName">
              <string>Spaces applications</string>
            </field>
            <field name="description">
              <string>Applications allowed to be added in spaces</string>
            </field>
            <field name="accessPermissions">
              <collection type="java.util.ArrayList" item-type="java.lang.String">
                <value>
                  <string>*:/platform/users</string>
                </value>
              </collection>
            </field>
            <field name="applications">
              <collection type="java.util.ArrayList">
                <value>
                  <object type="org.exoplatform.application.registry.Application">
                    <field name="applicationName">
                      <string>TasksManagement</string>
                    </field>
                    <field name="categoryName">
                      <string>spacesApplications</string>
                    </field>
                    <field name="displayName">
                      <string>Tasks</string>
                    </field>
                    <field name="description">
                      <string>Task Management Portlet</string>
                    </field>
                    <field name="type">
                      <string>portlet</string>
                    </field>
                    <field name="contentId">
                      <string>task-management/TasksManagement</string>
                    </field>
                    <field name="accessPermissions">
                      <collection type="java.util.ArrayList">
                        <value>
                          <string>Everyone</string>
                        </value>
                      </collection>
                    </field>
                  </object>
                </value>
              </collection>
            </field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
    <component-plugin>
      <name>tasks.portlets.registry</name>
      <set-method>initListener</set-method>
      <type>org.exoplatform.application.registry.ApplicationCategoriesPlugins</type>
      <description>Add TaskManagementPortlet to Collaboration category</description>
      <init-params>
        <object-param>
          <name>Collaboration</name>
          <description>Collaboration</description>
          <object type="org.exoplatform.application.registry.ApplicationCategory">
            <field name="name">
              <string>Collaboration</string>
            </field>
            <field name="displayName">
              <string>Collaboration</string>
            </field>
            <field name="accessPermissions">
              <collection type="java.util.ArrayList" item-type="java.lang.String">
                <value>
                  <string>*:/platform/users</string>
                </value>
              </collection>
            </field>
            <field name="applications">
              <collection type="java.util.ArrayList">
                <value>
                  <object type="org.exoplatform.application.registry.Application">
                    <field name="applicationName"><string>Tasks</string></field>
                    <field name="categoryName"><string>Collaboration</string></field>
                    <field name="displayName"><string>Tasks</string></field>
                    <field name="description"><string>Task management application</string></field>
                    <field name="type"><string>portlet</string></field>
                    <field name="contentId"><string>task-management/TasksManagement</string></field>
                    <field name="accessPermissions">
                      <collection type="java.util.ArrayList" item-type="java.lang.String">
                        <value><string>*:/platform/users</string></value>
                      </collection>
                    </field>
                  </object>
                </value>
              </collection>
            </field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>

  <external-component-plugins>
    <target-component>org.exoplatform.portal.config.UserACL</target-component>
    <component-plugin>
      <name>tasks_projects_permissions</name>
      <set-method>addGroupVisibilityPlugin</set-method>
      <type>org.exoplatform.task.integration.ProjectGroupVisibilityPlugin</type>
    </component-plugin>
  </external-component-plugins>
</configuration>