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

    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.

-->

<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.services.wcm.newsletter.NewsletterInitializationService</type>
    <init-params>
      <values-param>
        <name>portalNames</name>
        <value>acme</value>
      </values-param>
      <!-- set the access to administration menu of the newsletter -->
      <values-param>
   		<name>administrators</name>
        <value>john</value>
      </values-param>
      <object-param>
		<!-- Add "a-" in order to display this category first of all -->
        <name>a-general</name>
        <description>a-general</description>
        <object type="org.exoplatform.services.wcm.newsletter.NewsletterCategoryConfig">
          <field name="name">
            <string>a-general</string>
          </field>
          <field name="title">
            <string>General</string>
          </field>
          <field name="description">
            <string>General information about us</string>
          </field>
          <field name="moderator">
            <string>*:/platform/web-contributors</string>
          </field>
        </object>
      </object-param>
      <object-param>
        <name>acme-newsletters</name>
        <description>acme newsletters</description>
        <object type="org.exoplatform.services.wcm.newsletter.NewsletterSubscriptionConfig">
          <field name="name">
            <string>market</string>
          </field>
          <field name="title">
            <string>acme Newsletters</string>
          </field>
          <field name="description">
            <string>Learn more about our offers</string>
          </field>
          <field name="categoryName">
            <string>a-general</string>
          </field>
          <field name="redactor">
            <string>*:/platform/web-contributors</string>
          </field>
        </object>
      </object-param>
      <object-param>
        <name>acme-trainings</name>
        <description>acme trainings</description>
        <object type="org.exoplatform.services.wcm.newsletter.NewsletterSubscriptionConfig">
          <field name="name">
            <string>acme-trainings</string>
          </field>
          <field name="title">
            <string>acme Trainings</string>
          </field>
          <field name="description">
            <string>Learn how to use your new Super Powers</string>
          </field>
          <field name="categoryName">
            <string>a-general</string>
          </field>
          <field name="redactor">
            <string>*:/platform/web-contributors</string>
          </field>
        </object>
      </object-param>
      <object-param>
        <name>b-corporate</name>
        <description>b-corporate</description>
        <object type="org.exoplatform.services.wcm.newsletter.NewsletterCategoryConfig">
          <field name="name">
            <string>b-corporate</string>
          </field>
          <field name="title">
            <string>Corporate</string>
          </field>
          <field name="description">
            <string>You want to know where we are, where we go ?</string>
          </field>
          <field name="moderator">
            <string>*:/platform/web-contributors</string>
          </field>
        </object>
      </object-param>
      <object-param>
        <name>results</name>
        <description>results</description>
        <object type="org.exoplatform.services.wcm.newsletter.NewsletterSubscriptionConfig">
          <field name="name">
            <string>results</string>
          </field>
          <field name="title">
            <string>Results</string>
          </field>
          <field name="description">
            <string>Monthly newsletter about our financial results and forecasts</string>
          </field>
          <field name="categoryName">
            <string>b-corporate</string>
          </field>
          <field name="redactor">
            <string>*:/platform/web-contributors</string>
          </field>
        </object>
      </object-param>
    </init-params>
  </component>

  <external-component-plugins>
    <target-component>org.exoplatform.services.deployment.WCMContentInitializerService</target-component>
    <component-plugin>
      <name>Content Initializer Service</name>
      <set-method>addPlugin</set-method>
      <type>org.exoplatform.services.deployment.plugins.XMLDeploymentPlugin</type>
      <description>XML Deployment Plugin</description>
      <init-params>
        <object-param>
          <name>Demo newsletter for acme site</name>
          <description>Deployment Descriptor</description>
          <object type="org.exoplatform.services.deployment.DeploymentDescriptor">
            <field name="target">
              <object type="org.exoplatform.services.deployment.DeploymentDescriptor$Target">
                <field name="workspace">
                  <string>collaboration</string>
                </field>
                <field name="nodePath">
                  <string>/sites content/live/acme/ApplicationData/NewsletterApplication/DefaultTemplates</string>
                </field>
              </object>
            </field>
            <field name="sourcePath">
              <string>war:/conf/acme-portal/wcm/artifacts/site-resources/newsletter/newsletterBasicTemplate.xml</string>
            </field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>
</configuration>
