<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<book id="DeveloperGuide">
  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bookinfo.xml"/>
  <chapter id="DEV.Introduction">
    <title>Introduction </title>
    <para>The eXo Platform Developer Guide presents a complete overview of the eXo Platform 3.5 capabilities. This guide is intended for system integrators who want to know how to leverage eXo Platform in their customer projects and IT enterprises who need to customize and deploy their portals. Accordingly, this guide shows developers how to perform some of the most common tasks needed for customizing and working with eXo Platform 3.5. It also serves as an entry point for the Reference Guide, which provides in-depth technical reference for developers about eXo Platform 3.5.</para>
    <para>After reading this guide, developers are expected to be able to customize their own portals and develop applications to run on eXo Platform 3.5 through the following topics:</para>
    <itemizedlist>
      <listitem>
        <para>
          <link linkend="DEV.Introduction">Introduction</link>: The overview of this developer guide and its intended readers.</para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.GetStarted">Get Started</link>: Introduction to terms commonly used, how to set up Maven settings and eXo Architecture Primer.</para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.CreatingYourOwnPortal">Create Your Own Portal</link>: Steps on how to create and customize your own portal.</para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.WorkingwithContent">Work With Content</link>: Topics related to the eXo Platform content.</para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.WorkingwithApplications">Work With Applications</link>: Instructions on how to integrate applications into your portal and how to deploy your own applications.</para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.SystemIntegration">System Integration</link>: Topics related to the eXo Platform 3.5 integration into information systems through specific topics, such as authentication, user integration, LDAP integration and Email configuration.</para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.eXoPlatformAPIs">eXo Platform 3.5 APIs</link>: Information of APIs.</para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.Cookbook">Cookbook</link>: Introduction to Cookbook, particularly steps on how to copy a site to another eXo Platform server.</para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.Upgrade">Upgrade eXo Platform</link>: Steps on how to upgrade eXo Platform from 3.0 to 3.5, especially when your system is an extension of eXo Platform 3.0 with many customizations related to configurations, components and added features.</para>
      </listitem>
    </itemizedlist>
  </chapter>
  <chapter id="DEV.GetStarted">
    <title>Get Started </title>
    <para>This chapter will provide you the basic knowledge of eXo Platform 3.5 through the following topics:</para>
    <itemizedlist>
      <listitem>
        <para>
          <link linkend="DEV.Glossary">Glossary</link>
        </para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.SetupMavenSettings">Set up Maven settings</link>
        </para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.eXoArchitecturePrimer">eXo Architecture Primer</link>
        </para>
      </listitem>
    </itemizedlist>
    <section id="DEV.Glossary">
      <title>Glossary </title>
      <para>This section gives you explanations of some technical terms which are used throughout the documentation.</para>
      <para>
<citetitle>
<emphasis role="bold">Container templates</emphasis>
</citetitle>
</para>
      <para>Templates which are used to contain the UI components in a specific layout and display them on the portal page.</para>
      <para>
<citetitle>
<emphasis role="bold">ConversationState</emphasis>
</citetitle>
</para>
      <para>An object which stores all information about the state of the current user. This object also stores acquired attributes of an Identity which is a set of principals to identify a user.</para>
      <para>
<citetitle>
<emphasis role="bold">Data container</emphasis>
</citetitle>
</para>
      <para>An object which implements the physical data storage. It enables different types of backend (such as RDB, FS files) to be used as a storage for the JCR data. With the main Data Container, other storages for persisted Property Values can be configured and used. The eXo JCR persistent data container can work in two configuration modes.</para>
      <itemizedlist>
        <listitem>
          <para>
            <emphasis role="bold">Multi-database</emphasis>: A database for each workspace (used in the standalone eXo JCR service mode).</para>
        </listitem>
        <listitem>
          <para>
            <emphasis role="bold">Single-database</emphasis>: All workspaces persisted in one database (used in the embedded eXo JCR service mode; for example in eXo portal).</para>
        </listitem>
      </itemizedlist>
      <para>The data container uses the JDBC driver to communicate with the actual database software. For example, any JDBC-enabled data storage can be used with the eXo JCR implementation.</para>
      <para>
<citetitle>
<emphasis role="bold">Database Creator (DBCreator)</emphasis>
</citetitle>
</para>
      <para>A service that is responsible for executing the DDL (Data Definition Language) script in runtime. A DDL script may contain templates for database name, username, and password which will be replaced by real values at execution time.</para>
      <para>
<citetitle>
<emphasis role="bold">Drives</emphasis>
</citetitle>
</para>
      <para>Customized workspaces which include:</para>
      <itemizedlist>
        <listitem>
          <para>a configured path where the user will start when browsing the drive.</para>
        </listitem>
        <listitem>
          <para>a set of views with limitations to available actions, such as editing or creating contents while being in the drive.</para>
        </listitem>
        <listitem>
          <para>a set of permissions to limit the access (and view) of the drive to a restricted number of people.</para>
        </listitem>
        <listitem>
          <para>a set of options to describe the behavior of the drive when users browse it.</para>
        </listitem>
      </itemizedlist>
      <para>
<citetitle>
<emphasis role="bold">eXo Cache</emphasis>
</citetitle>
</para>
      <para>One which all applications on the top of eXo JCR need. This can rely on an <emphasis role="italic">org.exoplatform.services.cache.ExoCache</emphasis> instance managed by <emphasis role="italic">org.exoplatform.services.cache.CacheService</emphasis>.</para>
      <para>
<citetitle>
<emphasis role="bold">eXoContainer</emphasis>
</citetitle>
</para>
      <para>An object which behaves like a class loader that is responsible for loading services/components. The eXoContainer class is inherited by all the containers, including RootContainer, PortalContainer, and StandaloneContainer. It itself inherits from a PicoContainer framework which allows eXo to apply the IoC Inversion of Control principles. </para>
      <para>
<citetitle>
<emphasis role="bold">External Plugin</emphasis>
</citetitle>
</para>
      <para>One which allows adding configuration for services and components easily.</para>
      <para>
<citetitle>
<emphasis role="bold">Folksonomy</emphasis>
</citetitle>
</para>
      <para>A system of classification which is derived from the practice and a method of collaboratively creating and managing tags to annotate and categorize content. This practice is also known as collaborative tagging social classification social indexing and social tagging. For more details, see: <ulink url="http://en.wikipedia.org.">http://en.wikipedia.org.</ulink>
      </para>
      <para>
<citetitle>
<emphasis role="bold">Gadgets</emphasis>
</citetitle>
</para>
      <para>Web-based software components which are based on HTML, CSS, and JavaScript. They allow developers to easily write useful web applications that work anywhere on the web without modification. For more details, see: opensocial.org.</para>
      <para>
<citetitle>
<emphasis role="bold">Groovy template</emphasis>
</citetitle>
</para>
      <para>A template which is widely used in eXo UI framework. It leverages the usage of Groovy language, a scripting language for Java. The template file consists of HTML code and Groovy code blocks.</para>
      <para>
<citetitle>
<emphasis role="bold">JCR WebDav</emphasis>
</citetitle>
</para>
      <para>A service that allows accessing a JCR repository via WebDav.</para>
      <para>
<citetitle>
<emphasis role="bold">JobSchedulerService</emphasis>
</citetitle>
</para>
      <para>One which defines a job to execute a given number of times during a given period. It is a service that is in charge of unattended background executions commonly known for historical reasons as batch processing. </para>
      <para>
<citetitle>
<emphasis role="bold">JodConverter (Java OpenDocument Converter)</emphasis>
</citetitle>
</para>
      <para>A tool which converts documents into different office formats and vice versa.</para>
      <para>
<citetitle>
<emphasis role="bold">JCR Item</emphasis>
</citetitle>
</para>
      <para>One which may be a node or a property.</para>
      <para>
<citetitle>
<emphasis role="bold">ListenerService</emphasis>
</citetitle>
</para>
      <para>An event mechanism which allows triggering and listening to events under specific conditions inside eXo Platform. This mechanism is used in several places in eXo Platform, such as login/logout time, creating/updating users, and groups.</para>
      <para>
<citetitle>
<emphasis role="bold">LockManager</emphasis>
</citetitle>
</para>
      <para>One which stores lock objects, so it can give a lock object or can release it. Also, LockManager is responsible for removing Locks that live too long.</para>
      <para>
<citetitle>
<emphasis role="bold">Namespace</emphasis>
</citetitle>
</para>
      <para>The name of a node or property which may have a prefix delimited by a single ':' colon character. This name indicates the namespace of the item (Source: <ulink url="http://jcp.org/aboutJava/communityprocess/final/jsr170/index.html">JSR-170</ulink>) and is used to avoid the naming conflict. </para>
      <para>
<citetitle>
<emphasis role="bold">Navigation node</emphasis>
</citetitle>
</para>
      <para>A node which looks like a label of the link to page on the Navigation bar. By clicking a node, the page content is displayed. A node maps a URI and a portal page for the portal's navigation system. </para>
      <para>
<citetitle>
<emphasis role="bold">Navigation</emphasis>
</citetitle>
</para>
      <para>One which looks like a menu which is to help users visualize the site structure and to provide hyperlinks to other parts on a Portal. Thus, a bar which contains navigations is called the Navigation bar. </para>
      <para>
<citetitle>
<emphasis role="bold">Node type</emphasis>
</citetitle>
</para>
      <para>One which defines child nodes and properties which a node may (or must) have. Every node type has attributes, such as name, supertypes, mixin status, orderable child nodes status, property definitions, child node definitions and primary item name (Source: <ulink url="http://jcp.org/aboutJava/communityprocess/final/jsr170/index.html">JSR-170</ulink>). </para>
      <para>
<citetitle>
<emphasis role="bold">Node</emphasis>
</citetitle>
</para>
      <para>An element in the tree structure that makes up a repository. Each node may have zero or more child nodes and zero or more child properties. There is a single root node per workspace which has no parent. All other nodes have only one parent. </para>
      <para>
<citetitle>
<emphasis role="bold">Organization listener</emphasis>
</citetitle>
</para>
      <para>One which provides a mechanism to receive notifications via an organization listener, including UserEventListener, GroupEventListener and MembershipEventListener. </para>
      <itemizedlist>
        <listitem>
          <para>UserEventListener is called when a user is created, deleted or modified.</para>
        </listitem>
        <listitem>
          <para>GroupEventListener is called when a group is created, deleted or modified.</para>
        </listitem>
        <listitem>
          <para>MembershipEventListener is called when a membership is created or removed.</para>
        </listitem>
      </itemizedlist>
      <para>
<citetitle>
<emphasis role="bold">Organization management</emphasis>
</citetitle>
</para>
      <para>A portlet that manages users groups and memberships. This portlet is often managed by administrators to set up permission for users and groups. </para>
      <para>
<citetitle>
<emphasis role="bold">OrganizationService</emphasis>
</citetitle>
</para>
      <para>A service that allows accessing the Organization model. This model is composed of users, groups, and memberships. It is the basis of eXo's personalization and authorizations and is used for all over the platform. </para>
      <para>
<citetitle>
<emphasis role="bold">Path constraint</emphasis>
</citetitle>
</para>
      <para>One which restricts the result node to a scope specified by a path expression. The following path constraints must be supported exact child nodes descendants and descendants or self (Source: <ulink url="http://jcp.org/aboutJava/communityprocess/final/jsr170/index.html">JSR-170</ulink>). </para>
      <para>
<citetitle>
<emphasis role="bold">Permission</emphasis>
</citetitle>
</para>
      <para>A permission settings control which actions users can or cannot perform within the portal and are set by the portal administrators. Permission types specify what a user can do within the portal. </para>
      <para>
<citetitle>
<emphasis role="bold">Portal Page</emphasis>
</citetitle>
</para>
      <para>A page which consists of one or more various portlets. Their layouts are defined by container templates. To display a portal page, this page must be mapped to a navigation node. </para>
      <para>
<citetitle>
<emphasis role="bold">Portal skins</emphasis>
</citetitle>
</para>
      <para>Graphic styles which display an attractive user interface. Each skin has its own characteristics with different backgrounds, icons, color, and more. </para>
      <para>
<citetitle>
<emphasis role="bold">PortalContainer</emphasis>
</citetitle>
</para>
      <para>A type of container which is created at the startup of the portal web application in the init method of the PortalController servlet. </para>
      <para>
<citetitle>
<emphasis role="bold">Portlet</emphasis>
</citetitle>
</para>
      <para>A web-based application that provides a specific piece of content to be included as part of a portal page. In other words, portlets are pluggable user interface components that provide a presentation layer to information systems. There are two following types of portlet:</para>
      <itemizedlist>
        <listitem>
          <para>
            <emphasis role="bold">Functional Portlets</emphasis> support all functions within the portal. They are integrated into the portal that can be accessed through toolbar links.</para>
        </listitem>
        <listitem>
          <para>
            <emphasis role="bold">Interface Portlets</emphasis> constitute the interface of a portal. eXo Portal consists of some Interface Portlets, such as Banner Portlet, Footer Portlet, Homepage Portlet, Console Portlet, Breadcrumb Portlet and more. </para>
        </listitem>
      </itemizedlist>
      <para>
<citetitle>
<emphasis role="bold">Property constraint</emphasis>
</citetitle>
</para>
      <para>One which may be specified by a query on the result nodes by way of property constraints (Source: <ulink url="http://jcp.org/aboutJava/communityprocess/final/jsr170/index.html">JSR-170</ulink>). </para>
      <para>
<citetitle>
<emphasis role="bold">Property</emphasis>
</citetitle>
</para>
      <para>An element in the tree structure that makes up a repository. Each property has only one parent node and has no child node. </para>
      <para>
<citetitle>
<emphasis role="bold">Repository</emphasis>
</citetitle>
</para>
      <para>One which holds references to one or more workspaces. </para>
      <para>
<citetitle>
<emphasis role="bold">eXo REST framework</emphasis>
</citetitle>
</para>
      <para>One which is used to make eXo services (for example, the components deployed inside eXo Container) simply and transparently accessible via HTTP in a RESTful manner. In other words, those services should be viewed as a set of REST Resources-endpoints of the HTTP request-response chain. Those services are called <emphasis role="bold">ResourceContainers</emphasis>. </para>
      <para>
<citetitle>
<emphasis role="bold">RootContainer</emphasis>
</citetitle>
</para>
      <para>A base container which plays an important role during the startup. However, it is recommended that it should not be used directly.</para>
      <para>
<citetitle>
<emphasis role="bold">RTL Framework (Right To Left Framework)</emphasis>
</citetitle>
</para>
      <para>A framework which handles the text orientation depending on the current locale settings. It consists of four components, including Groovy template, Stylesheet, Images, and Client java.</para>
      <para>
<citetitle>
<emphasis role="bold">StandaloneContainer</emphasis>
</citetitle>
</para>
      <para>One which is a context independent eXo Container. It is also used for unit tests.</para>
      <para>
<citetitle>
<emphasis role="bold">Taxonomy</emphasis>
</citetitle>
</para>
      <para>One which is used to sort documents to ease searches when browsing documents online.</para>
      <para>
<citetitle>
<emphasis role="bold">Tree structure</emphasis>
</citetitle>
</para>
      <para>One structure which is defined as a hierarchical structure with a set of linked nodes and properties.</para>
      <para>
<citetitle>
<emphasis role="bold">Type constraint</emphasis>
</citetitle>
</para>
      <para>One which specifies the common primary node type of the returned nodes plus possibly additional mixin types that they also must have. Type constraints are inheritance-sensitive in which specifying a constraint of node type x will include all nodes explicitly declared to be type x and all nodes of subtypes of x (Source: <ulink url="http://jcp.org/aboutJava/communityprocess/final/jsr170/index.html">JSR-170</ulink>).</para>
      <para>
<citetitle>
<emphasis role="bold">Web Content</emphasis>
</citetitle>
</para>
      <para>A textual, visual or aural content that is encountered as part of the user experiences on a website. It may include other things, such as texts images, sounds, videos, and animations. </para>
      <para>
<citetitle>
<emphasis role="bold">Workspace</emphasis>
</citetitle>
</para>
      <para>A container of single rooted tree which includes items.</para>
    </section>
    <section id="DEV.SetupMavenSettings">
      <title>Set up Maven settings </title>
      <para>Before setting up a complete project/extension, you need to have knowledge of how to install a Maven project.</para>
      <citetitle>
<para>
<emphasis role="bold">
Requirements
</emphasis>
</para>
</citetitle>
      <itemizedlist>
        <listitem>
          <para>JDK (Java Development Kit) 6.0 </para>
        </listitem>
        <listitem>
          <para>SVN 1.6+</para>
        </listitem>
        <listitem>
          <para>Maven 2.2.1+</para>
        </listitem>
        <listitem>
          <para>Tomcat 6.0.32 or JBoss EAP 5.1.1</para>
        </listitem>
      </itemizedlist>
      <citetitle>
<para>
<emphasis role="bold">
Install and configure Maven
</emphasis>
</para>
</citetitle>
      <para>You need to add a system environment variable <emphasis role="italic">MAVEN_OPTS</emphasis> (it could be in a <emphasis role="italic">.profile</emphasis> startup script on Linux/MacOS operating systems or in the global environment variables panel on Windows).</para>
      <itemizedlist>
        <listitem>
          <para>Windows:</para>
        </listitem>
      </itemizedlist>
      <programlistingco>
        <areaspec units="linecolumn"/>
        <programlisting><![CDATA[
set MAVEN_OPTS=-Xshare:auto -Xms128M -Xmx1G -XX:MaxPermSize=256M
]]></programlisting>
      </programlistingco>
      <itemizedlist>
        <listitem>
          <para>Linux/MacOS:</para>
        </listitem>
      </itemizedlist>
      <programlistingco>
        <areaspec units="linecolumn"/>
        <programlisting><![CDATA[
export MAVEN_OPTS="-Xshare:auto -Xms128M -Xmx1G -XX:MaxPermSize=256M"
]]></programlisting>
      </programlistingco>
      <citetitle>
<para>
<emphasis role="bold">
Maven settings
</emphasis>
</para>
</citetitle>
      <para>
        <emphasis role="bold">1.</emphasis> Save the <emphasis role="italic">settings.xml</emphasis> file to the <emphasis role="italic">HOME/.m2/settings.xml</emphasis> path.</para>
      <para>
        <emphasis role="bold">2.</emphasis> Edit and change the <emphasis role="italic">local-properties</emphasis> profile, including:</para>
      <itemizedlist>
        <listitem>
          <para>
            <emphasis role="italic">exo.projects.directory.dependencies</emphasis> contains the application servers, and Openfire.</para>
        </listitem>
      </itemizedlist>
      <itemizedlist>
        <listitem>
          <para>each <emphasis role="italic">exo.projects.app.AS-NAME.version</emphasis> contains the name and version of the application servers.</para>
        </listitem>
      </itemizedlist>
      <para>If the <emphasis role="italic">settings.xml</emphasis> file has been existing, you can merge them. You will need the followings:</para>
      <itemizedlist>
        <listitem>
          <para>The <emphasis role="italic">local-properties</emphasis> profile, which defines properties, is used to build application server distributions of our products.</para>
        </listitem>
      </itemizedlist>
      <itemizedlist>
        <listitem>
          <para>The <ulink url="http://repository.exoplatform.org/public">repository</ulink> to download our dependencies.</para>
        </listitem>
      </itemizedlist>
      <note>
        <para>In Linux environments, the ulimit limits the system-wide resource used. When running eXo Platform, you may get the error message about "Too many open files" because the ulimit had limited the opened files. By default, the number of open files is limited to "1024". You should execute the command "ulimit -n 8196" as root before starting the server to avoid this issue.</para>
      </note>
      <para>
<prompt>
    <emphasis role="bold">See also</emphasis>
</prompt>
</para>
      <para>
        <link linkend="DEV.CreateYourOwnPortal.CreateExtensionProject">Create your extension project</link>
      </para>
      <para>
        <link linkend="DEV.CreateYourOwnPortal.CreateCustomLookAndFeel">Create custom look and feel</link>
      </para>
    </section>
    <section id="DEV.eXoArchitecturePrimer">
      <title>eXo Architecture Primer </title>
      <para>This section aims at helping readers further understand about the eXo architecture, including Kernel, GateIn extensions and Java Content Repository via concepts, services, configuration, and more. In this section, the sub-topics will be covered:</para>
      <para>
        <emphasis role="bold">
          <link linkend="DEV.eXoArchitecturePremer.Kernel">Kernel</link>
        </emphasis>
      </para>
      <itemizedlist>
        <listitem>
          <para>
            <link linkend="DEV.eXoArchitecturePremer.Containers">Containers</link>
          </para>
        </listitem>
        <listitem>
          <para>
            <link linkend="DEV.eXoArchitecturePremer.Services">Services</link>
          </para>
        </listitem>
        <listitem>
          <para>
            <link linkend="DEV.eXoArchitecturePremer.ServiceConfiguration">Service configuration</link>
          </para>
        </listitem>
        <listitem>
          <para>
            <link linkend="DEV.eXoArchitecturePremer.Plugins">Plugins</link>
          </para>
        </listitem>
        <listitem>
          <para>
            <link linkend="ADM.eXoArchitecturePremer.ConfigureLoadingSequence">Configuration loading sequence</link>
          </para>
        </listitem>
      </itemizedlist>
      <para>
        <emphasis role="bold">
          <link linkend="DEV.eXoArchitecturePremer.GateInExtensions">GateIn extensions</link>
        </emphasis>
      </para>
      <itemizedlist>
        <listitem>
          <para>
            <link linkend="DEV.eXoArchitecturePremer.defaultPortalContainer">Default Portal Container</link>
          </para>
        </listitem>
        <listitem>
          <para>
            <link linkend="DEV.eXoArchitecturePremer.RegisterExtension">Register Extension</link>
          </para>
        </listitem>
      </itemizedlist>
      <para>
        <emphasis role="bold">
          <link linkend="DEV.eXoArchitecturePremer.JavaContentRepository">Java Content Repository</link>
        </emphasis>
      </para>
      <itemizedlist>
        <listitem>
          <para>
            <link linkend="DEV.eXoArchitecturePremer.Repositories&amp;Workspaces">Repositories and workspaces</link>
          </para>
        </listitem>
        <listitem>
          <para>
            <link linkend="DEV.eXoArchitecturePremer.WorkingWithNodes&amp;Properties">Tree structure: working with nodes and properties</link>
          </para>
        </listitem>
      </itemizedlist>
      <section id="DEV.eXoArchitecturePremer.Kernel">
        <title>Kernel </title>
        <para>All eXo Platform services are built around the eXo Kernel, or the service management layer, which manages the configuration and the execution of all components. The main kernel object is the eXo Container, a micro-container that glues services together through the dependency injection. The container is responsible for loading services/components.</para>
        <para>This part introduces concepts of <emphasis role="bold">Container</emphasis> and <emphasis role="bold">Services</emphasis> with an overview before configuring basic services.</para>
        <section id="DEV.eXoArchitecturePremer.Containers">
          <title>Containers </title>
          <para>A container is always required to access a service, because the eXo Kernel relies on the dependency injection. This means that the lifecycle of a service (for example, instantiating, opening and closing streams, disposing) is handled by a dependency provider, such as the eXo Container, rather than the consumer. The consumer only needs a reference to an implementation of the requested service. The implementation is configured in an <emphasis role="italic">.xml</emphasis> configuration file that comes with every service. To learn more about the dependency injection, visit <ulink url="http://en.wikipedia.org/wiki/Dependency_injection">here</ulink>.</para>
          <para>eXo Platform provides two types of containers: RootContainer and PortalContainer.</para>
          <para>The <emphasis role="italic">RootContainer</emphasis> holds the low level components. It is automatically started before the <emphasis role="italic">PortalContainer</emphasis>. You will rarely interact directly with the <emphasis role="italic">RootContainer</emphasis> except when you activate your own extension. The <emphasis role="italic">PortalContainer</emphasis> is created for each portal (one or several portals). All services started by this container will run as embedded in the portal. It also gives access to components of its parent <emphasis role="italic">RootContainer</emphasis>.</para>
          <para>In your code, if you need to invoke a service of a container, you can use the <emphasis role="italic">ExoContainerContext</emphasis> helper from any location. The code below shows you a utility method that you can use to invoke any eXo Platform services.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
public class ExoUtils {
  /**
  * Get a service from the portal container
  * @param type : component type
  * @return the concrete instance retrieved in the container using the type as key
  */
  public <T>T getService(Class<T> type) {
    return (T)ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(type);
  }
}
]]></programlisting>
          </programlistingco>
          <para>Then, invoking becomes as easy as:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
OrganizationService orgService = ExoUtils.getService(OrganizationService.class)
]]></programlisting>
          </programlistingco>
        </section>
        <section id="DEV.eXoArchitecturePremer.Services">
          <title>Services </title>
          <para>Containers are used to gain access to services. The followings are important characteristics of services:</para>
          <itemizedlist>
            <listitem>
              <para>Because of the Dependency Injection concept, the interface and implementation for a service are usually separate.</para>
            </listitem>
            <listitem>
              <para>Each service has to be implemented as a singleton, which means it is created only once per portal container in a single instance.</para>
            </listitem>
            <listitem>
              <para>A component equals a service. A service must not be a large application. A service can be a little component that reads or transforms a document where the term "component" is often used instead of service.</para>
            </listitem>
          </itemizedlist>
          <para>For example, in the <emphasis role="italic">/lib</emphasis> folder, you can find services for the following databases, caching, and LDAP:</para>
          <itemizedlist>
            <listitem>
              <para>exo.core.component.database-x.y.z.jar</para>
            </listitem>
            <listitem>
              <para>exo.kernel.component.cache-x.y.z.jar</para>
            </listitem>
            <listitem>
              <para>exo.core.component.organization.ldap-x.y.z.jar</para>
            </listitem>
          </itemizedlist>
        </section>
        <section id="DEV.eXoArchitecturePremer.ServiceConfiguration">
          <title>Service configuration </title>
          <para>To declare a service, you must add the <emphasis role="bold">.xml</emphasis> configuration file to a specific place. This file can be in the jar file, in a webapp or in the external configuration directory. If you write a new component for the eXo Container, you should always provide a default configuration in your jar file. This default configuration must be in the /conf/portal/configuration.xml file in your jar.</para>
          <para>A configuration file can specify several services, so there can be several services in one jar file.</para>
          <section id="DEV.eXoArchitecturePremer.KernalXMLSchema">
            <title>Kernel XML Schema </title>
            <para>Containers configuration files must comply with the kernel configuration grammar. Thus, all configurations will contain an XSD declaration like this:</para>
            <programlistingco>
              <areaspec units="linecolumn"/>
              <programlisting language="xml"><![CDATA[
<configuration xmlns="http://www.exoplatform.org/xml/ns/kernel_1_1.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_1.xsd http://www.exoplatform.org/xml/ns/kernel_1_1.xsd">
</configuration>
]]></programlisting>
            </programlistingco>
            <para>The <emphasis role="italic">kernel_1_1.xsd</emphasis> file mentioned in the example above can be found inside <code>exo.kernel.container-x.y.z.jar!org/exoplatform/container/configuration/</code> along with other versions.</para>
          </section>
          <section id="DEV.eXoArchitecturePremer.Components">
            <title>Components </title>
            <para>The service registration within the container is done with the &lt;component&gt; element.</para>
            <para>For example, open the <emphasis role="italic">/webapps/exo-wcm-core/WEB-INF/conf/wcm-core/core-services-configuration.xml</emphasis>. You will see the following code:</para>
            <programlistingco>
              <areaspec units="linecolumn"/>
              <programlisting language="xml"><![CDATA[
    <component>
        <key>org.exoplatform.services.cms.CmsService</key>
        <type>org.exoplatform.services.cms.impl.CmsServiceImpl</type>
    </component>

]]></programlisting>
            </programlistingco>
            <para>Each component has a <emphasis role="italic">key</emphasis> which matches with the qualified Java interface name (<emphasis role="italic">org.exoplatform.services.cms.CmsService</emphasis>).</para>
            <para>The specific implementation class of the component (CmsServiceImpl) is defined in the &lt;type&gt; tag.</para>
            <para>If a service does not have a separate interface, the &lt;type&gt; will be used as the key in the container. This is the case of <emphasis role="italic">ContentInitializerService</emphasis>.</para>
          </section>
          <section id="DEV.eXoArchitecturePremer.Parameters">
            <title>Parameters </title>
            <para>You can provide initial parameters for your service by defining them in the configuration file. The followings are different parameters:</para>
            <itemizedlist>
              <listitem>
                <para>value-param</para>
              </listitem>
              <listitem>
                <para>properties-param</para>
              </listitem>
              <listitem>
                <para>object-param</para>
              </listitem>
              <listitem>
                <para>collection</para>
              </listitem>
              <listitem>
                <para>map</para>
              </listitem>
              <listitem>
                <para>native-array</para>
              </listitem>
            </itemizedlist>
            <section id="DEV.eXoArchitecturePremer.Value-param">
              <title>Value-param </title>
              <para>You can use the value-param to pass a single value to the service.</para>
              <programlistingco>
                <areaspec units="linecolumn"/>
                <programlisting language="xml"><![CDATA[
<component>
  <key>org.exoplatform.services.resources.LocaleConfigService</key>
  <type>org.exoplatform.services.resources.impl.LocaleConfigServiceImpl</type>
  <init-params>
    <value-param>
      <name>locale.config.file</name>
      <value>war:/conf/common/locales-config.xml</value>
    </value-param>
  </init-params>
</component>
]]></programlisting>
              </programlistingco>
              <para>The <emphasis role="italic">LocaleConfigService</emphasis> service accesses the value of value-param in its constructor.</para>
              <programlistingco>
                <areaspec units="linecolumn"/>
                <programlisting language="java"><![CDATA[
package org.exoplatform.services.resources.impl;
public class LocaleConfigServiceImpl implements LocaleConfigService {
  public LocaleConfigServiceImpl(InitParams params, ConfigurationManager cmanager) throws Exception {
    configs_ = new HashMap<String, LocaleConfig>(10);
    String confResource = params.getValueParam("locale.config.file").getValue();
    InputStream is = cmanager.getInputStream(confResource);
    parseConfiguration(is);
  }
}
]]></programlisting>
              </programlistingco>
            </section>
            <section id="DEV.eXoArchitecturePremer.Object-param">
              <title>Object-param </title>
              <para>For the object-param component, you can look at the LDAP service:</para>
              <programlistingco>
                <areaspec units="linecolumn"/>
                <programlisting language="xml"><![CDATA[
<component>
  <key>org.exoplatform.services.ldap.LDAPService</key>
  <type>org.exoplatform.services.ldap.impl.LDAPServiceImpl</type>
  <init-params>
    <object-param>
      <name>ldap.config</name>
      <description>Default ldap config</description>
      <object type="org.exoplatform.services.ldap.impl.LDAPConnectionConfig">
        <field name="providerURL"><string>ldaps://10.0.0.3:636</string></field>
        <field name="rootdn"><string>CN=Administrator,CN=Users,DC=exoplatform,DC=org</string></field>
        <field name="password"><string>exo</string></field>
        <field name="version"><string>3</string></field>
        <field name="minConnection"><int>5</int></field>
        <field name="maxConnection"><int>10</int></field>
        <field name="referralMode"><string>ignore</string></field>
        <field name="serverName"><string>active.directory</string></field>
      </object>
    </object-param>
  </init-params>
</component>
]]></programlisting>
              </programlistingco>
              <para>The object-param is used to create an object (which is actually a Java Bean) passed as a parameter to the service. This object-param is defined by a name, a description and exactly one object. The object tag defines the type of the object, while the field tags define parameters for that object.</para>
              <para>You can see how the service accesses the object in the code below:</para>
              <programlistingco>
                <areaspec units="linecolumn"/>
                <programlisting language="java"><![CDATA[
package org.exoplatform.services.ldap.impl;

public class LDAPServiceImpl implements LDAPService {
  // ...
  public LDAPServiceImpl(InitParams params) {
    LDAPConnectionConfig config = (LDAPConnectionConfig) params.getObjectParam("ldap.config").getObject();
    ...
  }
  // ...
}
]]></programlisting>
              </programlistingco>
              <para>The passed object is <emphasis role="italic">LDAPConnectionConfig</emphasis>, which is a classic Java Bean. It contains all fields defined in the configuration files and also the appropriate getters and setters (not listed here). You also can provide default values. The container creates a new instance of your Java Bean and calls all setters whose values are configured in the configuration file.</para>
              <programlistingco>
                <areaspec units="linecolumn"/>
                <programlisting language="java"><![CDATA[
package org.exoplatform.services.ldap.impl;

public class LDAPConnectionConfig {
  private String providerURL = "ldap://127.0.0.1:389";
  private String rootdn;
  private String password;
  private String version;
  private String authenticationType = "simple";
  private String serverName = "default";
  private int minConnection;
  private int maxConnection;
  private String referralMode = "follow";
  // ...
}
]]></programlisting>
              </programlistingco>
            </section>
            <section id="DEV.eXoArchitecturePremer.RestOfParameterTypes">
              <title>Rest of parameter types </title>
              <para>Other possible parameter types are Collection, Map and Native Array. See the exhaustive reference in the Kernel reference guide.</para>
            </section>
          </section>
        </section>
        <section id="DEV.eXoArchitecturePremer.Plugins">
          <title>Plugins </title>
          <para>Some components may want to offer some extensibilities. For this, they use a plugin mechanism based on the injection method. To offer an extension point for plugins, a component needs to provide a public method that takes an instance of <emphasis role="italic">org.exoplatform.container.xml. ComponentPlugin</emphasis> as a parameter.</para>
          <para>Plugins enable you to provide the structured configuration outside the original declaration of the component. This is the main way to customize eXo Platform to your needs.</para>
          <para>You can have a look at the configuration of the TaxonomyPlugin of the TaxonomyService as below:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<external-component-plugins>
  <target-component>org.exoplatform.services.cms.taxonomy.TaxonomyService</target-component>
  <component-plugin>
    <name>predefinedTaxonomyPlugin</name>
    <set-method>addTaxonomyPlugin</set-method>
    <type>org.exoplatform.services.cms.taxonomy.impl.TaxonomyPlugin</type>
    <init-params><!-- ... --></init-params>
  </component-plugin>
</external-component-plugins>
]]></programlisting>
          </programlistingco>
          <para>The &lt;target-component&gt; defines components that host the extension point. The configuration is injected by the container using the method defined in &lt;set-method&gt; (addTaxonomyPlugin(). The method accepts exactly one argument of the <emphasis role="italic">org.exoplatform.services. cms.categories.impl.TaxonomyPlugin</emphasis> type.</para>
          <para>The content of &lt;init-params&gt; is interpreted by the TaxonomyPlugin object.</para>
        </section>
        <section id="ADM.eXoArchitecturePremer.ConfigureLoadingSequence">
          <title>Configuration loading sequence </title>
          <para>The Kernel startup follows a well-defined sequence to load configuration files. The objects are initialized in the container only after the whole loading sequence is done. Hence, by placing your configuration in the upper location of the sequence, you can override a component declaration by yourself. You will typically do this when you want to provide your own implementation of a component, or declare custom init-params.</para>
          <note>
            <para>The <emphasis role="italic">external-component-plugins</emphasis> declarations are additive, so it is NOT possible to override them.</para>
          </note>
          <para>Configurations for the <emphasis role="italic">RootContainer</emphasis> are loaded first, and then for the <emphasis role="italic">PortalContainers</emphasis>.</para>
          <itemizedlist>
            <listitem>
              <para>Services default RootContainer configurations from JAR files: <emphasis role="italic">/conf/configuration.xml</emphasis>.</para>
            </listitem>
            <listitem>
              <para>External RootContainer configuration will be found at <emphasis role="italic">$exo.conf.dir/configuration.xml</emphasis>.</para>
            </listitem>
            <listitem>
              <para>Services default PortalContainer configurations from JAR files: <emphasis role="italic">/conf/$PORTAL/configuration.xml</emphasis>.</para>
            </listitem>
            <listitem>
              <para>Web applications configurations from WAR files <emphasis role="italic">/WEB-INF/conf/configuration.xml</emphasis>.</para>
            </listitem>
            <listitem>
              <para>External configuration for services of the portal will be found at <emphasis role="italic">$exo.conf.dir/portal/$PORTAL/configuration.xml</emphasis>.</para>
            </listitem>
          </itemizedlist>
          <note>
            <itemizedlist>
              <listitem>
                <para>
                  <emphasis role="italic">$exo.conf.dir</emphasis> is a system property which points to the folder containing external configuration files on the file system. It is passed to the JVM in the startup script like <emphasis role="italic">-Dexo.conf.dir=gatein</emphasis>.</para>
              </listitem>
              <listitem>
                <para>
                  <emphasis role="italic">$PORTAL</emphasis> is the name of the portal container. By default, the name "portal" is unique.</para>
              </listitem>
            </itemizedlist>
          </note>
        </section>
      </section>
      <section id="DEV.eXoArchitecturePremer.GateInExtensions">
        <title>GateIn extensions </title>
        <para>GateIn extensions are special <emphasis role="italic">.war</emphasis> files that are recognized by eXo Platform and contribute to custom configurations to the PortalContainer. To create your own portal, you will have to create a GateIn extension.</para>
        <para>The extension mechanism makes possible to extend or even override portal resources in almost plug-and-play way. You simply add a <emphasis role="italic">.war</emphasis> archive with your custom resources to the war folder and edit the configuration of the PortalContainerConfig service. Customizing a portal does not involve unpacking and repacking the original portal <emphasis role="italic">.war</emphasis> archives. Instead, you need to create your own <emphasis role="italic">.war</emphasis> archive with your own configurations, and modify resources. The content of your custom <emphasis role="italic">.war</emphasis> archive overrides the resources in the original archives.</para>
        <para>The most elegant way to reuse configuration for different coexisting portals is by way of extension mechanism. That is, you can inherit resources and configurations from existing web archives, then simply add extra resources and configurations to your extension, and override ones which need to be changed by including modified copies.</para>
        <note>
          <para>Starter is a web application which has been added to create and start all the portal containers once all the other web applications have already been started. Generally, each web application of a portal container defines several things, such as skins, JavaScripts, Google gadgets and configuration files, at its startup, so the loading order is important. For example, at startup of the web application 1, skins or configuration files or JavaScripts are defined that could depend on another JavaScript from the web application 2. Thus, if the web application 2 is loaded after the web application 1, you will get errors in the merged JavaScript file.</para>
        </note>
        <para>If you ship servlets or servlet filters as part of your portal extension, and these servlets/servlet filters need to access specific resources of a portal during the process of the servlets or filters request, make sure that these servlets/filters are associated with the current portal container. The proper way to do that is making your servlet extend the <emphasis role="italic">org.exoplatform.container.web.AbstractHttpServlet</emphasis> class. This will not only properly initialize the current <emphasis role="italic">PortalContainer</emphasis> for you, but also set the current thread's context ClassLoader to servlets or servlet filters which looks for resources in associated web applications in the order specified by dependencies configuration.</para>
        <para>As similar to filters, make  sure that your filter class extends <emphasis role="italic">org.exoplatform.container.web.AbstractFilter</emphasis>. Both <emphasis role="italic">AbstractHttpServlet</emphasis> and <emphasis role="italic">AbstractFilter</emphasis> have the method named <emphasis role="italic">getContainer()</emphasis>, which returns the current <emphasis role="italic">PortalContainer</emphasis>.</para>
        <section id="DEV.eXoArchitecturePremer.defaultPortalContainer">
          <title>Default Portal Container </title>
          <para>eXo Platform comes with a pre-configured PortalContainer named "portal". The configuration of this portal container ties the core and the extended services stack. The default Portal Container is started from <emphasis role="italic">portal.war</emphasis> and naturally maps to the <emphasis role="italic">/portal</emphasis> URL.</para>
          <para>The GateIn extension mechanism lets you extend the portal context easily. With this feature, you only need to make your desired modifications on your extension, but NOT on the <emphasis role="italic">portal.war</emphasis>. As a result, your upgrades will become simple as your <emphasis role="italic">extension.war</emphasis> is totally independent of the <emphasis role="italic">portal.war</emphasis>.</para>
          <para>This extensibility is achieved via 2 advanced features of the <emphasis role="italic">PortalContainer</emphasis>:</para>
          <itemizedlist>
            <listitem>
              <para>A unified ClassLoader: any classpath resource, such as property files, will be accessible as if it was inside the <emphasis role="italic">portal.war</emphasis>.</para>
            </listitem>
          </itemizedlist>
          <note>
            <para>This is valid only for resources but not for Java classes.</para>
          </note>
          <itemizedlist>
            <listitem>
              <para>A unified ServletContext: any web resources contained in your <emphasis role="italic">extension.war</emphasis> will be accessible from /portal/ uri.</para>
            </listitem>
          </itemizedlist>
          <para>For more details on how to make a simple extension for a "portal" container, see the <link linkend="DEV.eXoArchitecturePremer.RegisterExtension">Register Extension</link> section.</para>
        </section>
        <section id="DEV.eXoArchitecturePremer.RegisterExtension">
          <title>Register Extension </title>
          <para>The webapps are loaded in the order defined in the list of dependencies of the <emphasis role="italic">PortalContainerDefinition</emphasis>. You then need to deploy the <emphasis role="italic">starter.war</emphasis>; otherwise, the webapps will be loaded in the default application server's order, such as the loading order of the Application Server.</para>
          <para>If you need to customize your portal by adding a new extension and/or a new portal, you need to define the related <emphasis role="italic">PortalContainerDefinitions</emphasis> and to deploy the starter. Otherwise, you do not need to define any <emphasis role="italic">PortalContainerDefinition</emphasis>.</para>
          <para>First, you need to tell eXo Platform to load <emphasis role="italic">WEB-INF/conf/configuration.xml</emphasis> of your extension, you need to declare it as a <emphasis role="italic">PortalContainerConfigOwner</emphasis>. Next, open the file <emphasis role="italic">WEB-INF/web.xml</emphasis> of your extension and add a listener:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<web-app>
  <display-name>my-portal</display-name>
    <listener>
      <listener-class>org.exoplatform.container.web.PortalContainerConfigOwner</listener-class>
    </listener>
  <!-- ... -->
</web-app>
]]></programlisting>
          </programlistingco>
          <para>You need to register your extension in the portal container. This is done by the <emphasis role="bold">.xml</emphasis> configuration file like this: </para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<external-component-plugins>
  <target-component>org.exoplatform.container.definition.PortalContainerConfig</target-component>
  <component-plugin>
    <name>Change PortalContainer Definitions</name>
    <set-method>registerChangePlugin</set-method>
    <type>org.exoplatform.container.definition.PortalContainerDefinitionChangePlugin</type>
    <init-params>
      <object-param>
        <name>change</name>
        <object type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependencies">
        <field name="dependencies">
          <collection type="java.util.ArrayList">
            <value>
              <string>my-portal</string>
            </value>
            <value>
              <string>my-portal-resources</string>
            </value>              
          </collection>
        </field>
        </object>
      </object-param> 
      <value-param>
        <name>apply.default</name>
        <value>true</value>
      </value-param>       
    </init-params>
  </component-plugin>
</external-component-plugins>
]]></programlisting>
          </programlistingco>
          <para>A <emphasis role="italic">PortalContainerDefinitionChangePlugin</emphasis> plugin is defined to the <emphasis role="italic">PortalContainerConfig</emphasis>. The plugin declares a list of dependencies that are webapps. The <emphasis role="italic">apply.default=true</emphasis> indicates that your extension is actually extending <emphasis role="italic">portal.war</emphasis>. You  need to package your extension into a <emphasis role="bold">.war</emphasis> file and put it to the tomcat webapps folder, then restart the server.</para>
          <para>In your portal, if you want to add your own property file to support localization for your keys, you can do as follows:</para>
          <itemizedlist>
            <listitem>
              <para>Put your property file into the <emphasis role="italic">/WEB-INF/classes/locale/portal</emphasis> folder of your extension project.</para>
            </listitem>
          </itemizedlist>
          <itemizedlist>
            <listitem>
              <para>Add an external plugin declaration to the <emphasis role="italic">.xml</emphasis> configuration file.   </para>
            </listitem>
          </itemizedlist>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<external-component-plugins>
  <!-- The full qualified name of the ResourceBundleService -->
  <target-component>org.exoplatform.services.resources.ResourceBundleService</target-component>
  <component-plugin>
    <!-- The name of the plugin -->
    <name>Sample ResourceBundle Plugin</name>
    <!-- The name of the method to call on the ResourceBundleService in order to register the ResourceBundles -->
    <set-method>addResourceBundle</set-method>
    <!-- The full qualified name of the BaseResourceBundlePlugin -->
    <type>org.exoplatform.services.resources.impl.BaseResourceBundlePlugin</type>
    <init-params>
      <!--values-param>
        <name>classpath.resources</name>
        <description>The resources that start with the following package name should be load from file system</description>
        <value>locale.portlet</value>
      </values-param-->
      <values-param>
        <name>init.resources</name>
        <description>Store the following resources into the db for the first launch </description>
        <value>locale.portal.sample</value>
      </values-param>
      <values-param>
        <name>portal.resource.names</name>
        <description>The properties files of the portal , those file will be merged
        into one ResoruceBundle properties </description>
        <value>locale.portal.sample</value>
      </values-param>
    </init-params>
  </component-plugin>
</external-component-plugins>
]]></programlisting>
          </programlistingco>
        </section>
      </section>
      <section id="DEV.eXoArchitecturePremer.JavaContentRepository">
        <title>Java Content Repository </title>
        <para>All data of eXo Platform are stored in a Java Content Repository (JCR). JCR is the Java specification (<ulink url="http://jcp.org/aboutJava/communityprocess/final/jsr170/index.html">JSR-170</ulink>) for a type of Object Database tailored to the storage, searching, and retrieval of hierarchical data. It is useful for the content management systems, which require storage of objects associated with metadata. The JCR also provides versioning, transactions, observations of changes in data, and import or export of data in XML. The data in JCR are stored hierarchically in a tree of nodes with associated properties.</para>
        <para>Also, the JCR is primarily used as an internal storage engine. Accordingly, eXo Content lets you manipulate JCR data directly in several places. </para>
        <section id="DEV.eXoArchitecturePremer.Repositories&amp;Workspaces">
          <title>Repositories and workspaces </title>
          <para>A content repository consists of one or more workspaces. Each workspace contains a tree of items.</para>
          <para>
<citetitle>
<emphasis role="bold">
Access the repository's content from a service
</emphasis>
</citetitle>
</para>
          <para>
            <emphasis role="bold">1.</emphasis> Get the session object.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
import javax.jcr.Session;

import org.exoplatform.services.jcr.RepositoryService;
import org.exoplatform.services.jcr.core.ManageableRepository;
import org.exoplatform.services.jcr.ext.common.SessionProvider;
import org.exoplatform.services.wcm.utils.WCMCoreUtils;

// For example
RepositoryService repositoryService = WCMCoreUtils.getService(RepositoryService.class);
ManageableRepository manageableRepository = repositoryService.getRepository(repository);
SessionProvider sessionProvider = WCMCoreUtils.getSessionProvider();
Session session = sessionProvider.getSession(workspace, manageableRepository);
]]></programlisting>
          </programlistingco>
          <para>
            <emphasis role="bold">i.</emphasis> Obtain the <emphasis role="italic">javax.jcr.Repository</emphasis> object via one of the following ways:</para>
          <para>
            <emphasis role="bold">The first way</emphasis>
          </para>
          <para>Call the <emphasis role="italic">getRepository()</emphasis> method of <emphasis role="italic">RepositoryService</emphasis>.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
RepositoryService repositoryService = (RepositoryService) container.getComponentInstanceOfType(RepositoryService.class);
Repository repository = repositoryService.getRepository("repositoryName");
]]></programlisting>
          </programlistingco>
          <para>
            <emphasis role="bold">The second way</emphasis>
          </para>
          <para>Call the <emphasis role="italic">getCurrentRepository()</emphasis> method, especially when you plan to use a single repository which covers more than 90% of usecases.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
// set current repository at initial time
RepositoryService repositoryService = (RepositoryService) container.getComponentInstanceOfType(RepositoryService.class);
repositoryService.setCurrentRepositoryName("repositoryName");
....
// retrieve and use this  repository
Repository repository = repositoryService.getCurrentRepository();
]]></programlisting>
          </programlistingco>
          <para>
            <emphasis role="bold">The third way</emphasis>
          </para>
          <para>Using JNDI as specified in <ulink url="http://jcp.org/aboutJava/communityprocess/final/jsr170/index.html">JSR-170</ulink>.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
Context ctx = new InitialContext();
Repository repository =(Repository) ctx.lookup("repositoryName");
]]></programlisting>
          </programlistingco>
          <para>
            <emphasis role="bold">ii.</emphasis> Log in the server to get a Session object by either of two ways:</para>
          <para>
            <emphasis role="bold">The first way</emphasis>
          </para>
          <para>Create a Credential object, for example:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
Credentials credentials = new SimpleCredentials("exo", "exo".toCharArray());

Session jcrSession = repository.login(credentials, "production");
]]></programlisting>
          </programlistingco>
          <para>
            <emphasis role="bold">The second way</emphasis>
          </para>
          <para>Log in the server without using a Credential object.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
Session jcrSession = repository.login("production");
]]></programlisting>
          </programlistingco>
          <para>This way is only applied when you run an implementation of eXo Platform. The eXo Platform implementation will directly leverage the organization and security services that rely on LDAP or DB storage and JAAS login modules. Single-Sign-On products can now also be used as eXo Platform v.2 which supports them.</para>
          <note>
            <para>There are some JCR Session common considerations as follows:</para>
            <para>Because <emphasis role="italic">javax.jcr.Session</emphasis> is not a safe object of thread, it is recommended that you should not share it between threads.</para>
            <para>Do not use the System session from the user-related code because a system session has unlimited rights. Call <emphasis role="italic">ManageableRepository.getSystemSession()</emphasis> from the process-related code only.</para>
            <para>Call <emphasis role="italic">Session.logout()</emphasis> explicitly to release resources assigned to the session.</para>
            <para>When designing your application, you should take care of the Session policy inside your application. Two strategies are possible: Stateless (Session per business request) and Stateful (Session per User) or some mixings.</para>
          </note>
          <para>
            <emphasis role="bold">2.</emphasis> Retrieve your node content of the session object.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
String path = "/"; // put your node path here

Node node = (Node) session.getItem(path);
]]></programlisting>
          </programlistingco>
        </section>
        <section id="DEV.eXoArchitecturePremer.WorkingWithNodes&amp;Properties">
          <title>Tree structure: working with nodes and properties </title>
          <para>Every node can only have one primary node type. The primary node type defines names, types and other characteristics of the properties, and the number of its allowed child nodes. Every node has a special property called <emphasis role="italic">jcr:primaryType</emphasis> that records the name of its primary node type. A node may also have one or more mixin types. These are node type definitions that can mandate extra characteristics (for example, more child nodes, properties and their respective names and types).</para>
          <para>Data are stored in properties, which may hold simple values, such as numbers, strings or binary data of arbitrary length.</para>
          <para>The JCR API provides methods to define node types and node properties, create or delete nodes, and add or delete properties from an existing node.</para>
          <para>You can refer to the "6.2.3 Node Read Methods" in the JCR Specification document.</para>
        </section>
      </section>
    </section>
  </chapter>
  <chapter id="DEV.CreatingYourOwnPortal">
    <title>Create Your Own Portal </title>
    <para>When working with eXo Platform, it is important not to modify the source code. This will ensure compatibility with future upgrades, and support will be simplified. To customize your portal, you need to create an extension project by providing your own artifacts as a set of wars/jars/ears.</para>
    <para>This chapter will show you how to create a portal via the following topics:</para>
    <itemizedlist>
      <listitem>
        <para>
          <link linkend="DEV.CreateYourOwnPortal.CreateExtensionProject">Create your extension project</link>
        </para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.CreateYourOwnPortal.StructureOfPortalPages&amp;Menus">Structure of portal, pages and menus</link>
        </para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.CreateYourOwnPortal.AddOrRemoveLanguages">Add/Remove a language</link>
        </para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.CreateYourOwnPortal.CreateCustomLookAndFeel">Create custom look and feel</link>
        </para>
        <itemizedlist>
          <listitem>
            <para>
              <link linkend="DEV.CreateYourOwnPortal.StructureStylesheet">Structure stylesheet</link>
            </para>
          </listitem>
          <listitem>
            <para>
              <link linkend="DEV.CreateYourOwnPortal.ConfigureSkinInPlatform">Configure skin in eXo Platform</link>
            </para>
          </listitem>
          <listitem>
            <para>
              <link linkend="DEV.CreateYourOwnPortal.ConfigureSkinInWCM">Configure skin in WCM</link>
            </para>
          </listitem>
          <listitem>
            <para>
              <link linkend="DEV.CreateYourOwnPortal.CreateAndApplyGloabalStylesheet">Create and apply Global stylesheet</link>
            </para>
          </listitem>
          <listitem>
            <para>
              <link linkend="DEV.CreateYourOwnPortal.Sharedlayout">Sharedlayout.xml</link>
            </para>
          </listitem>
          <listitem>
            <para>
              <link linkend="DEV.CreateYourOwnPortal.CustomizeAdminbar">Customize the Admin bar</link>
            </para>
          </listitem>
        </itemizedlist>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.CreateYourOwnPortal.AddJavaScriptToYourPortal">Add JavaScript to your portal</link>
        </para>
      </listitem>
    </itemizedlist>
    <section id="DEV.CreateYourOwnPortal.CreateExtensionProject">
      <title>Create your extension project </title>
      <para>A custom extension contains two mandatory items:</para>
      <itemizedlist>
        <listitem>
          <para>
            <emphasis role="bold">extension webapp</emphasis> contains resources and kernel configurations.</para>
        </listitem>
        <listitem>
          <para>
            <emphasis role="bold">extension activator jar</emphasis> identifies your webapp as a dependency of the portal container.</para>
        </listitem>
      </itemizedlist>
      <para>To see the sample extension package, visit <ulink url="http://anonsvn.jboss.org/repos/gatein/portal/trunk/examples/extension/">here</ulink>.</para>
      <para>Once you have modified the sample extension to build your own portal, use the <emphasis role="italic">maven clean install</emphasis> command to create the archive files.</para>
      <para>
<citetitle>
<emphasis role="bold">
Deploy your extension in Tomcat
</emphasis>
</citetitle>
</para>
      <para>
        <emphasis role="bold">1.</emphasis> Add the <emphasis role="italic">sample-ext.war</emphasis> file from the <emphasis role="italic">sample/extension/war/target</emphasis>/ to the <emphasis role="italic">tomcat/webapps</emphasis> directory.</para>
      <para>
        <emphasis role="bold">2.</emphasis> Add the <emphasis role="italic">starter</emphasis> folder from <emphasis role="italic">starter/war/target</emphasis>/ to the <emphasis role="italic">tomcat/webapps</emphasis> directory.</para>
      <para>
        <emphasis role="bold">3.</emphasis> Rename the <emphasis role="italic">starter</emphasis> directory (unzipped folder) to <emphasis role="italic">starter.war</emphasis>.</para>
      <note>
        <para>This will only work if the starter.war is the last .war file to be loaded, so you may need to rename it if your war files are loaded in the alphabetical order.</para>
      </note>
      <para>
        <emphasis role="bold">4.</emphasis> Add the .jar file named <emphasis role="italic">exo.portal.sample.extension.config-X.Y.Z.jar</emphasis> from <emphasis role="italic">sample/extension/config/target</emphasis>/ to the <emphasis role="italic">tomcat/lib</emphasis> directory.</para>
      <para>
        <emphasis role="bold">5.</emphasis> Add the .jar file named <emphasis role="italic">exo.portal.sample.extension.jar-X.Y.Z.jar</emphasis> from <emphasis role="italic">sample/extension/jar/target</emphasis>/ to the <emphasis role="italic">tomcat/lib</emphasis> directory.</para>
      <para>For the JBoss deployment with more details, refer to the <ulink url="../../../reference/html/bk02.html">GateIn Reference Guide</ulink>.</para>
    </section>
    <section id="DEV.CreateYourOwnPortal.Create_default_portal">
      <title>Define a default portal </title>
      <para>When entering the link of the portal in the address bar of the browser without defining a specific portal (e.g. <emphasis role="italic">localhost:8080/portal</emphasis>/), you will be directed to a default portal.</para>
      <para>To configure the default portal, the portal must already exist first. Then, you just use the <emphasis role="italic">NewPortalConfigListener</emphasis> plugin as the sample code below.</para>
      <para>To use this plugin in the component configuration, you must use the following target-component:</para>
      <programlistingco>
        <areaspec units="linecolumn"/>
        <programlisting language="xml"><![CDATA[
<target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
]]></programlisting>
      </programlistingco>
      <para>The sample code below is the configuration of the portal named "<emphasis role="italic">default</emphasis>".</para>
      <programlistingco>
        <areaspec units="linecolumn"/>
        <programlisting language="xml"><![CDATA[
<external-component-plugins>
		<target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
		<component-plugin>
			<name>default.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>
				<value-param>
					<name>default.portal</name>
					<description>The default portal for checking db is empty or not</description>
					<value>default</value>
				</value-param>
				<object-param>
					....
				</object-param>
			</init-params>
		</component-plugin>
	</external-component-plugins>
]]></programlisting>
      </programlistingco>
      <para>
        <emphasis role="bold">Init-param</emphasis>
      </para>
      <informaltable>
        <tgroup cols="4">
          <thead>
            <row>
              <entry>Name</entry>
              <entry>Type</entry>
              <entry>Value</entry>
              <entry> Description</entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>default.portal</entry>
              <entry>String</entry>
              <entry>default</entry>
              <entry> The name of the default portal to which you are redirected when accessing the portal.</entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>
    </section>
    <section id="DEV.CreateYourOwnPortal.StructureOfPortalPages&amp;Menus">
      <title>Structure of portal, pages and menus </title>
      <para>You can create multiple pages within a single portal. Permissions can be defined to make them visible only to specific groups and/or users. This chapter describes how to define this structure.</para>
      <section id="DEV.CreateYourOwnPortal.PageLayout">
        <title>Portal navigation </title>
        <para>The portal navigation incorporates the pages that can be accessed even when the user is not logged in assuming the applicable permissions allow the public access). For example, several portal navigations are used when a company owns multiple trademarks, and sets up a website for each of them.</para>
        <para>The configuration of the "classic" portal can be found in the <emphasis role="italic">/src/main/WEB-INF/conf/portal/portal/classic</emphasis> directory of your extension webapp.</para>
        <citetitle>
<para>
<emphasis role="bold">portal.xml</emphasis>
</para>
</citetitle>
        <para>The <emphasis role="italic">portal.xml</emphasis> file describes the layout and portlets that will be shown on all pages. The layout usually contains the banner, footer, menu and breadcrumbs portlets. eXo Platform 3.5 is extremely configurable as every view element (even the banner and footer) is a portlet.</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<portal-config xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_0 http://www.gatein.org/xml/ns/gatein_objects_1_0">
   <portal-name>classic</portal-name>
   <locale>en</locale>
   <access-permissions>Everyone</access-permissions>
   <edit-permission>*:/platform/administrators</edit-permission>
   <properties>
      <entry key="sessionAlive">onDemand</entry>
      <entry key="showPortletInfo">1</entry>
   </properties>

   <portal-layout>
      <portlet-application>
         <portlet>
            <application-ref>web</application-ref>
            <portlet-ref>BannerPortlet</portlet-ref>
            <preferences>
               <preference>
                  <name>template</name>
                  <value>par:/groovy/groovy/webui/component/UIBannerPortlet.gtmpl</value>
                  <read-only>false</read-only>
               </preference>
            </preferences>
         </portlet>
         <access-permissions>Everyone</access-permissions>
         <show-info-bar>false</show-info-bar>
      </portlet-application>

      <portlet-application>
         <portlet>
            <application-ref>web</application-ref>
            <portlet-ref>NavigationPortlet</portlet-ref>
         </portlet>
         <access-permissions>Everyone</access-permissions>
         <show-info-bar>false</show-info-bar>
      </portlet-application>

      <portlet-application>
         <portlet>
            <application-ref>web</application-ref>
            <portlet-ref>BreadcumbsPortlet</portlet-ref>
         </portlet>
         <access-permissions>Everyone</access-permissions>
         <show-info-bar>false</show-info-bar>
      </portlet-application>

      <page-body> </page-body>

      <portlet-application>
         <portlet>
            <application-ref>web</application-ref>
            <portlet-ref>FooterPortlet</portlet-ref>
            <preferences>
               <preference>
                  <name>template</name>
                  <value>par:/groovy/groovy/webui/component/UIFooterPortlet.gtmpl</value>
                  <read-only>false</read-only>
               </preference>
            </preferences>
         </portlet>
         <access-permissions>Everyone</access-permissions>
         <show-info-bar>false</show-info-bar>
      </portlet-application>

   </portal-layout>

</portal-config>
]]></programlisting>
        </programlistingco>
        <para>Each portlet can be configured with a set of preferences, which will be further detailed in <link linkend="DEV.WorkingwithApplications">Chapter 5</link>.</para>
        <para>It is also possible to apply a nested container that can also contain portlets. Row, column or tab containers are then responsible for the layout of their child portlets.</para>
        <para>Each application references a portlet using the id: <emphasis role="italic">portal#{portalName}:/{portletWarName}/{portletName}/{uniqueId}</emphasis>
        </para>
        <para>The &lt;page-body&gt; &lt;/page-body&gt; tag is a placeholder for the different pages of your portal, it defines where Platform should render the current page. When the user opens a new portal page, all portlets of the portal layout (<emphasis role="italic">portal.xml</emphasis>) are remained, whereas the content of &lt;page-body&gt; switches to the page opened by the user.</para>
        <para>The defined "classic" portal is accessible to "Everyone" (at <emphasis role="italic">/portal/classic</emphasis>) but only members of the group <emphasis role="italic">/platform/administrators</emphasis> can edit it.</para>
        <citetitle>
<para>
<emphasis role="bold">pages.xml</emphasis>
</para>
</citetitle>
        <para>The structure of the <emphasis role="italic">pages.xml</emphasis> configuration file is very similar to that in the <emphasis role="italic">portal.xml</emphasis> of the "classic" portal and it can also contain container tags. Each application can decide whether to render the portlet border, the window state, the icons or portlet's mode.</para>
        <para>This is the example of the <emphasis role="italic">pages.xml</emphasis> file of the "classic" portal.</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<page-set xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_0 http://www.gatein.org/xml/ns/gatein_objects_1_0">

   <page>
      <name>homepage</name>
      <title>Home Page</title>
      <access-permissions>Everyone</access-permissions>
      <edit-permission>*:/platform/administrators</edit-permission>
      <portlet-application>
         <portlet>
            <application-ref>web</application-ref>
            <portlet-ref>HomePagePortlet</portlet-ref>
            <preferences>
               <preference>
                  <name>template</name>
                  <value>system:/templates/groovy/webui/component/UIHomePagePortlet.gtmpl</value>
                  <read-only>false</read-only>
               </preference>
            </preferences>
         </portlet>
         <title>Home Page portlet</title>
         <access-permissions>Everyone</access-permissions>
         <show-info-bar>false</show-info-bar>
         <show-application-state>false</show-application-state>
         <show-application-mode>false</show-application-mode>
      </portlet-application>
   </page>

   <page>
      <name>sitemap</name>
      <title>Site Map</title>
      <access-permissions>Everyone</access-permissions>
      <edit-permission>*:/platform/administrators</edit-permission>
      <portlet-application>
         <portlet>
            <application-ref>web</application-ref>
            <portlet-ref>SiteMapPortlet</portlet-ref>
         </portlet>
         <title>SiteMap</title>
         <access-permissions>Everyone</access-permissions>
         <show-info-bar>false</show-info-bar>
      </portlet-application>
   </page>
   .......
</page-set>
]]></programlisting>
        </programlistingco>
        <note>
          <para>See <link linkend="DEV.WorkingwithApplications">Chapter 5</link> to learn more about the portlet configuration within the <emphasis role="italic">pages.xml</emphasis> file.</para>
        </note>
        <citetitle>
<para>
<emphasis role="bold">navigation.xml</emphasis>
</para>
</citetitle>
        <para>The <emphasis role="italic">navigation.xml</emphasis> file defines all the navigation nodes of the portal. The syntax is simply using the nested node tags. Each node refers to a page defined in the <emphasis role="italic">pages.xml</emphasis> file that will be explained later.</para>
        <para>If the administrator wants to create node labels for each language, he will have to use <emphasis role="italic">xml:lang</emphasis> attribute in the label tag with the value of <emphasis role="italic">xml:lang</emphasis> is set to the relevant locale.</para>
        <para>Otherwise, if the administrator wants the node label is localized by resource bundle files, the <emphasis role="italic">#{...}</emphasis> syntax will be used. The enclosed property name serves as a key that is automatically passed to the internationalization mechanism. Thus, the emphasis property name is replaced with a localized value taken from the associated properties file matching the current locale.</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<node-navigation>
  <owner-type>portal</owner-type>
  <owner-id>classic</owner-id>
  <priority>1</priority>
  <page-nodes>
    <node>
      <uri>home</uri>
      <name>home</name>
      <label>#{portal.classic.home}</label>
      <page-reference>portal::classic::homepage</page-reference>
    </node>
    <node>
      <uri>webexplorer</uri>
      <name>webexplorer</name>
      <label>#{portal.classic.webexplorer}</label>
      <page-reference>portal::classic::webexplorer</page-reference>
    </node>
  </page-nodes>
</node-navigation>
]]></programlisting>
        </programlistingco>
        <para>This navigation tree is shown and reused in different portlets, such as sitemap, navigation or breadcrumbs. The breadcrumbs portlet renders the position of the current navigation node.</para>
        <note>
          <para>For the top nodes, the URI and the navigation node name must have the same value. For other nodes, the URI is composed like <emphasis role="italic">&lt;uri&gt;contentmanagement/fileexplorer&lt;/uri&gt;</emphasis> where 'contentmanagement' is the name of the parent node, and 'fileexplorer' is the name of node (<emphasis role="italic">&lt;name&gt;fileexplorer&lt;/name&gt;</emphasis>).</para>
        </note>
      </section>
      <section id="DEV.CreateYourOwnPortal.VisibilityPages">
        <title>Visibility of pages </title>
        <para>When you configure the <emphasis role="italic">navigation.xml</emphasis> file, sometimes you need to set the visibility of page (node).</para>
        <para>To configure the page visibility, simply put <emphasis role="italic">&lt;visibility&gt;type_of_visibility&lt;/visibility&gt;</emphasis> as a child of the <emphasis role="italic">&lt;node&gt;</emphasis> tag.</para>
        <para>eXo Platform supports 4 types of page visibility, including:</para>
        <itemizedlist>
          <listitem>
            <para>DISPLAYED: The page will be displayed.</para>
          </listitem>
          <listitem>
            <para>HIDDEN: The page is not visible in the navigation but can be accessed directly with its URL.</para>
          </listitem>
          <listitem>
            <para>SYSTEM: It is a system page which is visible to superusers. In particular, only superusers can change or delete this system page. </para>
          </listitem>
          <listitem>
            <para>TEMPORAL: The page is displayed in related time range. When the visibility of TEMPORAL page is configured, the start and end date can be specified by using <emphasis role="italic">&lt;startpublicationdate&gt;</emphasis> and <emphasis role="italic">&lt;endpublicationdate&gt;</emphasis>. For example:</para>
          </listitem>
        </itemizedlist>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<node>
  ...
  <visibility>TEMPORAL</visibility>
  <startpublicationdate>01/13/2011 12:46:38</startpublicationdate>
  <endpublicationdate>01/20/2011 18:46:42</endpublicationdate>
</node>
]]></programlisting>
        </programlistingco>
        <itemizedlist>
          <listitem>
            <para>To hide a page from menu and navigation, use <emphasis role="italic">&lt;visibility&gt;HIDDEN&lt;/visibility&gt;</emphasis>:</para>
          </listitem>
        </itemizedlist>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<node-navigation xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_0 http://www.gatein.org/xml/ns/gatein_objects_1_0">
  <page-nodes>
    <node>
      <uri>sitemap</uri>
      <name>sitemap</name>
      <label>#{portal.classic.sitemap}</label>
      <visibility>HIDDEN</visibility>
      <page-reference>portal::classic::sitemap</page-reference>
    </node>
    ...
  </page-nodes>
</node-navigation>
]]></programlisting>
        </programlistingco>
      </section>
      <section id="DEV.CreateYourOwnPortal.PagesAccessPermission">
        <title>Page access permission </title>
        <para>You can easily restrict the access of selected pages and navigation nodes to certain groups and users. You just need to create <emphasis role="italic">pages.xml</emphasis> and <emphasis role="italic">navigation.xml</emphasis> files in folders named after groups and users to which you want to give permission:</para>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="italic">sample-ext/portal/group/group-name/your files</emphasis>
            </para>
          </listitem>
        </itemizedlist>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="italic">sample-ext/portal/user/username/your files</emphasis>
            </para>
          </listitem>
        </itemizedlist>
        <para>As you know, the permission on a page has two types: access (view the page) and edit. </para>
        <para>To configure them, edit the <emphasis role="italic">pages.xml</emphasis> file and put tags: <emphasis role="italic">&lt;access-permissions&gt;</emphasis> and <emphasis role="italic">&lt;edit-permission&gt;</emphasis>.</para>
        <para>Currently, eXo Platform supports several access permissions but only one edit permission. It means that you can configure to make many groups to have the access permission but you can only set one group for edit permission.</para>
        <para>For example:</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<page>
  <name>newStaff</name>
  <title>New Staff</title>
  <access-permissions>manager:/organization/management/executive-board;member:/organization/management/executive-board</access-permissions>
  <edit-permission>manager:/organization/management/executive-board</edit-permission>
  ...
</page>
]]></programlisting>
        </programlistingco>
      </section>
    </section>
    <section id="DEV.CreateYourOwnPortal.EnableDisableDriveCreation">
      <title>Enable/Disable a drive creation during the portal creation </title>
      <para>When a portal is created, a drive with the same name as the portal is also automatically created. However, you can decide if such a drive is automatically created or not by using two parameters named <emphasis role="italic">autoCreatedDrive</emphasis>, and <emphasis role="italic">targetDrives</emphasis> in the <emphasis role="italic">CreateLivePortalEventListener</emphasis> external component plugin.</para>
      <programlistingco>
        <areaspec units="linecolumn"/>
        <programlisting language="xml"><![CDATA[
<external-component-plugins>
    <target-component>org.exoplatform.services.listener.ListenerService</target-component>
    <component-plugin>
        <name>org.exoplatform.portal.config.DataStorage.portalConfigCreated</name>
        <set-method>addListener</set-method>
        <type>org.exoplatform.services.wcm.portal.listener.CreateLivePortalEventListener</type>
        <description>this listener creates a new live portal content storage.</description>
        <init-params>
            <value-param>
                <name>autoCreatedDrive</name>
                <description>A drive will be automatically created during the portal creation.</description>
                <value>false</value>
            </value-param>
            <values-param>
                <name>targetDrives</name>
                <description>The list of drives which are automatically created during the portal creation with
                    "autoCreatedDrive=false".
                </description>
                <value>acme</value>
            </values-param>
        </init-params>
    </component-plugin>
</external-component-plugins>
]]></programlisting>
      </programlistingco>
      <itemizedlist>
        <listitem>
          <para>If <emphasis role="italic">autoCreatedDrive=true</emphasis>, a drive will be automatically created during the portal creation regardless of <emphasis role="italic">targetDrives</emphasis>. In case <emphasis role="italic">autoCreatedDrive</emphasis> is not specified, then its default value is <emphasis role="italic">true</emphasis>.</para>
        </listitem>
        <listitem>
          <para>If <emphasis role="italic">autoCreatedDrive=false</emphasis>, only drives listed in <emphasis role="italic">targetDrives</emphasis> are created. In case <emphasis role="italic">targetDrives</emphasis> is not specified, no drives are created.</para>
        </listitem>
      </itemizedlist>
    </section>
    <section id="DEV.CreateYourOwnPortal.AddOrRemoveLanguages">
      <title>Add/Remove a language </title>
      <para>Developer can define new or remove a defined language through the locale configuration file. The resource is managed by <emphasis role="italic">org.exoplatform.services.resources.LocaleConfigService</emphasis> as following:</para>
      <programlistingco>
        <areaspec units="linecolumn"/>
        <programlisting language="xml"><![CDATA[
<component>
    <key>org.exoplatform.services.resources.LocaleConfigService</key>
    <type>org.exoplatform.services.resources.impl.LocaleConfigServiceImpl</type>
      <init-params>
        <value-param>
          <name>locale.config.file</name>
          <value>war:/conf/common/locales-config.xml</value>
        </value-param>
      </init-params>
  </component>
]]></programlisting>
      </programlistingco>
      <para>All languages defined in the <emphasis role="italic">locale-config.xml</emphasis> file are listed in the <link linkend="DEV.Interface_Language_Setting_window">
          <emphasis role="bold">Interface Language Settings</emphasis>
        </link> window.</para>
      <section id="DEV.CreateYourOwnPortal.AddNewLanguages">
        <title>Add a new language </title>
        <para>To add a new language, you need to add the corresponding language node in the <emphasis role="italic">locale-config.xml</emphasis> file. Next, you must create a new <emphasis role="italic">resource bundle</emphasis> file containing the suffix name as the key of the added node.</para>
        <para>For example, to add Italian, do as follows:</para>
        <para>
          <emphasis role="bold">1.</emphasis> Add the following node to the <emphasis role="italic">locale-config.xml</emphasis> file.</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<locale-config>
  <locale>it</locale>
  <output-encoding>UTF-8</output-encoding>
  <input-encoding>UTF-8</input-encoding>
  <description>Default configuration for Italian locale</description>
</locale-config>
]]></programlisting>
        </programlistingco>
        <para>
          <emphasis role="bold">2.</emphasis> Create a new <emphasis role="italic">resource bundle</emphasis> as <emphasis role="bold">
            <emphasis role="italic">webui_it.properties</emphasis>
          </emphasis> in the <emphasis role="italic">myextension.war/WEB-INF/classes/locale/portal</emphasis> folder.</para>
        <note>
          <para>This step is necessary because the Resource Bundle Service of the portal will find keys and values in the <emphasis role="italic">resource bundle</emphasis> of each corresponding language. </para>
        </note>
        <para>
          <emphasis role="bold">3.</emphasis> Restart the server.</para>
        <para>To check if the added language takes effect, hover the mouse over your username on the <emphasis role="bold">Administration</emphasis> bar and click <emphasis role="bold">Change Language</emphasis>. In the <emphasis role="bold">Interface Language Settings</emphasis> window that appears, you will see the Italian is listed as below:</para>
        <para>
          <anchor id="DEV.Interface_Language_Setting_window"/>
        </para>
        <para>
          <mediaobject>
            <imageobject role="fo">
              <imagedata align="center" fileref="images/example_addItalian.png" format="PNG" scalefit="1" width="150mm"/>
            </imageobject>
            <imageobject role="html">
              <imagedata align="center" fileref="images/example_addItalian.png" format="PNG" scalefit="0" width="150mm"/>
            </imageobject>
          </mediaobject>
        </para>
      </section>
      <section id="DEV.CreateYourOwnPortal.RemoveLanguages">
        <title>Remove a language </title>
        <para>To remove an existing language, you need to delete the relevant language node in the <emphasis role="italic">locale-config.xml</emphasis> file and all files containing the suffix name as the key of language.</para>
        <para>For example, to remove French, do as follows:</para>
        <para>
          <emphasis role="bold">1.</emphasis> Find and remove the following node from the <emphasis role="italic">locale-config.xml</emphasis> file.</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<locale-config>
  <locale>fr</locale>
  <output-encoding>UTF-8</output-encoding>
  <input-encoding>UTF-8</input-encoding>
  <description>Default configuration for france locale</description>
</locale-config>
]]></programlisting>
        </programlistingco>
        <para>
          <emphasis role="bold">2.</emphasis> Continue removing all <emphasis role="italic">resource bundle</emphasis> files containing the suffix name as <emphasis role="bold">fr</emphasis> in all folders.</para>
        <note>
          <para>It is recommended this step be done to delete unnecessary data in the application.</para>
        </note>
        <para>  <emphasis role="bold">3.</emphasis> Restart the server.</para>
        <para>To check if French is removed, hover the mouse over your username on the <emphasis role="bold">Administration bar</emphasis> and click the <emphasis role="bold">Change Language</emphasis>.</para>
        <para>In the <emphasis role="bold">Interface Language Settings</emphasis> window that appears, French is no longer listed.</para>
        <para>
          <mediaobject>
            <imageobject role="fo">
              <imagedata align="center" fileref="images/example_removeFrench.png" format="PNG" scalefit="1" width="150mm"/>
            </imageobject>
            <imageobject role="html">
              <imagedata align="center" fileref="images/example_removeFrench.png" format="PNG" scalefit="0" width="150mm"/>
            </imageobject>
          </mediaobject>
        </para>
      </section>
    </section>
    <section id="DEV.CreateYourOwnPortal.CreateCustomLookAndFeel">
      <title>Create a custom look and feel </title>
      <section id="DEV.CreateYourOwnPortal.PageSkinElemnets">
        <title>Platform skin elements  </title>
        <section>
          <title>Overview</title>
          <itemizedlist>
            <listitem>
              <para>line 1</para>
            </listitem>
            <listitem>
              <para>line 2</para>
              <itemizedlist>
                <listitem>
                  <para>line 3</para>
                  <itemizedlist>
                    <listitem>
                      <para>line 4</para>
                    </listitem>
                  </itemizedlist>
                </listitem>
              </itemizedlist>
            </listitem>
            <listitem>
              <para>line 1</para>
            </listitem>
            <listitem>
              <para>line 2</para>
            </listitem>
          </itemizedlist>
          <note>
            <itemizedlist>
              <listitem>
                <para>line 1</para>
              </listitem>
              <listitem>
                <para>line 2</para>
              </listitem>
            </itemizedlist>
          </note>
          <tip>
            <itemizedlist>
              <listitem>
                <para>line 1</para>
              </listitem>
              <listitem>
                <para>line 2</para>
              </listitem>
            </itemizedlist>
          </tip>
          <warning>
            <itemizedlist>
              <listitem>
                <para>line 1</para>
              </listitem>
              <listitem>
                <para>line 2</para>
              </listitem>
            </itemizedlist>
          </warning>
          <para>Platform provides support for skinning the entire portal User Interface (UI) including your own portlets. Skins are designed to help you pack and reuse common graphic resources.</para>
          <para>The complete skinning of can be decomposed into three main parts: Portal skin, Window style, Portlet skin.</para>
          <citetitle>
<para>
<emphasis role="bold">Portal skin</emphasis>
</para>
</citetitle>
          <para>The portal skin contains styles for the HTML tags (for example, div, th, td) and the portal UI (including the toolbar). This should include all UI components, except for window decorators and portlet specific styles.</para>
          <citetitle>
<para>
<emphasis role="bold">Window style</emphasis>
</para>
</citetitle>
          <para>The CSS styles are associated with the portlet window decorators. The window decorators contain control buttons and borders surrounding each portlet. Individual portlets can have their own window decorators selected, or be rendered without one.</para>
          <para>
            <mediaobject>
              <imageobject role="fo">
                <imagedata align="center" fileref="images/window_decoration.jpg" format="JPG" scalefit="1" width="100mm"/>
              </imageobject>
              <imageobject role="html">
                <imagedata align="center" fileref="images/window_decoration.jpg" format="JPG" scalefit="0" width="100mm"/>
              </imageobject>
            </mediaobject>
          </para>
          <citetitle>
<para>
<emphasis role="bold">Portlet skin</emphasis>
</para>
</citetitle>
          <para>The portlet skins affect how portlets are rendered on the page. The portlet skins can affect in two main ways described in the following sections.</para>
          <para>
            <emphasis role="bold">Portlet Specification CSS Classes</emphasis> <anchor id="DEV.CreateYourOwnPortal.PortletSpecificationCSSClasses"/>
          </para>
          <para>The <ulink url="http://jcp.org/en/jsr/detail?id=286">portlet specification</ulink> defines a set of CSS classes that should be available to portlets. eXo Platform provides these classes as a part of the portal skin. This enables each portal skin to define its own look and feel for these default values.</para>
          <para>
            <emphasis role="bold">Portlet skins</emphasis> <anchor id="DEV.CreateYourOwnPortal.PortletSkins"/>
          </para>
          <para>eXo Platform provides a means for portlet CSS files to be loaded that is based on the current portal skin. This enables a portlet to provide different CSS styles to better match the current portal's look and feel.</para>
          <note>
            <para>The window decorators and the default portlet specification CSS classes should be considered as separate types of skinning components, but they need to be included as a part of the overall portal skin. The portal skin must include CSS classes of these components or they will not be displayed correctly. A portlet skin does not need  to be  included as a part of the portal skin and can be included within the portlets web application.</para>
          </note>
        </section>
        <section id="DEV.CreateYourOwnPortal.SkinService">
          <title>SkinService </title>
          <para>Platform skin is processed by the SkinService. It is used to discover and deploy skins into the portal.</para>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="bold">Configure skins</emphasis> <anchor id="DEV.CreateYourOwnPortal.ConfigureSkins"/>
              </para>
            </listitem>
          </itemizedlist>
          <para>In eXo Platform 3.5 has a file descriptor for skins (WEB-INF/gatein-resources.xml) which is to specify which portal, portlet and window decorators will be deployed into the skin service. Platform can automatically discover web archives containing this file gatein-resource.xml. The full schema can be found in the lib directory: <emphasis role="italic">exo.portal.component.portal.jar/gatein_resources_1_0.xsd</emphasis>.</para>
          <para>Here is the <emphasis role="italic">gatein-resources.xml</emphasis> file of a sample skin (called "MySkin") which defines the portal skin with its CSS location, window style and its portlet skins:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<gatein-resources>
<!-- define the portal skin -->
<portal-skin>
    <skin-name>MySkin</skin-name>
    <css-path>/skin/myskin.css</css-path>
    <overwrite>false</overwrite>
</portal-skin>

<!-- define the portlet skin -->

<portlet-skin>
  <application-name>web</application-name>
  <portlet-name>HomePagePortlet</portlet-name>
  <skin-name>Default</skin-name>
  <css-path>/templates/skin/webui/component/UIHomePagePortlet/DefaultStylesheet.css</css-path>
    <overwrite>false</overwrite>
</portlet-skin>

  <!-- define the window style -->
<window-style>
    <style-name>MyThemeCategory</style-name>
    <style-theme>
      <theme-name>MyThemeBlue</theme-name>
    </style-theme>
    <style-theme>
      <theme-name>MyThemeRed</theme-name>
    </style-theme>
</window-style>
</gatein-resources>
]]></programlisting>
          </programlistingco>
        </section>
        <section id="DEV.CreateYourOwnPortal.ResourceRequestFilter">
          <title>ResourceRequestFilter </title>
          <para>The ResourceRequestFilter is used to map process skin request mapping from portal, portlet to the exact skin that was defined in portal. ResourceRequestFilter is configured in the <emphasis role="italic">web.xml</emphasis> file in the skin web archive.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<webapp>
<display-name>eXoResources</display-name>
<filter>
  <filter-name>ResourceRequestFilter</filter-name>
  <filter-class>org.exoplatform.portal.application.ResourceRequestFilter</filter-class>
</filter>
<filter-mapping>
  <filter-name>ResourceRequestFilter</filter-name>
  <url-pattern>*.css</url-pattern>
</filter-mapping>
</webapp>
]]></programlisting>
          </programlistingco>
          <note>
            <para>The configuration of Portlet Skin takes an optional parameter application-name, which is the web application wrapping skinned portlet. Hence, the display-name element in <emphasis role="italic">web.xml</emphasis> needs to be coherent with the application-name in the <emphasis role="italic">gatein-resources.xml</emphasis> file.</para>
          </note>
        </section>
        <section id="DEV.CreateYourOwnPortal.DefaultSkin">
          <title>The default skin </title>
          <para>The default skin of eXo Platform 3.5 is in the <emphasis role="italic">eXoResource.war</emphasis> file. The main files associated with the skin are:</para>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="italic">WEB-INF/gatein-resources.xml</emphasis> defines the skin settings to use.</para>
            </listitem>
            <listitem>
              <para>
                <emphasis role="italic">WEB-INF/web.xml</emphasis> contains the resource filter with the display-name set.</para>
            </listitem>
            <listitem>
              <para>
                <emphasis role="italic">skin/Stylesheet.css</emphasis> contains the CSS class definitions for this skin.</para>
            </listitem>
          </itemizedlist>
          <note>
            <para>To get a new portal skin declared in <emphasis role="italic">gatein-resources.xml</emphasis> loaded successfully, <emphasis role="italic">display-name</emphasis> of the extension webapp (in <emphasis role="italic">web.xml</emphasis>) should be identical to the context path of the extension webapp.</para>
          </note>
          <para>The following block of CSS illustrates content of the <emphasis role="italic">skin/Stylesheet.css</emphasis> file:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
@import url(DefaultSkin/portal/webui/component/UIPortalApplicationSkin.css); (1)
@import url(DefaultSkin/webui/component/Stylesheet.css); (2)
@import url(PortletThemes/Stylesheet.css); (3)
@import url(Portlet/Stylesheet.css); (4)
]]></programlisting>
          </programlistingco>
          <para>In which:</para>
          <itemizedlist>
            <listitem>
              <para>(1) Skin of the portal page. The <emphasis role="italic">UIPortalApplicationSkin.css</emphasis> defines CSS classes shared by all the portal pages.</para>
            </listitem>
            <listitem>
              <para>(2) Skins of various portal-owned components, such as WorkingWorkspace, MaskWorkspace, PortalForm, and more.</para>
            </listitem>
            <listitem>
              <para>(3) Window decorator skins.</para>
            </listitem>
            <listitem>
              <para>(4) The portlet specification CSS classes. (The CSS styles defined in Portlet Specification JSR286)</para>
            </listitem>
          </itemizedlist>
          <para>To make a default skin flexible and highly reusable, instead of defining all CSS classes in this file, CSS classes are arranged in nested stylesheet files, based on the @import statement. This makes easier for new skins to reuse parts of the default skin. To reuse a CSS stylesheet from the default portal skin, you need to refer to the default skin from eXoResources. For example, to include the window decorators from the default skin within a new portal skin, you need to use the following import:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
@import url(/eXoResources/skin/Portlet/Stylesheet.css);
]]></programlisting>
          </programlistingco>
          <note>
            <para>When the portal skin is added to the page, it merges all CSS stylesheets into a single file.</para>
          </note>
        </section>
      </section>
      <section id="DEV.CreateYourOwnPortal.OverrideSkinsWithExtension">
        <title>Override skins with extension </title>
        <para>The extension mechanism of eXo Platform 3.5 enables the skin definition to be replaced with the skin resource configured in the extension-deployed web application. This is the example where the CSS path of default portal skin needs to be modified without touching the Platform's files.</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<gatein-resources>
  <portal-skin>
    <skin-name>Default</skin-name>
    <css-path>/skin/Defaultskin/Stylesheet.css</css-path>
    <overwrite>false</overwrite>
    <css-priority>0</css-priority>
  </portal-skin>
</gatein-resources>
]]></programlisting>
        </programlistingco>
        <para>(The css-path specifies the stylesheet of the new skin.)</para>
        <para>
<citetitle>
<para>
              <emphasis role="bold">Override skins with extension</emphasis>
            </para>
</citetitle>
</para>
        <para>
          <emphasis role="bold">1.</emphasis> Create a web application whose <emphasis role="italic">gatein-resources.xml</emphasis> contains the same content as the above xml block, except the element &lt;css-path&gt; is modified.</para>
        <para>
          <emphasis role="bold">2.</emphasis> Ensure that once the server has deployed the artifact, it does not load any web application with <emphasis role="italic">gatein-resources.xml</emphasis> configuring the same portal skin.</para>
      </section>
      <section id="DEV.CreateYourOwnPortal.CreateNewSkins">
        <title>Create new skins </title>
        <section>
          <title>Create a new skin web archive</title>
          <para xml:id="DEV.CreateYourOwnPortal.CreateNewPortalSkins">
<citetitle>
<emphasis role="bold">Create new portal skins</emphasis>
</citetitle>
</para>
          <para>To create a new skin (called "MySkin"), you should create a new skin web archive with the following structure:</para>
          <para>
            <mediaobject>
              <imageobject role="fo">
                <imagedata align="center" fileref="images/FolderStructure.png" format="PNG" scalefit="1"/>
              </imageobject>
              <imageobject role="html">
                <imagedata align="center" fileref="images/FolderStructure.png" format="PNG" scalefit="0"/>
              </imageobject>
            </mediaobject>
          </para>
          <itemizedlist>
            <listitem>
              <para>The <emphasis role="italic">web.xml</emphasis> is the file that you will define the ResourceRequestFilter.</para>
            </listitem>
            <listitem>
              <para>The <emphasis role="italic">gatein-resource.xml</emphasis> will define your new skin (for portal, portlet or window style).</para>
            </listitem>
            <listitem>
              <para>The <emphasis role="bold">skin</emphasis> folder will contain images and stylesheets of your skin.</para>
            </listitem>
          </itemizedlist>
          <para>
            <emphasis role="bold">Configure portal skins</emphasis> <anchor id="DEV.CreateYourOwnPortal.ConfigurePortalSkins"/>
          </para>
          <para>You need to specify the new portal skin in the <emphasis role="italic">gatein-resources.xml</emphasis> file. You also need to specify the name of new skin, where to locate its CSS stylesheet file and whether to overwrite the existing portal theme with the same name.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<gatein-resources>
  <portal-skin>
    <skin-name>MySkin</skin-name>
    <css-path>/skin/myskin.css</css-path>
    <overwrite>false</overwrite>
    <css-priority>0</css-priority>
  </portal-skin>
</gatein-resources>
]]></programlisting>
          </programlistingco>
          <para>The default portal skin and window styles are defined in the <emphasis role="italic">eXoResources.war/WEB-INF/gatein-resources.xml</emphasis> file.</para>
          <note>
            <para>The CSS for the portal skin needs to contain CSS for all window decorators and portlet specification CSS classes.</para>
            <para>eXo Platform provides the "CSS priority" concept  which controls the loading order of skins. The skin with lower "css-priority" value will be loaded first.</para>
          </note>
        </section>
        <section id="DEV.CreateYourOwnPortal.PortalSkinPreviewIcon">
          <title>Create the skin preview icon </title>
          <para>When selecting a skin it is possible to see a preview of what the skin will look like. The current skin needs to know about the skin icons for all the available skins, otherwise it will not be able to show the previews. When creating a new portal it is recommended to include the preview icons of the other skins and to update the other skins with your new portal skin preview.</para>
          <para>
            <mediaobject>
              <imageobject role="fo">
                <imagedata align="center" fileref="images/Skin_preview.png" format="PNG" scalefit="1"/>
              </imageobject>
              <imageobject role="html">
                <imagedata align="center" fileref="images/Skin_preview.png" format="PNG" scalefit="0"/>
              </imageobject>
            </mediaobject>
          </para>
          <para>For any portal skin, the paths to the preview images are specified in CSS class UIChangeSkinForm:</para>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="italic">eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/customization/UIChangeSkinForm/Stylesheet.css</emphasis>
              </para>
            </listitem>
          </itemizedlist>
          <para>For the portal named MySkin, it is required to define the following CSS classes:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
.UIChangeSkinForm .UIItemSelector .TemplateContainer .MySkinImage
]]></programlisting>
          </programlistingco>
          <para>The default skin would be aware of skin icons if the preview screenshot is placed in:</para>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="italic">eXoResources.war:/skin/DefaultSkin/portal/webui/component/customization/UIChangeSkinForm/background</emphasis>.</para>
            </listitem>
          </itemizedlist>
          <para>The CSS stylesheet for the default portal needs to have the following updated with the preview icon CSS class. For the skin named MySkin, it is required to update the following:</para>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="italic">eXoResources.war:/skin/DefaultSkin/portal/webui/component/customization/UIChangeSkinForm/Stylesheet.css</emphasis>.</para>
            </listitem>
          </itemizedlist>
          <para>Now, amending the deployed package eXoResources is inevitable (modifying the default war/jar breaches development convention of Platform-based products). The problem would be resolved in future eXo Platform versions in which different skin modules are fully independent, for example, there will be no preview image duplication.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
.UIChangeSkinForm .UIItemSelector .TemplateContainer .MySkinImage {
margin: auto;
width: 329px; height:204px;
background: url('background/MySkin.jpg') no-repeat top;
cursor: pointer ;
}
]]></programlisting>
          </programlistingco>
        </section>
        <section id="DEV.CreateYourOwnPortal.Skin_the_window_style">
          <title>Skin the window style </title>
          <para>Window style is the CSS applied to the window decorator. When the administrator selects a new application to add to a page, he can decide which style of decorator surrounding the window if any.</para>
          <para>
            <emphasis role="bold">Configure window styles</emphasis> <anchor id="DEV.CreateYourOwnPortal.ConfigureWindowStyles"/>
          </para>
          <para>Window style is defined within the <emphasis role="italic">gatein-resources.xml</emphasis> file used by the SkinService to deploy the window style. Window styles can belong to a window style category. This category and window styles need to be specified in the resources file. For example, the following <emphasis role="italic">gatein-resource.xml</emphasis> fragment will add MyThemeBlue and MyThemeRed to the MyTheme category.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<window-style>
  <style-name>MyTheme</style-name>
  <style-theme>
    <theme-name>MyThemeBlue</theme-name>
  </style-theme>
  <style-theme>
    <theme-name>MyThemeRed</theme-name>
  </style-theme>
</window-style>
]]></programlisting>
          </programlistingco>
          <para>The windows style of the default skin is configured in the <emphasis role="italic">eXoResources.war/WEB-INF/gatein-resources.xml</emphasis> file.</para>
          <note>
            <para>When a window style is defined in the <emphasis role="italic">gatein-resources.xml</emphasis> file, it will be available to all portlets regardless of whether the current portal skin supports the window decorator or not. When a new window decorator is added, it should be added to all portal skins or the portal skins should share a common stylesheet for window decorators.</para>
          </note>
          <para>
            <emphasis role="bold">Window style CSS</emphasis> <anchor id="DEV.CreateYourOwnPortal.WindowStyleCSS"/>
          </para>
          <para>In order for the SkinService to display the window decorators, it must have CSS classes with the specific naming related to the window style name. The service will try and display CSS based on this naming. The CSS class must be included as part of the current portal skin for the window decorators to be displayed. The window decorator CSS classes for the default portal theme are located at <emphasis role="italic">eXoResources.war/skin/PortletThemes/Stylesheet.css</emphasis>.</para>
          <para>
            <emphasis role="bold">Set the default window style</emphasis> <anchor id="DEV.CreateYourOwnPortal.SetDefaultWindowStyle"/>
          </para>
          <para>To set the default window style for a portal, you need to specify the CSS classes for a theme called DefaultTheme.</para>
          <note>
            <para>You do not need to specify the DefaultTheme in the <emphasis role="italic">gatein-resources.xml</emphasis> file.</para>
          </note>
        </section>
        <section id="DEV.CreateYourOwnPortal.Configure_RTL_skin">
          <title>Configure the right-to-left skin </title>
          <para>The SkinService handles stylesheet rewriting to accommodate the orientation. It works by appending <emphasis role="italic">-lt</emphasis> or <emphasis role="italic">-rt</emphasis> to the stylesheet name. For example, <emphasis role="italic">/web/skin/portal/webui/component/UIFooterPortlet/DefaultStylesheet-rt.css</emphasis> will return the same stylesheet as <emphasis role="italic">/web/skin/portal/webui/component/UIFooterPortlet/DefaultStylesheet.css</emphasis> but processed for the RT orientation. The <emphasis role="italic">-lt</emphasis> suffix is optional. Stylesheet authors can annotate their stylesheet to create content that depends on the orientation.</para>
          <para>Example 1. This example uses the orientation to modify the float attribute that will make the horizontal tabs either float on left or on right:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
float: left; /* orientation=lt */
float: right; /* orientation=rt */
font-weight: bold;
text-align: center;
white-space: nowrap;
]]></programlisting>
          </programlistingco>
          <para>The LT produced output will be:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
float: left; /* orientation=lt */
font-weight: bold;
text-align: center;
white-space: nowrap;
]]></programlisting>
          </programlistingco>
          <para>The RT produced output will be:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
float: right; /* orientation=rt */
font-weight: bold;
text-align: center;
white-space: nowrap;
]]></programlisting>
          </programlistingco>
          <para>Example 2. In this example, you need to modify the padding based on the orientation:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
color: white;
line-height: 24px;
padding: 0px 5px 0px 0px; /* orientation=lt */
padding: 0px 0px 0px 5px; /* orientation=rt */
]]></programlisting>
          </programlistingco>
          <para>The LT produced output will be:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
color: white;
line-height: 24px;
padding: 0px 5px 0px 0px; /* orientation=lt */
]]></programlisting>
          </programlistingco>
          <para>The RT produced output will be:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
color: white;
line-height: 24px;
padding: 0px 0px 0px 5px; /* orientation=rt */
]]></programlisting>
          </programlistingco>
        </section>
      </section>
      <section id="DEV.CreateYourOwnPortal.Skin_the_portlet">
        <title>Skin the portlet </title>
        <para>Portlets often require additional styles that may not be defined by the portal skin. eXo Platform 3.5 defines additional stylesheets for each portlet and will append the corresponding link tags to the head. The ID attribute of &lt;link&gt; element will be in the <emphasis role="italic">portletAppName/PortletName</emphasis> form. For example, the ContentPortlet in content.war takes "content/ContentPortlet" as ID. To define a new CSS file to be included whenever a portlet is available on a portal page, the following fragment needs to be added in the <emphasis role="italic">gatein-resources.xml</emphasis> file.</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<portlet-skin>
  <application-name>portletAppName</application-name>
  <portlet-name>PortletName</portlet-name>
  <skin-name>Default</skin-name>
  <css-path>/skin/DefaultStylesheet.css</css-path>
</portlet-skin>
<portlet-skin>
  <application-name>portletAppName</application-name>
  <portlet-name>PortletName</portlet-name>
  <skin-name>OtherSkin</skin-name>
  <css-path>/skin/OtherSkinStylesheet.css</css-path>
</portlet-skin>
]]></programlisting>
        </programlistingco>
        <para>This action will load DefaultStylesheet.css or OtherSkinStylesheet.css when the DefaultSkin or OtherSkin is used respectively.</para>
        <note>
          <para>If the current portal skin is not defined as part of the supported skins, the portlet CSS class will not be loaded. The portlet skins should be updated whenever a new portal skin is created.</para>
        </note>
        <para xml:id="DEV.CreateYourOwnPortal.ChangePortletIcons">
<citetitle>
<emphasis role="bold">Change portlet icons</emphasis>
</citetitle>
</para>
        <para>Each portlet can be represented by a unique icon that you can see in the portlet registry or page editor. This icon can be changed by adding an image to the directory of portlet web application: <emphasis role="italic">skin/DefaultSkin/portletIcons/icon_name.png</emphasis>. The icon must be named after the portlet. For example, the icon of account portlet must be named AccountPortlet and located at: <emphasis role="italic">skin/DefaultSkin/portletIcons/AccountPortlet.png</emphasis>.</para>
        <note>
          <para>You must use <emphasis role="italic">skin/DefaultSkin/portletIcons/</emphasis> for the directory to store the portlet icon regardless of using any skins.</para>
        </note>
      </section>
      <section id="DEV.CreateYourOwnPortal.Configure_portlet_skin">
        <title>Configure Platform skin </title>
        <section id="DEV.CreateYourOwnPortal.SelectSkinWithinConfigurationFiles">
          <title>Select skins within the configuration files </title>
          <para>The default skin can be set in the portal configuration files. The skin configured as default is used by Platform as the administrator starts/restarts the server.</para>
          <para>Simply add a skin tag to the <emphasis role="italic">portal.war/WEB-INF/conf/portal/portal/classic/portal.xml</emphasis> configuration file.</para>
          <para>To change skin to YourSkin, use the following code:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<portal-config>
  <portal-name>classic</portal-name>
  <locale>en</locale>
  <access-permissions>Everyone</access-permissions>
  <edit-permission>*:/platform/administrators</edit-permission>
  <skin>MySkin</skin>
  ...
</portal-config>
]]></programlisting>
          </programlistingco>
        </section>
        <section id="DEV.CreateYourOwnPortal.SkinsInThePageMarkup">
          <title>Skins in the page markup </title>
          <para>The eXo Platform 3.5 skin not only contains CSS styles for the portal's components, but also shares components that may be reused in portlets. When eXo Platform 3.5 generates the page markup of portal, stylesheet links will be inserted in the page's head tag. There are two main types of CSS links which appear in the head tag: one to the portal skin CSS file and the other to the portlet skin CSS file.</para>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="bold">Portal Skin</emphasis> appears as a single link to a CSS file. This link contains contents from all portal skin classes merged into one file. The portal skin will be transferred more quickly as a single file instead of multiple smaller files.</para>
            </listitem>
            <listitem>
              <para>
                <emphasis role="bold">Portlet Skin</emphasis> only appears as the link on the page if that portlet is loaded on the current page. A page may contain many CSS links of portlet skins or none.</para>
            </listitem>
          </itemizedlist>
          <para>In the code fragment below, you can see two types of links:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
<head>
  ...
  <!-- The portal skin -->
  <link id="CoreSkin" rel="stylesheet" type="text/css" href="/eXoResources/skin/Stylesheet.css" />
  <!-- The portlet skins -->
  <link id="web_FooterPortlet" rel="stylesheet" type="text/css"
    href="/web/skin/portal/webui/
component/UIFooterPortlet/DefaultStylesheet.css" />
  <link id="web_NavigationPortlet" rel="stylesheet" type="text/css"
    href="/web/skin/portal/webui/
component/UINavigationPortlet/DefaultStylesheet.css" />
  <link id="web_HomePagePortlet" rel="stylesheet" type="text/css"
    href="/portal/templates/skin/
webui/component/UIHomePagePortlet/DefaultStylesheet.css" />
  <link id="web_BannerPortlet" rel="stylesheet" type="text/css"
    href="/web/skin/portal/webui/
component/UIBannerPortlet/DefaultStylesheet.css" />
  ...
</head>
]]></programlisting>
          </programlistingco>
          <note>
            <para>Window styles and portlet specification CSS classes are included within the portal skin.</para>
          </note>
        </section>
        <section id="DEV.CreateYourOwnPortal.CustomizePortalLayout">
          <title>Customize portal's layout </title>
          <note>
            <para>This section is related to the configuration. You can see a sample <ulink url="http://svn.exoplatform.org/projects/ecms/tags/2.1.0-GA/packaging/ecmdemo/webapp/src/main/webapp/WEB-INF/conf/sample-portal/portal/portal/acme/portal.xml">here.</ulink> You can leave all the portlet's preferences as blank, that means the default value will be taken and you do not need to care about it at this time.</para>
          </note>
          <para>For example, you will have a layout like this:</para>
          <para>
            <mediaobject>
              <imageobject role="fo">
                <imagedata align="center" fileref="images/samplelayout.jpg" format="JPG" scalefit="1" width="100mm"/>
              </imageobject>
              <imageobject role="html">
                <imagedata align="center" fileref="images/samplelayout.jpg" format="JPG" scalefit="0" width="100mm"/>
              </imageobject>
            </mediaobject>
          </para>
          <para>In which:</para>
          <itemizedlist>
            <listitem>
              <para>Branding: A branding application</para>
            </listitem>
            <listitem>
              <para>Top navigation: A top navigation application</para>
            </listitem>
          </itemizedlist>
          <para>A table column container with three nested containers:</para>
          <itemizedlist>
            <listitem>
              <para>Left Column and Right Column: Contain one application for each.</para>
            </listitem>
            <listitem>
              <para>Main content: Contain the page body.</para>
            </listitem>
          </itemizedlist>
          <para>And here is the fragment of <emphasis role="italic">portal.xml</emphasis> located in this path: <emphasis role="italic">&lt;myportal_path&gt;/src/main/webapp/WEB-INF/conf/myportal/portal/portal/mysite/portal.xml</emphasis>.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<!-- ... -->

<portlet-application>
  <!-- Branding application. You can use WCM web content *exo:webContent* for the content and SCV portlet to display -->
</portlet-application>

<portlet-application>
  <!-- navigation application. You can use WCM web content *exo:webContent* for the content and SCV portlet to display -->
</portlet-application>

<container id="MySite" template="system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl">
  <container id="LeftColumn" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
    <!-- One or more application(s) here -->
    <portlet-application>
    </portlet-application>
  </container>

  <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
    <page-body>
    </page-body>
  </container>

  <container id="RightColumn" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
    <!-- One or more application(s) here -->
    <portlet-application>
    </portlet-application>
  </container>
</container>

<portlet-application>
  <!-- Footer application. You can use WCM web content *exo:webContent* for the content and SCV portlet to display -->
</portlet-application>

<!-- ... -->
]]></programlisting>
          </programlistingco>
          <para>As you see in the <emphasis role="italic">portal.xml</emphasis> file above, every <emphasis role="bold">container</emphasis> tag has an <emphasis role="bold">id</emphasis> attribute, for example "&lt;container id = '<emphasis role="bold">RightColumn</emphasis>'&gt;". When you create a CSS file, the property applied for this container should have the following name manner:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
${container_id}TDContainer
]]></programlisting>
          </programlistingco>
          <para>and the details of this container:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
RightColumnTDContainer
]]></programlisting>
          </programlistingco>
          <para>The reason is, when you have a look in the file system: <emphasis role="italic">/groovy/portal/webui/container/UITableColumnContainer.gtmpl</emphasis> shown above, you will see this code fragment:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
<table class="UITableColumnContainer"
  style="table-layout: fixed; margin: 0px auto;">
  <tr class="TRContainer">
    <% for(uiChild in uicomponent.getChildren()) {%>
    <td class="${uiChild.id}TDContainer TDContainer"><%
      uicomponent.renderUIComponent(uiChild) %></td> <% } %>
  </tr>
</table>
]]></programlisting>
          </programlistingco>
          <para>So, in the <emphasis role="bold">table</emphasis> element (which represents the outer container), there are many <emphasis role="bold">td</emphasis> elements, each of which has the <emphasis role="bold">class</emphasis> attribute that equals to the <emphasis role="bold">id</emphasis> of the corresponding child component plus the "TDContainer" string literal.</para>
          <para>To learn more, see <link linkend="customize-portal-and-page-style">Customize portal and page's style</link>.</para>
        </section>
        <section id="DEV.CreateYourOwnPortal.CustomizePageLayout">
          <title>Customize page's layouts </title>
          <note>
            <para>This section is related to the configuration. You can see a sample <ulink url="http://svn.exoplatform.org/projects/ecms/tags/2.1.0-GA/packaging/ecmdemo/webapp/src/main/webapp/WEB-INF/conf/sample-portal/portal/portal/acme/pages.xml">here.</ulink> You can leave all the portlet's preferences as blank, that means the default value will be taken and you do not need to care about it at this time.</para>
          </note>
          <itemizedlist>
            <listitem>
              <para>Like <emphasis role="italic">portal.xml</emphasis>, you can define the layout for each page in your site as shown in the following example:</para>
            </listitem>
          </itemizedlist>
          <para>
            <mediaobject>
              <imageobject role="fo">
                <imagedata align="center" fileref="images/sample_page.jpg" format="JPG" scalefit="1" width="80mm"/>
              </imageobject>
              <imageobject role="html">
                <imagedata align="center" fileref="images/sample_page.jpg" format="JPG" scalefit="0" width="80mm"/>
              </imageobject>
            </mediaobject>
          </para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<!-- ... -->

<portlet-application> <!-- A custom document for content and SCV portlet to display -->
</portlet-application>

<portlet-application> <!-- A CLV portlet with a custom template. -->
</portlet-application>

<portlet-application> <!-- A CLV portlet with another custom template. -->
</portlet-application>

<!-- ... -->
]]></programlisting>
          </programlistingco>
        </section>
        <section>
          <title>Customize the Admin bar</title>
          <section id="DEV.CreateYourOwnPortal.Sharedlayout">
            <title>sharedlayout.xml    </title>
            <para>The <emphasis role="bold">Admin</emphasis> bar is a special container composed of portlets and defined in <emphasis role="italic">WEB-INF/conf/portal/portal/sharedlayout.xml</emphasis>.</para>
            <para>If you want to redefine these portlets, you need to override this file by creating your own <emphasis role="italic">sharedlayout.xml</emphasis> located into your extension: <emphasis role="italic">custom-extension.war!WEB-INF/conf/portal/portal/sharedlayout.xml</emphasis>.</para>
            <para>Followings are two examples of configuration, one to remove a portlet, the other to add a new portlet to the <emphasis role="bold">Admin</emphasis> bar.</para>
          </section>
          <section id="DEV.CreateYourOwnPortal.RemoveAdminbarContent">
            <title>Remove a content from the Admin bar </title>
            <para>
              <mediaobject>
                <imageobject role="fo">
                  <imagedata align="center" fileref="images/admin_bar_portlets.png" format="PNG" scalefit="1" width="150mm"/>
                </imageobject>
                <imageobject role="html">
                  <imagedata align="center" fileref="images/admin_bar_portlets.png" format="PNG" scalefit="0" width="150mm"/>
                </imageobject>
              </mediaobject>
            </para>
            <para>
              <emphasis role="bold">Portlets on the Admin bar</emphasis>
            </para>
            <para>In the illustration above, each circle represents a portlet defined in the <emphasis role="bold">Admin</emphasis> bar and configured in <emphasis role="italic">sharedlayout.xml</emphasis>.</para>
            <para>The <emphasis role="italic">sharedlayout.xml</emphasis> file configures the current displayed portlets on the <emphasis role="bold">Admin</emphasis> bar. For example, to remove the <emphasis role="bold">Dashboard</emphasis> menu, you will need to remove the following block:</para>
            <programlistingco>
              <areaspec units="linecolumn"/>
              <programlisting language="xml"><![CDATA[
...
<container id="UserToolBarDashboardPortlet" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
  <portlet-application>
    <portlet>
      <application-ref>exoadmin</application-ref>
      <portlet-ref>UserToolbarDashboardPortlet</portlet-ref>
    </portlet>
    <access-permissions>Everyone</access-permissions>
    <show-info-bar>false</show-info-bar>
  </portlet-application>
</container>
 ...
]]></programlisting>
            </programlistingco>
          </section>
          <section id="DEV.CreateYourOwnPortal.AddAdminbarContent">
            <title>Add a content to the Admin bar </title>
            <para>
              <emphasis role="bold">Add a portlet to the Admin bar to logout user</emphasis>
            </para>
            <para>In the same way you removed a portlet from the admin bar, you can add your own portlet by editing your <emphasis role="italic">sharedlayout.xml</emphasis>.</para>
            <programlistingco>
              <areaspec units="linecolumn"/>
              <programlisting language="xml"><![CDATA[
...
<container id="UILogoutPortlet" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
  <access-permissions>*:/platform/users</access-permissions>
  <portlet-application>
    <portlet>
      <application-ref>platformNavigation</application-ref>
      <portlet-ref>UILogoutPortlet</portlet-ref>
    </portlet>
    <access-permissions>*:/platform/users</access-permissions>
    <show-info-bar>false</show-info-bar>
  </portlet-application>
</container>
...
]]></programlisting>
            </programlistingco>
            <para>Style of portlet container can be changed by editing this css file:</para>
            <para>
              <emphasis role="italic">eXoResources/skin/DefaultSkin/portal/webui/component/view/UIToolbarContainer/Stylesheet.css</emphasis>
            </para>
            <programlistingco>
              <areaspec units="linecolumn"/>
              <programlisting><![CDATA[
.UIToolbarContainer .UILogoutPortletTDContainer {
	float: right; /* orientation=lt */
	float: left; /* orientation=rt */
}
]]></programlisting>
            </programlistingco>
          </section>
          <section id="DEV.CreateYourOwnPortal.ChangeColorScheme">
            <title>Change the color scheme </title>
            <para>The current color of the <emphasis role="bold">Admin</emphasis> bar is gray gradient. However, you can change the color to match your brand colors.</para>
            <para>The default <emphasis role="bold">Administration</emphasis> style:</para>
            <para>
              <mediaobject>
                <imageobject role="fo">
                  <imagedata align="center" fileref="images/admin_bar.png" format="PNG" scalefit="1" width="150mm"/>
                </imageobject>
                <imageobject role="html">
                  <imagedata align="center" fileref="images/admin_bar.png" format="PNG" scalefit="0" width="150mm"/>
                </imageobject>
              </mediaobject>
            </para>
            <para>The style of the <emphasis role="bold">Admin</emphasis> bar is defined in the <emphasis role="bold">stylesheet.css</emphasis> located in <emphasis role="italic">extension/resources/src/main/webapp/skin/platformSkin/UIToolbarContainer</emphasis>.</para>
            <para>Edit this CSS file to customize the <emphasis role="bold">Admin</emphasis> bar to your preferred color scheme.</para>
            <para>The CSS code below shows how to modify the Admin bar to look like this:</para>
            <para>
              <mediaobject>
                <imageobject role="fo">
                  <imagedata align="center" fileref="images/modified_admin_bar.png" format="PNG" scalefit="1" width="150mm"/>
                </imageobject>
                <imageobject role="html">
                  <imagedata align="center" fileref="images/modified_admin_bar.png" format="PNG" scalefit="0" width="150mm"/>
                </imageobject>
              </mediaobject>
            </para>
            <programlistingco>
              <areaspec units="linecolumn"/>
              <programlisting><![CDATA[
.UIWorkingWorkspace #UIToolbarContainer .HomeLinkTDContainer {
	line-height: 31px;
    margin: 0px 5px;
    vertical-align: middle;
}

.UIWorkingWorkspace .UIToolbarContainer .ToolbarContainer {
	/*background: url(background/BgToolbarContainer.gif) repeat-x left top;*/
	height: 31px;
	border: none;
}

.UIWorkingWorkspace .UIToolbarContainer .ToolbarContainer .UITab .MenuItemContainer .MenuItem a {
	padding: 0 22px 0 22px;
	font-size: 12px!important;
	color: #4c4c4c;
	display: block;
	font-weight: normal;
	white-space: nowrap;
}

.UIToolbarContainer .ToolbarContainer .PinLink {
    padding: 0px;
}

.UIWorkingWorkspace .UIToolbarContainer .ToolbarContainer a.TBIcon {
	/*color: #2f3334;*/
	font-weight: normal;
	padding: 0 20px;
	display: block;
	white-space: nowrap;
	background: none;
	margin-left: 0;
	zoom: 1;
	font-size:14px!important;
	font-family: verdana;
	border: 1px solid transparent;
	border-bottom: none;
	line-height: 29px;
	height: 29px;
}

.UIWorkingWorkspace .UIToolbarContainer .ToolbarContainer a.SetupMenuItem  {
	padding: 0 8px;
	line-height:25px;
 }
]]></programlisting>
            </programlistingco>
          </section>
        </section>
      </section>
      <section>
        <title>Configure skin in WCM</title>
        <para>This tutorial will help you to create a new layout and skin, and give some best practices when creating a new layout and skin for your portal and page. Instructions described here are based on the following assumptions:</para>
        <itemizedlist>
          <listitem>
            <para>You have an extension named "MyPortal", and you need to create a site called "MySite" inside this portal.</para>
          </listitem>
          <listitem>
            <para>The <emphasis role="italic">&lt;myportal_path&gt;</emphasis> below is replaced with the based path of your "MyPortal" extension.</para>
          </listitem>
          <listitem>
            <para>If you see any folder/file which does not exist, you should create a new one.</para>
          </listitem>
        </itemizedlist>
        <section id="DEV.CreateYourOwnPortal.CustomizeCLVPortletTemplate">
          <title>Customize CLV portlet's template </title>
          <note>
            <para>This section is related to the configuration. You can see a sample <ulink url="http://svn.exoplatform.org/projects/ecms/tags/2.1.0-GA/packaging/wcm/webapp/src/main/webapp/WEB-INF/conf/wcm-artifacts/application-templates/content-list-viewer/list-by-folder/TwoColumnsCLVTemplate.gtmpl">here.</ulink>
            </para>
          </note>
          <itemizedlist>
            <listitem>
              <para>Apply your HTML/Groovy template code for this template.</para>
            </listitem>
          </itemizedlist>
          <para>For example:</para>
          <para>
            <emphasis role="italic">&lt;myportal_path&gt;/src/main/webapp/WEB-INF/conf/myportal/customized/template/list/ACustomizedCLVTemplate.gtmpl</emphasis>
          </para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
<div id="$uicomponent.id" class="ACustomizedCLVTemplate">
  <div class="ListContents">
    <!-- something here -->
  </div>
</div>
]]></programlisting>
          </programlistingco>
          <itemizedlist>
            <listitem>
              <para>Now, you need to import this template to the database.</para>
            </listitem>
          </itemizedlist>
          <para>
            <emphasis role="italic">&lt;myportal_path&gt;/src/main/webapp/WEB-INF/conf/myportal/customized/template/configuration.xml</emphasis>
          </para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<external-component-plugins>
  <target-component>org.exoplatform.services.cms.views.ApplicationTemplateManagerService</target-component>
  <component-plugin>
    <name>ACustomizedCLVTemplate</name>
    <set-method>addPlugin</set-method>
    <type>org.exoplatform.services.cms.views.PortletTemplatePlugin</type>
    <description>This is a sample customized CLV template</description>
    <init-params>
      <value-param>
        <name>portletName</name>
        <value>Content List Viewer</value>
      </value-param>
      <value-param>
        <name>portlet.template.path</name>
        <value>war:/conf/myportal/customized/template</value>
      </value-param>
      <object-param>
        <name>default.folder.list.viewer</name>
        <description>Default folder list viewer groovy template</description>
        <object type="org.exoplatform.services.cms.views.PortletTemplatePlugin$PortletTemplateConfig">
          <field name="templateName">
            <string>ACustomizedCLVTemplate.gtmpl</string>
          </field>
          <field name="category">
            <string>list</string>
          </field>
        </object>
      </object-param>
    </init-params>
  </component-plugin>
</external-component-plugins>
]]></programlisting>
          </programlistingco>
        </section>
        <section id="DEV.CreateYourOwnPortal.CustomizeCLVTemplateStyle">
          <title>Customize CLV template's style </title>
          <para>
            <emphasis role="bold">1.</emphasis> Go to <emphasis role="bold">Sites explorer</emphasis> portlet <emphasis role="bold">--&gt; Sites management</emphasis> drive <emphasis role="bold">--&gt; MySite/css</emphasis> folder.</para>
          <para>
            <emphasis role="bold">2.</emphasis> Create a new CSS document which contains your stylesheet for the portal and the page layout. You can use any name for this document and put a priority number.</para>
          <note>
            <para>This document should contain ONLY one stylesheet for THIS template. If you have another template, you should create a new CSS document.</para>
          </note>
          <itemizedlist>
            <listitem>
              <para>The following is the sample stylesheet:</para>
            </listitem>
          </itemizedlist>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
/* ... */
.ACustomizedCLVTemplate {
/* ... */

}

.ListContents {
/* ... */

}

/* ... */
]]></programlisting>
          </programlistingco>
          <para>
            <emphasis role="bold">3.</emphasis> Export the document and now you have an XML file.</para>
          <para>Please check out <ulink url="http://wiki.exoplatform.com/xwiki/bin/view/WCM/How+to+create+and+deploy+pre-defined+contents+in+WCM">this tutorial</ulink> to know how to import this XML into the database.</para>
        </section>
      </section>
      <section id="DEV.CreateYourOwnPortal.CustomizeDocuemntSkin">
        <title>Customize Document's skin </title>
        <note>
          <para>This section is related to the configuration. You can see a sample <ulink url="http://svn.exoplatform.org/projects/ecms/tags/2.1.0-GA/packaging/wcm/webapp/src/main/webapp/WEB-INF/conf/wcm-extension/wcm/nodetypes-configuration.xml">here.</ulink>
          </para>
        </note>
        <para>First, you need to create a new document definition.</para>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="italic">&lt;myportal_path&gt;/src/main/webapp/WEB-INF/conf/myportal/customized/document/ACustomizedDocument.xml</emphasis>
            </para>
          </listitem>
        </itemizedlist>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting><![CDATA[
	node type name :exo:customizedDocument
	properties: exo:name(type : String), exo:title(type : String), exo:content(type : String)
]]></programlisting>
        </programlistingco>
        <para>You also need to configure it to make sure it is imported to the database.</para>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="italic">&lt;myportal_path&gt;/src/main/webapp/WEB-INF/conf/myportal/customized/document/definition-configuration.xml</emphasis>
            </para>
          </listitem>
        </itemizedlist>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<external-component-plugins>
  <target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
  <component-plugin>
    <name>ACustomizedDocument</name>
    <set-method>addPlugin</set-method>
    <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
    <priority>200</priority>
    <init-params>
      <values-param>
        <name>autoCreatedInNewRepository</name>
        <description>ACustomizedDocument document definition</description>
        <value>war:/conf/myportal/customized/document/ACustomizedDocument.xml</value>
      </values-param>
    </init-params>
  </component-plugin>
</external-component-plugins>
]]></programlisting>
        </programlistingco>
        <para>Next, create the templates for this document, including:</para>
        <itemizedlist>
          <listitem>
            <para>Dialog: see the sample <ulink url="http://svn.exoplatform.org/projects/ecms/tags/2.1.0-GA/packaging/wcm/webapp/src/main/webapp/WEB-INF/conf/dms-extension/dms/artifacts/templates/article/dialogs/dialog1.gtmpl">here.</ulink>
            </para>
          </listitem>
        </itemizedlist>
        <para>
          <emphasis role="italic">&lt;myportal_path&gt;/src/main/webapp/WEB-INF/conf/myportal/customized/document/dialog.gtmpl</emphasis>
        </para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting><![CDATA[
<div class="UIForm ACustomizedDocument">
  <% uiform.begin() %>
  <!-- Document dialog content is here -->
  <% uiform.end() %>
]]></programlisting>
        </programlistingco>
        <itemizedlist>
          <listitem>
            <para>View: see the sample <ulink url="http://svn.exoplatform.org/projects/ecms/tags/2.1.0-GA/packaging/wcm/webapp/src/main/webapp/WEB-INF/conf/dms-extension/dms/artifacts/templates/article/views/view1.gtmpl">here.</ulink>
            </para>
          </listitem>
        </itemizedlist>
        <para>
          <emphasis role="italic">&lt;myportal_path&gt;/src/main/webapp/WEB-INF/conf/myportal/customized/document/view.gtmpl</emphasis>
        </para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting><![CDATA[
<style>
  <% _ctx.include(uicomponent.getTemplateSkin("exo:customizedDocument", "Stylesheet")); %>
</style>
<!-- Document view template content is here -->
]]></programlisting>
        </programlistingco>
        <itemizedlist>
          <listitem>
            <para>Stylesheet: see the sample <ulink url="http://svn.exoplatform.org/projects/ecms/tags/2.1.0-GA/packaging/wcm/webapp/src/main/webapp/WEB-INF/conf/dms-extension/dms/artifacts/templates/article/skins/Stylesheet-lt.css">here.</ulink>
            </para>
          </listitem>
        </itemizedlist>
        <note>
          <para>This document should contain ONLY the stylesheet for THIS template.</para>
        </note>
        <para>
          <emphasis role="italic">&lt;myportal_path&gt;/src/main/webapp/WEB-INF/conf/myportal/customized/document/stylesheet.css</emphasis>
        </para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting><![CDATA[
/* ... */

.ACustomizedDocument {
  /* ... */
}

/* ... */
]]></programlisting>
        </programlistingco>
        <itemizedlist>
          <listitem>
            <para>You also need to import them to the database.</para>
          </listitem>
        </itemizedlist>
        <para>
          <emphasis role="italic">&lt;myportal_path&gt;/src/main/webapp/WEB-INF/conf/myportal/customized/document/template-configuration.xml</emphasis>
        </para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<external-component-plugins>
  <target-component>org.exoplatform.services.cms.templates.TemplateService</target-component>
  <component-plugin>
    <name>addTemplates</name>
    <set-method>addTemplates</set-method>
    <type>org.exoplatform.services.cms.templates.impl.TemplatePlugin</type>
    <init-params>
      <value-param>
        <name>autoCreateInNewRepository</name>
        <value>true</value>
      </value-param>
      <value-param>
        <name>storedLocation</name>
        <value>war:/conf/myportal/customized/document</value>
      </value-param>
      <value-param>
        <name>repository</name>
        <value>repository</value>
      </value-param>
      <object-param>
        <name>template.configuration</name>
        <description>configuration for the localtion of nodetypes templates to inject in jcr</description>
        <object type="org.exoplatform.services.cms.templates.impl.TemplateConfig">
          <field name="nodeTypes">
            <collection type="java.util.ArrayList">
              <value>
                <object type="org.exoplatform.services.cms.templates.impl.TemplateConfig$NodeType">
                  <field name="nodetypeName">
                    <string>exo:customizedDocument</string>
                  </field>
                  <field name="documentTemplate">
                    <boolean>true</boolean>
                  </field>
                  <field name="label">
                    <string>Customized Document</string>
                  </field>
                  <field name="referencedView">
                    <collection type="java.util.ArrayList">
                      <value>
                        <object type="org.exoplatform.services.cms.templates.impl.TemplateConfig$Template">
                          <field name="templateFile">
                            <string>view.gtmpl</string>
                          </field>
                          <field name="roles">
                            <string>*</string>
                          </field>
                        </object>
                      </value>
                    </collection>
                  </field>
                  <field name="referencedDialog">
                    <collection type="java.util.ArrayList">
                      <value>
                        <object type="org.exoplatform.services.cms.templates.impl.TemplateConfig$Template">
                          <field name="templateFile">
                            <string>dialog.gtmpl</string>
                          </field>
                          <field name="roles">
                            <string>webdesigner:/platform/web-contributors</string>
                          </field>
                        </object>
                      </value>
                    </collection>
                  </field>
                  <field name="referencedSkin">
                    <collection type="java.util.ArrayList">
                      <value>
                        <object type="org.exoplatform.services.cms.templates.impl.TemplateConfig$Template">
                          <field name="templateFile">
                            <string>stylesheet.css</string>
                          </field>
                          <field name="roles">
                            <string>*</string>
                          </field>
                        </object>
                      </value>
                    </collection>
                  </field>
                </object>
              </value>
            </collection>
          </field>
        </object>
      </object-param>
    </init-params>
  </component-plugin>
</external-component-plugins>
]]></programlisting>
        </programlistingco>
        <para>Finally, you should create some initial contents and export them to XML files.</para>
        <para>To import this XML into database, you can set up the deployment like this:</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<external-component-plugins>
  <target-component>org.exoplatform.services.wcm.deployment.WCMContentInitializerService</target-component>
  <component-plugin>
    <name>Content Initializer Service</name>
    <set-method>addPlugin</set-method>
    <type>org.exoplatform.services.wcm.deployment.plugins.XMLDeploymentPlugin</type>
    <description>XML Deployment Plugin</description>
    <init-params>
      <object-param>
        <name>ACME Logo data</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="repository">
                <string>repository</string>
              </field>
              <field name="workspace">
                <string>collaboration</string>
              </field>
              <field name="nodePath">
                <string>/sites content/live/acme/web contents/site artifacts</string>
              </field>
            </object>
          </field>
          <field name="sourcePath">
            <string>war:/conf/wcm/artifacts/site-resources/acme/Logo.xml</string>
          </field>
        </object>
      </object-param>
    </init-params>
  </component-plugin>
</external-component-plugins>
]]></programlisting>
        </programlistingco>
      </section>
      <section id="DEV.CreateYourOwnPortal.BestPracticeToCustomizeSkin">
        <title>Best practices to customize a skin </title>
        <para>The skin folder structure must be prepared once you start the design. Follow these conventions and best practices to ease the integration of your design in eXo Platform.</para>
        <para>
          <emphasis role="bold">Name files and folders</emphasis> <anchor id="DEV.CreateYourOwnPortal.NameFiles&amp;Folder"/>
        </para>
        <para>The id and class names are defined after the WebUI components name and portlets name with the 'UI-' as prefix. The same rule is applied for folder that contains components and portlets. It will help you find and edit correct files easily. For example, the UI portlet will be named as UIFooterPortlet, or UIBannerPortlet and the UI component will be named as UIToolbarContainer, or UIVerticalTab.</para>
        <para>
          <emphasis role="bold">Folder structure</emphasis> <anchor id="DEV.CreateYourOwnPortal.FolderStructure"/>
        </para>
        <citetitle>
<para>
<emphasis role="bold">Portal skins</emphasis>
</para>
</citetitle>
        <para>The portal skin will appear as a single link to a CSS file. This link will contain contents from all the portal skin classes merged into one file. This enables the portal skin to be transferred more quickly as a single file instead of many smaller files included with every page render.</para>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="bold">The general folder structure for portal skin:</emphasis>
            </para>
          </listitem>
        </itemizedlist>
        <para>
          <code>/webapp/skin/NameOfPortalSkin/portal</code>
        </para>
        <para>For example:</para>
        <para>
          <code>/webapp/skin/DefaultSkin/portal</code>
        </para>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="bold">The main entry CSS file:</emphasis>
            </para>
          </listitem>
        </itemizedlist>
        <para>The main entry CSS file should be placed right in the main portal skin folder. The file is the main entry point to the CSS class definitions for the skin:</para>
        <para>
          <code>/webapp/skin/NameOfPortalSkin/Stylesheet.css</code>
        </para>
        <para>For example:</para>
        <para>
          <code>/webapp/skin/SkinBlue/Stylesheet.css</code>
        </para>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="bold">The folder structure for WebUI components:</emphasis>
            </para>
          </listitem>
        </itemizedlist>
        <para>
          <code>/webapp/skin/SkinBlue/webui/component/YourUIComponentName</code>
        </para>
        <para>For example:</para>
        <para>
          <code>/webapp/skin/SkinBlue/webui/component/UIToolbarContainer</code>
        </para>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="bold">Window decorator CSS is put in:</emphasis>
            </para>
          </listitem>
        </itemizedlist>
        <para>
          <code>webapp/skin/PortletThemes/Stylesheet.css</code>
        </para>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="bold">Where to put images for portal skin?</emphasis>
            </para>
          </listitem>
        </itemizedlist>
        <para>The images for portal skin should be put in the background folder right in the Portal skin folder and for each UI component.</para>
        <para>For example:</para>
        <para> <code>/webapp/skin/SkinBlue/webui/component/UIProfileUser/SkinBlue/background</code>
        </para>
        <para>In summary, the folder structure for a new portal skin should be:</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting><![CDATA[
webapp
|- skin
|--- NameOfPortalSkin
|----- stylesheet.css
|------- webui
|---------- component
|------------ UIComponentName
|--------------- NameOfPortalSkin.css
|--------------- NameOfPortalSkin
|------------------ background
]]></programlisting>
        </programlistingco>
        <citetitle>
<para>
<emphasis role="bold">Portlet skin</emphasis>
</para>
</citetitle>
        <para>Each portlet on a page may contribute its own style. The link to the portlet skin will only appear on the page if that portlet is loaded on the current page. A page may contain many portlet skin CSS links or none. The link ID will be named like {portletAppName}{PortletName}. For example,  ContentPortlet in <emphasis role="italic">content.war</emphasis> will have the <emphasis role="italic">id="contentContentPortlet"</emphasis>.</para>
        <para>
          <emphasis role="bold">General folder structure for portlet skin:</emphasis> <emphasis role="italic">/webapp/skin/portlet/webui/component/YourUIPortletName</emphasis>
        </para>
        <para>and for the Groovy skin: <emphasis role="italic">/webapp/groovy/portlet/webui/component/YourUIPortletName</emphasis>/</para>
        <para>For example:</para>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="italic">/webapp/skin/portlet/webui/component/UIBannerPortlet</emphasis>
            </para>
          </listitem>
        </itemizedlist>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="italic">/webapp/groovy/portlet/webui/component/UIBannerPortlet</emphasis>
            </para>
          </listitem>
        </itemizedlist>
        <para>
          <emphasis role="bold">Portlet images folder:</emphasis> <emphasis role="italic">/webapp/skin/portlet/YourUIPortletName/PortalSkinName/background</emphasis>
        </para>
        <para>For example:</para>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="italic">/webapp/skin/portlet/UIBannerPortlet/BlueSkin/background</emphasis>
            </para>
          </listitem>
        </itemizedlist>
        <para>
          <emphasis role="bold">Portlet themes</emphasis>
        </para>
        <para>Main entry CSS:</para>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="italic">/webapp/skin/PortletThemes/Stylesheet.css</emphasis>
            </para>
          </listitem>
        </itemizedlist>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="italic">/webapp/skin/PortletThemes/background</emphasis>
            </para>
          </listitem>
        </itemizedlist>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="italic">/webapp/skin/PortletThemes/icons</emphasis>
            </para>
          </listitem>
        </itemizedlist>
      </section>
    </section>
    <section id="DEV.CreateYourOwnPortal.AddJavaScriptToYourPortal">
      <title>Add JavaScript to your portal </title>
      <para>This can be done entirely within your extension by customizing the <emphasis role="italic">gatein-resources.xml</emphasis> configuration.</para>
      <para>To add a JavaScript library, for example jQuery, create the <emphasis role="italic">war:/WEB-INF/gatein-resources.xml_ file.</emphasis>
      </para>
      <programlistingco>
        <areaspec units="linecolumn"/>
        <programlisting language="xml"><![CDATA[
<javascript>
  <param>
    <js-module>jQuery</js-module>
    <js-path>/javascript/jQuery.js</js-path>
    <js-priority>0</js-priority>
  </param>
</javascript>
]]></programlisting>
      </programlistingco>
      <para>In which:</para>
      <itemizedlist>
        <listitem>
          <para>
            <emphasis role="italic">&lt;js-module&gt;</emphasis> is the namespace of your JavaScript.</para>
        </listitem>
      </itemizedlist>
      <itemizedlist>
        <listitem>
          <para>
            <emphasis role="italic">&lt;js-path&gt;</emphasis> is the path to your JavaScript file.</para>
        </listitem>
      </itemizedlist>
      <itemizedlist>
        <listitem>
          <para>
            <emphasis role="italic">&lt;js-priority&gt;</emphasis> is an optional tag. This tag is used to indicate the loading order of JavaScript files across all eXo Platform. Its value is of the integer type. If its value is not negative (&gt;=0), the loading priority is sorted by the descending order. If its value is negative (&lt;0), the loading priority of the JavaScript file depends on the loading order of the web app (.war file) containing the JavaScript file.</para>
        </listitem>
      </itemizedlist>
    </section>
    <section id="DEV.CreateYourOwnPortal.AddJavaScriptToYourPortal.Create_custom_templates_for_pages">
      <title>Create custom templates for pages </title>
      <para>eXo Platform 3.5 provides you with some built-in templates when you create a new page via <emphasis role="bold">Page Creation Wizard</emphasis>. In this section, you will learn how to create a custom page template for <emphasis role="bold">Page Creation Wizard</emphasis>.</para>
      <para>You should use the extension to add the page layout configuration. In this guide, you are going to work with the <emphasis role="italic">/examples/extension</emphasis> project.</para>
      <para>
<citetitle>
<emphasis role="bold">
Create a custom page template
</emphasis>
</citetitle>
</para>
      <para>
        <emphasis role="bold">1.</emphasis> Add your sample template "FourRowsLayout" by overriding the <emphasis role="italic">PageConfigOptions.groovy</emphasis> file (portal.war).</para>
      <para>Add it to this path: <emphasis role="italic">/examples/extension/war/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/page/PageConfigOptions.groovy</emphasis>
      </para>
      <para>
        <mediaobject>
          <imageobject role="fo">
            <imagedata align="center" fileref="images/PageConfigOptions.groovy.png" format="PNG" scalefit="1" width="150mm"/>
          </imageobject>
          <imageobject role="html">
            <imagedata align="center" fileref="images/PageConfigOptions.groovy.png" format="PNG" scalefit="0" width="150mm"/>
          </imageobject>
        </mediaobject>
      </para>
      <para>Sample code:</para>
      <programlistingco>
        <areaspec units="linecolumn"/>
        <programlisting language="java"><![CDATA[
...
SelectItemCategory samplePageConfigs = new SelectItemCategory("samplePageConfigs"):
categories.add(samplePageConfigs):
samplePageConfigs.addSelectItemOption(new SelectItemOption("samplePage.FourRowsLayout","four-rows","FourRowsLayout:"));
...
]]></programlisting>
      </programlistingco>
      <para>
        <emphasis role="bold">2.</emphasis> Add your template file into the <emphasis role="italic">/examples/extension/war/src/main/webapp/WEB-INF/conf/portal/template/pages/four-rows/page.xml</emphasis> file.</para>
      <para>
        <mediaobject>
          <imageobject role="fo">
            <imagedata align="center" fileref="images/page.xml.png" format="PNG" scalefit="1" width="150mm"/>
          </imageobject>
          <imageobject role="html">
            <imagedata align="center" fileref="images/page.xml.png" format="PNG" scalefit="0" width="150mm"/>
          </imageobject>
        </mediaobject>
      </para>
      <para>Sample code:</para>
      <programlistingco>
        <areaspec units="linecolumn"/>
        <programlisting><![CDATA[
<page
xmlns:xsi="http://www.w3.org.2001/XMLSchema-instance"
xsi:schemaLocation="httlp://www.gatein.org/xml/ns/gatein_object_1_2.xsd http://gatein.org/xml/ns/gatein_object_1_2.xsd"
xmlns:"http://gatein.org/xml/ns/gatein_object_1_2.xsd">
<name></name>
<container template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
<access-permission>Everyone<access-permission>
</container>

<container template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
<access-permission>Everyone<access-permission>
</container>

<container template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
<access-permission>Everyone<access-permission>
</container>

<container template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
<access-permission>Everyone<access-permission>
</container>
</page>
]]></programlisting>
      </programlistingco>
      <para>You can refer to the default template of eXo Platform in this path: <emphasis role="italic">/web/portal/src/main/webapp/WEB-INF/conf/portal/template/pages</emphasis>
      </para>
      <para>
        <emphasis role="bold">3</emphasis>. Add the stylesheet to make the template preview image.</para>
      <para>Add your own stylesheet in your extension webapp:</para>
      <programlistingco>
        <areaspec units="linecolumn"/>
        <programlisting><![CDATA[
.UIItemSelector .<FourRowsLayout>{
 width: 270px; height: 170px;
 margin: auto;
 background: url('background/ItemSelector.gif') no-repeat left -1700px;
}
]]></programlisting>
      </programlistingco>
      <para>You can refer to the eXo Platform 3.5's default stylesheet in this path: <emphasis role="italic">/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UISelector/UIItemSelector/Stylesheet.css</emphasis>
      </para>
      <para>
        <emphasis role="bold">4</emphasis>. Deploy your extension project. You will see the template and its preview image in the <emphasis role="bold">Page Creation Wizard</emphasis>.</para>
    </section>
  </chapter>
  <chapter id="DEV.WorkingwithContent">
    <title>Work With Content </title>
    <para>eXo Platform provides you with 2 options to create the content for your new extension:</para>
    <itemizedlist>
      <listitem>
        <para>Create new content manually.</para>
      </listitem>
      <listitem>
        <para>Import an existing content into your extension.</para>
      </listitem>
    </itemizedlist>
    <para>This chapters represents issues related to creating a new content manually via the following topics:</para>
    <itemizedlist>
      <listitem>
        <para>
          <link linkend="DEV.WorkWithContent.NodeType">Node type</link>
        </para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.WorkWithContent.WCMTemplate">WCM template</link>
        </para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.WorkWithContent.DocumentType">Document type</link>
        </para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.WorkWithContent.DialogSyntax">Dialog Syntax</link>
        </para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.WorkWithContent.Taxonomy">Taxonomy</link>
        </para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.WorkWithContent.ManageTemplateService">Manage Template service</link>
        </para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.WorkWithContent.NavigationByContent">Manage Navigation By Content</link>
        </para>
      </listitem>
    </itemizedlist>
    <section id="DEV.WorkWithContent.NodeType">
      <title>Node type </title>
      <para>To create a content for your extension, you first need to define a node type which represents the document type in the JCR. There are 2 ways to define your node type:</para>
      <itemizedlist>
        <listitem>
          <para>Via the <emphasis role="bold">Content Administration</emphasis> portlet. For more details on how to create a note type via the <emphasis role="bold">Content Administration</emphasis> portlet, see the <emphasis role="bold">
              <ulink url="../../../user-guide/html/ch05.html#sect-User_Guide-Content_Types-Manage_Node_Types">Manage node types</ulink>
            </emphasis> in the <ulink url="../../../user-guide/html/index.html">eXo Platform 3.5 user guide</ulink>.</para>
        </listitem>
        <listitem>
          <para>Via the .xml configuration files by creating a <emphasis role="italic">nodetypes-configuration.xml</emphasis> file in your extension as below.</para>
        </listitem>
      </itemizedlist>
      <programlistingco>
        <areaspec units="linecolumn"/>
        <programlisting language="xml"><![CDATA[
<nodeType hasOrderableChildNodes="false" isMixin="true" name="exo:newnodetype" primaryItemName=""> 
  <supertypes>
    <supertype>exo:article</supertype>
  </supertypes>
  <propertyDefinitions>
    <propertyDefinition autoCreated="true" mandatory="true" multiple="false" name="text" onParentVersion="COPY" protected="false" requiredType="String">
      <valueConstraints/>
    </propertyDefinition>
    <propertyDefinition autoCreated="false" mandatory="true" multiple="false" name="date" onParentVersion="COPY" protected="false" requiredType="Date">
      <valueConstraints/>
    </propertyDefinition>

  </propertyDefinitions>
</nodeType>
]]></programlisting>
      </programlistingco>
      <para>By defining a supertype, you can reuse other node types and extend them with more properties (just like inheritance in Object Oriented Programming).</para>
    </section>
    <section id="DEV.WorkWithContent.WCMTemplate">
      <title>WCM template </title>
      <para>After defining your node type, you need to select templates which are applied to a node type or a metadata mixin type. eXo Platform provides 2 types of WCM templates, including:</para>
      <itemizedlist>
        <listitem>
          <para>
            <emphasis role="bold">dialogs</emphasis> which are HTML forms for creating node instances.</para>
        </listitem>
        <listitem>
          <para>
            <emphasis role="bold">views</emphasis> which are HTML fragments for displaying nodes.</para>
        </listitem>
      </itemizedlist>
      <para>From the <emphasis role="bold">Content Administration</emphasis> portlet, the <emphasis role="bold">Manage Template</emphasis> module lists all existing node types that have been associated with <emphasis role="bold">Dialog</emphasis> and/or <emphasis role="bold">View</emphasis> templates. These templates can be attached to permissions (in the usual <emphasis role="italic">membership:group</emphasis> form), so which specific templates are displayed according to user rights (which can be useful in a content validation workflow activity).</para>
      <para>In eXo Platform, you can specify whether JavaScript is allowed to run on a field of the content template or not by using the <emphasis role="italic">"option"</emphasis> parameter.</para>
      <para>
<citetitle>
<emphasis role="bold">
Enable JavaScrip
</emphasis>
</citetitle>
</para>
      <para>
        <emphasis role="bold">1.</emphasis> Go to <emphasis role="bold">Content Administration --&gt; Content Presentation --&gt; Manage Templates</emphasis>.</para>
      <para>
        <emphasis role="bold">2.</emphasis> Edit your desired template.</para>
      <para>
        <emphasis role="bold">3.</emphasis> Select the <emphasis role="bold">Dialog</emphasis> tab, and then edit the content of <emphasis role="italic">Dialog1</emphasis> in the <emphasis role="bold">View &amp; Edit Template</emphasis> form.</para>
      <para>
        <emphasis role="bold">4.</emphasis> Add <emphasis role="italic">option = noSanitization</emphasis> to the code in the <emphasis role="bold">Main</emphasis> field as the example below.</para>
      <para>For example:</para>
      <programlistingco>
        <areaspec units="linecolumn"/>
        <programlisting><![CDATA[
String [] htmlArguments = ["jcrPath = / node / default.html / JCR: content / JCR: data", "options = toolbar: CompleteWCM, height: '410px ', noSanitization" htmlContent];
]]></programlisting>
      </programlistingco>
      <para>By default, JavaScript is disabled for any fields of some content templates to prevent the XSS attacks.</para>
    </section>
    <section id="DEV.WorkWithContent.DocumentType">
      <title>Document type </title>
      <para>The <emphasis role="bold">Document Type</emphasis> checkbox is to define if the node type should be a <emphasis role="bold">Document Type</emphasis> or not. If this checkbox is selected, the <emphasis role="bold">Sites Explorer</emphasis> considers such nodes as user content and applies the following behavior:</para>
      <itemizedlist>
        <listitem>
          <para>The <emphasis role="bold">View</emphasis> template will be used to display the <emphasis role="bold">DocumentType</emphasis> nodes.</para>
        </listitem>
      </itemizedlist>
      <itemizedlist>
        <listitem>
          <para>The document types nodes can be created by the <emphasis role="bold">Add Content</emphasis> action. The forms shown in the <emphasis role="bold">Add Document</emphasis> action are the corresponding <emphasis role="bold">Dialog</emphasis> templates of each document type.</para>
        </listitem>
      </itemizedlist>
      <itemizedlist>
        <listitem>
          <para>Non-document types are hidden unless the <emphasis role="bold">Show Non-document Nodes</emphasis> option is checked.</para>
        </listitem>
      </itemizedlist>
      <para>Templates are written using Groovy Templates and will require experiences with JCR API and HTML notions.</para>
    </section>
    <section id="DEV.WorkWithContent.DialogSyntax">
      <title>Dialog Syntax </title>
      <para>Dialogs are Groovy Templates that generate forms by mixing static HTML fragments and Groovy calls to the components responsible for building the UI at runtime. As a result, you will get a simple but powerful syntax.</para>
      <section id="DEV.WorkWithContent.Interceptors">
        <title>Interceptors </title>
        <para>By placing interceptors in your template, you will be able to execute a Groovy script just before and just after saving the node. Pre-save interceptors are mostly used to validate input values and their overall meaning while the post-save interceptor can be used to do some manipulations or references for the newly created node, such as binding it with a forum discussion or wiki space.</para>
        <para>To place interceptors, use the following fragment:</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="java"><![CDATA[
<% uicomponent.addInterceptor("ecm-explorer/interceptor/PreNodeSaveInterceptor.groovy", "prev");%>
]]></programlisting>
        </programlistingco>
        <para>Interceptor Groovy scripts are managed in the 'Manage Script' section in the ECM admin portlet. They must implement the CmsScript interface. Pre-save interceptors obtain input values within the context:</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="java"><![CDATA[
public class PreNodeSaveInterceptor implements CmsScript {

  public PreNodeSaveInterceptor() {
  }

  public void execute(Object context) {
    Map inputValues = (Map) context;
    Set keys = inputValues.keySet();
    for(String key : keys) {
      JcrInputProperty prop = (JcrInputProperty) inputValues.get(key);
      println("   --> "+prop.getJcrPath());
    }
  }

  public void setParams(String[] params) {
  }

}
]]></programlisting>
        </programlistingco>
        <para>Whereas the post-save interceptor is passed the path of the saved node in the context:</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="java"><![CDATA[
<% uicomponent.addInterceptor("ecm-explorer/interceptor/PostNodeSaveInterceptor.groovy", "post");%>

public class PostNodeSaveInterceptor implements CmsScript {

  public PostNodeSaveInterceptor() {
  }

  public void execute(Object context) {
    String path = (String) context;

    println("Post node save interceptor, created node: "+path);
  }

  public void setParams(String[] params) {
  }
}
]]></programlisting>
        </programlistingco>
      </section>
      <section id="DEV.WorkWithContent.HiddenFields">
        <title>Hidden fields </title>
        <para>In the next code sample, each argument is composed of a set of keys and values. The order of arguments are not important and only the key matters. That example defines a field with the id as "hiddenField2", which will generate a hidden field. The value of this field will be automatically set to UTF-8 and no visible field will be printed on the form.</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="java"><![CDATA[
String[] hiddenField2 = ["jcrPath=/node/jcr:content/jcr:encoding", "visible=false", "UTF-8"];
uicomponent.addHiddenField("hiddenInput2", hiddenField2);
]]></programlisting>
        </programlistingco>
        <para>Once the form has been saved, the date value will be saved under the relative JCR path ./exo:image/jcr:lastModified.</para>
        <section id="DEV.WorkWithContent.Non-ValueField">
          <title>Non-value field </title>
          <para>You cannot either see the non-value field on the form or input value for them. Its value will be automatically created or defined when you are managing templates.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
String[] hiddenField1 = ["jcrPath=/node/jcr:content", "nodetype=nt:resource", "mixintype=dc:elementSet", "visible=false"] ;
uicomponent.addHiddenField("hiddenInput1", hiddenField1) ;
]]></programlisting>
          </programlistingco>
        </section>
        <section id="DEV.WorkWithContent.Non-EditableFields">
          <title>Non-editable fields </title>
          <para>It is possible to create widgets that are non-editable (and then only used to print some information).</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
String[] fieldCategories = ["jcrPath=/node/exo:category", "multiValues=true", "reference=true", "editable=false"]; uicomponent.addTextField("categories", fieldCategories);
]]></programlisting>
          </programlistingco>
        </section>
        <section id="DEV.WorkWithContent.CreateNodeTypeOrMixinType">
          <title>Create node type or mixin type </title>
          <para>In many cases, when creating an instance where the node is out of form, you must still specify the CMS service about the node structure. Particularly, you must define if which node type is child of the newly created node or if the current node has any mixin type attributed.</para>
          <para>By defining these arguments, the node and its children are created with the correct node type and mixin type.</para>
          <para>See the following example:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
String[] hiddenField = ["jcrPath=/node/jcrcontent", "nodetype=nt:resource", "mixintype=exo:rss-enable", "visible=false"] ;
uicomponent.addHiddenField("hiddenInput", hiddenField) ; 
]]></programlisting>
          </programlistingco>
        </section>
        <section id="DEV.WorkWithContent.HiddenFieldWithDefaultValue">
          <title>Hidden field with default value </title>
          <para>In the previous sample, the value was automatically created and set according to the current date. However, it is also possible to set a default value for a field.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
String[] hiddenField = ["jcrPath=/node/jcrcontent/jcr:mimeType", "image/jpeg"] ;
uicomponent.addHiddenField("hiddenInput", hiddenField) ;
]]></programlisting>
          </programlistingco>
        </section>
        <section id="DEV.WorkWithContent.VisibleWithoutNullFields">
          <title>Visible without null fields </title>
          <para>It is possible to tell that a widget should be visible only if its value is not null or when the form is used to edit the node which has been existing.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
String nameArgs[] = ["jcrPath=/node", "mixintype=mix:votable", "visible=if-not-null"];
uicomponent.addMixinField("name", nameArgs ) 
]]></programlisting>
          </programlistingco>
        </section>
        <section id="DEV.WorkWithContent.WYSIWYGWidget">
          <title>WYSIWYG widget </title>
          <para>Widgets are natively part of the eXo Platform product to provide a simple and easy way for users to get information and notification on their application. They complete the portlet application that focuses on more transactional behaviors. </para>
          <para>WYSIWYG stands for What You See Is What You Get. This widget is one of the most powerful tools. It renders an advanced JavaScript text editor with many functionalities, including the ability to dynamically upload images or flash assets into a JCR workspace and then to refer to them from the created HTML text.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
String[] fieldSummary = ["jcrPath=/node/exo:summary", "options=basic"] ;
uicomponent.addWYSIWYGField("summary", fieldSummary) ;
]]></programlisting>
          </programlistingco>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
String[] fieldContent = ["jcrPath=/node/exo:text", "options=toolbar:CompleteWCM,'height:410px'", ""] ;
uicomponent.addRichtextField("content", fieldContent)
]]></programlisting>
          </programlistingco>
          <para>The "options" argument is used to tell the component which toolbar should be used.</para>
          <para>By default, there are five options for the toolbar: CompleteWCM, Default, BasicWCM, Basic, SuperBasicWCM.</para>
          <itemizedlist>
            <listitem>
              <para>CompleteWCM: a full set of tools is shown.</para>
            </listitem>
          </itemizedlist>
          <para>The following buttons are shown: Source, Templates, Show Blocks, Cut, Copy, Paste Text, Undo, Redo, SpellCheck, WCM Insert Gadget, Flash, Table,  Insert Special Character, WCM Insert Content Link, Bold, Italic, Underline, Strike Through, Justify Left, Justify Center, Justify Right, Justify Full, Ordered List, Unordered List, Text Color, Background Color, Remove Format, Link, WCM Insert Portal Link, Unlink, Anchor, Style, Font Format, Font Name, Font Size, Maximize.</para>
          <para>
            <mediaobject>
              <imageobject role="fo">
                <imagedata align="center" fileref="images/CompleteWCMToolbar.png" format="PNG" scalefit="1" width="120mm"/>
              </imageobject>
              <imageobject role="html">
                <imagedata align="center" fileref="images/CompleteWCMToolbar.png" format="PNG" scalefit="0" width="120mm"/>
              </imageobject>
            </mediaobject>
          </para>
          <itemizedlist>
            <listitem>
              <para>Default: a large set of tools is shown, no "options" argument is needed in that case.</para>
            </listitem>
          </itemizedlist>
          <para>The following buttons are shown: Source, Templates, Cut, Copy, PasteText, Undo, Redo, SpellCheck, RemoveFormat, Bold, Italic, Underline, Strike Through, Ordered List, Unordered List, Link, Unlink, Anchor, Image, Flash, Table, Special Character, Text Color, Background Color, Show Blocks, Style, Font Format, Font Name, Font Size, Maximize.</para>
          <para>
            <mediaobject>
              <imageobject role="fo">
                <imagedata align="center" fileref="images/DefaultToolbar.png" format="PNG" scalefit="1" width="120mm"/>
              </imageobject>
              <imageobject role="html">
                <imagedata align="center" fileref="images/DefaultToolbar.png" format="PNG" scalefit="0" width="120mm"/>
              </imageobject>
            </mediaobject>
          </para>
          <itemizedlist>
            <listitem>
              <para>BasicWCM: a minimal set of tools is shown. </para>
            </listitem>
          </itemizedlist>
          <para>The following buttons are shown: Source, Bold, Italic, Underline, Strike Through, OrderedList, UnorderedList, Outdent, Indent, Justify Left, Justify Center, Justify Right, JustifyFull, Blockquote, Link, Unlink, WCM Insert Portal Link, WCM Insert Content Link, Show Blocks, Style, Font Format, Font Name, FontSize, Maximize.</para>
          <para>
            <mediaobject>
              <imageobject role="fo">
                <imagedata align="center" fileref="images/BasicWCMToolbar.png" format="PNG" scalefit="1" width="120mm"/>
              </imageobject>
              <imageobject role="html">
                <imagedata align="center" fileref="images/BasicWCMToolbar.png" format="PNG" scalefit="0" width="120mm"/>
              </imageobject>
            </mediaobject>
          </para>
          <itemizedlist>
            <listitem>
              <para>Basic: </para>
            </listitem>
          </itemizedlist>
          <para>The following buttons are shown: Source, Bold, Italic, Underline, Strike Through, Ordered List, Unordered List, Outdent, Indent, Justify Left, Justify Center, Justify Right, Justify Full, Blockquote, Link, Unlink, Show Blocks, Style, Font Format, Font Name, Font Size, Maximize.</para>
          <para>
            <mediaobject>
              <imageobject role="fo">
                <imagedata align="center" fileref="images/BasicTools.png" format="PNG" scalefit="1" width="120mm"/>
              </imageobject>
              <imageobject role="html">
                <imagedata align="center" fileref="images/BasicTools.png" format="PNG" scalefit="0" width="120mm"/>
              </imageobject>
            </mediaobject>
          </para>
          <itemizedlist>
            <listitem>
              <para>SuperBasicWCM: </para>
            </listitem>
          </itemizedlist>
          <para>The following buttons are shown: Source, Bold, Italic, Underline, Justify Left, Justify Center, Justify Right, Justify Full, Link, Unlink, WCM Insert Portal Link, WCM Insert Gadget, WCM Insert Content Link.</para>
          <para>
            <mediaobject>
              <imageobject role="fo">
                <imagedata align="center" fileref="images/SuperBasicWCMToolbar.png" format="PNG" scalefit="1" width="120mm"/>
              </imageobject>
              <imageobject role="html">
                <imagedata align="center" fileref="images/SuperBasicWCMToolbar.png" format="PNG" scalefit="0" width="120mm"/>
              </imageobject>
            </mediaobject>
          </para>
          <para>There is also a simple text area widget, which has text-input area only: </para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
String [] descriptionArgs = ["jcrPath=/node/exo:title", "validate=empty"];
uicomponent.addTextAreaField("description", descriptionArgs) ;
]]></programlisting>
          </programlistingco>
        </section>
        <section id="DEV.WorkWithContent.Create_a_custom_Richtext_editor_fields">
          <title>Create a custom RichText editor fields  </title>
          <para>In the <link linkend="DEV.WorkWithContent.WYSIWYGWidget">WYSIWYG widget</link> section, you already know about a set of default toolbars (CompleteWCM, Default, BasicWCM, Basic, SuperBasicWCM). In this section, you will learn how to create a <emphasis role="bold">RichText</emphasis> editor with custom buttons.</para>
          <para>Just edit the configuration file and modify or add new items to the configuration file of the <emphasis role="bold">RichText</emphasis> editor is located in: <emphasis role="italic">apps/resource-static/src/main/Webapp/eXoConfig.js</emphasis>
          </para>
          <para>Take a look at the eXoConfig.js file to see a definition of a custom toolbar named "MyCustomToolbar":</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
FCKConfig.ToolbarSets["MyCustomToolbar"] = [
  ['Source','Templates','-','FitWindow','ShowBlocks'],
 ['Cut','Copy','PasteText','-','SpellCheck','-','Undo','Redo'],
 ['WCMInsertGadget','Flash','Table','SpecialChar', 'WCMInsertContent'],
 '/',
 ['Bold','Italic','Underline','StrikeThrough','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull','-','OrderedList','UnorderedList','-','TextColor','BGColor','-','RemoveFormat'],
 ['Link','WCMInsertPortalLink','Unlink','Anchor'],
 '/',
 ['Style','FontFormat','FontName','FontSize']
] ;
]]></programlisting>
          </programlistingco>
          <para>Every toolbar set is composed of a series of "toolbar bands" that are grouped in the final toolbar layout. The bands items move together on new rows when resizing the editor.</para>
          <para>Every toolbar band is defined as a separated JavaScript array of strings. Each string corresponds to an available toolbar item defined in the editor code or in a plugin.</para>
          <itemizedlist>
            <listitem>
              <para>Put the desired button names in square bracket ("[" &amp; "]") and separate them by commas to create a toolbar band. You can look at the above code to know all the possible toolbar item. If the toolbar item does not exist, a message will be displayed when loading the editor.</para>
            </listitem>
          </itemizedlist>
          <itemizedlist>
            <listitem>
              <para>Include a separator in the toolbar band by putting the "-" string on it.</para>
            </listitem>
          </itemizedlist>
          <itemizedlist>
            <listitem>
              <para>Separate each toolbar brands with commas.</para>
            </listitem>
          </itemizedlist>
          <itemizedlist>
            <listitem>
              <para>Use slash ("/") to tell the editor that you want to force the next bands to be rendered in a new row and not following the previous one.</para>
            </listitem>
          </itemizedlist>
          <note>
            <para>The last toolbar band must have no comma after it.</para>
          </note>
        </section>
        <section id="DEV.WorkWithContent.SimpleSelectBoxWidget">
          <title>Simple select box widget </title>
          <para>The select box widget enables you to render a select box with static values. These values are enumerated in a comma-separated list in the "options" argument. The argument with no key (here "text/html") is selected by default.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
String[] mimetype = ["jcrPath=/node/jcrcontent/jcr:mimeType", "text/html", "options=text/html,text/plain"] ;
uicomponent.addSelectBoxField("mimetype", mimetype) ;
]]></programlisting>
          </programlistingco>
          <para>As usual, the value will be stored at the relative path defined by the jcrPath directive argument.</para>
          <para>For more examples on how to create WCM templates, refer to the <ulink url="../../../reference/html/bk03ch04.html#CONTref.InsideWCMTemplates">WCM Templates</ulink> section.</para>
        </section>
        <section id="DEV.WorkWithContent.AdvancedDynamicSelectBox">
          <title>Advanced dynamic select box </title>
          <para>In many cases, the previous solution with static options is not good enough and one would like to have the select box checked dynamically.  That is what eXo Platform provide thanks to the introduction of a Groovy script as shown in the code fragment below.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
String[] args = ["jcrPath=/node/exodestWorkspace", "script=ecm-explorer/widget/FillSelectBoxWithWorkspaces:groovy", "scriptParams=production"];
uicomponent.addSelectBoxField("destWorkspace", args) ;
]]></programlisting>
          </programlistingco>
          <para>The script itself implements the CMS Script interface and the cast is done to get the select box object as shown in the script code which fills the select box with the existing JCR workspaces.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
import java.util.List ;
import java.util.ArrayList ;

import org.exoplatform.services.jcr.RepositoryService;
import org.exoplatform.services.jcr.core.ManageableRepository;

import org.exoplatform.webui.form.UIFormSelectBox;
import org.exoplatform.webui.core.model.SelectItemOption;
import org.exoplatform.services.cms.scripts.CmsScript;

public class FillSelectBoxWithWorkspaces implements CmsScript {

  private RepositoryService repositoryService_;

  public FillSelectBoxWithWorkspaces(RepositoryService repositoryService) {
    repositoryService_ = repositoryService;
  }

  public void execute(Object context) {
    UIFormSelectBox selectBox = (UIFormSelectBox) context;

    ManageableRepository jcrRepository = repositoryService_.getRepository();
    List options = new ArrayList();
    String[] workspaceNames = jcrRepository.getWorkspaceNames();
    for(name in workspaceNames) {
      options.add(new SelectItem(name, name));
    }
    selectBox.setOptions(options);
  }

  public void setParams(String[] params) {
  }
}
]]></programlisting>
          </programlistingco>
          <note>
            <para>It is also possible to provide a parameter to the script by using the argument "scriptParams".</para>
          </note>
        </section>
        <section id="DEV.WorkWithContent.WidgetWithSelector">
          <title>Widget with selector </title>
          <para>One of the most advanced functionalities of this syntax is the ability to plug your own component that shows an interface, enabling you to select the value of the field.</para>
          <para>In the generated form, you will see an icon which is configurable thanks to the selectorIcon argument. The syntax is a bit more complex but not much.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
String[] groupArgs = ["jcrPath=/node/exogroup", "selectorClass=org:exoplatform:ecm:webui:selector:UIGroupMemberSelector"];
uicomponent.addActionField("group", groupArgs);
]]></programlisting>
          </programlistingco>
          <para>You can plug your own component using the selectorClass argument. It must follow the eXo UIComponent mechanism and implements the interface ComponentSelector:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="java"><![CDATA[
package org.exoplatform.ecm.webui.selector;

import org.exoplatform.webui.core.UIComponent;
public interface ComponentSelector {
  public UIComponent getSourceComponent() ;
  public void setSourceComponent(UIComponent uicomponent, String[] initParams) ;    
}

]]></programlisting>
          </programlistingco>
        </section>
        <section id="DEV.WorkWithContent.Multi-valueWidget">
          <title>Multi-valued widget </title>
          <para>A widget can have multiple values if you add the argument "multiValues=true" to the directive.</para>
        </section>
      </section>
    </section>
    <section id="DEV.WorkWithContent.Taxonomy">
      <title>Taxonomy </title>
      <para>Taxonomy is a particular classification arranged in a hierarchical structure. Taxonomy trees in eXo Platform will help you organize your content into categories.</para>
      <para>When you create a new taxonomy tree, you will add a pre-configured <emphasis role="italic">exo:action</emphasis> (<emphasis role="italic">exo:scriptAction</emphasis> or <emphasis role="italic">exo:businessProcessAction</emphasis>) to the root node of the taxonomy tree. This action is triggered when a new document is added anywhere in the taxonomy tree. The default action moves the document to the physical storage location and replaces the document in the taxonomy tree with a symlink of the <emphasis role="italic">exo:taxonomyLink</emphasis> type pointing to it. The physical storage location is defined by a workspace name, a path and the current date and time.</para>
      <para>Like adding document types, taxonomy trees can be managed through the <emphasis role="bold">Content Administration</emphasis> portlet, or by adding .xml configuration files.</para>
      <para>To configure taxonomy trees by adding configuration files in the <emphasis role="italic">/webapp/WEB-INF/conf/acme-portal/wcm/taxonomy</emphasis>/ directory, create a new file called <emphasis role="italic">$taxonomyName-taxonomies-configuration.xml</emphasis>. For example, if the name of your taxonomy tree is "acme", the file should be named <emphasis role="italic">acme-taxonomies-configuration.xml</emphasis>.</para>
      <para>You can view the file here: <emphasis role="italic">$PLF-HOME_/samples/acme-website/webapp/src/main/webapp/WEB-INF/conf/acme-portal/wcm/taxonomy/acme-taxonomies-configuration.xml</emphasis>.</para>
      <para>As you can see, the value-params enable you to define the repository, workspace, name of the tree and its JCR path. You can then configure  permissions for each group of users in the portal, and the triggered action when a new document is added to the taxonomy tree. Finally, you can describe the structure and names of the categories inside your taxonomy tree.</para>
    </section>
    <section id="DEV.WorkWithContent.ManageTemplateService">
      <title>Manage Template service </title>
      <para>The Template service enables you to create dialogs and view templates for each node type registered. Each node type may have many dialogs and view templates. The template will be used when creating or viewing nodes.</para>
      <para>You can find the template service configuration in <emphasis role="italic">/webapps/ecm-wcm-core/WEB-INF/conf/wcm-core/core-services-configuration.xml</emphasis>.</para>
      <programlistingco>
        <areaspec units="linecolumn"/>
        <programlisting language="xml"><![CDATA[
<component>
  <key>org.exoplatform.services.cms.templates.TemplateService</key>
  <type>org.exoplatform.services.cms.templates.impl.TemplateServiceImpl</type>
</component>
]]></programlisting>
      </programlistingco>
      <para>As usual, one can register a plugin inside the service. This plugin initializes default dialogs and views template of any node type as nt:file, exo:article, exo:workflowAction, exo:sendMailAction, and more.</para>
      <programlistingco>
        <areaspec units="linecolumn"/>
        <programlisting language="xml"><![CDATA[
<component-plugins>
  <component-plugin>
    <name>addTemplates</name>
    <set-method>addTemplates</set-method>
    <type>org.exoplatform.services.cms.templates.impl.TemplatePlugin</type>
    .........
  </component-plugin>
</component-plugins>
]]></programlisting>
      </programlistingco>
      <para>With init-parameters as:</para>
      <programlistingco>
        <areaspec units="linecolumn"/>
        <programlisting language="xml"><![CDATA[
<init-params>
  <value-param>
    <name>autoCreateInNewRepository</name>
    <value>true</value>
  </value-param>
  <value-param>
    <name>storedLocation</name>
    <value>war:/conf/ecm/artifacts/templates</value>
  </value-param>
  <value-param>
    <name>repository</name>
    <value>repository</value>
  </value-param>
  <object-param>
    <name>template.configuration</name>
    <description>configuration for the localtion of templates to inject in jcr</description>
    <object type="org.exoplatform.services.cms.templates.impl.TemplateConfig">
      <field name="nodeTypes">
        <collection type="java.util.ArrayList">
          <value>
            <object type="org.exoplatform.services.cms.templates.impl.TemplateConfig$NodeType">
              <field name="nodetypeName">
                <string>exo:article</string>
              </field>
              <field name="documentTemplate">
                <boolean>true</boolean>
              </field>
              <field name="label">
                <string>Article</string>
              </field>
              <field name="referencedView">
                <collection type="java.util.ArrayList">
                  <value>
                    <object type="org.exoplatform.services.cms.templates.impl.TemplateConfig$Template">
                      <field name="templateFile">
                        <string>/article/views/view1.gtmpl</string>
                      </field>
                      <field name="roles">
                        <string>*</string>
                      </field>
                    </object>
                  </value>
                </collection>
              </field>
              <field name="referencedDialog">
                <collection type="java.util.ArrayList">
                  <value>
                    <object type="org.exoplatform.services.cms.templates.impl.TemplateConfig$Template">
                      <field name="templateFile">
                        <string>/article/dialogs/dialog1.gtmpl</string>
                      </field>
                      <field name="roles">
                        <string>*</string>
                      </field>
                    </object>
                  </value>
                </collection>
              </field>
            </object>
          </value>
        </collection>
      </field>
    </object>
  </object-param>
</init-params>    
]]></programlisting>
      </programlistingco>
    </section>
    <section id="DEV.WorkWithContent.NavigationByContent">
      <title>Manage Navigation By Content </title>
      <para>
        <emphasis role="bold">Navigation By Content</emphasis> is a feature which allows users to browse content of each page easily. With this feature, users experiencing eXo Platform 3.5 can navigate from a page to another or browse site content inside one page directly from a contextual menu.</para>
      <para>In this part, you will have opportunity to learn how to manage <emphasis role="bold">Navigation By Content</emphasis> through the following topics:</para>
      <itemizedlist>
        <listitem>
          <para>
            <link linkend="DEV.WorkWithContent.NavigationByContent.ContentNavigation">Actual content navigation</link>
          </para>
        </listitem>
        <listitem>
          <para>
            <link linkend="DEV.WorkWithContent.NavigationByContent.Add_content_to_the_navigation">Add content to the navigation</link>
          </para>
        </listitem>
        <listitem>
          <para>
            <link linkend="DEV.WorkWithContent.NavigationByContent.ActionsNavigationByContent">Actions on Navigation By Content</link>
          </para>
        </listitem>
        <listitem>
          <para>
            <link linkend="DEV.WorkWithContent.NavigationByContent.CreateDataForNavigationByContentExamples">Examples of creating data for Navigation By Content</link>
          </para>
          <itemizedlist>
            <listitem>
              <para>
                <link linkend="DEV.WorkWithContent.NavigationByContent.CreateDataForNavigationByContentExamples.CreateNewProductPage">Create a Product page</link>
              </para>
            </listitem>
            <listitem>
              <para>
                <link linkend="DEV.WorkWithContent.NavigationByContent.CreateDataForNavigationByContentExamples.DevelopProductContent">Develop your own Product content</link>
              </para>
            </listitem>
          </itemizedlist>
        </listitem>
      </itemizedlist>
      <section id="DEV.WorkWithContent.NavigationByContent.ContentNavigation">
        <title>Actual content navigation </title>
        <para>One of the powerful features of Enterprise Content Management System (ECMS) that comes out with eXo Platform 3.5 is the ability to navigate in site contents using taxonomies. This functionality can easily be added in a page with the help of two <emphasis role="bold">Content List Viewer</emphasis> (CLV) portlets. The pre-configured example can be found in the <emphasis role="bold">News</emphasis> page of the sample ACME website. In this example, all contents in the <emphasis role="italic">/Sites Management/acme/events/All</emphasis> node will be used.</para>
        <citetitle>
<para>
<emphasis role="bold">Add "Actual content navigation" to a page
</emphasis>
</para>
</citetitle>
        <para>
          <emphasis role="bold">1.</emphasis> Log into the sample ACME website.</para>
        <para>
          <emphasis role="bold">2.</emphasis> Add a new page, for example "Events".</para>
        <para>
          <emphasis role="bold">3.</emphasis> Parameterize this page with the <emphasis role="bold">Autofit Two Columns</emphasis> container.</para>
        <para>
          <emphasis role="bold">4.</emphasis> Add two <emphasis role="bold">Content List</emphasis> portlets to each column.</para>
        <para>
          <emphasis role="bold">5.</emphasis> Add content.</para>
        <para>
          <emphasis role="bold">i. Configure the left portlet as follows</emphasis>:</para>
        <para>
          <mediaobject>
            <imageobject role="fo">
              <imagedata align="center" fileref="images/navigation_by_content_feature/browseByCLV.png" format="PNG" scalefit="1" width="150mm"/>
            </imageobject>
            <imageobject role="html">
              <imagedata align="center" fileref="images/navigation_by_content_feature/browseByCLV.png" format="PNG" scalefit="0" width="150mm"/>
            </imageobject>
          </mediaobject>
        </para>
        <para>In which:</para>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="bold">Folder path</emphasis> = <emphasis role="italic">/Sites Management/acme/events/All</emphasis>: The path to the folder that contains the content.</para>
          </listitem>
          <listitem>
            <para>
              <emphasis role="bold">Header</emphasis> = <emphasis role="italic">Browse by</emphasis>: The title of all contents that are listed in the content list viewer.</para>
          </listitem>
          <listitem>
            <para>
              <emphasis role="bold">Template</emphasis> = <emphasis role="italic">CategoryTree.gtmpl</emphasis>: The template used for displaying the content list.</para>
          </listitem>
          <listitem>
            <para>
              <emphasis role="bold">Contextual Folder</emphasis> = <emphasis role="italic">Disabled</emphasis>: The Contextual Content property is set to "Disable", the Advanced pane is closed by default and a single content will be opened by an URL containing the content path. </para>
          </listitem>
          <listitem>
            <para>
              <emphasis role="bold">Show in page</emphasis> =<emphasis role="italic">Events</emphasis>: A single content in CLV will be shown in the <emphasis role="bold">Events</emphasis> page.</para>
          </listitem>
          <listitem>
            <para>
              <emphasis role="bold">With</emphasis> = <emphasis role="italic">folder-id</emphasis>: The parameter containing the content path. </para>
          </listitem>
        </itemizedlist>
        <para>
          <emphasis role="bold">ii. Configure the right portlet as follows</emphasis>:</para>
        <para>
          <mediaobject>
            <imageobject role="fo">
              <imagedata align="center" fileref="images/navigation_by_content_feature/showListCLV.png" format="PNG" scalefit="1" width="150mm"/>
            </imageobject>
            <imageobject role="html">
              <imagedata align="center" fileref="images/navigation_by_content_feature/showListCLV.png" format="PNG" scalefit="0" width="150mm"/>
            </imageobject>
          </mediaobject>
        </para>
        <para>In which:</para>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="bold">Folder path</emphasis> = <emphasis role="italic">/Sites Management/acme/events/All</emphasis>: The path to the folder that contains the content.</para>
          </listitem>
          <listitem>
            <para>
              <emphasis role="bold">Template</emphasis> = <emphasis role="italic">OneColumnCLVTemplate.gtmpl</emphasis>: The template used for displaying the content list.</para>
          </listitem>
          <listitem>
            <para>
              <emphasis role="bold">Contextual Folder</emphasis> = <emphasis role="italic">Enabled</emphasis>: The Contextual Content property is set to "Enable". This portlet is configured with the provided parameter (content-id by default).</para>
          </listitem>
          <listitem>
            <para>
              <emphasis role="bold">Show in page</emphasis> = <emphasis role="italic">Details</emphasis>: A single content in CLV will be shown in the "Details" page.</para>
          </listitem>
          <listitem>
            <para>
              <emphasis role="bold">With</emphasis> = <emphasis role="italic">content-id</emphasis>: The parameter containing the content path.</para>
          </listitem>
        </itemizedlist>
        <para>As a result, the created <emphasis role="bold">Events</emphasis> page will look like:</para>
        <para>
          <mediaobject>
            <imageobject role="fo">
              <imagedata align="center" fileref="images/navigation_by_content_feature/eventsPage.png" format="PNG" scalefit="1" width="150mm"/>
            </imageobject>
            <imageobject role="html">
              <imagedata align="center" fileref="images/navigation_by_content_feature/eventsPage.png" format="PNG" scalefit="0" width="150mm"/>
            </imageobject>
          </mediaobject>
        </para>
        <para>You can now navigate from the left portlet to see contents displayed in the right portlet.</para>
        <para>The new <emphasis role="bold">Navigation By Content</emphasis> feature will traduce this example in a contextual menu.</para>
      </section>
      <section id="DEV.WorkWithContent.NavigationByContent.Add_content_to_the_navigation">
        <title>Add content to the navigation </title>
        <citetitle>
<para>
<emphasis role="bold">Attach your root folder/node to some page nodes from the homepage (the drop-down menu holds your new contextual menu)
</emphasis>
</para>
</citetitle>
        <para>
          <emphasis role="bold">1.</emphasis> Go to the <emphasis role="bold">Sites Explorer</emphasis> page and navigate to <emphasis role="italic">/Sites Management/acme/events/All</emphasis>.</para>
        <para>
          <emphasis role="bold">2.</emphasis> Click the <emphasis role="bold">Content Navigation</emphasis> button, the <emphasis role="bold">Navigation</emphasis> form will appear. If you do not see this button on the <emphasis role="bold">Action</emphasis> bar, add this button via the <emphasis role="bold">Content Administration</emphasis> page.</para>
        <para>
          <emphasis role="bold">3.</emphasis> Fill values into the <emphasis role="bold">Content Navigation</emphasis> form:</para>
        <para>
          <mediaobject>
            <imageobject role="fo">
              <imagedata align="center" fileref="images/navigation_by_content_feature/Navigation_form.png" format="PNG" scalefit="1" width="150mm"/>
            </imageobject>
            <imageobject role="html">
              <imagedata align="center" fileref="images/navigation_by_content_feature/Navigation_form.png" format="PNG" scalefit="0" width="150mm"/>
            </imageobject>
          </mediaobject>
        </para>
        <para>In which:</para>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="bold">Visible</emphasis> = true. This node will be navigable.</para>
          </listitem>
        </itemizedlist>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="bold">Target parent navigation</emphasis> = Events. The contextual menu will be attached to the <emphasis role="bold">Events</emphasis> drop-down menu.</para>
          </listitem>
        </itemizedlist>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="bold">Clickable</emphasis> = false. This node will not be clickable.</para>
          </listitem>
        </itemizedlist>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="bold">Page for list</emphasis> = catalog. This page is a system page that contains a <emphasis role="bold">Content List Viewer</emphasis> portlet and will be used to display the list of child nodes.</para>
          </listitem>
        </itemizedlist>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="bold">Page for detail</emphasis> = detail. This page is a system page that contains a <emphasis role="bold">Single Content Viewer</emphasis> portlet and will be used to display details of child nodes.</para>
          </listitem>
        </itemizedlist>
        <para>
          <emphasis role="bold">4.</emphasis> Save changes, then go back to the ACME homepage. You will see changes from the <emphasis role="bold">Events</emphasis> drop-down menu.</para>
        <para>
          <mediaobject>
            <imageobject role="fo">
              <imagedata align="center" fileref="images/navigation_by_content_feature/contextualMenu.png" format="PNG" scalefit="1" width="150mm"/>
            </imageobject>
            <imageobject role="html">
              <imagedata align="center" fileref="images/navigation_by_content_feature/contextualMenu.png" format="PNG" scalefit="0" width="150mm"/>
            </imageobject>
          </mediaobject>
        </para>
        <para>In which:</para>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="bold">Visible</emphasis>: The <emphasis role="italic">/Sites Management/acme/events/All</emphasis> node is navigable and its child nodes are rendered in the contextual menu.</para>
          </listitem>
        </itemizedlist>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="bold">Target parent navigation</emphasis>: The <emphasis role="italic">/Sites Management/acme/events/All</emphasis> node is attached to the site menu item called <emphasis role="bold">Events</emphasis>.</para>
          </listitem>
        </itemizedlist>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="bold">Clickable</emphasis>: The <emphasis role="italic">/Sites Management/acme/events/All</emphasis> node is not clickable but all of its child nodes are clickable.</para>
          </listitem>
        </itemizedlist>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="bold">Page for list</emphasis>: The list of child nodes (if a child node is <emphasis role="bold">directory/folder</emphasis>) will be rendered in the following page.</para>
          </listitem>
        </itemizedlist>
        <para>Click the <emphasis role="bold">Earth</emphasis> menu item from the contextual menu, you will see that contents of the <emphasis role="bold">Earth</emphasis> directory are rendered in a separate page (catalog):</para>
        <para>
          <mediaobject>
            <imageobject role="fo">
              <imagedata align="center" fileref="images/navigation_by_content_feature/listEarth.png" format="PNG" scalefit="1" width="150mm"/>
            </imageobject>
            <imageobject role="html">
              <imagedata align="center" fileref="images/navigation_by_content_feature/listEarth.png" format="PNG" scalefit="0" width="150mm"/>
            </imageobject>
          </mediaobject>
        </para>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="bold">Page for detail</emphasis>: The details of child nodes (if a child node is a sample content) will be rendered in this page.</para>
          </listitem>
        </itemizedlist>
        <para>Select the <emphasis role="bold">Power 1 - Fire</emphasis> menu item from the contextual menu to see the <emphasis role="bold">Fire</emphasis> content displayed in a separate page (details):</para>
        <para>
          <mediaobject>
            <imageobject role="fo">
              <imagedata align="center" fileref="images/navigation_by_content_feature/Power1_fire_item.png" format="PNG" scalefit="1" width="150mm"/>
            </imageobject>
            <imageobject role="html">
              <imagedata align="center" fileref="images/navigation_by_content_feature/Power1_fire_item.png" format="PNG" scalefit="0" width="150mm"/>
            </imageobject>
          </mediaobject>
        </para>
      </section>
      <section id="DEV.WorkWithContent.NavigationByContent.ActionsNavigationByContent">
        <title>Actions on Navigation By Content </title>
        <citetitle>
<para>
<emphasis role="bold">Restrict the visibility of some contents</emphasis>
</para>
</citetitle>
        <para>
          <emphasis role="bold">1.</emphasis> Go to the <emphasis role="bold">Sites Explorer</emphasis> page and navigate to the <emphasis role="italic">/Sites Management/acme/events/All/Fire</emphasis> node.</para>
        <para>
          <emphasis role="bold">2.</emphasis> Click the <emphasis role="bold">Content Navigation</emphasis> button to open the <emphasis role="bold">Navigation</emphasis> form.</para>
        <para>
          <emphasis role="bold">3.</emphasis> Uncheck the <emphasis role="bold">Visible</emphasis> field and save.</para>
        <para>
          <emphasis role="bold">4.</emphasis> Go back to the ACME homepage. You will see that the <emphasis role="bold">Fire</emphasis> sub-menu is not displayed in the contextual menu anymore.</para>
        <para>
          <mediaobject>
            <imageobject role="fo">
              <imagedata align="center" fileref="images/navigation_by_content_feature/Restrict_content_visibility.png" format="PNG" scalefit="1" width="150mm"/>
            </imageobject>
            <imageobject role="html">
              <imagedata align="center" fileref="images/navigation_by_content_feature/Restrict_content_visibility.png" format="PNG" scalefit="0" width="150mm"/>
            </imageobject>
          </mediaobject>
        </para>
        <citetitle>
<para>
<emphasis role="bold">Sort elements of the contextual menu</emphasis>
</para>
</citetitle>
        <para>
          <emphasis role="bold">1.</emphasis> Go to the <emphasis role="bold">Sites Explorer</emphasis> page and navigate to the <emphasis role="italic">/Sites Management/acme/events/All</emphasis> node.</para>
        <para>
          <emphasis role="bold">2.</emphasis> Select the <emphasis role="italic">/Sites Management/acme/events/All/Earth</emphasis> node.</para>
        <para>
          <emphasis role="bold">3.</emphasis> Click the <emphasis role="bold">Content Navigation</emphasis> button to open the <emphasis role="bold">Navigation</emphasis> form.</para>
        <para>
          <emphasis role="bold">4.</emphasis> Set the <emphasis role="bold">Display order</emphasis> field to "1" and save.</para>
        <para>
          <emphasis role="bold">5.</emphasis> Select the <emphasis role="italic">/Sites Management/acme/events/All/Water</emphasis> node.</para>
        <para>
          <emphasis role="bold">6.</emphasis> Click the <emphasis role="bold">Content Navigation</emphasis> button.</para>
        <para>
          <emphasis role="bold">7.</emphasis> Set the <emphasis role="bold">Display order</emphasis> field to "2" and save.</para>
        <para>
          <emphasis role="bold">8.</emphasis> Select the <emphasis role="italic">/Sites Management/acme/events/All/Air</emphasis> node.</para>
        <para>
          <emphasis role="bold">9.</emphasis> Click the <emphasis role="bold">Content Navigation</emphasis> button.</para>
        <para>
          <emphasis role="bold">10.</emphasis> Set the <emphasis role="bold">Display order</emphasis> field to "3" and save.</para>
        <para>
          <emphasis role="bold">11.</emphasis> Go back to the ACME homepage. You will see that the display order from the contextual menu is <emphasis role="bold">Earth</emphasis>, <emphasis role="bold">Water</emphasis>, <emphasis role="bold">Air</emphasis>. Note that the <emphasis role="bold">Fire</emphasis> sub-menu is not displayed because it is set to "Invisible" in the previous example.</para>
        <citetitle>
<para>
<emphasis role="bold">Restore a node to the contextual menu and attach it to another page</emphasis>
</para>
</citetitle>
        <para>
          <emphasis role="bold">1.</emphasis> Go to the <emphasis role="bold">Sites Explorer</emphasis> page and navigate to the <emphasis role="italic">/Sites Management/acme/events/All/Fire</emphasis> node.</para>
        <para>
          <emphasis role="bold">2.</emphasis> Click the <emphasis role="bold">Content Navigation</emphasis> button to open the <emphasis role="bold">Navigation</emphasis> form.</para>
        <para>
          <emphasis role="bold">3.</emphasis> Fill values into the <emphasis role="bold">Navigation</emphasis> form fields, including:</para>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="bold">Visible</emphasis> = true</para>
          </listitem>
          <listitem>
            <para>
              <emphasis role="bold">Target parent navigation</emphasis> = News</para>
          </listitem>
          <listitem>
            <para>
              <emphasis role="bold">Clickable</emphasis> = false</para>
          </listitem>
          <listitem>
            <para>
              <emphasis role="bold">Page for list</emphasis> = catalog</para>
          </listitem>
          <listitem>
            <para>
              <emphasis role="bold">Page for detail</emphasis> = detail</para>
          </listitem>
        </itemizedlist>
        <para>
          <emphasis role="bold">4.</emphasis> Save changes and go back to the <emphasis role="bold">Acme/Overview</emphasis> homepage. You will see that the <emphasis role="bold">Fire</emphasis> node is attached to the <emphasis role="bold">News</emphasis> drop-down menu from the site menu:</para>
        <para>
          <mediaobject>
            <imageobject role="fo">
              <imagedata align="center" fileref="images/navigation_by_content_feature/Attach_node_ to_another_page.png" format="PNG" scalefit="1" width="150mm"/>
            </imageobject>
            <imageobject role="html">
              <imagedata align="center" fileref="images/navigation_by_content_feature/Attach_node_ to_another_page.png" format="PNG" scalefit="0" width="150mm"/>
            </imageobject>
          </mediaobject>
        </para>
        <para>However, if you want to add your newly created content directly to the contextual menu, you need to add the <emphasis role="bold">populateToMenu</emphasis> action first.</para>
        <citetitle>
<para>
<emphasis role="bold">Add your newly created contents to the contextual menu</emphasis>
</para>
</citetitle>
        <para>
          <emphasis role="bold">1.</emphasis> Go to the <emphasis role="bold">Sites Explorer</emphasis> page and navigate to the <emphasis role="italic">/Sites Management/acme/events/All/Fire</emphasis> node.</para>
        <para>
          <emphasis role="bold">2.</emphasis> Click the <emphasis role="bold">Actions</emphasis> button and add the <emphasis role="bold">exo:populateToMenu</emphasis> action.</para>
        <para>
          <mediaobject>
            <imageobject role="fo">
              <imagedata align="center" fileref="images/navigation_by_content_feature/populateToMenuAction.png" format="PNG" scalefit="1" width="150mm"/>
            </imageobject>
            <imageobject role="html">
              <imagedata align="center" fileref="images/navigation_by_content_feature/populateToMenuAction.png" format="PNG" scalefit="0" width="150mm"/>
            </imageobject>
          </mediaobject>
        </para>
        <para>
          <emphasis role="bold">3.</emphasis> Create a document under the <emphasis role="italic">/Sites Management/acme/events/All/Fire</emphasis> node and publish it.</para>
        <para>
          <emphasis role="bold">4.</emphasis> Go back to the homepage. You will see that your newly created document is added to the contextual menu.</para>
        <para>
          <mediaobject>
            <imageobject role="fo">
              <imagedata align="center" fileref="images/navigation_by_content_feature/docPDF.png" format="PNG" scalefit="1" width="150mm"/>
            </imageobject>
            <imageobject role="html">
              <imagedata align="center" fileref="images/navigation_by_content_feature/docPDF.png" format="PNG" scalefit="0" width="150mm"/>
            </imageobject>
          </mediaobject>
        </para>
        <para>The sample ACME website comes with a configured navigation by content menu:</para>
        <para>
          <mediaobject>
            <imageobject role="fo">
              <imagedata align="center" fileref="images/navigation_by_content_feature/productsMenu.png" format="PNG" scalefit="1" width="150mm"/>
            </imageobject>
            <imageobject role="html">
              <imagedata align="center" fileref="images/navigation_by_content_feature/productsMenu.png" format="PNG" scalefit="0" width="150mm"/>
            </imageobject>
          </mediaobject>
        </para>
        <para>You can click the <emphasis role="bold">Vision</emphasis> sub-menu and see contents of <emphasis role="bold">Vision</emphasis> directory rendered in the <emphasis role="bold">catalog</emphasis> page:</para>
        <para>
          <mediaobject>
            <imageobject role="fo">
              <imagedata align="center" fileref="images/navigation_by_content_feature/visionSubMenuList.png" format="PNG" scalefit="1" width="150mm"/>
            </imageobject>
            <imageobject role="html">
              <imagedata align="center" fileref="images/navigation_by_content_feature/visionSubMenuList.png" format="PNG" scalefit="0" width="150mm"/>
            </imageobject>
          </mediaobject>
        </para>
        <para>Select the <emphasis role="bold">X-Ray</emphasis> content and see the newly implemented content using new visual effects and presentation.</para>
        <itemizedlist>
          <listitem>
            <para>"Benefits" and "Features" tabs:</para>
          </listitem>
        </itemizedlist>
        <para>
          <mediaobject>
            <imageobject role="fo">
              <imagedata align="center" fileref="images/navigation_by_content_feature/Benefits_tab.png" format="PNG" scalefit="1" width="150mm"/>
            </imageobject>
            <imageobject role="html">
              <imagedata align="center" fileref="images/navigation_by_content_feature/Benefits_tab.png" format="PNG" scalefit="0" width="150mm"/>
            </imageobject>
          </mediaobject>
        </para>
        <itemizedlist>
          <listitem>
            <para>Coverflow section:</para>
          </listitem>
        </itemizedlist>
        <para>
          <mediaobject>
            <imageobject role="fo">
              <imagedata align="center" fileref="images/navigation_by_content_feature/Coverflow.png" format="PNG" scalefit="1" width="150mm"/>
            </imageobject>
            <imageobject role="html">
              <imagedata align="center" fileref="images/navigation_by_content_feature/Coverflow.png" format="PNG" scalefit="0" width="150mm"/>
            </imageobject>
          </mediaobject>
        </para>
        <itemizedlist>
          <listitem>
            <para>Related documents:</para>
          </listitem>
        </itemizedlist>
        <para>
          <mediaobject>
            <imageobject role="fo">
              <imagedata align="center" fileref="images/navigation_by_content_feature/relatedDocuments.png" format="PNG" scalefit="1" width="150mm"/>
            </imageobject>
            <imageobject role="html">
              <imagedata align="center" fileref="images/navigation_by_content_feature/relatedDocuments.png" format="PNG" scalefit="0" width="150mm"/>
            </imageobject>
          </mediaobject>
        </para>
      </section>
      <section id="DEV.WorkWithContent.NavigationByContent.CreateDataForNavigationByContentExamples">
        <title>Examples of creating data for Navigation By Content </title>
        <section id="DEV.WorkWithContent.NavigationByContent.CreateDataForNavigationByContentExamples.CreateNewProductPage">
          <title>Create a Product page </title>
          <citetitle>
<para>
<emphasis role="bold">Create content about the product</emphasis>
</para>
</citetitle>
          <para>
            <emphasis role="bold">1.</emphasis> Go to the <emphasis role="bold">Sites Explorer</emphasis> page and navigate to <emphasis role="italic">somePath/someDirectory</emphasis>.</para>
          <para>
            <emphasis role="bold">2.</emphasis> Click the <emphasis role="bold">New Content</emphasis> button on the <emphasis role="bold">Action</emphasis> bar. There will be a several content type appears.</para>
          <para>
            <emphasis role="bold">3.</emphasis> Select the <emphasis role="bold">Product</emphasis> content type. </para>
          <para>
            <emphasis role="bold">4.</emphasis> Fill the <emphasis role="bold">Product</emphasis> dialog form.</para>
          <para>
            <emphasis role="bold">5.</emphasis> Save changes.</para>
          <citetitle>
<para>
<emphasis role="bold">Add media files to enrich the Product page</emphasis>
</para>
</citetitle>
          <para>
            <emphasis role="bold">1.</emphasis> Go to <emphasis role="italic">somePath/someDirectory/sampleProduct/medias/images</emphasis>.</para>
          <para>
            <emphasis role="bold">2.</emphasis> Click <emphasis role="bold">Upload</emphasis> on the <emphasis role="bold">Action</emphasis> bar to upload some images from your local device and publish them.</para>
          <para>
            <mediaobject>
              <imageobject role="fo">
                <imagedata align="center" fileref="images/navigation_by_content_feature/sampleProductImages.png" format="PNG" scalefit="1" width="150mm"/>
              </imageobject>
              <imageobject role="html">
                <imagedata align="center" fileref="images/navigation_by_content_feature/sampleProductImages.png" format="PNG" scalefit="0" width="150mm"/>
              </imageobject>
            </mediaobject>
          </para>
          <para>
            <emphasis role="bold">3.</emphasis> Go to <emphasis role="italic">somePath/someDirectory/sampleProduct/medias/videos</emphasis>.</para>
          <para>
            <emphasis role="bold">4.</emphasis> Click <emphasis role="bold">Upload</emphasis> on the <emphasis role="bold">Action</emphasis> bar to upload some videos from your local device and publish it.</para>
          <para>
            <mediaobject>
              <imageobject role="fo">
                <imagedata align="center" fileref="images/navigation_by_content_feature/sampleProductVideos.png" format="PNG" scalefit="1" width="150mm"/>
              </imageobject>
              <imageobject role="html">
                <imagedata align="center" fileref="images/navigation_by_content_feature/sampleProductVideos.png" format="PNG" scalefit="0" width="150mm"/>
              </imageobject>
            </mediaobject>
          </para>
          <para>
            <emphasis role="bold">5.</emphasis> Go to <emphasis role="italic">somePath/someDirectory/sampleProduct/documents</emphasis>.</para>
          <para>
            <emphasis role="bold">6.</emphasis> Create two directories, including <emphasis role="bold">Sale Materials</emphasis> and <emphasis role="bold">Technical Documentations</emphasis>.</para>
          <para>
            <emphasis role="bold">7.</emphasis> Upload a PDF document and publish it under each sub-folder.</para>
          <para>
            <mediaobject>
              <imageobject role="fo">
                <imagedata align="center" fileref="images/navigation_by_content_feature/sampleProductDocuments.png" format="PNG" scalefit="1" width="150mm"/>
              </imageobject>
              <imageobject role="html">
                <imagedata align="center" fileref="images/navigation_by_content_feature/sampleProductDocuments.png" format="PNG" scalefit="0" width="150mm"/>
              </imageobject>
            </mediaobject>
          </para>
          <para>
            <emphasis role="bold">8.</emphasis> Add your <emphasis role="bold">sampleProduct</emphasis> to some categories or add it to the <emphasis role="bold">Content List</emphasis> portlet.</para>
          <para>Your newly created product is now ready to be displayed in some pages.</para>
          <para>
            <emphasis role="bold">9.</emphasis> Publish your newly created product. Note that you can select this content from a CLV:</para>
          <para>
            <mediaobject>
              <imageobject role="fo">
                <imagedata align="center" fileref="images/navigation_by_content_feature/sampleProductCLV.png" format="PNG" scalefit="1" width="150mm"/>
              </imageobject>
              <imageobject role="html">
                <imagedata align="center" fileref="images/navigation_by_content_feature/sampleProductCLV.png" format="PNG" scalefit="0" width="150mm"/>
              </imageobject>
            </mediaobject>
          </para>
          <para>As a result, the content will be displayed in a detailed page as follows:</para>
          <para>
            <mediaobject>
              <imageobject role="fo">
                <imagedata align="center" fileref="images/navigation_by_content_feature/sampleProductDetail.png" format="PNG" scalefit="1" width="150mm"/>
              </imageobject>
              <imageobject role="html">
                <imagedata align="center" fileref="images/navigation_by_content_feature/sampleProductDetail.png" format="PNG" scalefit="0" width="150mm"/>
              </imageobject>
            </mediaobject>
          </para>
        </section>
        <section id="DEV.WorkWithContent.NavigationByContent.CreateDataForNavigationByContentExamples.DevelopProductContent">
          <title>Develop your own Product content </title>
          <para>The sample <emphasis role="bold">Product</emphasis> page is composed of the following fields and folders:</para>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="bold">Product</emphasis> content type fields: Name, Title, Illustration Image, Summary, Benefits, and Features.</para>
            </listitem>
          </itemizedlist>
          <para>(The <emphasis role="bold">Product</emphasis> content type is the template specified for the <emphasis role="bold">Product</emphasis> page.)</para>
          <itemizedlist>
            <listitem>
              <para>Other content folders: documents, medias/images, medias/videos.</para>
            </listitem>
          </itemizedlist>
          <para>(These folders contain documents and media files to enrich the <emphasis role="bold">Product</emphasis> page.)</para>
          <citetitle>
<para>
<emphasis role="bold">Create fields in the Product content type</emphasis>
</para>
</citetitle>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="bold">Name</emphasis>
              </para>
            </listitem>
          </itemizedlist>
          <para>Other content folders are created within the product content when the <emphasis role="bold">Name</emphasis> field is created. This can be achieved (from the .gtmpl product dialog) as follows:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
<tr>
	<td class="FieldLabel"><%=_ctx.appRes("Product.dialog.label.name")%></td>
	<td class="FieldComponent">
	<%
	String[] productFieldName = ["jcrPath=/node", "mixintype=mix:votable,mix:commentable","editable=if-null","validate=name,empty"] ;
	uicomponent.addTextField("name", productFieldName) ;
	String[] documentsFolder = ["jcrPath=/node/documents", "nodetype=nt:folder","mixintype=exo:documentFolder", "defaultValues=documents"] ;
	String[] mediasFolder = ["jcrPath=/node/medias", "nodetype=exo:multimediaFolder", "defaultValues=medias"] ;
	String[] imagesFolder = ["jcrPath=/node/medias/images", "nodetype=nt:folder", "defaultValues=images"] ;
	String[] videoFolder = ["jcrPath=/node/medias/videos", "nodetype=nt:folder", "defaultValues=videos"] ;
	uicomponent.addHiddenField("documentsFolder", documentsFolder);
	uicomponent.addHiddenField("mediasFolder", mediasFolder);
	uicomponent.addHiddenField("imagesFolder", imagesFolder);
	uicomponent.addHiddenField("videoFolder", videoFolder);
	%>
	</td>
</tr>
]]></programlisting>
          </programlistingco>
          <para>
            <emphasis role="bold">Other fields are created almost in the same way:</emphasis>
          </para>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="bold">Title:</emphasis>
              </para>
            </listitem>
          </itemizedlist>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
<tr>
	<td class="FieldLabel"><%=_ctx.appRes("Product.dialog.label.title")%></td>
	<td class="FieldComponent">
	<%
		String[] productFieldTitle = ["jcrPath=/node/exo:title", "validate=empty", "editable=if-null"];
		uicomponent.addTextField("title", productFieldTitle) ;
	%>
	</td>
</tr>
]]></programlisting>
          </programlistingco>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="bold">Illustration image</emphasis>:</para>
            </listitem>
          </itemizedlist>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
<%
private void setUploadFields(name) {
	String[] illustrationHiddenField1 = ["jcrPath=/node/medias/images/illustration", "nodetype=nt:file", "mixintype=mix:referenceable", "defaultValues=illustration"];
	String[] illustrationHiddenField2 = ["jcrPath=/node/medias/images/illustration/jcr:content", "nodetype=nt:resource", "mixintype=dc:elementSet", "visible=false"];
	String[] illustrationHiddenField3 = ["jcrPath=/node/medias/images/illustration/jcr:content/jcr:encoding", "visible=false", "UTF-8"];
	String[] illustrationHiddenField4 = ["jcrPath=/node/medias/images/illustration/jcr:content/jcr:lastModified", "visible=false"];
	String[] illustrationHiddenField5 = ["jcrPath=/node/medias/images/illustration/jcr:content/dc:date", "visible=false"];
	uicomponent.addHiddenField("illustrationHiddenField1", illustrationHiddenField1);
	uicomponent.addHiddenField("illustrationHiddenField2", illustrationHiddenField2);
	uicomponent.addHiddenField("illustrationHiddenField3", illustrationHiddenField3);
	uicomponent.addCalendarField("illustrationHiddenField4", illustrationHiddenField4);
	uicomponent.addCalendarField("illustrationHiddenField5", illustrationHiddenField5);
	String[] fieldImage = ["jcrPath=/node/medias/images/illustration/jcr:content/jcr:data"] ;
	uicomponent.addUploadField(name, fieldImage) ;
}
%>
<tr>
	<td class="FieldLabel"><%=_ctx.appRes("Product.dialog.label.illustrationImage")%></td>
	<td class="FieldComponent">
		<%
			String illustration = "illustration";
			if(ProductNode != null && ProductNode.hasNode("medias/images/illustration") && (uicomponent.findComponentById(illustration) == null)) {
				def imageNode = ProductNode.getNode("medias/images/illustration") ;
				def resourceNode = imageNode.getNode("jcr:content");
				if(resourceNode.getProperty("jcr:data").getStream().available() > 0) {
					def imgSrc = uicomponent.getImage(imageNode, "jcr:content");
					def actionLink = uicomponent.event("RemoveData", "/medias/images/illustration/jcr:content");
					%>
						<div>
							<image src="$imgSrc" width="100px" height="80px"/>
							<a onclick="$actionLink">
								<img src="/eXoResources/skin/DefaultSkin/background/Blank.gif" class="ActionIcon Remove16x16Icon"/>
							</a>
						</div>
					<%
				} else {
					setUploadFields(illustration);
				}
			} else {
				setUploadFields(illustration);
			}
		%>
	</td>
</tr>
]]></programlisting>
          </programlistingco>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="bold">Summary:</emphasis>
              </para>
            </listitem>
          </itemizedlist>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
<tr>
	<td class="FieldLabel"><%=_ctx.appRes("Product.dialog.label.summary")%></td>
	<td class="FieldComponent">
	<%
		String[] fieldSummary = ["jcrPath=/node/exo:summary", "options=Basic", ""] ;
		uicomponent.addRichtextField("summary", fieldSummary) ;
	%>
	</td>
</tr>
]]></programlisting>
          </programlistingco>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="bold">Benefits:</emphasis>
              </para>
            </listitem>
          </itemizedlist>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
<tr>
	<td class="FieldLabel"><%=_ctx.appRes("Product.dialog.label.benefits")%></td>
	<td class="FieldComponent">
	<div class="UIFCKEditor">
	<%
		String[] productFieldBenefits = ["jcrPath=/node/exo:productBenefits", "options=toolbar:CompleteWCM", ""] ;
		uicomponent.addRichtextField("productBenefits", productFieldBenefits) ;
	%>
	</div>
	</td>
</tr>
]]></programlisting>
          </programlistingco>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="bold">Features:</emphasis>
              </para>
            </listitem>
          </itemizedlist>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
<tr>
	<td class="FieldLabel"><%=_ctx.appRes("Product.dialog.label.features")%></td>
	<td class="FieldComponent">
	<div class="UIFCKEditor">
	<%
		String[] productFieldFeatures = ["jcrPath=/node/exo:productFeatures", "options=toolbar:CompleteWCM", ""] ;
		uicomponent.addRichtextField("productFeatures", productFieldFeatures) ;
	%>
	</div>
	</td>
</tr>
]]></programlisting>
          </programlistingco>
          <citetitle>
<para>
<emphasis role="bold">Develop the Product's view form</emphasis>
</para>
</citetitle>
          <para>
            <emphasis role="bold">The illustration image, title and summary are grouped together:</emphasis>
          </para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
<!-- Hot news -->
<div class="BigNews ClearFix">
	<!-- Begin illustrative image -->
		<%
		RESTImagesRendererService imagesRenderer = uicomponent.getApplicationComponent(RESTImagesRendererService.class);
		def imageURI = imagesRenderer.generateImageURI(currentNode.getNode("medias/images/illustration"),null);
		if (imageURI != null){
		%>
	<a class="Image"><img width="93" src="$imageURI" alt=""></a>
		<%
		}
		%>
	<div class="Content">
	<!-- Begin title -->
	<%
	  if(currentNode.hasProperty("exo:title")) {
		def title = currentNode.getProperty("exo:title").getString();
		%>
		<a href="#" class="Title">$title</a>
		<div class="Index1">$title</div>
		<%
	  }
	%>
	<!-- End title -->
	<!-- Begin summary -->
		<%
		if(currentNode.hasProperty("exo:summary")) {
		def summary = currentNode.getProperty("exo:summary").getString();
		%>
		<div class="Summary">$summary</div>
		<%
		}
		%>
	<!-- End summary -->
	</div>
</div>
]]></programlisting>
          </programlistingco>
          <para>In which:</para>
          <itemizedlist>
            <listitem>
              <para>Name: The name of the product.</para>
            </listitem>
            <listitem>
              <para>Title: The title of the product.</para>
            </listitem>
            <listitem>
              <para>Illustration Image: The image that is used as an illustration for the product.</para>
            </listitem>
            <listitem>
              <para>Summary: The summary about the product that goes with the illustration.</para>
            </listitem>
            <listitem>
              <para>Benefits: The benefits of the product.</para>
            </listitem>
            <listitem>
              <para>Features: The features of the product.</para>
            </listitem>
          </itemizedlist>
          <para>
            <emphasis role="bold">Benefits and Features fields are rendered in two tabs using the jQuery library (already integrated into eXo Platform 3.5).</emphasis>
          </para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
<div id="sectionsTabs" class="ui-tabs">
	<ul class="ui-tabs-nav ClearFix">
		<li class="ui-state-default">
			<!-- Begin Benefits head section -->
			<a class="ArrowCtrl" href="#tab-benefits"><%=_ctx.appRes("Product.view.label.benefits")%></a>
			<!-- End Benefits head section -->
		</li>
		<li class="ui-tabs-selected">
			<!-- Begin Features head section -->
			<a class="ArrowCtrl" href="#tab-features"><%=_ctx.appRes("Product.view.label.features")%></a>
			<!-- End Features head section -->
		</li>
	</ul>
	<div id="tab-benefits">
	  <%
		  if(currentNode.hasProperty("exo:productBenefits")) {
			def benefits = currentNode.getProperty("exo:productBenefits").getString();
			print benefits;
		  }
	  %>
	</div>
	<div id="tab-features">
	  <%
		  if(currentNode.hasProperty("exo:productFeatures")) {
			def features = currentNode.getProperty("exo:productFeatures").getString();
			print features;
		  }
	  %>
	</div>
</div>

<script type="text/javascript">
	jQuery.noConflict();
	jQuery(document).ready(function() {
		jQuery("#sectionsTabs").tabs();
	});
</script>
]]></programlisting>
          </programlistingco>
          <itemizedlist>
            <listitem>
              <para>The jQuery-based feature is used to display the product's images (in the coverflow view) from the images folder.</para>
            </listitem>
          </itemizedlist>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
<div class="jQProBoxC">
<!-- Begin jCarouselLite part -->
<button class="jQprev">&nbsp;</button>
<div class="jCarouselLite">
	<ul>
	   <%
             FOR IMAGE IN PRODUCT'S IMAGE FOLDER
		String imgSrc = "";
		/*
		GET THE IMAGE PATH
		imgSrc = GET THE IMAGE PATH;
		*/
		%>
		<li><img src="$imgSrc" width="204" height="200"/></li>
		<%
	    %>
	</ul>
</div>
<button class="jQnext">&nbsp;</button>
<!-- End jCarouselLite part -->
</div>
<script type="text/javascript">
jQuery.noConflict();
   jQuery(document).ready(function(){
  //jQuery.noConflict();
	jQuery(".jCarouselLite").jCarouselLite({
	btnNext: ".jQprev",
	btnPrev: ".jQnext",
	//auto: 500,
	//speed: 500
});
});
</script>
]]></programlisting>
          </programlistingco>
          <itemizedlist>
            <listitem>
              <para>Documents and videos are simply displayed within the view form as follows:</para>
            </listitem>
          </itemizedlist>
          <para>
            <emphasis role="bold">1.</emphasis> Get the node path to a document or video.</para>
          <para>
            <emphasis role="bold">2.</emphasis> Use some customized CSS classes to display a link for this node.</para>
          <para>Labels and/or messages are displayed in the dialog and the view form are localized.</para>
          <para>The use of this instruction is described as below:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
<td class="FieldLabel"><%=_ctx.appRes("Product.dialog.label.summary")%></td>
(...)
<h1><%=_ctx.appRes("Product.view.label.seeItInAction")%></h1>
]]></programlisting>
          </programlistingco>
          <para>This can be achieved by adding locale files. For example:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<Product>
  <view>
    <label>
      <benefits>Benefits</benefits>
      <features>Features</features>
      <seeItInAction>See it in action</seeItInAction>
      <resources>Resources</resources>
      <videos>Videos</videos>
    </label>
  </view>
</Product>
]]></programlisting>
          </programlistingco>
          <para>Make sure that locale files are added to the resource bundle configuration. If locale files (dialogs and views) are under the <emphasis role="italic">classes/locale/wcm</emphasis> directory, use the following code:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<value>locale.wcm.dialogs</value>
<value>locale.wcm.views</value>
]]></programlisting>
          </programlistingco>
        </section>
      </section>
    </section>
  </chapter>
  <chapter id="DEV.WorkingwithApplications">
    <title>Work With Applications </title>
    <para>Applications play an important role in each eXo service, so it is necessary for you to further understand about them.</para>
    <para>In this chapter, you will know how to integrate an application into your portal, and how to develop your own application:</para>
    <itemizedlist>
      <listitem>
        <para>
          <link linkend="DEV.WorkWithApplications.ApplicationIntegration">Integrate an application</link>
        </para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.WorkWithApplications.DevelopYourOwnApplications">Develop your own application</link>
        </para>
        <itemizedlist>
          <listitem>
            <para>
              <link linkend="DEV.WorkWithContent.GadgetvsPortlet">Gadget vs Portlet</link>
            </para>
          </listitem>
          <listitem>
            <para>
              <link linkend="DEV.WorkWithApplications.DevelopAGadgetForPlatform">Develop a gadget for eXo Platform</link>
            </para>
          </listitem>
          <listitem>
            <para>
              <link linkend="DEV.WorkWithApplications.PortletBridges">Portlet Bridges</link>
            </para>
          </listitem>
        </itemizedlist>
      </listitem>
    </itemizedlist>
    <section id="DEV.WorkWithApplications.ApplicationIntegration">
      <title>Integrate an application </title>
      <para>To add a portlet to one of your portal's pages, you should configure the <emphasis role="italic">pages.xml</emphasis> file located at <emphasis role="italic">/war/src/main/webapp/WEB-INF/conf/sample-ext/portal/portal/classic</emphasis>/.</para>
      <para>Here is an example of the portlet configuration in the <emphasis role="italic">pages.xml</emphasis> file:</para>
      <programlistingco>
        <areaspec units="linecolumn"/>
        <programlisting language="xml"><![CDATA[
<portlet-application>
  <portlet>
    <application-ref>presentation</application-ref>
    <portlet-ref>SingleContentViewer</portlet-ref>
    <preferences>
      <preference>
        <name>repository</name>
        <value>repository</value>
        <read-only>false</read-only>
      </preference>
      <preference>
        <name>workspace</name>
        <value>collaboration</value>
        <read-only>false</read-only>
      </preference>
      <preference>
        <name>nodeIdentifier</name>
        <value>/sites content/live/acme/web contents/site artifacts/Introduce</value>
        <read-only>false</read-only>
      </preference>
      <!-- ... -->
    </preferences>
  </portlet>
  <title>Homepage</title>
  <access-permissions>Everyone</access-permissions>
  <show-info-bar>false</show-info-bar>
  <show-application-state>false</show-application-state>
  <show-application-mode>false</show-application-mode>
</portlet-application>
]]></programlisting>
      </programlistingco>
      <para>
        <emphasis role="bold">Details:</emphasis>
      </para>
      <informaltable>
        <tgroup cols="2">
          <thead>
            <row>
              <entry> XML tag name </entry>
              <entry> Description </entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry> <code>application-ref</code> </entry>
              <entry> The name of the webapp that contains the portlet. </entry>
            </row>
            <row>
              <entry> <code>portlet-ref</code> </entry>
              <entry> The name of the portlet. </entry>
            </row>
            <row>
              <entry> <code>title</code> </entry>
              <entry> The title of the page. </entry>
            </row>
            <row>
              <entry> <code>access-permission</code> </entry>
              <entry> Define who can access the portlet. </entry>
            </row>
            <row>
              <entry> <code>show-info-bar</code> </entry>
              <entry> Show the top bar with the portlet title. </entry>
            </row>
            <row>
              <entry> <code>show-application-state</code> </entry>
              <entry> Show the collapse/expand icons. </entry>
            </row>
            <row>
              <entry> <code>show-application-mode</code> </entry>
              <entry> Show the change portlet mode icon. </entry>
            </row>
            <row>
              <entry> <code>preferences</code> </entry>
              <entry> Contain a list of <emphasis role="italic">preferences</emphasis> specific to each portlet. Each <emphasis role="italic">preference</emphasis> has a <emphasis role="italic">name</emphasis> and a <emphasis role="italic">value</emphasis>. You can also lock it by setting the <emphasis role="italic">read-only</emphasis> element to "true". To learn more, refer to <ulink url="../../../reference/html/index.html">eXo JCR and Extension Services Reference</ulink>. </entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>
    </section>
    <section id="DEV.WorkWithApplications.DevelopYourOwnApplications">
      <title>Develop your own application </title>
      <section id="DEV.WorkWithContent.GadgetvsPortlet">
        <title>Gadget vs Portlet </title>
        <para>It is important to understand distinctions between gadgets and portlets. Portlets are user interface components that provide fragments of markup code from the server side, while gadgets generate dynamic web content on the client side. With Gadgets, small applications can be built quickly, and mashed up on the client side using the lightweight Web-Oriented Architecture (WOA) technologies, like REST or RSS.</para>
        <note>
          <para>For more information on how to develop gadgets and portlets, see the <ulink url="../../../reference/html/bk02ch04.html">Portlet development</ulink> and <ulink url="../../../reference/html/bk02ch05.html">Gadget development</ulink> sections.</para>
        </note>
      </section>
      <section id="DEV.WorkWithApplications.DevelopAGadgetForPlatform">
        <title>Develop a gadget for eXo Platform </title>
        <para>Because a gadget is basically an independent HTML content, the gadget UI such as layout, font, color may be different. Thus, making consistent in the look and feel of all eXo Platform gadgets is very important. In this part, it is assumed that developers have already known how to write a gadget in eXo Platform. The information here helps developers make a consistent look and feel with eXo Platform skin, even when this skin may be changed in the future.</para>
        <note>
          <para>To get more information on how to develop gadgets, see the <ulink url="../../../reference/html/bk02ch05.html">Gadget development</ulink> and <ulink url="../../../developer-guide/html/ide-user-guide/index.html">Develop gadgets via a powerful web-based IDE of eXo Platform</ulink> sections.</para>
        </note>
        <section>
          <title>Get the consistent look and feel</title>
          <citetitle>
<para>
<emphasis role="bold">Resources</emphasis>
</para>
</citetitle>
          <para>To achieve the consistent look and feel, you have to collect the common features of all gadgets as much as possible and put in a place where it can be shared for all gadgets. You will use exo-gadget-resources for this purpose.  It is a <emphasis role="italic">.war</emphasis> file that contains commonly used static resources (stylesheets, images, JavaScript libraries, and more) available for all gadgets in eXo Platform at runtime: </para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
/exo-gadget-resources 
 |__skin 
 |   |__exo-gadget 
 |   |   |__images 
 |   |   |__gadget-common.css 
 |   |__...(3rd-party components' CSS)
 |__script 
    |__jquery 
    |  |__1.6.2 
    |  |__...(other jQuery versions) 
    |  |__plugins 
    |__utils 
]]></programlisting>
          </programlistingco>
          <para>The resources are divided into 2 categories: skin and script.</para>
          <para>
            <emphasis role="bold">Skin</emphasis>: is the place for the shared stylesheets of the gadgets (<emphasis role="italic">exo-gadget/gadget-common.css</emphasis>) and other third-party components styles adapted to the eXo Platform skin (jqPlot, Flexigrid, and more). This is a copy of the component's original CSS with some modifications to match the eXo Platform's skin. You can find this original file at the component's folder under <emphasis role="italic">exo-gadget-resources/script</emphasis>  , then link to it or make your own copy (put it in your gadget's folder and refer to it in gadget's .xml file) to suit your need.</para>
          <para>The <emphasis role="italic">gadget-common.css</emphasis> file is the main place for the global stylesheets. When the eXo Platform skin is changed, updating stylesheets in this file will affect all gadgets skins accordingly. In this file, you will define stylesheets applied for all gadgets, such as gadget title, gadget body, fonts, colors, tables, and some commonly used icons, such as drop-down arrow, list bullet, setting button, and more.</para>
          <para>For example:</para>
          <itemizedlist>
            <listitem>
              <para>UIGadgetThemes: the gadget container.</para>
            </listitem>
            <listitem>
              <para>TitGad: the gadget title.</para>
            </listitem>
            <listitem>
              <para>ContTit: the gadget title content.</para>
            </listitem>
            <listitem>
              <para>GadCont: the gadget content.</para>
            </listitem>
            <listitem>
              <para>SettingButton: the setting button for gadget's User Preferences.</para>
            </listitem>
          </itemizedlist>
          <para>
            <emphasis role="bold">Script</emphasis>: is the place for commonly used third-party JavaScript libraries (e.g: jQuery and its plugins) and a library of useful utility scripts (the utils folder). </para>
          <para>jQuery and plugins:</para>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="italic">jquery/&lt;version&gt;</emphasis>: <ulink url="http://jquery.com/">jQuery JavaScript library</ulink>.</para>
            </listitem>
            <listitem>
              <para>
                <emphasis role="italic">jquery/plugins/jqplot</emphasis>: <ulink url="http://www.jqplot.com/">Charts and Graphs for jQuery</ulink>.</para>
            </listitem>
            <listitem>
              <para>
                <emphasis role="italic">jquery/plugins/flexigrid</emphasis>: <ulink url="http://flexigrid.info/">Lightweight but rich data grid</ulink>.</para>
            </listitem>
            <listitem>
              <para>
                <emphasis role="italic">jquery/plugins/date.js</emphasis>: <ulink url="http://www.datejs.com/">JavaScript date library</ulink>.</para>
            </listitem>
            <listitem>
              <para>
                <emphasis role="italic">jquery/plugins/jquery.timers</emphasis>: <ulink url="http://plugins.jquery.com/project/timers">JavaScript timer</ulink>.</para>
            </listitem>
          </itemizedlist>
          <para>(Here you should keep the latest and several versions of jQuery because some plugins may not work with the latest version. Several versions of a plugin are also kept).</para>
          <para>The utilities scripts:</para>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="italic">utils/pretty.date.js</emphasis>: Calculate the difference from a point of time in the past to the present and display "4 months 3 weeks ago", for example.</para>
            </listitem>
          </itemizedlist>
          <citetitle>
<para>
<emphasis role="bold">Apply for a gadget</emphasis>
</para>
</citetitle>
          <para>A gadget should use static resources available in <emphasis role="italic">exo-gadget-resources</emphasis> instead of including them in their own package. This helps reduce packaging size, avoid duplication (considering that every gadget includes a version of jQuery is in its own package) and take advantages of automatic skin changing/updating when the resources of <emphasis role="italic">exo-gadget-resources</emphasis> are updated to the new eXo Platform skin. To make it work, the applied gadget must use the CSS classes defined in <emphasis role="italic">gadget-common.css</emphasis> (at least for the gadget title) like the sample gadget below:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<Module> 
<ModulePrefs title="Sample gadget"/> 
<Content type="html"> 
  <head> 
    <link href="/exo-gadget-resources/skin/exo-gadget/gadget-common.css" rel="stylesheet" type="text/css"/> 
    <script language="javascript" src="/exo-gadget-resources/script/jquery/1.6.2/jquery.min.js" type="text/javascript"/> 
    <script language="javascript" type="text/javascript"> 
      $(function(){ 
        alert("Hello from jQuery");  (3)
      }); 
    </script>  
  </head> 
  <body> 
    <div class="UIGadgetThemes"> 
      <div class="TitGad ClearFix"> 
        <div class="ContTit">Gadget title</div>  (1)
      </div> 
      <div class="GadCont">  (2)
        Gadget content 
      </div> 
    </div> 
  </body> 
</Content> 
</Module>
]]></programlisting>
          </programlistingco>
          <para>The sample gadget:</para>
          <para>
            <mediaobject>
              <imageobject role="fo">
                <imagedata align="center" fileref="images/sample_gadget.png" format="PNG" scalefit="1" width="100mm"/>
              </imageobject>
              <imageobject role="html">
                <imagedata align="center" fileref="images/sample_gadget.png" format="PNG" scalefit="0" width="100mm"/>
              </imageobject>
            </mediaobject>
          </para>
          <citetitle>
<para>
<emphasis role="bold">The sample user settings of a gadget</emphasis>
</para>
</citetitle>
          <para>The following gadget gives the demo of a user settings screen which uses eXo Platform standard icons (setting button, list item bullet, and more) that are defined in the <emphasis role="italic">gadget-common.css</emphasis>.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<Module> 
<ModulePrefs title="Setting demo"> 
  <Require feature="dynamic-height"/> 
  <Require feature="setprefs"/> 
</ModulePrefs>  
<Content type="html"> 
  <head> 
    <link href="/exo-gadget-resources/skin/exo-gadget/gadget-common.css" rel="stylesheet" type="text/css"/> 
    <style type="text/css"> 
      .SettingButton:hover {cursor:pointer;} 
    </style>  
    <script language="javascript" src="/exo-gadget-resources/script/jquery/1.6.2/jquery.min.js" type="text/javascript"/> 
    <script language="javascript" type="text/javascript"> 
 
      $(function(){ 
        var prefs = new gadgets.Prefs(); 
        var defaultNumItems = 3; 

        function displayItems(){ 
          var numItems = prefs.getInt("numItems") || defaultNumItems; 
          $("#content").html(""); 
          for(i=0; i&lt;=numItems; i++) { 
            $("#content").append("&lt;div class='IconLink'&gt;Item " + (i+1) + "&lt;/div&gt;");    (3)
          } 
          gadgets.window.adjustHeight($(".GadCont").get(0).offsetHeight); 
        }      
		
        $(".SettingButton").live("click", function(){ 
          $("#txtNumItems").val(prefs.getInt("numItems") || defaultNumItems); 
          $("#setting").toggle(); 
          gadgets.window.adjustHeight($(".GadCont").get(0).offsetHeight); 
        }); 

        $("#btnOk").live("click", function(){ 
          var sNumItems = $("#txtNumItems").val(); 
          prefs.set("numItems", parseInt(sNumItems) || defaultNumItems); 
          $("#setting").hide(); 
          displayItems(); 
        }); 

        $("#btnCancel").live("click", function(){ 
          $("#setting").hide(); 
          gadgets.window.adjustHeight($(".GadCont").get(0).offsetHeight); 
        }); 

        displayItems(); 
      }); 
 
    </script>  
  </head> 
  <body> 
    <div class="UIGadgetThemes"> 
      <div class="TitGad ClearFix"> 
        <div class="ContTit"> 
          Setting demo 
          <div class="SettingButton" style="display:block; width:20px; height:20px"/>   (1)
        </div> 
      </div> 
      <div class="GadCont"> 
        <div id="setting" style="display:none;">   (2)
          <label for="txtNumItems">Num of items</label> 
          <input id="txtNumItems" type="text"/>                                       
          <input id="btnOk" type="button" value="OK"/> 
          <input id="btnCancel" type="button" value="Cancel"/> 
          <hr/> 
        </div> 
        <div id="content"/> 
      </div> 
    </div> 
  </body> 
</Content> 
</Module> 
]]></programlisting>
          </programlistingco>
          <para>
            <mediaobject>
              <imageobject role="fo">
                <imagedata align="center" fileref="images/setting_demo_form.png" format="PNG" scalefit="1" width="100mm"/>
              </imageobject>
              <imageobject role="html">
                <imagedata align="center" fileref="images/setting_demo_form.png" format="PNG" scalefit="0" width="100mm"/>
              </imageobject>
            </mediaobject>
          </para>
          <citetitle>
<para>
<emphasis role="bold">Customize the gadget thumbnail</emphasis>
</para>
</citetitle>
          <para>The gadget thumbnails are displayed in the <emphasis role="bold">Page Editor</emphasis> window when you edit a page. The thumbnail image size needs to be consistent for all gadgets in the list.  The current size (in eXo Platform 3.5) is 80 x 80px, so you should select an image of this size in PNG (preferred), JPG or GIF format for your gadget thumbnail. </para>
          <para>
            <mediaobject>
              <imageobject role="fo">
                <imagedata align="center" fileref="images/gadget_thumbnail.png" format="PNG" scalefit="1" width="150mm"/>
              </imageobject>
              <imageobject role="html">
                <imagedata align="center" fileref="images/gadget_thumbnail.png" format="PNG" scalefit="0" width="150mm"/>
              </imageobject>
            </mediaobject>
          </para>
          <itemizedlist>
            <listitem>
              <para>The image can also be one from a public website (absolute URL), for example: &lt;ModulePrefs title="Sample gadget" thumbnail="<ulink url="http://www.example.com/images/sample-icon.jpg">http://www.example.com/images/sample-icon.jpg</ulink>"/&gt;; or from an internal image (relative URL): &lt;ModulePrefs title="Sample gadget" thumbnail="image/sample-icon<emphasis role="italic">80x80.png"/&gt;.</emphasis>
              </para>
            </listitem>
          </itemizedlist>
        </section>
      </section>
      <section id="DEV.WorkWithApplications.PortletBridges">
        <title>Portlet Bridges </title>
        <para>The Portlet Bridge is an adapter for a web framework to the portlet container runtime. It works ideally with framework that does not expose the servlet container with the limited support for the full portlet API.</para>
        <para>The JavaTM Specification Request 168 Portlet Specification (JSR 168) standardizes how components for portal servers are developed. This standard has industry backing from major portal server vendors. A Portlet Bridge allows you to create a JSR-168 compliant portlet with very little change on your existing web application.</para>
        <para>For example, the JSF Bridge allows you to transparently deploy your existing JSF Applications as a Portlet Application or Web Application. For more details, see <ulink url="http://wiki.apache.org/myfaces/PortletBridge.">http://wiki.apache.org/myfaces/PortletBridge.</ulink>
        </para>
        <para>The JBoss implementation of the Portlet Bridge has enhancements to support other web frameworks, such as RichFaces and Seam. For more details, see <ulink url="http://jboss.org/portletbridge/docs.html.">http://jboss.org/portletbridge/docs.html.</ulink>
        </para>
      </section>
    </section>
  </chapter>
  <chapter id="DEV.SystemIntegration">
    <title>System Integration </title>
    <para>This chapter will show you how to integrate eXo Platform 3.5 into your information system through the specific topics below:</para>
    <itemizedlist>
      <listitem>
        <para>
          <link linkend="DEV.SystemIntegration.Authentication">Authentication</link>
        </para>
        <itemizedlist>
          <listitem>
            <para>
              <link linkend="DEV.SystemIntegration.SingleSignON">Single-Sign-On (SSO)</link>
            </para>
          </listitem>
          <listitem>
            <para>
              <link linkend="DEV.SystemIntegration.KerberosSSOOnActiveDirectory">Kerberos SSO on Active Directory</link>
            </para>
          </listitem>
        </itemizedlist>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.SystemIntegration.UserIntegration">Users integration</link>
        </para>
        <itemizedlist>
          <listitem>
            <para>
              <link linkend="DEV.SystemIntegration.OrganizationService">Organization Service</link>
            </para>
          </listitem>
          <listitem>
            <para>
              <link linkend="DEV.SystemIntegration.MembershipsGroupsAndUsers">Memberships, Groups and Users</link>
            </para>
          </listitem>
          <listitem>
            <para>
              <link linkend="DEV.SystemIntegration.OrganizationAPI">Organization API</link>
            </para>
          </listitem>
        </itemizedlist>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.SystemIntegration.LDAPIntegration">LDAP Integration</link>
        </para>
        <itemizedlist>
          <listitem>
            <para>
              <link linkend="DEV.SystemIntegration.ConnectionSettings">Connection Settings</link>
            </para>
          </listitem>
          <listitem>
            <para>
              <link linkend="DEV.SystemIntegration.ActiveDirectorySampleConfiguration">Active Directory sample configuration</link>
            </para>
          </listitem>
          <listitem>
            <para>
              <link linkend="DEV.SystemIntegration.ActiveDirectorySampleConfiguration">Active Directory sample configuration</link>
            </para>
          </listitem>
        </itemizedlist>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.SystemIntegration.Email">Email</link>
        </para>
      </listitem>
    </itemizedlist>
    <section id="DEV.SystemIntegration.Authentication">
      <title>Authentication </title>
      <section id="DEV.SystemIntegration.SingleSignON">
        <title>Single-Sign-On (SSO) </title>
        <para>When logging into the portal, you can gain access to many systems through portlets using a single identity. However, in many cases, the portal infrastructure must be integrated with other SSO-enabled systems. There are many different Identity Management solutions available. The GateIn documentation gives detailed configuration for different SSO implementation. For more details, see <ulink url="http://docs.jboss.com/gatein/portal/3.1.0-FINAL/reference-guide/en-US/html_single/index.html#chap-Reference_Guide-SSO_Single_Sign_On">SSO - Single Sign On</ulink>.</para>
      </section>
      <section id="DEV.SystemIntegration.CenterAuthenticationService">
        <title>Central Authentication Service (CAS) </title>
        <para>Central Authentication Service (CAS) is a Web Single-Sign-On (WebSSO), developed by JA-SIG as an open source project. CAS enables you to work on different applications to log in only once and to be recognized and authenticated by all applications. Details about CAS can be found <ulink url="http://www.jasig.org/cas">here</ulink>.</para>
        <para>The CAS integration consists of two steps:</para>
        <itemizedlist>
          <listitem>
            <para>Installing or configuring the CAS server.</para>
          </listitem>
          <listitem>
            <para>Setting up the portal to use the CAS server.</para>
          </listitem>
        </itemizedlist>
        <para>For more information on CAS configuration, see <ulink url="http://docs.jboss.com/gatein/portal/3.1.0-FINAL/reference-guide/en-US/html_single/index.html#sect-Reference_Guide-Single_Sign_On-CAS_Central_Authentication_Service">here</ulink>.</para>
      </section>
      <section id="DEV.SystemIntegration.KerberosSSOOnActiveDirectory">
        <title>Kerberos SSO on Active Directory </title>
        <para>eXo Portal 3.5 supports the Kerberos authentication on a Microsoft Active Directory. You will need to configure both your Active Directory server and the application server.</para>
        <para>The implementation makes possible to use SPNEGO or NTLM. The client will get two authentication headers, including <emphasis role="bold">Negotiate</emphasis> and <emphasis role="bold">NTLM</emphasis> and will use whichever supported by the browser. In Firefox, it is possible to manage authentication types, but it is not in Internet Explorer; therefore, SPNEGO will be used.</para>
        <para>To learn more about how to configure Kerberos SSO, see <ulink url="http://wiki.exoplatform.com/xwiki/bin/view/WS/Kerberos%20SSO%20on%20Active%20Directory">here</ulink>.</para>
      </section>
    </section>
    <section id="DEV.SystemIntegration.UserIntegration">
      <title>Users integration </title>
      <section id="DEV.SystemIntegration.OrganizationService">
        <title>Organization Service </title>
        <para>To specify the initial Organization configuration, the content of your extension.war in <emphasis role="italic">/WEB-INF/conf/organization/organization-configuration.xml</emphasis> should be edited. This file uses the portal XML configuration schema. It lists several configuration plugins.</para>
        <para>The plugin of <emphasis role="italic">org.exoplatform.services.organization.OrganizationDatabaseInitializer</emphasis> type is used to specify a list of membership types, groups and users to be created.</para>
      </section>
      <section id="DEV.SystemIntegration.MembershipsGroupsAndUsers">
        <title>Memberships, Groups and Users </title>
        <para>The predefined membership types are specified in the <emphasis role="bold">membershipType</emphasis> field of the OrganizationConfig plugin parameter.</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<field name="membershipType">
  <collection type="java.util.ArrayList">
    <value>
      <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
        <field name="type">
          <string>member</string>
        </field>
        <field name="description">
          <string>member membership type</string>
        </field>
      </object>
    </value>
    <value>
      <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
        <field name="type">
          <string>owner</string>
        </field>
        <field name="description">
          <string>owner membership type</string>
        </field>
      </object>
    </value>
  </collection>
</field>
]]></programlisting>
        </programlistingco>
        <para>The predefined groups are specified in the <emphasis role="bold">group</emphasis> field of the OrganizationConfig plugin parameter.</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<field name="group">
  <collection type="java.util.ArrayList">
    <value>
      <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
        <field name="name">
          <string>portal</string>
        </field>
        <field name="parentId">
          <string/>
        </field>
        <field name="type">
          <string>hierachy</string>
        </field>
        <field name="description">
          <string>the /portal group</string>
        </field>
      </object>
    </value>
    <value>
      <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
        <field name="name">
          <string>community</string>
        </field>
        <field name="parentId">
          <string>/portal</string>
        </field>
        <field name="type">
          <string>hierachy</string>
        </field>
        <field name="description">
          <string>the /portal/community group</string>
        </field>
      </object>
    </value>
    ...
  </collection>
</field>
]]></programlisting>
        </programlistingco>
        <para>The predefined users are specified in the <emphasis role="bold">membershipType</emphasis> field of the OrganizationConfig plugin parameter.</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<field name="user">
  <collection type="java.util.ArrayList">
    <value>
      <object type="org.exoplatform.services.organization.OrganizationConfig$User">
        <field name="userName">
          <string>root</string>
        </field>
        <field name="password">
          <string>exo</string>
        </field>
        <field name="firstName">
          <string>root</string>
        </field>
        <field name="lastName">
          <string>root</string>
        </field>
        <field name="email">
          <string>exoadmin@localhost</string>
        </field>
        <field name="groups">
          <string>member:/admin,member:/user,owner:/portal/admin</string>
        </field>
      </object>
    </value>
    <value>
      <object type="org.exoplatform.services.organization.OrganizationConfig$User">
        <field name="userName">
          <string>exo</string>
        </field>
        <field name="password">
          <string>exo</string>
        </field>
        <field name="firstName">
          <string>site</string>
        </field>
        <field name="lastName">
          <string>site</string>
        </field>
        <field name="email">
          <string>exo@localhost</string>
        </field>
        <field name="groups">
          <string>member:/user</string>
        </field>
      </object>
    </value>
    ...
  </collection>
</field>
]]></programlisting>
        </programlistingco>
      </section>
      <section id="DEV.SystemIntegration.OrganizationAPI">
        <title>Organization API </title>
        <para>The <emphasis role="italic">exo.platform.services.organization</emphasis> package has five main components: user, user profile, group, membership type and membership. There is an additional component that serves as an entry point into Organization API - <emphasis role="italic">OrganizationService</emphasis> component which provides handling functionality for five components. For more details, see the <ulink url="../../../reference/html/bk02ch06.html#sect-Reference_Guide-APIs-Organization_API">Organization API</ulink> section.</para>
      </section>
    </section>
    <section id="DEV.SystemIntegration.LDAPIntegration">
      <title>LDAP Integration </title>
      <para>If you have an existing LDAP server, the eXo predefined settings will likely not match your directory structure. eXo LDAP organization service implementation was written with flexibility in mind and can certainly be configured to meet your requirements.</para>
      <para>The configuration is done in the <emphasis role="italic">ldap-configuration.xml</emphasis> file, and this part will explain the numerous parameters which it contains.</para>
      <section id="DEV.SystemIntegration.ConnectionSettings">
        <title>Connection Settings </title>
        <para>First, start by connection settings which will tell eXo how to connect to your directory server. These settings are very close to the <ulink url="http://java.sun.com/products/jndi">JNDI API</ulink> context parameters. This configuration is activated by the init-param <emphasis role="italic">ldap.config</emphasis> of service <emphasis role="italic">LDAPServiceImpl</emphasis>.</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<component>
  <key>org.exoplatform.services.ldap.LDAPService</key>
  <type>org.exoplatform.services.ldap.impl.LDAPServiceImpl</type>
  <init-params>
    <object-param>
      <name>ldap.config</name>
      <description>Default ldap config</description>
      <object type="org.exoplatform.services.ldap.impl.LDAPConnectionConfig">
        <field name="providerURL">
          <string>ldap://127.0.0.1:389,10.0.0.1:389</string>
        </field>
        <field name="rootdn">
          <string>CN=Manager,DC=exoplatform,DC=org</string>
        </field>
        <field name="password">
          <string>secret</string>
        </field>
        <!-- field name="authenticationType"><string>simple</string></field -->
        <field name="version">
          <string>3</string>
        </field>
        <field name="referralMode">
          <string>follow</string>
        </field>
        <!-- field name="serverName"><string>active.directory</string></field -->
      </object>
    </object-param>
  </init-params>
</component>
]]></programlisting>
        </programlistingco>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="bold">providerURL</emphasis>: LDAP server URL (see <ulink url="http://java.sun.com/products/jndi/1.2/javadoc/javax/naming/Context.html#PROVIDER_URL">PROVIDER URL</ulink>). For multiple LDAP servers, use comma separated list of host:port (For example, <ulink url="ldap://127.0.0.1:389">ldap://127.0.0.1:389</ulink>,10.0.0.1:389).</para>
          </listitem>
          <listitem>
            <para>
              <emphasis role="bold">rootdn</emphasis>: distinguished name of user that will be used by the service to authenticate on the server (see <ulink url="http://java.sun.com/products/jndi/1.2/javadoc/javax/naming/Context.html#SECURITY_PRINCIPAL">SECURITY PRINCIPAL</ulink>).</para>
          </listitem>
          <listitem>
            <para>
              <emphasis role="bold">password</emphasis>: password for user <emphasis role="italic">rootdn</emphasis> (see <ulink url="http://java.sun.com/products/jndi/1.2/javadoc/javax/naming/Context.html#SECURITY_CREDENTIALS">SECURITY CREDENTIALS</ulink>).</para>
          </listitem>
          <listitem>
            <para>
              <emphasis role="bold">authenticationType</emphasis>: type of authentication to be used (see <ulink url="http://java.sun.com/products/jndi/1.2/javadoc/javax/naming/Context.html#SECURITY_AUTHENTICATION">SECURITY AUTHENTICATION</ulink>). Use one of <emphasis role="italic">none</emphasis>, <emphasis role="italic">simple</emphasis>, <emphasis role="italic">strong</emphasis>. Default is <emphasis role="italic">simple</emphasis>.</para>
          </listitem>
          <listitem>
            <para>
              <emphasis role="bold">version</emphasis>: LDAP protocol version (see <ulink url="http://java.sun.com/products/jndi/tutorial/ldap/misc/version.html">java.naming.ldap.version</ulink>). Set to 3 if your server supports LDAP V3.</para>
          </listitem>
          <listitem>
            <para>
              <emphasis role="bold">referralMode</emphasis>: one of <emphasis role="italic">follow</emphasis>, <emphasis role="italic">ignore</emphasis>, <emphasis role="italic">throw</emphasis> (see <ulink url="http://java.sun.com/products/jndi/1.2/javadoc/javax/naming/Context.html#REFERRAL">REFERRAL</ulink>).</para>
          </listitem>
          <listitem>
            <para>
              <emphasis role="bold">serverName</emphasis>: you will need to set this to <emphasis role="italic">active.directory</emphasis> to work with Active Directory servers. Any other value will be ignored and the service will act as on a standard LDAP.</para>
          </listitem>
        </itemizedlist>
      </section>
      <section id="DEV.SystemIntegration.OrganizationServiceConfiguration">
        <title>Organization Service Configuration </title>
        <para>Next, you need to configure the eXo <emphasis role="bold">OrganizationService</emphasis> to show how the directory is structured and how to interact with it. This is managed by a couple of init-params: <emphasis role="bold">ldap.userDN.key</emphasis> and <emphasis role="bold">ldap.attribute.mapping</emphasis> in the <emphasis role="italic">ldap-configuration.xml</emphasis> file (by default located at <emphasis role="italic">portal.war/WEB-INF/conf/organization</emphasis>)</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<component>
  <key>org.exoplatform.services.organization.OrganizationService</key>
  <type>org.exoplatform.services.organization.ldap.OrganizationServiceImpl</type>
  [...]
  <init-params>
    <value-param>
      <name>ldap.userDN.key</name>
      <description>The key used to compose user DN</description>
      <value>cn</value>
    </value-param>
    <object-param>
      <name>ldap.attribute.mapping</name>
      <description>ldap attribute mapping</description>
      <object type="org.exoplatform.services.organization.ldap.LDAPAttributeMapping"/>
        [...]
    </object-param>
  </init-params>
  [...]
</component>
]]></programlisting>
        </programlistingco>
        <para>
          <emphasis role="bold">ldap.attribute.mapping</emphasis> maps your LDAP to eXo. At first, there are two main parameters to configure in it:</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<field name="baseURL">
  <string>dc=exoplatform,dc=org</string>
</field>
<field name="ldapDescriptionAttr">
  <string>description</string>
</field>
]]></programlisting>
        </programlistingco>
        <itemizedlist>
          <listitem>
            <para>
              <emphasis role="bold">baseURL</emphasis>: root dn for eXo organizational entities. This entry cannot be created by eXo and must have existed in the directory already.</para>
          </listitem>
          <listitem>
            <para>
              <emphasis role="bold">ldapDescriptionAttr</emphasis>: Name of a common attribute that will be used as description for groups and membership types.</para>
          </listitem>
        </itemizedlist>
        <warning>
          <para>In Core, the ldapDescriptionAttr key is present but not consistently used everywhere in code. When using <emphasis role="bold">Core</emphasis>, consider that the description is always mapped to the 'description' attribute.</para>
        </warning>
        <para>Other parameters are discussed in the following sections.</para>
        <section id="DEV.SystemIntegration.Users">
          <title>Users </title>
          <section id="DEV.SystemIntegration.MainParameters">
            <title>Main parameters </title>
            <para>Here are the main parameters to map eXo users to your directory:</para>
            <programlistingco>
              <areaspec units="linecolumn"/>
              <programlisting language="xml"><![CDATA[
<field name="userURL">
  <string>ou=users,ou=portal,dc=exoplatform,dc=org</string>
</field>
<field name="userObjectClassFilter">
  <string>objectClass=person</string>
</field>
<field name="userLDAPClasses">
  <string>top,person,organizationalPerson,inetOrgPerson</string>
</field>
]]></programlisting>
            </programlistingco>
            <itemizedlist>
              <listitem>
                <para>
                  <emphasis role="bold">userURL</emphasis>: base dn for users. Users are created in a flat structure under this base with a <emphasis role="bold">dn</emphasis> of the form: <emphasis role="bold">ldap.userDN.key=username,userURL</emphasis>.</para>
              </listitem>
            </itemizedlist>
            <para>For example: <programlistingco>
                <areaspec units="linecolumn"/>
                <programlisting><![CDATA[uid=john,cn=People,o=MyCompany,c=com{code}]]></programlisting>
              </programlistingco>
            </para>
            <para>However, if users exist deeply under <emphasis role="italic">userURL</emphasis>, eXo will be able to retrieve them.</para>
            <para>Example: <programlistingco>
                <areaspec units="linecolumn"/>
                <programlisting><![CDATA[uid=tom,ou=France,ou=EMEA,cn=People,o=MyCompany,c=com{code}]]></programlisting>
              </programlistingco>
            </para>
            <itemizedlist>
              <listitem>
                <para>
                  <emphasis role="bold">userObjectClassFilter</emphasis>: Filter used under <emphasis role="italic">userURL</emphasis> branch to distinguish eXo user entries from others.</para>
              </listitem>
            </itemizedlist>
            <para>Example: <emphasis role="italic">john</emphasis> and <emphasis role="italic">tom</emphasis> will be recognized as valid eXo users but <emphasis role="italic">EMEA</emphasis> and <emphasis role="italic">France</emphasis> entries will be ignored in the following subtree:</para>
            <programlistingco>
              <areaspec units="linecolumn"/>
              <programlisting><![CDATA[
uid=john,cn=People,o=MyCompany,c=com
  objectClass: person
  ...
ou=EMEA,cn=People,o=MyCompany,c=com
  objectClass: organizationalUnit
  ...
    ou=France,ou=EMEA,cn=People,o=MyCompany,c=com
      objectClass: organizationalUnit
      ...
        uid=tom,ou=EMEA,cn=People,o=MyCompany,c=com
          objectClass: person
          ...
]]></programlisting>
            </programlistingco>
            <itemizedlist>
              <listitem>
                <para>
                  <emphasis role="bold">userLDAPClasses</emphasis>: commas are used to separate list of classes used for creating users. </para>
              </listitem>
            </itemizedlist>
            <para>When a new user is created, an entry will be created with the given <emphasis role="italic">objectClass</emphasis> attributes.  The classes must at least define <emphasis role="italic">cn</emphasis> and any attribute referenced in the user mapping.</para>
            <para>For example, adding the user <emphasis role="italic">Marry Simons</emphasis> could produce:</para>
            <programlistingco>
              <areaspec units="linecolumn"/>
              <programlisting><![CDATA[
uid=marry,cn=users,ou=portal,dc=exoplatform,dc=org
  objectclass: top
  objectClass: person
  objectClass: organizationalPerson
  objectClass: inetOrgPerson
  ...
]]></programlisting>
            </programlistingco>
          </section>
          <section id="DEV.SystemIntegration.UserMapping">
            <title>User mapping </title>
            <para>The following parameters maps LDAP attributes to eXo User Java objects attributes.</para>
            <programlistingco>
              <areaspec units="linecolumn"/>
              <programlisting language="xml"><![CDATA[
<field name="userUsernameAttr">
  <string>uid</string>
</field>
<field name="userPassword">
  <string>userPassword</string>
</field>
<field name="userFirstNameAttr">
  <string>givenName</string>
</field>
<field name="userLastNameAttr">
  <string>sn</string>
</field>
<field name="userDisplayNameAttr">
  <string>displayName</string>
</field>
<field name="userMailAttr">
  <string>mail</string>
</field>
]]></programlisting>
            </programlistingco>
            <itemizedlist>
              <listitem>
                <para>
                  <emphasis role="bold">userUsernameAttr</emphasis>: username (login)</para>
              </listitem>
              <listitem>
                <para>
                  <emphasis role="bold">userPassword</emphasis>: password (used when the portal authentication is done by eXo login module)</para>
              </listitem>
              <listitem>
                <para>
                  <emphasis role="bold">userFirstNameAttr</emphasis>: first name</para>
              </listitem>
              <listitem>
                <para>
                  <emphasis role="bold">userLastNameAttr</emphasis>: last name</para>
              </listitem>
              <listitem>
                <para>
                  <emphasis role="bold">userDisplayNameAttr</emphasis>: display name</para>
              </listitem>
              <listitem>
                <para>
                  <emphasis role="bold">userMailAttr</emphasis>: email address</para>
              </listitem>
            </itemizedlist>
            <para>In the example above, the user <emphasis role="italic">Marry Simons</emphasis> could produce:</para>
            <programlistingco>
              <areaspec units="linecolumn"/>
              <programlisting><![CDATA[
uid=marry,cn=users,ou=portal,dc=exoplatform,dc=org
  userPassword: XXXX
  givenName: Marry
  sn: Simons
  displayName: Marry Simons
  mail: marry.simons@example.org
  uid: marry
  ...
]]></programlisting>
            </programlistingco>
          </section>
        </section>
        <section id="DEV.SystemIntegration.Groups">
          <title>Groups </title>
          <para>eXo Platform groups can be mapped to organizational or applicative groups defined in your directory.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<field name="groupsURL">
  <string>ou=groups,ou=portal,dc=exoplatform,dc=org</string>
</field>
<field name="groupLDAPClasses">
  <string>top,organizationalUnit</string>
</field>
<field name="groupObjectClassFilter">
  <string>objectClass=organizationalUnit</string>
</field>
]]></programlisting>
          </programlistingco>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="bold">groupsURL</emphasis>: base dn for eXo groups</para>
            </listitem>
          </itemizedlist>
          <para>Groups can be structured hierarchically under <emphasis role="italic">groupsURL</emphasis>.              For example, groups, including <emphasis role="italic">communication</emphasis>, <emphasis role="italic">communication/marketing</emphasis> and <emphasis role="italic">communication/press</emphasis>, would map to:             </para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
ou=communication,ou=groups,ou=portal,dc=exoplatform,dc=org
...
  ou=marketing,ou=communication,ou=groups,ou=portal,dc=exoplatform,dc=org
  ...            
  ou=press,ou=communication,ou=groups,ou=portal,dc=exoplatform,dc=org                          
  ...
]]></programlisting>
          </programlistingco>
          <para>        </para>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="bold">groupLDAPClasses</emphasis>: commas are used to separate list of classes used for group creation. </para>
            </listitem>
          </itemizedlist>
          <para>When a new group is created, an entry will be also created with the given objectClass attributes. The classes must define at least the required attributes: <emphasis role="bold">ou</emphasis>, <emphasis role="bold">description</emphasis> and <emphasis role="bold">l</emphasis>.</para>
          <note>
            <para>The <emphasis role="bold">l</emphasis> attribute corresponds to the <emphasis role="bold">City</emphasis> property in OU property editor.</para>
          </note>
          <para>                         For example, adding the <emphasis role="italic">human-resources</emphasis> group could produce: </para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[                       
ou=human-resources,ou=groups,ou=portal,dc=exoplatform,dc=org
  objectclass: top
  objectClass: organizationalunit
  ou: human-resources
  description: The human resources department
  l: Human Resources
  ...
]]></programlisting>
          </programlistingco>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="bold">groupObjectClassFilter</emphasis>: This filter is used under the <emphasis role="italic">groupsURL</emphasis> branch to distinguish eXo groups from other entries. You can also use a complex filter if you need.</para>
            </listitem>
          </itemizedlist>
          <para>             Example: groups <emphasis role="italic">WebDesign</emphasis>, <emphasis role="italic">WebDesign/Graphists</emphasis> and <emphasis role="italic">sales</emphasis> could be retrieved in:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[           
l=Paris,dc=sites,dc=mycompany,dc=com
  ...
  ou=WebDesign,l=Paris,dc=sites,dc=mycompany,dc=com
  ...
    ou=Graphists,WebDesign,l=Paris,dc=sites,dc=mycompany,dc=com
    ...
l=London,dc=sites,dc=mycompany,dc=com
  ...
  ou=Sales,l=London,dc=sites,dc=mycompany,dc=com
  ...
]]></programlisting>
          </programlistingco>
        </section>
        <section id="DEV.SystemIntegration.MembershipTypes">
          <title>Membership types </title>
          <para>Membership types are the possible roles that can be assigned to users in groups.</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<field name="membershipTypeURL">
  <string>ou=memberships,ou=portal,dc=exoplatform,dc=org</string>
</field>
<field name="membershipTypeLDAPClasses">
  <string>top,organizationalRole</string>
</field>
<field name="membershipTypeNameAttr">
  <string>cn</string>
</field>
]]></programlisting>
          </programlistingco>
          <para>          </para>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="bold">membershipTypeURL</emphasis>: base dn for membership types storage.</para>
            </listitem>
          </itemizedlist>
          <para>eXo stores membership types in a flat structure under <emphasis role="italic">membershipTypeURL</emphasis>. For example, roles, including <emphasis role="italic">manager</emphasis>, <emphasis role="italic">user</emphasis>, <emphasis role="italic">admin</emphasis> and <emphasis role="italic">editor</emphasis> could be defined by the subtree:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[           
ou=roles,ou=portal,dc=exoplatform,dc=org
...
  cn=manager,ou=roles,ou=portal,dc=exoplatform,dc=org
  ...
  cn=user,ou=roles,ou=portal,dc=exoplatform,dc=org
  ...
  cn=admin,ou=roles,ou=portal,dc=exoplatform,dc=org               
  ...
  cn=editor,ou=roles,ou=portal,dc=exoplatform,dc=org
  ...
]]></programlisting>
          </programlistingco>
          <para>             </para>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="bold">membershipTypeLDAPClasses</emphasis>: commas are used to separate list of classes for creating membership types.</para>
            </listitem>
          </itemizedlist>
          <para>When a new membership type is created, an entry will be also created with the given <emphasis role="italic">objectClass</emphasis> attributes. The classes must define the required attributes: <emphasis role="bold">description</emphasis>, <emphasis role="bold">cn</emphasis>. </para>
          <para>For example, adding the membership type <emphasis role="italic">validator</emphasis> would produce: </para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[          
cn=validator,ou=roles,ou=portal,dc=exoplatform,dc=org
  objectclass: top
  objectClass: organizationalRole
  ...                       
]]></programlisting>
          </programlistingco>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="bold">membershipTypeNameAttr</emphasis>: Attribute will be used as the name of the role.</para>
            </listitem>
          </itemizedlist>
          <para>           For example, if <emphasis role="italic">membershipTypeNameAttr</emphasis> is <emphasis role="italic">cn</emphasis>, the role name will be <emphasis role="italic">manager</emphasis> for the following membership type entry: </para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[cn=manager,ou=roles,ou=portal,dc=exoplatform,dc=org ]]></programlisting>
          </programlistingco>
        </section>
        <section id="DEV.SystemIntegration.Membership">
          <title>Memberships </title>
          <para>Memberships are used to assign a role within a group. They are entries that are placed under the group entry of their scope group. Users in this role are defined as attributes of the membership entry.             </para>
          <itemizedlist>
            <listitem>
              <para>For example, to designate <emphasis role="italic">tom</emphasis> as the <emphasis role="italic">manager</emphasis> of the group <emphasis role="italic">human-resources</emphasis>: </para>
            </listitem>
          </itemizedlist>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[          
ou=human-resources,ou=groups,ou=portal,dc=exoplatform,dc=org
  ...
  cn=manager,ou=human-resources,ou=groups,ou=portal,dc=exoplatform,dc=org
    member: uid=tom,ou=users,ou=portal,dc=exoplatform,dc=org
    ...                
]]></programlisting>
          </programlistingco>
          <para>The parameters to configure memberships are:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<field name="membershipLDAPClasses">
  <string>top,groupOfNames</string>
</field>
<field name="membershipTypeMemberValue">
  <string>member</string>
</field>
<field name="membershipTypeRoleNameAttr">
  <string>cn</string>
</field>
<field name="membershipTypeObjectClassFilter">
  <string>objectClass=organizationalRole</string>
</field>
]]></programlisting>
          </programlistingco>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="bold">membershipLDAPClasses</emphasis>: the commas are used to separate the list of classes for creating memberships.</para>
            </listitem>
          </itemizedlist>
          <para>When a new membership is created, an entry will be also created with the given <emphasis role="italic">objectClass</emphasis> attributes. The classes must at least define the attribute designated by <emphasis role="italic">membershipTypeMemberValue</emphasis>.            Example: Adding membership <emphasis role="italic">validator</emphasis> would produce:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[           
cn=validator,ou=human-resources,ou=groups,ou=portal,dc=exoplatform,dc=org
  objectclass: top
  objectClass: groupOfNames
  ...
]]></programlisting>
          </programlistingco>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="bold">membershipTypeMemberValue</emphasis>: Multi-valued attribute is used in memberships to reference users that have the role in the group. </para>
            </listitem>
          </itemizedlist>
          <para>Values should be a user dn.</para>
          <para>Example: <emphasis role="italic">james</emphasis> and <emphasis role="italic">root</emphasis>, who have <emphasis role="italic">admin</emphasis> role within the group <emphasis role="italic">human-resources</emphasis>, would give:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
cn=admin,ou=human-resources,ou=groups,ou=portal,dc=exoplatform,dc=org
  member: cn=james,ou=users,ou=portal,dc=exoplatform,dc=org
  member: cn=root,ou=users,ou=portal,dc=exoplatform,dc=org
  ...
]]></programlisting>
          </programlistingco>
          <para>                   </para>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="bold">membershipTypeRoleNameAttr</emphasis>: Attribute of the membership entry whose value refers to the membership type.</para>
            </listitem>
          </itemizedlist>
          <para>             For example, in the following membership entry:             </para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
cn=manager,ou=human-resources,ou=groups,ou=portal,dc=exoplatform,dc=org
]]></programlisting>
          </programlistingco>
          <para>           The <emphasis role="italic">cn</emphasis> attribute is used to designate the <emphasis role="italic">manager</emphasis> membership type. In other words, the name of role is given by the 'cn' attribute.</para>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="bold">membershipTypeObjectClassFilter</emphasis>: Filter is used to distinguish membership entries under groups. You can use the more complex filters.</para>
            </listitem>
          </itemizedlist>
          <para>             For example, the following is a filter used for a customer that needs to trigger a dynlist overlay on OpenLDAP.            </para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[(&amp;amp;(objectClass=ExoMembership)(membershipURL=&#42;)) ]]></programlisting>
          </programlistingco>
          <para>          </para>
          <note>
            <para>Please pay attention to the xml escaping of the '&amp;' (and) operator.</para>
          </note>
        </section>
        <section id="DEV.SystemIntegration.UserProfiles">
          <title>User profiles </title>
          <para>eXo User profiles also have entries in the LDAP but the actual storage is still done with the hibernate service. You will need the following parameters:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<field name="profileURL">
  <string>ou=profiles,ou=portal,dc=exoplatform,dc=org</string>
</field>
<field name="profileLDAPClasses">
  <string>top,organizationalPerson</string>
</field>
]]></programlisting>
          </programlistingco>
          <itemizedlist>
            <listitem>
              <para>
                <emphasis role="bold">profileURL</emphasis>: base dn to store user profiles.</para>
            </listitem>
            <listitem>
              <para>
                <emphasis role="bold">profileLDAPClasses</emphasis>: Classes used for creating user profiles.</para>
            </listitem>
          </itemizedlist>
        </section>
      </section>
      <section id="DEV.SystemIntegration.ActiveDirectorySampleConfiguration">
        <title>Active Directory sample configuration </title>
        <para>Here is an alternative configuration for active directory that you can find in <emphasis role="bold">activedirectory-configuration.xml</emphasis>.</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
[...]
<component>
  <key>org.exoplatform.services.ldap.LDAPService</key>
  [..]
  <object type="org.exoplatform.services.ldap.impl.LDAPConnectionConfig">         
  <!-- for multiple ldap servers, use comma separated list of host:port (Ex. ldap://127.0.0.1:389,10.0.0.1:389) -->
  <!-- whether or not to enable ssl, if ssl is used ensure that the javax.net.ssl.keyStore & java.net.ssl.keyStorePassword properties are set -->
  <!-- exo portal default installed javax.net.ssl.trustStore with file is java.home/lib/security/cacerts-->
  <!-- ldap service will check protocol, if protocol is ldaps, ssl is enable (Ex. for enable ssl: ldaps://10.0.0.3:636 ;for disable ssl: ldap://10.0.0.3:389 ) -->
  <!-- when enable ssl, ensure server name is *.directory and port (Ex. active.directory) -->	  		 
    <field name="providerURL"><string>ldaps://10.0.0.3:636</string></field>
    <field name="rootdn"><string>CN=Administrator,CN=Users, DC=exoplatform,DC=org</string></field>
    <field name="password"><string>site</string></field> 		
    <field name="version"><string>3</string></field>	            
    <field name="referralMode"><string>ignore</string></field>     	       	       
    <field name="serverName"><string>active.directory</string></field>    	       	  
  </object>
  [..]
</component>
<component>
  <key>org.exoplatform.services.organization.OrganizationService</key>
  [...]
  <object type="org.exoplatform.services.organization.ldap.LDAPAttributeMapping">                
    [...]
    <field name="userAuthenticationAttr"><string>mail</string></field>
    <field name="userUsernameAttr"><string>sAMAccountName</string></field>
    <field name="userPassword"><string>unicodePwd</string></field> 
    <field name="userLastNameAttr"><string>sn</string></field>
    <field name="userDisplayNameAttr"><string>displayName</string></field>
    <field name="userMailAttr"><string>mail</string></field>
    [..]
    <field name="membershipTypeLDAPClasses"><string>top,group</string></field>
    <field name="membershipTypeObjectClassFilter"><string>objectClass=group</string></field>
    [..]
    <field name="membershipLDAPClasses"><string>top,group</string></field>
    <field name="membershipObjectClassFilter"><string>objectClass=group</string></field>
  </object>
  [...]  
</component>  
]]></programlisting>
        </programlistingco>
        <note>
          <para>There is a Microsoft limitation: the password cannot be set in AD via unsecured connection, you have to use the LDAPs protocol.</para>
        </note>
        <para>Here is how to use the LDAPs protocol with the Active Directory:</para>
        <para>
          <emphasis role="bold">1.</emphasis> Set up AD to use SSL:</para>
        <para>
          <emphasis role="bold">i.</emphasis> Add the Active Directory Certificate Services role.</para>
        <para>
          <emphasis role="bold">ii.</emphasis> Install the right certificate for the DC machine.</para>
        <para>
          <emphasis role="bold">2.</emphasis> Enable Java VM to use the certificate from AD:</para>
        <para>
          <emphasis role="bold">i.</emphasis> Import the root CA used in AD, to keystore, such as: keytool <emphasis role="strikethrough">importcert </emphasis>file 2008.cer <emphasis role="strikethrough">keypass changeit </emphasis>keystore /home/user/java/jdk1.6/jre/lib/security/cacerts.</para>
        <para>
          <emphasis role="bold">ii.</emphasis> Set the Java options as below:</para>
        <para>  <emphasis role="italic">JAVA_OPTS="${JAVA_OPTS} -Djavax.net.ssl.trustStorePassword=changeit -Djavax.net.ssl.trustStore=/home/user/java/jdk1.6/jre/lib/security/ca"</emphasis>
        </para>
      </section>
      <section id="DEV.SystemIntegration.PicketlinkIDM">
        <title>Picketlink IDM </title>
        <para>eXo Platform uses the PicketLink IDM component to keep the necessary identity information, such as users, groups, memberships. While the legacy interfaces are still used (org.exoplatform.services.organization) for the identity management, there is a wrapper implementation that delegates to the PicketLink IDM framework.  For further information, visit <ulink url="http://jboss.org/picketlink/IDM.html">here</ulink>.</para>
        <para>The project exo.core defines the API for Organization Service and the eXo Platform implementation of API. For the Organization Service plugged in the eXo Platform product, you are flexible in switching between: eXo Organization Service, PicketLink and your own implementation. The configuration to switch between various Organization Service implementations can be found in <emphasis role="italic">portal.war/WEB-INF/conf/configuration.xml</emphasis>:</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<!--PicketLink IDM integration -->
<import>war:/conf/organization/idm-configuration.xml</import>

<!--Former exo implementations -->
<!--<import>war:/conf/organization/exo/hibernate-configuration.xml</import> -->
<!-- <import>war:/conf/organization/exo/jdbc-configuration.xml</import> -->
<!--for organization service used active directory which is user lookup server -->
<!-- <import>war:/conf/organization/exoactivedirectory-configuration.xml</import> -->
<!--for organization service used ldap server which is user lookup server -->
<!-- <import>war:/conf/ldap-configuration.xml</import> -->
]]></programlisting>
        </programlistingco>
        <para>If you want to switch between different implementations, you just need to uncomment the corresponding &lt;import&gt; and leave others commented:</para>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<!--PicketLink IDM integration -->
<import>war:/conf/ldap-configuration.xml</import>
<!-- <import>war:/conf/organization/idm-configuration.xml</import> -->
<!--Former exo implementations -->
<!--<import>war:/conf/organization/exo/hibernate-configuration.xml</import> -->
<!-- <import>war:/conf/organization/exo/jdbc-configuration.xml</import> -->
<!--for organization service used active directory which is user lookup server -->
<!-- <import>war:/conf/organization/exoactivedirectory-configuration.xml</import> -->
<!--for organization service used ldap server which is user lookup server -->
]]></programlisting>
        </programlistingco>
      </section>
    </section>
    <section id="DEV.SystemIntegration.Email">
      <title>Email </title>
      <para>The email service can use any SMTP account configured in <emphasis role="italic">$JBOSS_HOME/server/default/conf/gatein/configuration.properties</emphasis> or <emphasis role="italic">$TOMCAT_HOME/gatein/conf/configuration.properties</emphasis> if you are using Tomcat.</para>
      <para>The relevant section looks like:</para>
      <programlistingco>
        <areaspec units="linecolumn"/>
        <programlisting><![CDATA[
# EMail
gatein.email.smtp.username=
gatein.email.smtp.password=
gatein.email.smtp.host=smtp.gmail.com
gatein.email.smtp.port=465
gatein.email.smtp.starttls.enable=true
gatein.email.smtp.auth=true
gatein.email.smtp.socketFactory.port=465
gatein.email.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
]]></programlisting>
      </programlistingco>
      <para>It is pre-configured for Gmail, so any Gmail account can easily be used. You simply need to use the full Gmail address as username, and fill in the password.</para>
      <para>In corporate environments, you will want to use your corporate SMTP gateway. When using it over SSL, like in the default configuration, you may need to configure a certificate trust-store, containing your SMTP server's public certificate. Depending on the key sizes, you might also need to install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files for your Java Runtime Environment.</para>
    </section>
  </chapter>
  <chapter id="DEV.eXoPlatformAPIs">
    <title>eXo Platform 3.5 APIs </title>
    <para>This chapter presents the information about APIs that help you build your own applications from eXo services via the following topics:</para>
    <itemizedlist>
      <listitem>
        <para>
          <link linkend="DEV.eXoPlatformSupportedAPIs.DefinitionsOfAPILevels">Definitions of API Levels</link>
        </para>
        <itemizedlist>
          <listitem>
            <para>
              <link linkend="DEV.eXoPlatformSupportedAPIs.UseProvisionalOrExperimentalAPIs">Use Provisional or Experimental APIs</link>
            </para>
          </listitem>
        </itemizedlist>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.eXoPlatformSupportedAPIs.PlatformAPIs">Platform APIs</link>
        </para>
        <itemizedlist>
          <listitem>
            <para>
              <link linkend="DEV.eXoPlatformSupportedAPIs.JavaAPIs">Java APIs</link>
            </para>
          </listitem>
          <listitem>
            <para>
              <link linkend="DEV.eXoPlatformSupportedAPIs.JavaScriptAPIs">JavaScript APIs</link>
            </para>
          </listitem>
          <listitem>
            <para>
              <link linkend="DEV.eXoPlatformSupportedAPIs.WebServices">Web Services</link>
            </para>
          </listitem>
        </itemizedlist>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.eXoPlatformSupportedAPIs.ProvisionalAPIs">Provisional APIs</link>
        </para>
        <itemizedlist>
          <listitem>
            <para>
              <link linkend="DEV.eXoPlatformSupportedAPIs.ProvisionalAPIs.JavaAPIs">Java APIs</link>
            </para>
          </listitem>
        </itemizedlist>
      </listitem>
    </itemizedlist>
    <section id="DEV.eXoPlatformSupportedAPIs.DefinitionsOfAPILevels">
      <title>Definitions of API Levels </title>
      <para>APIs vary according to the maturity level. It is important to understand the eXo Platform's general approach to the API change management. The different levels of APIs are described in the following table:</para>
      <informaltable>
        <tgroup cols="7">
          <thead>
            <row>
              <entry> API Level </entry>
              <entry> Test Suite </entry>
              <entry> Clients </entry>
              <entry> Documentation </entry>
              <entry> Support </entry>
              <entry> Compatibility X.Y.Z(+1) </entry>
              <entry> Compatibility X.Y(+1) </entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>
                <emphasis role="bold">Platform API</emphasis>
              </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
            </row>
            <row>
              <entry>
                <emphasis role="bold">Provisional API</emphasis>
              </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/no.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/no.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
            </row>
            <row>
              <entry>
                <emphasis role="bold">Experimental API</emphasis>
              </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/no.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/no.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/yes.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
              <entry> Best effort </entry>
              <entry> Best effort </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/no.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/no.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
            </row>
            <row>
              <entry>
                <emphasis role="bold">Unsupported API</emphasis>
              </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/no.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/no.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/no.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/no.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/no.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/no.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/no.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/no.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/no.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/no.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
              <entry> <inlinemediaobject>
                  <imageobject role="fo">
                    <imagedata fileref="images/no.gif" format="GIF"/>
                  </imageobject>
                  <imageobject role="html">
                    <imagedata fileref="images/no.gif" format="GIF"/>
                  </imageobject>
                </inlinemediaobject> </entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>
      <para>
        <emphasis role="bold">Test Suite</emphasis>: A suite of tests that can be run against the API to detect changes.</para>
      <para>
        <emphasis role="bold">Clients</emphasis>: The API has been used successfully by at least 2 different teams, using the API Documentation only.</para>
      <para>
        <emphasis role="bold">Documentation</emphasis>: The API has a clean JavaDoc and reference documentation.</para>
      <para>
        <emphasis role="bold">Support</emphasis>: The eXo Support team provides help on the code that uses this API, and fixes any reported bugs.</para>
      <para>
        <emphasis role="bold">Compatibility X.Y.Z(+1)</emphasis>: The compatibility between maintenance versions (X.Y.Z and X.Y.Z+1) is guaranteed. If there is any change between X.Y and X.Y+1, the eXo Support team will help by upgrading the code.</para>
      <para>
        <emphasis role="bold">Compatibility X.Y(+1)</emphasis>: The compatibility between minor versions (X.Y and X.Y+1) is guaranteed. If there is any change between X and X+1, the eXo Support team will help by upgrading the code.</para>
      <para>
        <emphasis role="bold">Best Effort</emphasis>: You will receive assistance, but eXo Platform cannot guarantee any specific result.</para>
      <section id="DEV.eXoPlatformSupportedAPIs.UseProvisionalOrExperimentalAPIs">
        <title>Use Provisional or Experimental APIs </title>
        <para>These APIs are provided to give an "early look" at which will be available in upcoming versions of eXo Platform. These APIs are not final, but they can be used to start developing your application.</para>
        <para>
          <emphasis role="bold">Provisional APIs</emphasis> are APIs close to being frozen, but that need a last look from users. They can be used by third-party developers for their own apps, with the knowledge that only a limited compatibility guarantee is offered.</para>
        <para>
          <emphasis role="bold">Experimental APIs</emphasis> are APIs that are likely to change. They are published to get feedback from the community. These APIs have been tested successfully, but have not yet had enough feedback from developers.</para>
      </section>
    </section>
    <section id="DEV.eXoPlatformSupportedAPIs.PlatformAPIs">
      <title>Platform APIs </title>
      <section id="DEV.eXoPlatformSupportedAPIs.JavaAPIs">
        <title>Java APIs </title>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/bk02ch04.html#sect-Reference_Guide-Portlet_Primer">Portlet API:</ulink> (JSR 168 and JSR 286)</emphasis> A Java standard that defines how to write portlets. This is the way to develop Java applications that are integrated into eXo Platform.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/bk02ch07.html#wsrp-Introduction">WSRP 1.0 on JBoss:</ulink>
          </emphasis> A network protocol for integrating remote portlets into eXo Platform.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/ch-introduction-to-rest.html#d0e17006">JAX-RS:</ulink> (JSR 311)</emphasis> A standard API that provides support for creating REST-like services.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/ch-intro.html#d0e32">JCR (JSR 170):</ulink>
          </emphasis> A standard API that provides access to a content repository.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/ch-jcr-extensions.html#d0e512">JCR Service Extensions:</ulink>
          </emphasis> A set of APIs that provide extended functionalities for the JCR, such as observation, permissions, and access to a repository.</para>
        <para>
          <emphasis role="bold">
            <ulink url="http://www.oracle.com/technetwork/java/javaee/overview/index.html">Java EE 6:</ulink>
          </emphasis> eXo Platform supports the Java EE 5 APIs, so you can develop applications using this standard.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/ch-cache.html#d0e13710">Cache:</ulink>
          </emphasis> An API used for data caching.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/ch-understanding-listeners-service.html#d0e13389">Event and Listener:</ulink>
          </emphasis> An API for listening and sending events within eXo Platform.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/ch-organization-service.html#Overview">Organization:</ulink>
          </emphasis> An API and SPI for accessing user, group and membership information.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/ch-service-configuration-for-beginners.html#d0e11071">Portal Container Definition:</ulink>
          </emphasis> This API is used to configure your portal.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/bk03ch04.html#CONTref.JavaServices.TaxonomyService">Taxonomy:</ulink>
          </emphasis> An API that allows you to organize your content.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/bk03ch04.html#CONTref.JavaServices.LinkManager">LinkManager:</ulink>
          </emphasis> An API that provides a way to manage links when developing WCM features.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/bk03ch04.html#CONTref.JavaServices.PublicationManager">PublicationManager:</ulink>
          </emphasis> An API that provides different ways to manage the publication of content when developing WCM features.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/bk03ch04.html#CONTref.JavaServices.WCMComposer">WCMComposer:</ulink>
          </emphasis> An API to get content shown in the website. The cache management is used in this service, and methods to update the content cache.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/bk03ch04.html#CONTref.JavaServices.NewFolksonomy">NewFolksonomy:</ulink>
          </emphasis>
        </para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/bk03ch04.html#CONTref.JavaServices.ApplicationTemplateManager">ApplicationTemplateManager:</ulink>
          </emphasis>   An API to manage dynamic groovy templates for WCM-based products.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/bk03ch04.html#CONTref.JavaServices.NodeFinder">NodeFinder:</ulink>
          </emphasis> An API to find a node with a given path.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/bk03ch04.html#CONTref.JavaServices.JodConverter">JodConverter:</ulink>
          </emphasis> An API to convert documents into different office formats.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../html/bk03ch04.html#CONTref.JavaServices.SiteSearchService">SiteSearchService:</ulink>
          </emphasis> An API that allows users to find all information matching with their given keyword.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/bk03ch04.html#CONTref.JavaServices.SEOService">SEOService:</ulink>
          </emphasis> An API that manages SEO data of a page or a content.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/bk03ch03.html#CONTref.Configuration.Components.TimelineService">TimelineService:</ulink>
          </emphasis> An API that allows documents to be displayed by days, months and years.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/ch-services-wiring.html#d0e13290">XML Configuration:</ulink>
          </emphasis> A set of DTD for configuring eXo Platform.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/bk08ch03.html#Developer_document.Java_APIs.Activity_Manager">ActivityManager:</ulink>
          </emphasis> An API to manage activities (create/delete/like activity; delete/like/create comment; get activities of space/user/connection).</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/bk08ch03.html#Developer_document.Java_APIs.Identity_Manager">IdentityManager:</ulink>
          </emphasis> An API to manage identities (create identity, save profile, get connection of an identity).</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../reference/html/bk08ch03.html#Developer_document.Java_APIs.Relationship_manager">RelationshipManager:</ulink>
          </emphasis> An API which is used to work with connections between 2 identities, interact between identities, get list access to get list of connections, incomings, outgoings.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../reference/html/bk08ch03.html#Developer_document.JavaAPIs.Java_APIs.SpaceService">SpaceService:</ulink>
          </emphasis>  An API that provides methods for working with space (create new space, delete, get space by url, groupid, display name, pretty name)</para>
      </section>
      <section id="DEV.eXoPlatformSupportedAPIs.JavaScriptAPIs">
        <title>JavaScript APIs </title>
        <para>
          <emphasis role="bold">
            <ulink url="http://opensocial-resources.googlecode.com/svn/spec/1.1/Social-Gadget.xml">OpenSocial 1.1 Gadget Specification:</ulink>
          </emphasis> A standard that defines how to write gadgets and provide APIs. Gadgets are particularly useful for integrating external applications into eXo Platform.</para>
      </section>
      <section id="DEV.eXoPlatformSupportedAPIs.WebServices">
        <title>Web Services </title>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/bk05ch01.html#Adm_CMIS.Introduction">CMIS:</ulink>
          </emphasis> A standard API that gives access to the content repository via REST and SOAP Web services.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/ch-ftp.html#d0e7058">FTP:</ulink>
          </emphasis> A standard protocol for exchanging documents.</para>
        <para>
          <emphasis role="bold">
            <ulink url="http://opensocial-resources.googlecode.com/svn/spec/1.1/Social-API-Server.xml">OpenSocial 1.1 REST Protocol:</ulink>
          </emphasis> A standard API for accessing the social graph and activity streams.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/ch-webdav.html#d0e6836">WebDAV:</ulink>
          </emphasis> A standard protocol for exchanging document over HTTP.</para>
      </section>
    </section>
    <section id="DEV.eXoPlatformSupportedAPIs.ProvisionalAPIs">
      <title>Provisional APIs </title>
      <section id="DEV.eXoPlatformSupportedAPIs.ProvisionalAPIs.JavaAPIs">
        <title>Java APIs </title>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/bk03ch04.html#CONTref.Extensions.UIExtensions">UI Extensions:</ulink>
          </emphasis> An API to plug new actions into the eXo Platform UI.</para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/bk03ch04.html#CONTref.Extensions.UIExtensions.AddOwnTabInECMAdministration.AddOwnUIAction">DocumentExplorer Toolbar</ulink>
          </emphasis>
        </para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/bk03ch04.html#CONTref.Extensions.UIExtensions.AddOwnTabInECMAdministration">ECM Admin</ulink>
          </emphasis>
        </para>
        <para>
          <emphasis role="bold">
            <ulink url="../../../reference/html/bk08ch03.html#Developer_document.Create the activity plug-in">Activity Sharing</ulink>
          </emphasis>
        </para>
      </section>
    </section>
  </chapter>
  <chapter id="DEV.Cookbook">
    <title>Cookbook </title>
    <para>This chapter currently focuses on how to copy a work done on the eXo Platform server, such as creating navigations, node types and templates, to another eXo Platform servers through these topics:</para>
    <itemizedlist>
      <listitem>
        <para>
          <link linkend="DEV.Cookbook.CopySitesContentFolderWithVersionHistory">Copy a site's content folder with its version history</link>.</para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.Cookbook.CopyNavigationNodesOfSites">Copy navigation nodes of sites</link>.</para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.Cookbook.CopyTemplateOfNodeType">Copy templates of node types templates</link>.</para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.Cookbook.CopyWCMTemplates">Copy the WCM template</link>.</para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.Cookbook.CopyTaxonomyTree">Copy a Taxonomy tree</link>.</para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.Cookbook.CopyMetadataTemplates">Copy metadata templates</link>.</para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.Cookbook.CopyQueries">Copy queries</link>.</para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.Cookbook.CopyScripts">Copy scripts</link>.</para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.Cookbook.CopyDriveConfigurations">Copy drive configurations</link>.</para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.Cookbook.CopyGadgets">Copy gadgets</link>.</para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.Cookbook.RestartServer">Restart the server</link>.</para>
      </listitem>
    </itemizedlist>
    <section id="DEV.Cookbook.HowToCoppyASite">
      <title>How to Copy a Site </title>
      <para>The procedure of each step will be detailed as follows:</para>
      <citetitle>
 <para xml:id="DEV.Cookbook.CopySitesContentFolderWithVersionHistory">
 <emphasis role="bold">Step 1. Copy a site's content folder with its version history.</emphasis>
 </para>
 </citetitle>
      <para>
        <emphasis role="bold">1.</emphasis> Go to the <emphasis role="bold">Sites Management</emphasis> drive.</para>
      <para>
        <emphasis role="bold">2.</emphasis> Open the site node, for example "acme".</para>
      <para>
        <emphasis role="bold">3.</emphasis> Click <emphasis role="bold">Export Node</emphasis> to export the node with its version history as below:</para>
      <para>
        <mediaobject>
          <imageobject role="fo">
            <imagedata align="center" fileref="images/how_to_copy_a_site/export_site_nodes2.png" format="PNG" scalefit="1" width="150mm"/>
          </imageobject>
          <imageobject role="html">
            <imagedata align="center" fileref="images/how_to_copy_a_site/export_site_nodes2.png" format="PNG" scalefit="0" width="150mm"/>
          </imageobject>
        </mediaobject>
      </para>
      <para>
        <emphasis role="bold">4.</emphasis> Select <emphasis role="bold">Export</emphasis> and <emphasis role="bold">Export Version History</emphasis> to perform the exporting.</para>
      <para>
        <emphasis role="bold">5.</emphasis> Navigate to the node where you want to import the file, then click <emphasis role="bold">Import Node</emphasis> to open the <emphasis role="bold">Import Node</emphasis> form.</para>
      <para>
        <emphasis role="bold">6.</emphasis> Select the exported nodes and version history to be imported.</para>
      <para>
        <mediaobject>
          <imageobject role="fo">
            <imagedata align="center" fileref="images/how_to_copy_a_site/import_site_nodes2.png" format="PNG" scalefit="1" width="150mm"/>
          </imageobject>
          <imageobject role="html">
            <imagedata align="center" fileref="images/how_to_copy_a_site/import_site_nodes2.png" format="PNG" scalefit="0" width="150mm"/>
          </imageobject>
        </mediaobject>
      </para>
      <para>One pop-up message will appear to inform that you have imported successfully.</para>
      <citetitle>
<para xml:id="DEV.Cookbook.CopyNavigationNodesOfSites">
<emphasis role="bold">Step 2. Copy navigation nodes of sites.</emphasis>
</para>
</citetitle>
      <para>
        <emphasis role="bold">1.</emphasis> Go to the <emphasis role="bold">Content Administration</emphasis> page and add a new drive to both target and source servers.</para>
      <para>
        <mediaobject>
          <imageobject role="fo">
            <imagedata align="center" fileref="images/how_to_copy_a_site/add_portal_system_drive.png" format="PNG" scalefit="1" width="150mm"/>
          </imageobject>
          <imageobject role="html">
            <imagedata align="center" fileref="images/how_to_copy_a_site/add_portal_system_drive.png" format="PNG" scalefit="0" width="150mm"/>
          </imageobject>
        </mediaobject>
      </para>
      <para>
        <emphasis role="bold">2.</emphasis> Export the navigation node.</para>
      <para>
        <mediaobject>
          <imageobject role="fo">
            <imagedata align="center" fileref="images/how_to_copy_a_site/export_site_navigations.png" format="PNG" scalefit="1" width="150mm"/>
          </imageobject>
          <imageobject role="html">
            <imagedata align="center" fileref="images/how_to_copy_a_site/export_site_navigations.png" format="PNG" scalefit="0" width="150mm"/>
          </imageobject>
        </mediaobject>
      </para>
      <para>
        <emphasis role="bold">3.</emphasis> Import the nodes navigation.</para>
      <para>
        <mediaobject>
          <imageobject role="fo">
            <imagedata align="center" fileref="images/how_to_copy_a_site/import_site_navigations.png" format="PNG" scalefit="1" width="150mm"/>
          </imageobject>
          <imageobject role="html">
            <imagedata align="center" fileref="images/how_to_copy_a_site/import_site_navigations.png" format="PNG" scalefit="0" width="150mm"/>
          </imageobject>
        </mediaobject>
      </para>
      <citetitle>
<para xml:id="DEV.Cookbook.CopyTemplateOfNodeType">
<emphasis role="bold">Step 3. Copy templates of node types.</emphasis>
</para>
</citetitle>
      <para>
        <emphasis role="bold">1.</emphasis> Add the <emphasis role="bold">System</emphasis> drive to both servers.</para>
      <para>
        <mediaobject>
          <imageobject role="fo">
            <imagedata align="center" fileref="images/how_to_copy_a_site/add_system_drive.png" format="PNG" scalefit="1" width="150mm"/>
          </imageobject>
          <imageobject role="html">
            <imagedata align="center" fileref="images/how_to_copy_a_site/add_system_drive.png" format="PNG" scalefit="0" width="150mm"/>
          </imageobject>
        </mediaobject>
      </para>
      <para>
        <emphasis role="bold">2.</emphasis> Open <emphasis role="italic">system:/jcr:system/exo:namespaces/{namespace_name}</emphasis>, and export it.</para>
      <para>
        <mediaobject>
          <imageobject role="fo">
            <imagedata align="center" fileref="images/how_to_copy_a_site/export_namespace.png" format="PNG" scalefit="1" width="150mm"/>
          </imageobject>
          <imageobject role="html">
            <imagedata align="center" fileref="images/how_to_copy_a_site/export_namespace.png" format="PNG" scalefit="0" width="150mm"/>
          </imageobject>
        </mediaobject>
      </para>
      <para>
        <emphasis role="bold">3.</emphasis> Open <emphasis role="italic">system:/jcr:system/exo:namespaces</emphasis>/, and import the exported file as described in <link linkend="DEV.Cookbook.CopyNavigationNodesOfSites">
          <emphasis role="bold">Step 2</emphasis>
        </link>.</para>
      <para>
        <mediaobject>
          <imageobject role="fo">
            <imagedata align="center" fileref="images/how_to_copy_a_site/import_namespace.png" format="PNG" scalefit="1" width="150mm"/>
          </imageobject>
          <imageobject role="html">
            <imagedata align="center" fileref="images/how_to_copy_a_site/import_namespace.png" format="PNG" scalefit="0" width="150mm"/>
          </imageobject>
        </mediaobject>
      </para>
      <para>
        <emphasis role="bold">4.</emphasis> Open <emphasis role="italic">system:/jcr:system/jcr:nodetypes/{node_type}</emphasis>, and export it.</para>
      <para>
        <mediaobject>
          <imageobject role="fo">
            <imagedata align="center" fileref="images/how_to_copy_a_site/export_node_type.png" format="PNG" scalefit="1" width="150mm"/>
          </imageobject>
          <imageobject role="html">
            <imagedata align="center" fileref="images/how_to_copy_a_site/export_node_type.png" format="PNG" scalefit="0" width="150mm"/>
          </imageobject>
        </mediaobject>
      </para>
      <para>
        <emphasis role="bold">5.</emphasis> Open <emphasis role="italic">system:/jcr:system/jcr:nodetypes</emphasis>/, and import the exported file as described in <link linkend="DEV.Cookbook.CopyWCMTemplates">
          <emphasis role="bold">Step 4</emphasis>
        </link>.</para>
      <para>
        <mediaobject>
          <imageobject role="fo">
            <imagedata align="center" fileref="images/how_to_copy_a_site/import_nodetype.png" format="PNG" scalefit="1" width="150mm"/>
          </imageobject>
          <imageobject role="html">
            <imagedata align="center" fileref="images/how_to_copy_a_site/import_nodetype.png" format="PNG" scalefit="0" width="150mm"/>
          </imageobject>
        </mediaobject>
      </para>
      <note>
        <para>If you have some specific JCR namespaces and node types, you need to import them into the new server.</para>
      </note>
      <citetitle>
<para xml:id="DEV.Cookbook.CopyWCMTemplates">
<emphasis role="bold">Step 4. Copy the WCM template.</emphasis>
</para>
</citetitle>
      <para>
        <emphasis role="bold">1.</emphasis> Open the <emphasis role="bold">DMS Administration</emphasis> drive.</para>
      <para>
        <emphasis role="bold">2.</emphasis> Open <emphasis role="italic">dms-system:/exo:ecm/templates/{node_type}</emphasis>, and export it.</para>
      <para>
        <mediaobject>
          <imageobject role="fo">
            <imagedata align="center" fileref="images/how_to_copy_a_site/export_node_type_templates.png" format="PNG" scalefit="1" width="150mm"/>
          </imageobject>
          <imageobject role="html">
            <imagedata align="center" fileref="images/how_to_copy_a_site/export_node_type_templates.png" format="PNG" scalefit="0" width="150mm"/>
          </imageobject>
        </mediaobject>
      </para>
      <para>
        <emphasis role="bold">3.</emphasis> Open <emphasis role="italic">dms-system:/exo:ecm/templates</emphasis>/, and import the exported file.</para>
      <para>
        <mediaobject>
          <imageobject role="fo">
            <imagedata align="center" fileref="images/how_to_copy_a_site/import_node_type_templates.png" format="PNG" scalefit="1" width="150mm"/>
          </imageobject>
          <imageobject role="html">
            <imagedata align="center" fileref="images/how_to_copy_a_site/import_node_type_templates.png" format="PNG" scalefit="0" width="150mm"/>
          </imageobject>
        </mediaobject>
      </para>
      <para>Also, for the CLV/PCLV templates, you can find all template views defined in the <emphasis role="italic">dms-system:/exo:ecm/views</emphasis> path with:</para>
      <itemizedlist>
        <listitem>
          <para>userviews: this folder contains views of Sites Explorer with a set of actions.</para>
        </listitem>
        <listitem>
          <para>templates: where you can find all gtmpl templates of:</para>
          <itemizedlist>
            <listitem>
              <para>Category Navigation Portlet templates.</para>
            </listitem>
            <listitem>
              <para>Content List Viewer (CLV) templates and its paginator templates.</para>
            </listitem>
            <listitem>
              <para>content-browser templates (Deprecated Portlet).</para>
            </listitem>
            <listitem>
              <para>ecm-explorer templates define how to display nodes in the Sites Explorer portlet, such as CoverFlow template, IconView template.</para>
            </listitem>
            <listitem>
              <para>Parameterized Content List Viewer (PCLV) templates and its paginator templates.</para>
            </listitem>
            <listitem>
              <para>
                <emphasis role="bold">WCM Advanced Search</emphasis> is used in the <emphasis role="bold">WCM Search</emphasis> portlet to define the form, layout, result and result's paginator.</para>
            </listitem>
          </itemizedlist>
        </listitem>
      </itemizedlist>
      <para>If you want to reuse one of the non-predefined templates above, simply export and import it into the new server at the same place.</para>
      <para>
        <mediaobject>
          <imageobject role="fo">
            <imagedata align="center" fileref="images/how_to_copy_a_site/WCM_templates.png" format="PNG" scalefit="1" width="150mm"/>
          </imageobject>
          <imageobject role="html">
            <imagedata align="center" fileref="images/how_to_copy_a_site/WCM_templates.png" format="PNG" scalefit="0" width="150mm"/>
          </imageobject>
        </mediaobject>
      </para>
      <note>
        <para>If you have some specific WCM (CLV/PCLV) views and/or templates of node types, you will need to import them into the new server.</para>
      </note>
      <citetitle>
<para xml:id="DEV.Cookbook.CopyTaxonomyTree">
<emphasis role="bold">Step 5. Copy a Taxonomy tree.</emphasis>
</para>
</citetitle>
      <para>By importing the whole site as described in the <link linkend="DEV.Cookbook.CopySitesContentFolderWithVersionHistory">
          <emphasis role="bold">Copy a site's content folder with its version history</emphasis>
        </link> section, you will also have the Taxonomy tree imported. The default location where the site's Taxonomy is placed in a sub-folder is named <emphasis role="bold">category</emphasis>. So, you do not need to export or import them because this step is automatically done. But the Taxonomy tree definition is still not fully imported in the new server. What you need to do is to add this Taxonomy tree definition by following these steps:</para>
      <para>
        <emphasis role="bold">1.</emphasis> Open the <emphasis role="bold">DMS Administration</emphasis> drive in the new server.</para>
      <para>
        <emphasis role="bold">2.</emphasis> Go to <emphasis role="italic">dms-system:/exo:ecm/exo:taxonomyTrees/definition</emphasis>/.</para>
      <para>
        <emphasis role="bold">3.</emphasis> Add a symlink to the <emphasis role="bold">Taxonomy Tree Root Node</emphasis>, for example <emphasis role="italic">collaboration:/sites content/live/acme/categories/acme</emphasis>.</para>
      <para>
        <mediaobject>
          <imageobject role="fo">
            <imagedata align="center" fileref="images/how_to_copy_a_site/select_TaxonomyTree_rootNode.png" format="PNG" scalefit="1" width="150mm"/>
          </imageobject>
          <imageobject role="html">
            <imagedata align="center" fileref="images/how_to_copy_a_site/select_TaxonomyTree_rootNode.png" format="PNG" scalefit="0" width="150mm"/>
          </imageobject>
        </mediaobject>
      </para>
      <para>The name of symlink is displayed as "acme".</para>
      <para>
        <mediaobject>
          <imageobject role="fo">
            <imagedata align="center" fileref="images/how_to_copy_a_site/select_TaxonomyTree_rootNode2.png" format="PNG" scalefit="1" width="150mm"/>
          </imageobject>
          <imageobject role="html">
            <imagedata align="center" fileref="images/how_to_copy_a_site/select_TaxonomyTree_rootNode2.png" format="PNG" scalefit="0" width="150mm"/>
          </imageobject>
        </mediaobject>
      </para>
      <para>The symlink will be generated as below:</para>
      <para>
        <mediaobject>
          <imageobject role="fo">
            <imagedata align="center" fileref="images/how_to_copy_a_site/select_TaxonomyTree_rootNode3.png" format="PNG" scalefit="1" width="150mm"/>
          </imageobject>
          <imageobject role="html">
            <imagedata align="center" fileref="images/how_to_copy_a_site/select_TaxonomyTree_rootNode3.png" format="PNG" scalefit="0" width="150mm"/>
          </imageobject>
        </mediaobject>
      </para>
      <para>In some cases, to see changes, you need to clear the cache by disconnecting or restarting the server.</para>
      <para>
        <mediaobject>
          <imageobject role="fo">
            <imagedata align="center" fileref="images/how_to_copy_a_site/TaxonomyTree_added_successfully.png" format="PNG" scalefit="1" width="150mm"/>
          </imageobject>
          <imageobject role="html">
            <imagedata align="center" fileref="images/how_to_copy_a_site/TaxonomyTree_added_successfully.png" format="PNG" scalefit="0" width="150mm"/>
          </imageobject>
        </mediaobject>
      </para>
      <citetitle>
<para xml:id="DEV.Cookbook.CopyMetadataTemplates">
<emphasis role="bold">Step 6. Copy metadata templates.</emphasis>
</para>
</citetitle>
      <para>
        <emphasis role="bold">1.</emphasis> Open the <emphasis role="bold">DMS Administration</emphasis> drive in the new server.</para>
      <para>
        <emphasis role="bold">2.</emphasis> Go to <emphasis role="italic">/exo:ecm/metadata/{meta_data_name}</emphasis>.</para>
      <para>
        <emphasis role="bold">3.</emphasis> Export and import it in the same location in the new server again.</para>
      <citetitle>
<para xml:id="DEV.Cookbook.CopyQueries">
<emphasis role="bold">Step 7. Copy queries.</emphasis>
</para>
</citetitle>
      <para>
        <emphasis role="bold">1.</emphasis> Open the <emphasis role="bold">DMS Administration</emphasis> drive in the new server.</para>
      <para>
        <emphasis role="bold">2.</emphasis> Go to <emphasis role="italic">/exo:ecm/queries/{query_name}</emphasis>.</para>
      <para>
        <emphasis role="bold">3.</emphasis> Export and import it in the same location in the new server again.</para>
      <citetitle>
<para xml:id="DEV.Cookbook.CopyScripts">
<emphasis role="bold">Step 8. Copy scripts.</emphasis>
</para>
</citetitle>
      <para>
        <emphasis role="bold">1.</emphasis> Open the <emphasis role="bold">DMS Administration</emphasis> drive in the new server.</para>
      <para>
        <emphasis role="bold">2.</emphasis> Go to <emphasis role="italic">/exo:ecm/scripts/ecm-explorer</emphasis>.</para>
      <para>You will find three folders referring to the three types of groovy scripts in eXo Platform, including:</para>
      <itemizedlist>
        <listitem>
          <para>action: The action scripts are launched when an ECM action triggers them. For more information, refer to <emphasis role="bold">Actions Concept</emphasis>.</para>
        </listitem>
      </itemizedlist>
      <itemizedlist>
        <listitem>
          <para>interceptor: Interceptor scripts are triggered before and/or after the JCR node is saved, or when a node is created or edited. They are used to either validate the value entered in a form or to manipulate the newly created node, for example, to map the new node with a forum thread or any other type of discussion areas.</para>
        </listitem>
      </itemizedlist>
      <itemizedlist>
        <listitem>
          <para>widget: Widget scripts are used to fill widgets, such as a select box in a dynamic way.</para>
        </listitem>
      </itemizedlist>
      <para>
        <emphasis role="bold">3.</emphasis> Export your customized script in the same location in the new server.</para>
      <citetitle>
<para xml:id="DEV.Cookbook.CopyDriveConfigurations">
<emphasis role="bold">Step 9. Copy drive configurations.</emphasis>
</para>
</citetitle>
      <para>
        <emphasis role="bold">1.</emphasis> Open the <emphasis role="bold">DMS Administration</emphasis> drive in the new server.</para>
      <para>
        <emphasis role="bold">2.</emphasis> Go to <emphasis role="italic">/exo:ecm/exo:drives/{drive_name}</emphasis>.</para>
      <para>
        <emphasis role="bold">3.</emphasis> Export and import it in the same location in the new server again.</para>
      <citetitle>
<para xml:id="DEV.Cookbook.CopyGadgets">
<emphasis role="bold">Step 10. Copy gadgets.</emphasis>
</para>
</citetitle>
      <para>
        <emphasis role="bold">1.</emphasis> Open the drive that points into the <emphasis role="bold">Portal-System</emphasis> Workspace.</para>
      <para>
        <emphasis role="bold">2.</emphasis> Go to your gadget by following the <emphasis role="italic">portal-system:/production/app:gadgets/{gadget_name}</emphasis> path.</para>
      <para>
        <emphasis role="bold">3.</emphasis> Export and import it in the same location in the new server again.</para>
      <citetitle>
<para xml:id="DEV.Cookbook.RestartServer">
<emphasis role="bold">Step 11. Restart the server.</emphasis>
</para>
</citetitle>
      <para>After importing the site navigation nodes, the site may look quite broken, so you need to restart the server first. After the server is restarted, the site will look like:</para>
      <para>
        <mediaobject>
          <imageobject role="fo">
            <imagedata align="center" fileref="images/how_to_copy_a_site/acme_site_after_import_and_restart.png" format="PNG" scalefit="1" width="150mm"/>
          </imageobject>
          <imageobject role="html">
            <imagedata align="center" fileref="images/how_to_copy_a_site/acme_site_after_import_and_restart.png" format="PNG" scalefit="0" width="150mm"/>
          </imageobject>
        </mediaobject>
      </para>
    </section>
  </chapter>
  <chapter id="DEV.Upgrade">
    <title>Upgrade eXo Platform </title>
    <para>This chapter aims at instructing you how to upgrade eXo Platform from 3.0 to 3.5, especially when your system is an extension of eXo Platform 3.0 with many customizations related to configurations, components and added features.</para>
    <para>The following topics are covered:</para>
    <itemizedlist>
      <listitem>
        <para>
          <link linkend="DEV.Upgrade.Prerequisites">Prerequisites</link>
        </para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.Upgrade.Prepare_extension_project">Prepare your extension project</link>
        </para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.Upgrade.What_need_to_be_adapted">What needs to be adapted in eXo Platform extension</link>
        </para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.Upgrade.Update_project_Maven_dependencies">Update project Maven dependencies</link>
        </para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.Upgrade.Update_configuration">Update configurations</link>
        </para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.Upgrade.Update_components">Update components</link>
        </para>
      </listitem>
      <listitem>
        <para>
          <link linkend="DEV.Upgrade.Update_extension">Update extension</link>
        </para>
      </listitem>
    </itemizedlist>
    <section id="DEV.Upgrade.Prerequisites">
      <title>Prerequisites </title>
      <para>Before upgrading, you first need to understand how to create a project which is based on eXo Platform 3.5. For more details, refer to the <ulink url="../../../developer-guide/html/developer-guide/index.html">eXo Platform Developer Guide.</ulink>
      </para>
      <para>And now, you need to gather all requirements for your upgraded project by clarifying the following questions:</para>
      <itemizedlist>
        <listitem>
          <para>Do you actually need to migrate your project sources?</para>
        </listitem>
        <listitem>
          <para>Have you created any new portal containers in your system?</para>
        </listitem>
        <listitem>
          <para>Have you made any lifetime-related changes on eXo Platform? Would you like to keep these changes?</para>
        </listitem>
        <listitem>
          <para>Have you developed a custom application? Where have you stored your application data?</para>
        </listitem>
        <listitem>
          <para>Have you configured a dedicated JCR workspace?</para>
        </listitem>
        <listitem>
          <para>Which eXo APIs are you using in your code?</para>
        </listitem>
        <listitem>
          <para>Have you overridden any files of eXo Platform?</para>
        </listitem>
        <listitem>
          <para>Have you disabled any services of eXo Platform?</para>
        </listitem>
        <listitem>
          <para>Which Kernel configurations have you customized?</para>
        </listitem>
      </itemizedlist>
    </section>
    <section id="DEV.Upgrade.Prepare_extension_project">
      <title>Prepare your extension project </title>
      <para>You need to create a new branch for eXo Platform 3.5 extension project, then clone your source code of eXo Platform 3.0 with that of eXo Platform 3.5.</para>
      <para>The way to package your project customization called extensions has been introduced in eXo Platform 3.0. Therefore, by using the WAR extension configuration approach, you can overload eXo Platform's default files defined in WARs, such as <emphasis role="italic">gtmpl, favicon, xml, jsp</emphasis>.  For more details on how to create your extension project, refer to the <link linkend="DEV.CreatingYourOwnPortal">Create Your Own Portal</link> section.</para>
      <para>Because there are not any changes on the eXo Platform 3.5 extension mechanism, your extensions should be mostly compatible. However, if your extension was overriding either of the eXo Platform 3.0 built-in files, you should check that the file has not been changed in eXo Platform 3.5 and update it if any.</para>
    </section>
    <section id="DEV.Upgrade.What_need_to_be_adapted">
      <title>What needs to be adapted in eXo Platform extension </title>
      <para>There are 4 main steps which need to be defined for updating eXo Platform extension from 3.0 to 3.5:</para>
      <itemizedlist>
        <listitem>
          <para>Update your project Maven dependencies in the <emphasis role="italic">POM</emphasis> files.</para>
        </listitem>
        <listitem>
          <para>Update your eXo Platform 3.5 configurations.</para>
        </listitem>
        <listitem>
          <para>Update components in your eXo Platform extension to use components of Platform 3.5</para>
        </listitem>
        <listitem>
          <para>Update your eXo Platform extension which are customised features/components (were added new/ modified/ delete in eXo Platform 3.0 extension), and make sure they can work well in eXo Platform 3.5 environment.</para>
        </listitem>
      </itemizedlist>
    </section>
    <section id="DEV.Upgrade.Update_project_Maven_dependencies">
      <title>Update project Maven dependencies </title>
      <para>eXo Platform include many components, so if you want to update your eXo Platform extension to use eXo Platform 3.5, you need to update all dependencies version in the <emphasis role="italic">POM</emphasis> files, and select dependencies version which are compatible with the eXo Platform 3.5. For example, eXo Platform 3.5.1 needs to have the following main dependencies:</para>
      <programlistingco>
        <areaspec units="linecolumn"/>
        <programlisting language="xml"><![CDATA[
<!-- kernel -->
<dependency>
	<groupId>org.exoplatform.kernel</groupId>
	<artifactId>kernel-parent</artifactId>
	<version>2.3.5-GA</version>
</dependency>
<!-- core -->
<dependency>
   <groupId>org.exoplatform.core</groupId>
   <artifactId>core-parent</artifactId>
   <version>2.4.5-GA</version>
</dependency>
<!-- ws -->
<dependency>
   <groupId>org.exoplatform.ws</groupId>
   <artifactId>ws-parent</artifactId>
   <version>2.2.5-GA</version>
</dependency>

<!-- jcr -->
<dependency>
  <groupId>org.exoplatform.jcr</groupId>
  <artifactId>jcr-parent</artifactId>
  <version>1.14.5-GA</version>
</dependency>

<!-- jcr service -->
<dependency>
  <groupId>org.exoplatform</groupId>
  <artifactId>exo-jcr-services</artifactId>
  <version>1.14.5-GA</version>
</dependency>

<!-- commons -->
<dependency>
  <groupId>org.exoplatform.commons</groupId>
  <artifactId>exo.platform.commons</artifactId>
  <version>1.1.5</version>
</dependency>

<!-- exogtn -->
<dependency>
   <groupId>org.exoplatform.portal</groupId>
   <artifactId>exo.portal.parent</artifactId>
   <version>3.2.2-PLF</version>
</dependency>

<!-- webos -->
<dependency>
  <groupId>org.exoplatform.webos</groupId>
  <artifactId>webos-parent</artifactId>
  <version>2.0.2</version>
</dependency>

<!-- ecms -->
<dependency>
  <groupId>org.exoplatform.ecms</groupId>
  <artifactId>exo-ecms</artifactId>
  <version>2.3.5</version>
</dependency>

<!-- ide -->
<dependency>
   <groupId>org.exoplatform.ide</groupId>
   <artifactId>exo-ide-parent</artifactId>
   <version>1.1.4</version>
</dependency>

<!-- cs -->
<dependency>
  <groupId>org.exoplatform.cs</groupId>
  <artifactId>cs</artifactId>
  <version>2.2.7</version>
</dependency>

<!-- ks -->
<dependency>
  <groupId>org.exoplatform.ks</groupId>
  <artifactId>ks</artifactId>
  <version>2.2.7</version>
</dependency>

<!-- social -->
<dependency>
  <groupId>org.exoplatform.social</groupId>
  <artifactId>social-project</artifactId>
  <version>1.2.7</version>
</dependency>

<!-- integration -->
<dependency>
  <groupId>org.exoplatform.integration</groupId>
  <artifactId>integ</artifactId>
  <version>1.0.5</version>
</dependency>
]]></programlisting>
      </programlistingco>
    </section>
    <section id="DEV.Upgrade.Update_configuration">
      <title>Update configurations </title>
      <para>After updating Maven dependencies, you need to update configurations via answering two questions:</para>
      <itemizedlist>
        <listitem>
          <para>In your eXo Platform extension, did you override anything in <emphasis role="italic">$PLATFORM-TOMCAT-HOME/gatein/conf</emphasis>?</para>
          <itemizedlist>
            <listitem>
              <para>If NO, you can skip this step, and simply keep all configurations in <emphasis role="italic">$PLATFORM-TOMCAT-HOME/gatein/conf</emphasis>.</para>
            </listitem>
            <listitem>
              <para>If YES, you first need to keep all configurations of eXo Platform 3.5, then define which configurations you want to add/remove/update.</para>
            </listitem>
          </itemizedlist>
        </listitem>
      </itemizedlist>
      <para>After that, you can put them into <emphasis role="italic">$PLATFORM-TOMCAT-HOME/gatein/conf</emphasis>.</para>
      <note>
        <para>There are some new configurations in <emphasis role="italic">$PLATFORM-TOMCAT-HOME/gatein/conf/</emphasis> which are related to <ulink url="../../../admin-guide/html/ch07.html">how to deploy the eXo Platform clustering</ulink>, and <ulink url="../../../reference/html/ch-jbosscache-configuration-templates.html">JBoss Cache configuration.</ulink>
        </para>
      </note>
      <itemizedlist>
        <listitem>
          <para>In your eXo Platform extension, did you override anything in <emphasis role="italic">$PLATFORM-TOMCAT-HOME/bin</emphasis>?</para>
          <itemizedlist>
            <listitem>
              <para>If NO, you can skip this step, and simply keep all configurations in <emphasis role="italic">$PLATFORM-TOMCAT-HOME/bin</emphasis>.</para>
            </listitem>
            <listitem>
              <para>If YES, you first need to keep all eXo Platform 3.5's origin configurations, then add/remove/update your extension configuration into it.</para>
            </listitem>
          </itemizedlist>
        </listitem>
      </itemizedlist>
      <note>
        <para>
          <emphasis role="italic">$PLATFORM-TOMCAT-HOME/bin/gatein.sh</emphasis> and <emphasis role="italic">$PLATFORM-TOMCAT-HOME/bin/gatein.bat</emphasis> are no longer used. Therefore, you should add your customized configurations in a more official way to set environment variables via <emphasis role="italic">setenv.sh</emphasis> or <emphasis role="italic">setenv.bat</emphasis>.</para>
      </note>
    </section>
    <section id="DEV.Upgrade.Update_components">
      <title>Update components </title>
      <para>There are many components in eXo Platform, so if you update your eXo Platform extension to eXo Platform 3.5, you need to update the version of all eXo Platform 3.5's components.  To do so, simply configure the Maven POM file that allows you to use the artifacts (eXo Platform 3.5 and its components). For more details, see the <link linkend="DEV.Upgrade.Update_project_Maven_dependencies">Update project Maven dependencies</link> section. All eXo Platform 3.5's components will be automatically included in your eXo Platform extension.</para>
      <para>There are some new components in eXo Platform 3.5 that have not been existing in eXo Platform 3.0, including Webos, Wiki, and Gadget-pack. To use these components, simply activate their profiles. For more details, see the <ulink url="../../../admin-guide/html/ch02.html#ADM.Installation.eXo_profiles">Profiles of eXo Platform</ulink> section.</para>
      <para>In eXo Platform 3.5, the "intranet" portal is defined in the <emphasis role="italic">acme-intranet.war</emphasis> file (not in the <emphasis role="italic">office-portal.war</emphasis> file of eXo Platform 3.0). So if you have overridden anything in the "intranet" portal, you need to synchronize your extension with the <emphasis role="italic">acme-intranet.war</emphasis> file of eXo Platform-3.5.</para>
    </section>
    <section id="DEV.Upgrade.Update_extension">
      <title>Update extension </title>
      <para>This section details how to update your custom eXo Platform extension, including updating <link linkend="DEV.Upgrade.Update_extension.Update_Kernel_XML_Schema">Kernel XML Schema</link>, <link linkend="DEV.Upgrade.Update_extension.Update_portal">portal</link> and <link linkend="DEV.Upgrade.Update_extension.Update_APIs">APIs</link>.</para>
      <section id="DEV.Upgrade.Update_extension.Update_Kernel_XML_Schema">
        <title>Update Kernel XML Schema </title>
        <itemizedlist>
          <listitem>
            <para>Simply upgrade the version from <emphasis role="italic">kernel_1_0.xsd</emphasis> to <emphasis role="italic">kernel_1_2.xsd</emphasis> in all <emphasis role="italic">.xml</emphasis> configurations files.</para>
          </listitem>
        </itemizedlist>
        <programlistingco>
          <areaspec units="linecolumn"/>
          <programlisting language="xml"><![CDATA[
<configuration xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd" 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">
	.....
</configuration>
]]></programlisting>
        </programlistingco>
      </section>
      <section id="DEV.Upgrade.Update_extension.Update_portal">
        <title>Update portal </title>
        <section id="DEV.Upgrade.Update_extension.Update_portal.Portal_data_import">
          <title>Portal data import </title>
          <note>
            <para>It is recommended you have the knowledge of the import mechanism by referring to the <ulink url="../../../reference/html/bk02ch03.html#sect-Reference_Guide-Import_Strategy">Data Import Strategy</ulink> section.</para>
          </note>
          <para>Processing the portal data import includes the following tasks:</para>
          <itemizedlist>
            <listitem>
              <para>Improve the current data import strategy so that it becomes more flexible in various scenarios.</para>
            </listitem>
            <listitem>
              <para>Deploy an extension after you have initialized the portal that allows the extension to contribute its entities to an existing site.</para>
            </listitem>
            <listitem>
              <para>Reimport data by overwriting an existing entire configuration at each startup.</para>
            </listitem>
          </itemizedlist>
          <para>
<citetitle>
<emphasis role="bold">
What's new?
</emphasis>
</citetitle>
</para>
          <informaltable>
<tgroup cols="2">
  <thead>
	<row>
	  <entry>Previous behavior</entry>
	  <entry>New behavior</entry>
	</row>
  </thead>
  <tbody>
	<row>
	  <entry>
		<para>The previous mode for navigations is defined using the overridden configuration. </para>
		<itemizedlist>
		  <listitem>
			<para>
                          <emphasis role="bold">Merge</emphasis>: Merge data from the XML descriptor to the existing data.</para>
		  </listitem>
		  <listitem>
		<para>
                          <emphasis role="bold">Override</emphasis>: Destroy any existing data, and create new ones.</para>
		  </listitem>
		</itemizedlist>
		<para>The previous mode has two main issues:</para>
		<itemizedlist>
		  <listitem>
			<para>The behavior for instance disables the "always merge data" usecase. It means that it is always impossible to merge new navigations nodes from XML to MOP.</para>
          </listitem>
          <listitem>
		    <para>The behavior is configured by the overridden parameter.</para>
		  </listitem>
		</itemizedlist>
	  </entry>
	  <entry>
	  <para>The new behavior which is configured at the import level with a field parameter would have the following values:</para>
      <itemizedlist>
		<listitem>
		  <para>
                          <emphasis role="bold">conserve</emphasis>: Import data. However, if the navigation has been existing, it will be kept.</para>
        </listitem>
        <listitem>
		  <para>
                          <emphasis role="bold">insert</emphasis>: Insert the missing descriptor data by adding new nodes without any modifications on the existing nodes.</para>
		</listitem>
		<listitem>
		   <para>
                          <emphasis role="bold">merge</emphasis>: Merge the descriptor data, add missing nodes and update the nodes of the same name.</para>
		</listitem>
		<listitem>
		  <para>
                          <emphasis role="bold">overwrite</emphasis>: Always destroy the previous data and create new ones.</para>
		</listitem>
	   </itemizedlist>
	 </entry>
	</row>
  </tbody>
</tgroup>
</informaltable>
          <para>For example, if you want to merge the new portal navigation from the configuration file and the existing portal navigation into the current eXo Platform, you can configure as below:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting language="xml"><![CDATA[
<object-param>
  <name>portal.configuration</name>
  <object type="org.exoplatform.portal.config.NewPortalConfig">
    <field name="predefinedOwner">
     <collection type="java.util.HashSet">
       <value><string>classic</string></value>
     </collection>
    </field>
    <field name="ownerType">
      <string>portal</string>
    </field>
    <field name="templateLocation">
      <string>war:/conf/portal</string>
    </field>
    <field name="importMode">
      <string>merge</string>
    </field>
  </object>
</object-param>
]]></programlisting>
          </programlistingco>
          <note>
            <para>When a mode is not specified, the default mode will be <emphasis role="bold">conserve</emphasis>.</para>
          </note>
        </section>
        <section id="DEV.Upgrade.Update_extension.Update_portal.Authentication">
          <title>Authentication </title>
          <para>eXo Platform 3.5 uses a new authentication mechanism so-called the WCI authentication mechanism. This change from GateIn into the WCI module is because:</para>
          <itemizedlist>
            <listitem>
              <para>Authentication is commonly part of Java EE and happens at the Servlet Container layer, while WCI is the layer of integration between our stack and the Servlet Container. </para>
            </listitem>
            <listitem>
              <para>WCI provides an easier integration of SSO providers that allows the SSO module to depend on the WCI module instead of integrating directly with the GateIn module. Its main benefit is to improve the quality of SSO and to decouple SSO from GateIn.</para>
            </listitem>
            <listitem>
              <para>The GateIn stack wants to support and leverage specifications of both Servlet 3.0 and Servlet 2.5 that are not supported by the GateIn module. Meanwhile, WCI can serve both.</para>
            </listitem>
            <listitem>
              <para>The Servlet 3.0 provides a programmatic login feature which can be used to implement WCI.</para>
            </listitem>
            <listitem>
              <para>WCI provides the stronger guaranty of the authentication quality, meanwhile the authentication of GateIn was not unit tested. By moving the GateIn to WCI module, the test can be made against several implementations.</para>
            </listitem>
          </itemizedlist>
          <para>If there are other new portal containers in your eXo Platform extension, you need to update the authentication mechanism in the <emphasis role="italic">$PLATFORM-TOMCAT-HOME/conf/jaas.conf</emphasis> file.  For example, in case you have added a new portal container named "company" to eXo Platform, you need to configure the new authentication module for the new portal container as follows:</para>
          <programlistingco>
            <areaspec units="linecolumn"/>
            <programlisting><![CDATA[
<!--this configuration for defaul portal container with name "portal"-->
gatein-domain {
  org.gatein.wci.security.WCILoginModule optional;
  org.exoplatform.services.security.jaas.SharedStateLoginModule required;
  org.exoplatform.services.security.j2ee.TomcatLoginModule required;
};

<!--this configuration for new portal container with name "company"-->
gatein-domain-company {
  org.gatein.wci.security.WCILoginModule optional
    portalContainerName="company"
  	realmName="gatein-domain-company";
  org.exoplatform.services.security.jaas.SharedStateLoginModule required
    portalContainerName="company"
  	realmName="gatein-domain-company";
  org.exoplatform.services.security.j2ee.TomcatLoginModule required
    portalContainerName="company"
  	realmName="gatein-domain-company";
};
]]></programlisting>
          </programlistingco>
          <para>For more details, see the <ulink url="../../../admin-guide/html/ch05.html#ADM.Security.Change_JAAS_real">Change the JAAS realm</ulink> section.</para>
        </section>
      </section>
      <section id="DEV.Upgrade.Update_extension.Update_APIs">
        <title>Update APIs </title>
        <para>eXo Platform 3.5 has many changes on the data model and APIs. Therefore, if there are any new customized components in your eXo Platform extension that use eXo Platform 3.0 APIs, you need to check if they can work well in eXo Platform 3.5 or not. For more details, see the <link linkend="DEV.eXoPlatformAPIs">eXo Platform 3.5 APIs</link> section. </para>
        <para>Finally, you need to update your customized components if needed. </para>
      </section>
    </section>
  </chapter>
</book>
