JBoss.orgCommunity Documentation

Developer Guide


About this guide
1. Get Started
1.1. Glossary
1.2. Set up Maven settings
1.3. eXo Architecture Primer
1.3.1. Kernel
1.3.1.1. Containers
1.3.1.2. Services
1.3.1.3. Service configuration
1.3.1.3.1. Kernel XML Schema
1.3.1.3.2. Components
1.3.1.3.3. Parameters
1.3.1.3.3.1. Value-param
1.3.1.3.3.2. Object-param
1.3.1.3.3.3. Rest of parameter types
1.3.1.4. Plugins
1.3.1.5. Configuration loading sequence
1.3.2. GateIn extensions
1.3.2.1. Default Portal Container
1.3.2.2. Register Extension
1.3.3. Java Content Repository
1.3.3.1. Repositories and workspaces
1.3.3.2. Tree structure: working with nodes and properties
2. Create Your Own Portal
2.1. Create your extension project
2.2. Define a default portal
2.3. Structure of portal, pages and menus
2.3.1. Portal navigation
2.3.2. Visibility of pages
2.3.3. Page access permission
2.4. Enable/Disable a drive creation during the portal creation
2.5. Add/Remove a language
2.5.1. Add a new language
2.5.2. Remove a language
2.6. Create a custom look and feel
2.6.1. Platform skin elements
2.6.1.1. SkinService
2.6.1.2. ResourceRequestFilter
2.6.1.3. The default skin
2.6.2. Override skins with extension
2.6.3. Create new skins
2.6.3.1. Create a new skin web archive
2.6.3.2. Create the skin preview icon
2.6.3.3. Skin the window style
2.6.3.4. Configure the right-to-left skin
2.6.4. Skin the portlet
2.6.5. Configure Platform skin
2.6.5.1. Select skins within the configuration files
2.6.5.2. Skins in the page markup
2.6.5.3. Customize portal's layout
2.6.5.4. Customize page's layouts
2.6.5.5. Customize the Admin bar
2.6.5.5.1. sharedlayout.xml
2.6.5.5.2. Remove a content from the Admin bar
2.6.5.5.3. Add content to the Admin bar
2.6.5.5.4. Change the color scheme
2.6.6. Configure skin in WCM
2.6.6.1. Customize CLV portlet's template
2.6.6.2. Customize CLV template's style
2.6.7. Customize Document's skin
2.6.8. Best practices to customize a skin
2.7. Add JavaScript to your portal
2.8. Create custom templates for pages
3. Work With Content
3.1. Node type
3.2. WCM template
3.3. Document type
3.4. Dialog Syntax
3.4.1. Interceptors
3.4.2. Hidden fields
3.4.2.1. Non-value field
3.4.2.2. Non-editable fields
3.4.2.3. Create node type or mixin type
3.4.2.4. Hidden field with default value
3.4.2.5. Visible without null fields
3.4.2.6. WYSIWYG widget
3.4.2.7. Create a custom RichText editor fields
3.4.2.8. Simple select box widget
3.4.2.9. Advanced dynamic select box
3.4.2.10. Widget with selector
3.4.2.11. Multi-valued widget
3.5. Customize CKEditor
3.5.1. Installation
3.5.1.1. Fresh Installation
3.5.1.2. Upgrade
3.5.2. File and Folder Structure
3.5.2.1. Inside CKEditor
3.5.2.2. CKEditor in Context of eXo Platform
3.5.3. Configuration in CKEditor
3.5.3.1. Setting Configuration
3.5.3.2. Skin
3.5.3.3. Toolbar
3.5.3.4. How to create a plugin for CKEditor
3.6. Taxonomy
3.7. Manage Template service
3.8. Manage Navigation By Content
3.8.1. Actual content navigation
3.8.2. Add content to the navigation
3.8.3. Actions on Navigation By Content
3.8.4. Examples of creating data for Navigation By Content
3.8.4.1. Create a Product page
3.8.4.2. Develop your own Product content
4. Work With Applications
4.1. Integrate an application
4.2. Develop your own application
4.2.1. Gadget vs Portlet
4.2.2. Develop a gadget for eXo Platform
4.2.2.1. Resources
4.2.2.2. Apply for a gadget
4.2.2.3. Customize the gadget thumbnail
4.2.3. Portlet Bridges
5. System Integration
5.1. Authentication
5.1.1. Single-Sign-On (SSO)
5.1.2. Central Authentication Service (CAS)
5.1.3. Kerberos SSO on Active Directory
5.2. Users integration
5.2.1. Organization Service
5.2.2. Memberships, Groups and Users
5.2.3. Organization API
5.3. LDAP Integration
5.3.1. Connection Settings
5.3.2. Organization Service Configuration
5.3.2.1. Users
5.3.2.2. Groups
5.3.2.3. Membership types
5.3.2.4. Memberships
5.3.2.5. User profiles
5.3.3. Active Directory sample configuration
5.3.4. Picketlink IDM
5.4. Email
6. eXo Platform 3.5 APIs
6.1. Definitions of API Levels
6.2. Platform APIs
6.2.1. Java APIs
6.2.2. JavaScript APIs
6.2.3. Web Services
6.3. Provisional APIs
7. Cookbook
7.1. How to Copy a Site
8. Upgrade eXo Platform
8.1. Prerequisites
8.2. Prepare your extension project
8.3. What needs to be adapted in eXo Platform extension
8.4. Update project Maven dependencies
8.5. Update configurations
8.6. Update components
8.7. Update extension
8.7.1. Update Kernel XML Schema
8.7.2. Update portal
8.7.2.1. Portal data import
8.7.2.2. Authentication
8.7.3. Update APIs

The intended readers of this document are users using eXo Platform. This user guide explains all the basic and advanced features of eXo Platform by providing a series of in-depth examples and clear explanations which help users easily benefit from the eXo Platform capabilities and features.

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:

  • Get Started: Introduction to terms commonly used, how to set up Maven settings and eXo Architecture Primer.

  • Create Your Own Portal: Steps on how to create and customize your own portal.

  • Work With Content: Topics related to the eXo Platform content.

  • Work With Applications: Instructions on how to integrate applications into your portal and how to deploy your own applications.

  • System Integration: 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.

  • System Integration: Introduction to terms commonly used, how to set up Maven settings and eXo Architecture Primer.

  • eXo Platform 3.5 APIs: Information of APIs.

  • Cookbook: Introduction to Cookbook, particularly steps on how to copy a site to another eXo Platform server.

  • Upgrade eXo Platform: 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.

This section gives you explanations of some technical terms which are used throughout the documentation.

Container templates

Templates which are used to contain the UI components in a specific layout and display them on the portal page.

ConversationState

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.

Data container

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.

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.

Database Creator (DBCreator)

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.

Drives

Customized workspaces which include:

eXo Cache

One which all applications on the top of eXo JCR need. This can rely on an org.exoplatform.services.cache.ExoCache instance managed by org.exoplatform.services.cache.CacheService.

eXoContainer

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.

External Plugin

One which allows adding configuration for services and components easily.

Folksonomy

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: http://en.wikipedia.org.

Gadgets

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.

Groovy template

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.

JCR WebDav

A service that allows accessing a JCR repository via WebDav.

JobSchedulerService

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.

JodConverter (Java OpenDocument Converter)

A tool which converts documents into different office formats and vice versa.

JCR Item

One which may be a node or a property.

ListenerService

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.

LockManager

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.

Namespace

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: JSR-170) and is used to avoid the naming conflict.

Navigation node

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.

Navigation

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.

Node type

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: JSR-170).

Node

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.

Organization listener

One which provides a mechanism to receive notifications via an organization listener, including UserEventListener, GroupEventListener and MembershipEventListener.

  • UserEventListener is called when a user is created, deleted or modified.

  • GroupEventListener is called when a group is created, deleted or modified.

  • MembershipEventListener is called when a membership is created or removed.

Organization management

A portlet that manages users groups and memberships. This portlet is often managed by administrators to set up permission for users and groups.

OrganizationService

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.

Path constraint

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: JSR-170).

Permission

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.

Portal Page

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.

Portal skins

Graphic styles which display an attractive user interface. Each skin has its own characteristics with different backgrounds, icons, color, and more.

PortalContainer

A type of container which is created at the startup of the portal web application in the init method of the PortalController servlet.

Portlet

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:

  • Functional Portlets support all functions within the portal. They are integrated into the portal that can be accessed through toolbar links.

  • Interface Portlets 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.

Property constraint

One which may be specified by a query on the result nodes by way of property constraints (Source: JSR-170).

Property

An element in the tree structure that makes up a repository. Each property has only one parent node and has no child node.

Repository

One which holds references to one or more workspaces.

eXo REST framework

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 ResourceContainers.

RootContainer

A base container which plays an important role during the startup. However, it is recommended that it should not be used directly.

RTL Framework (Right To Left Framework)

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.

StandaloneContainer

One which is a context independent eXo Container. It is also used for unit tests.

Taxonomy

One which is used to sort documents to ease searches when browsing documents online.

Tree structure

One structure which is defined as a hierarchical structure with a set of linked nodes and properties.

Type constraint

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: JSR-170).

Web Content

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.

Workspace

A container of single rooted tree which includes items.

Before setting up a complete project/extension, you need to have knowledge of how to install a Maven project.

Requirements

  • JDK (Java Development Kit) 6.0

  • SVN 1.6+

  • Maven 2.2.1+

  • Tomcat 6.0.32 or JBoss EAP 5.1.1

Install and configure Maven

You need to add a system environment variable MAVEN_OPTS (it could be in a .profile startup script on Linux/MacOS operating systems or in the global environment variables panel on Windows).

  • Windows:

set MAVEN_OPTS=-Xshare:auto -Xms128M -Xmx1G -XX:MaxPermSize=256M
  • Linux/MacOS:

export MAVEN_OPTS="-Xshare:auto -Xms128M -Xmx1G -XX:MaxPermSize=256M"

Maven settings

1. Save the settings.xml file to the HOME/.m2/settings.xml path.

2. Edit and change the local-properties profile, including:

  • exo.projects.directory.dependencies contains the application servers, and Openfire.

  • each exo.projects.app.AS-NAME.version contains the name and version of the application servers.

If the settings.xml file has been existing, you can merge them. You will need the followings:

  • The local-properties profile, which defines properties, is used to build application server distributions of our products.

Note

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.

See also

Create your extension project

Create custom look and feel

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.

This part introduces concepts of Container and Services with an overview before configuring basic services.

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 .xml configuration file that comes with every service. To learn more about the dependency injection, visit here.

eXo Platform provides two types of containers: RootContainer and PortalContainer.

The RootContainer holds the low level components. It is automatically started before the PortalContainer. You will rarely interact directly with the RootContainer except when you activate your own extension. The PortalContainer 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 RootContainer.

In your code, if you need to invoke a service of a container, you can use the ExoContainerContext helper from any location. The code below shows you a utility method that you can use to invoke any eXo Platform services.



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);
  }
}

Then, invoking becomes as easy as:



OrganizationService orgService = ExoUtils.getService(OrganizationService.class)

To declare a service, you must add the .xml 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.

A configuration file can specify several services, so there can be several services in one jar file.

This section is divided into the following sub-topics:

You can provide initial parameters for your service by defining them in the configuration file. The followings are different parameters:

For the object-param component, you can look at the LDAP service:

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.

You can see how the service accesses the object in the code below:

The passed object is LDAPConnectionConfig, 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.

GateIn extensions are special .war 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.

The extension mechanism makes possible to extend or even override portal resources in almost plug-and-play way. You simply add a .war 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 .war archives. Instead, you need to create your own .war archive with your own configurations, and modify resources. The content of your custom .war archive overrides the resources in the original archives.

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.

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 org.exoplatform.container.web.AbstractHttpServlet class. This will not only properly initialize the current PortalContainer 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.

As similar to filters, make sure that your filter class extends org.exoplatform.container.web.AbstractFilter. Both AbstractHttpServlet and AbstractFilter have the method named getContainer(), which returns the current PortalContainer.

The webapps are loaded in the order defined in the list of dependencies of the PortalContainerDefinition. You then need to deploy the starter.war; otherwise, the webapps will be loaded in the default application server's order, such as the loading order of the Application Server.

If you need to customize your portal by adding a new extension and/or a new portal, you need to define the related PortalContainerDefinitions and to deploy the starter. Otherwise, you do not need to define any PortalContainerDefinition.

First, you need to tell eXo Platform to load WEB-INF/conf/configuration.xml of your extension, you need to declare it as a PortalContainerConfigOwner. Next, open the file WEB-INF/web.xml of your extension and add a listener:

You need to register your extension in the portal container. This is done by the .xml configuration file like this:

A PortalContainerDefinitionChangePlugin plugin is defined to the PortalContainerConfig. The plugin declares a list of dependencies that are webapps. The apply.default=true indicates that your extension is actually extending portal.war. You need to package your extension into a .war file and put it to the tomcat webapps folder, then restart the server.

In your portal, if you want to add your own property file to support localization for your keys, you can do as follows:



<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>

All data of eXo Platform are stored in a Java Content Repository (JCR). JCR is the Java specification (JSR-170) 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.

Also, the JCR is primarily used as an internal storage engine. Accordingly, eXo Content lets you manipulate JCR data directly in several places.

A content repository consists of one or more workspaces. Each workspace contains a tree of items.

Access the repository's content from a service

1. Get the session object.

i. Obtain the javax.jcr.Repository object via one of the following ways:

The first way

Call the getRepository() method of RepositoryService.

The second way

Call the getCurrentRepository() method, especially when you plan to use a single repository which covers more than 90% of usecases.

The third way

Using JNDI as specified in JSR-170.



Context ctx = new InitialContext();
Repository repository =(Repository) ctx.lookup("repositoryName");

ii. Log in the server to get a Session object by either of two ways:

The first way

Create a Credential object, for example:



Credentials credentials = new SimpleCredentials("exo", "exo".toCharArray());
Session jcrSession = repository.login(credentials, "production");

The second way

Log in the server without using a Credential object.



Session jcrSession = repository.login("production");

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.

Note

There are some JCR Session common considerations as follows:

Because javax.jcr.Session is not a safe object of thread, it is recommended that you should not share it between threads.

Do not use the System session from the user-related code because a system session has unlimited rights. Call ManageableRepository.getSystemSession() from the process-related code only.

Call Session.logout() explicitly to release resources assigned to the session.

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.

2. Retrieve your node content of the session object.



String path = "/"; // put your node path here
Node node = (Node) session.getItem(path);

A custom extension contains two mandatory items:

To see the sample extension package, visit here.

Once you have modified the sample extension to build your own portal, use the maven clean install command to create the archive files.

Deploy your extension in Tomcat

1. Add the sample-ext.war file from the sample/extension/war/target/ to the tomcat/webapps directory.

2. Add the starter folder from starter/war/target/ to the tomcat/webapps directory.

3. Rename the starter directory (unzipped folder) to starter.war.

Note

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.

4. Add the .jar file named exo.portal.sample.extension.config-X.Y.Z.jar from sample/extension/config/target/ to the tomcat/lib directory.

5. Add the .jar file named exo.portal.sample.extension.jar-X.Y.Z.jar from sample/extension/jar/target/ to the tomcat/lib directory.

For the JBoss deployment with more details, refer to the GateIn Reference Guide.

When entering the link of the portal in the address bar of the browser without defining a specific portal (e.g. localhost:8080/portal/), you will be directed to a default portal.

To configure the default portal, the portal must already exist first. Then, you just use the NewPortalConfigListener plugin as the sample code below.

To use this plugin in the component configuration, you must use the following target-component:

The sample code below is the configuration of the portal named "default".

Init-param

NameTypeValue Description
default.portalStringdefault The name of the default portal to which you are redirected when accessing the portal.

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.

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.

The configuration of the "classic" portal can be found in the /src/main/WEB-INF/conf/portal/portal/classic directory of your extension webapp.

portal.xml

The portal.xml 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.



<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>

Each portlet can be configured with a set of preferences, which will be further detailed in the Work With Applications chapter.

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.

Each application references a portlet using the id: portal#{portalName}:/{portletWarName}/{portletName}/{uniqueId}

The <page-body> </page-body> 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 (portal.xml) are remained, whereas the content of <page-body> switches to the page opened by the user.

The defined "classic" portal is accessible to "Everyone" (at /portal/classic) but only members of the group /platform/administrators can edit it.

pages.xml

The structure of the pages.xml configuration file is very similar to that in the portal.xml 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.

This is the example of the pages.xml file of the "classic" portal.



<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>

Note

See the Work With Applications chapter to learn more about the portlet configuration within the pages.xml file.

navigation.xml

The navigation.xml 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 pages.xml file that will be explained later.

If the administrator wants to create node labels for each language, he will have to use xml:lang attribute in the label tag with the value of xml:lang is set to the relevant locale.

Otherwise, if the administrator wants the node label is localized by resource bundle files, the #{...} 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.



<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>

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.

Note

For the top nodes, the URI and the navigation node name must have the same value. For other nodes, the URI is composed like <uri>contentmanagement/fileexplorer</uri> where 'contentmanagement' is the name of the parent node, and 'fileexplorer' is the name of node (<name>fileexplorer</name>).

When you configure the navigation.xml file, sometimes you need to set the visibility of page (node).

To configure the page visibility, simply put <visibility>type_of_visibility</visibility> as a child of the <node> tag.

eXo Platform supports 4 types of page visibility, including:

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 autoCreatedDrive, and targetDrives in the CreateLivePortalEventListener external component plugin.

Developer can define new or remove a defined language through the locale configuration file. The resource is managed by org.exoplatform.services.resources.LocaleConfigService as following:

All languages defined in the locale-config.xml file are listed in the Interface Language Settings window.

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.

The complete skinning of can be decomposed into three main parts: Portal skin, Window style, Portlet skin.

Portal skin

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.

Window style

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.

Portlet skin

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.

Portlet Specification CSS Classes

The portlet specification 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.

Portlet skins

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.

Platform skin is processed by the SkinService. It is used to discover and deploy skins into the portal.

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: exo.portal.component.portal.jar/gatein_resources_1_0.xsd.

Here is the gatein-resources.xml file of a sample skin (called "MySkin") which defines the portal skin with its CSS location, window style and its portlet skins:

The default skin of eXo Platform 3.5 is in the eXoResource.war file. The main files associated with the skin are:

The following block of CSS illustrates content of the skin/Stylesheet.css file:

In which:

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:

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.

For any portal skin, the paths to the preview images are specified in CSS class UIChangeSkinForm:

For the portal named MySkin, it is required to define the following CSS classes:

The default skin would be aware of skin icons if the preview screenshot is placed in:

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:

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.

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.

Configure window styles

Window style is defined within the gatein-resources.xml 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 gatein-resource.xml fragment will add MyThemeBlue and MyThemeRed to the MyTheme category.

The windows style of the default skin is configured in the eXoResources.war/WEB-INF/gatein-resources.xml file.

Window style CSS

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 eXoResources.war/skin/PortletThemes/Stylesheet.css.

Set the default window style

To set the default window style for a portal, you need to specify the CSS classes for a theme called DefaultTheme.

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 <link> element will be in the portletAppName/PortletName 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 gatein-resources.xml file.

This action will load DefaultStylesheet.css or OtherSkinStylesheet.css when the DefaultSkin or OtherSkin is used respectively.

Change portlet icons

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: skin/DefaultSkin/portletIcons/icon_name.png. The icon must be named after the portlet. For example, the icon of account portlet must be named AccountPortlet and located at: skin/DefaultSkin/portletIcons/AccountPortlet.png.

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.

In the code fragment below, you can see two types of links:

Note

This section is related to the configuration. You can see a sample here. 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.

For example, you will have a layout like this:

In which:

  • Branding: A branding application

  • Top navigation: A top navigation application

A table column container with three nested containers:

  • Left Column and Right Column: Contain one application for each.

  • Main content: Contain the page body.

And here is the fragment of portal.xml located in this path: <myportal_path>/src/main/webapp/WEB-INF/conf/myportal/portal/portal/mysite/portal.xml.



<!-- ... -->

<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>

<!-- ... -->

As you see in the portal.xml file above, every container tag has an id attribute, for example "<container id = 'RightColumn'>". When you create a CSS file, the property applied for this container should have the following name manner:

${container_id}TDContainer

and the details of this container:

RightColumnTDContainer

The reason is, when you have a look in the file system: /groovy/portal/webui/container/UITableColumnContainer.gtmpl shown above, you will see this code fragment:

<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>

So, in the table element (which represents the outer container), there are many td elements, each of which has the class attribute that equals to the id of the corresponding child component plus the "TDContainer" string literal.

Note

This section is related to the configuration. You can see a sample here. 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.

  • Like portal.xml, you can define the layout for each page in your site as shown in the following example:



<!-- ... -->

<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>

<!-- ... -->

This section shows you how to customize the Admin bar via the following topics:

The current color of the Admin bar is gray gradient. However, you can change the color to match your brand colors.

The default Administration style:

The style of the Admin bar is defined in the stylesheet.css located in extension/resources/src/main/webapp/skin/platformSkin/UIToolbarContainer.

Edit this CSS file to customize the Admin bar to your preferred color scheme.

The CSS code below shows how to modify the Admin bar to look like this:

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:

  • Apply your HTML/Groovy template code for this template.

For example:

<myportal_path>/src/main/webapp/WEB-INF/conf/myportal/customized/template/list/ACustomizedCLVTemplate.gtmpl

<div id="$uicomponent.id" class="ACustomizedCLVTemplate">
  <div class="ListContents">
    <!-- something here -->
  </div>
</div>
  • Now, you need to import this template to the database.

<myportal_path>/src/main/webapp/WEB-INF/conf/myportal/customized/template/configuration.xml



<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>

First, you need to create a new document definition.

  • <myportal_path>/src/main/webapp/WEB-INF/conf/myportal/customized/document/ACustomizedDocument.xml

	node type name :exo:customizedDocument
	properties: exo:name(type : String), exo:title(type : String), exo:content(type : String)

You also need to configure it to make sure it is imported to the database.

  • <myportal_path>/src/main/webapp/WEB-INF/conf/myportal/customized/document/definition-configuration.xml



<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>

Next, create the templates for this document, including:

  • Dialog: see the sample here.

<myportal_path>/src/main/webapp/WEB-INF/conf/myportal/customized/document/dialog.gtmpl

<div class="UIForm ACustomizedDocument">
  <% uiform.begin() %>
  <!-- Document dialog content is here -->
  <% uiform.end() %>
  • View: see the sample here.

<myportal_path>/src/main/webapp/WEB-INF/conf/myportal/customized/document/view.gtmpl

<style>
  <% _ctx.include(uicomponent.getTemplateSkin("exo:customizedDocument", "Stylesheet")); %>
</style>
<!-- Document view template content is here -->
  • Stylesheet: see the sample here.

Note

This document should contain ONLY the stylesheet for THIS template.

<myportal_path>/src/main/webapp/WEB-INF/conf/myportal/customized/document/stylesheet.css

/* ... */

.ACustomizedDocument {
  /* ... */
}

/* ... */
  • You also need to import them to the database.

<myportal_path>/src/main/webapp/WEB-INF/conf/myportal/customized/document/template-configuration.xml



<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>

Finally, you should create some initial contents and export them to XML files.

To import this XML into database, you can set up the deployment like this:



<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>

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.

Name files and folders

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.

Folder structure

Portal skins

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.

  • The general folder structure for portal skin:

/webapp/skin/NameOfPortalSkin/portal

For example:

/webapp/skin/DefaultSkin/portal

  • The main entry CSS file:

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:

/webapp/skin/NameOfPortalSkin/Stylesheet.css

For example:

/webapp/skin/SkinBlue/Stylesheet.css

  • The folder structure for WebUI components:

/webapp/skin/SkinBlue/webui/component/YourUIComponentName

For example:

/webapp/skin/SkinBlue/webui/component/UIToolbarContainer

  • Window decorator CSS is put in:

webapp/skin/PortletThemes/Stylesheet.css

  • Where to put images for portal skin?

The images for portal skin should be put in the background folder right in the Portal skin folder and for each UI component.

For example:

/webapp/skin/SkinBlue/webui/component/UIProfileUser/SkinBlue/background

In summary, the folder structure for a new portal skin should be:

webapp
|- skin
|--- NameOfPortalSkin
|----- stylesheet.css
|------- webui
|---------- component
|------------ UIComponentName
|--------------- NameOfPortalSkin.css
|--------------- NameOfPortalSkin
|------------------ background

Portlet skin

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 content.war will have the id="contentContentPortlet".

General folder structure for portlet skin: /webapp/skin/portlet/webui/component/YourUIPortletName

and for the Groovy skin: /webapp/groovy/portlet/webui/component/YourUIPortletName/

For example:

  • /webapp/skin/portlet/webui/component/UIBannerPortlet

  • /webapp/groovy/portlet/webui/component/UIBannerPortlet

Portlet images folder: /webapp/skin/portlet/YourUIPortletName/PortalSkinName/background

For example:

  • /webapp/skin/portlet/UIBannerPortlet/BlueSkin/background

Portlet themes

Main entry CSS:

  • /webapp/skin/PortletThemes/Stylesheet.css

  • /webapp/skin/PortletThemes/background

  • /webapp/skin/PortletThemes/icons

eXo Platform 3.5 provides you with some built-in templates when you create a new page via Page Creation Wizard. In this section, you will learn how to create a custom page template for Page Creation Wizard.

You should use the extension to add the page layout configuration. In this guide, you are going to work with the /examples/extension project.

Create a custom page template

1. Add your sample template "FourRowsLayout" by overriding the PageConfigOptions.groovy file (portal.war).

Add it to this path: /examples/extension/war/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/page/PageConfigOptions.groovy

Sample code:

2. Add your template file into the /examples/extension/war/src/main/webapp/WEB-INF/conf/portal/template/pages/four-rows/page.xml file.

Sample code:

You can refer to the default template of eXo Platform in this path: /web/portal/src/main/webapp/WEB-INF/conf/portal/template/pages

3. Add the stylesheet to make the template preview image.

Add your own stylesheet in your extension webapp:

You can refer to the eXo Platform 3.5's default stylesheet in this path: /web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UISelector/UIItemSelector/Stylesheet.css

4. Deploy your extension project. You will see the template and its preview image in the Page Creation Wizard.

Note

eXo Platform provides you with 2 options to create the content for your new extension:

  • Create new content manually.

  • Import an existing content into your extension.

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:



<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>

By defining a supertype, you can reuse other node types and extend them with more properties (just like inheritance in Object Oriented Programming).

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.

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.

To place interceptors, use the following fragment:

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:

Whereas the post-save interceptor is passed the path of the saved node in the context:

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.

Once the form has been saved, the date value will be saved under the relative JCR path ./exo:image/jcr:lastModified.

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.

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.

The "options" argument is used to tell the component which toolbar should be used.

By default, there are five options for the toolbar: CompleteWCM, Default, BasicWCM, Basic, SuperBasicWCM.

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.

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.

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.

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.

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.

There is also a simple text area widget, which has text-input area only:

In the WYSIWYG widget 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 RichText editor with custom buttons.

Just edit the configuration file and modify or add new items to the configuration file of the RichText editor is located in: apps/resource-static/src/main/Webapp/eXoConfig.js

Take a look at the eXoConfig.js file to see a definition of a custom toolbar named "MyCustomToolbar":



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']
] ;

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.

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.

  • Put the desired button names in square bracket ("[" & "]") 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.

  • Include a separator in the toolbar band by putting the "-" string on it.

  • Separate each toolbar brands with commas.

  • 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.

Note

The last toolbar band must have no comma after it.

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.

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.

CKEditor is a text editor. This is a WYSIWYG editor which allows you to see what the published results look like while editing your text. It brings to the common web-editing features found on desktop-editing applications like Microsoft Word, and OpenOffice. To have more information about a WYSIWYG editor, see the WYSIWYG widget section.

You can install CKEditor easily by selecting an appropriate procedure (fresh installation or upgrade) and follow the steps described below.

This way is used to install CKEditor for the first time.

1. Download the latest version of the editor here.

2. Extract (decompress) the downloaded archive to a directory called ckeditor in the root of your website.

Note

You can place the files in any path of your website. The ckeditor directory is the default one.

To upgrade an existing CKEditor installation, do as follows:

1. Rename your old editor folder to a backup folder, for example, "ckeditor_old".

2. Download the latest version of the editor here.

3. Extract/Decompress the downloaded archive to the original editor directory, for example, "ckeditor".

4. Copy all configuration files that you have changed from the backup folder to their corresponding positions in the new directory. These files could include (but not limited to) the following files:

  • config.js

  • contents.css

  • plugins/templates/templates/default.js

  • plugins/styles/styles/default.js

  • plugins/pastefromword/filter/default.js

There are the following folders:

Folders Description
samples Contain CKEditor samples.
sourceContain CKEditor source code.
adaptersContain CKEditor adapters. It may be removed if you do not use any adapters, like the jQuery one.
imagesContain CKEditor graphics files.
langContain CKEditor language files.
pluginsContain plugin files and is necessary for CKEditor to work.
skinsContain CKEditor skin files along with toolbar buttons and stylesheet definitions.
themesContains CKEditor theme.
FilesDescription
ckeditor.js The heart of CKEditor application. It is the unique compressed file which contains all of codes to run CKEditor.
ckeditorbasic.js The compressed file like ckeditor.js, but it is only a bootstrap which contains the core functionality only, so the rest of the code can be loaded at later time, avoiding delaying the initial load of the page.
ckeditorsource.js An uncompressed version of ckeditor.js.
ckeditorbasicsource.js An uncompressed version of ckeditorbasic.js.
config.jsAllow users to customize some configurations.
contents.css Define the stylesheets of the CKEditor application.
ckeditor.aspUsed for ASP integration.
ckeditor.phpUsed for PHP integration.
ckeditorphp4.php Used for PHP4 integration.
ckeditorphp5.php Used for PHP5 integration.
ckeditor.pack Re-build the compression version of 2 files: ckeditor.js, and ckeditorbasic.js.

There is a .war package named eXoStaticResources which integrates the CKEditor application into eXo Platform. The source code is placed inside the apps/resources-static/src/main/webapp folder.

Its structure consists of the folders and files below:

Folders & FilesDescription
ckeditor Contain all source codes of CKEditor v3.3.2.
eXoPlugins Contain the source code of 3 external plugins: {}Insert Content Link{}, {}Insert Portal Link{}, {}WCM Insert Gadget{}.
eXoConfig.jsRegister 3 external plugins, and define some types of the toolbar.
eXoPlugins.js Define some utility functions which can be used by 3 external plugins.

Toolbar Definition

CKEditor is a full-featured WYSIWYG editor, but not all of its options are needed in all cases. Therefore, the toolbar customization is one of the most common and required tasks when dealing with CKEditor.

Toolbar Definition is a JavaScript array which contains the elements to be displayed in all toolbar rows available in the editor. In eXo Platform, the toolbar definition is placed in the /webapps/eXoStaticResources/eXoConfig.js file. The following code snippet contains the default CKEditor toolbar set in eXo Platform.

Add a new toolbar in eXo Platform

Show the newly added toolbar

To show the newly added toolbar, you have to add it to a field of a WCM template. For example, to show the new toolbar on the content field of HTML file, you need to modify the dialog template of HTML file as follows:

By adding a new HTML file, you will see the new toolbar (MyToolbar) on the content field:

This section shows you how to create a basic CKEditor plugin.

Assuming that you will develop a timestamp plugin that inserts the current date and time into the editing area of CKEditor. The timestamp will be added after a user clicks a dedicated toolbar button. The implementation makes use of the insertHtml function which can be also easily adjusted to insert any other HTML elements into CKEditor.

1. Create a directory inside the eXoPlugins directory for CKEditor with the timestamp plugin.

2. Place the plugin.js file that contains the plugin logic inside the newly created timestamp folder. Also, you will need a toolbar icon for the plugin by adding an images folder and subsequently placing the timestamp.png file inside it.

3. Modify the plugin.js file in which you will write the behavior.

The following is the code used to create a simple plugin named timestamp:

To use the created plugin, plug it to CKEditor by using the following code:

The following is the illustration about the Timestamp plugin added to the CKEditor.

Taxonomy is a particular classification arranged in a hierarchical structure. Taxonomy trees in eXo Platform will help you organize your content into categories.

When you create a new taxonomy tree, you will add a pre-configured exo:action (exo:scriptAction or exo:businessProcessAction) 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 exo:taxonomyLink type pointing to it. The physical storage location is defined by a workspace name, a path and the current date and time.

Like adding document types, taxonomy trees can be managed through the Content Administration portlet, or by adding .xml configuration files.

To configure taxonomy trees by adding configuration files in the /webapp/WEB-INF/conf/acme-portal/wcm/taxonomy/ directory, create a new file called $taxonomyName-taxonomies-configuration.xml. For example, if the name of your taxonomy tree is "acme", the file should be named acme-taxonomies-configuration.xml.

You can view the file here: $PLF-HOME_/samples/acme-website/webapp/src/main/webapp/WEB-INF/conf/acme-portal/wcm/taxonomy/acme-taxonomies-configuration.xml.

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.

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.

You can find the template service configuration in /webapps/ecm-wcm-core/WEB-INF/conf/wcm-core/core-services-configuration.xml.

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.

With init-parameters as:



<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 location 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>    

Navigation By Content 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.

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 Content List Viewer (CLV) portlets. The pre-configured example can be found in the News page of the sample ACME website. In this example, all contents in the /Sites Management/acme/events/All node will be used.

Add "Actual content navigation" to a page

1. Log into the sample ACME website.

2. Add a new page, for example "Events".

3. Parameterize this page with the Autofit Two Columns container.

4. Add two Content List portlets to each column.

5. Add content.

i. Configure the left portlet as follows:

In which:

  • Folder path = /Sites Management/acme/events/All: The path to the folder that contains the content.

  • Header = Browse by: The title of all contents that are listed in the content list viewer.

  • Template = CategoryTree.gtmpl: The template used for displaying the content list.

  • Contextual Folder = Disabled: 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.

  • Show in page =Events: A single content in CLV will be shown in the Events page.

  • With = folder-id: The parameter containing the content path.

ii. Configure the right portlet as follows:

In which:

  • Folder path = /Sites Management/acme/events/All: The path to the folder that contains the content.

  • Template = OneColumnCLVTemplate.gtmpl: The template used for displaying the content list.

  • Contextual Folder = Enabled: The Contextual Content property is set to "Enable". This portlet is configured with the provided parameter (content-id by default).

  • Show in page = Details: A single content in CLV will be shown in the "Details" page.

  • With = content-id: The parameter containing the content path.

As a result, the created Events page will look like:

You can now navigate from the left portlet to see contents displayed in the right portlet.

The new Navigation By Content feature will traduce this example in a contextual menu.

Attach your root folder/node to some page nodes from the homepage (the drop-down menu holds your new contextual menu)

1. Go to the Sites Explorer page and navigate to /Sites Management/acme/events/All.

2. Click the Content Navigation button, the Navigation form will appear. If you do not see this button on the Action bar, add this button via the Content Administration page.

3. Fill values into the Content Navigation form:

In which:

  • Visible = true. This node will be navigable.

  • Target parent navigation = Events. The contextual menu will be attached to the Events drop-down menu.

  • Clickable = false. This node will not be clickable.

  • Page for list = catalog. This page is a system page that contains a Content List Viewer portlet and will be used to display the list of child nodes.

  • Page for detail = detail. This page is a system page that contains a Single Content Viewer portlet and will be used to display details of child nodes.

4. Save changes, then go back to the ACME homepage. You will see changes from the Events drop-down menu.

In which:

  • Visible: The /Sites Management/acme/events/All node is navigable and its child nodes are rendered in the contextual menu.

  • Target parent navigation: The /Sites Management/acme/events/All node is attached to the site menu item called Events.

  • Clickable: The /Sites Management/acme/events/All node is not clickable but all of its child nodes are clickable.

  • Page for list: The list of child nodes (if a child node is directory/folder) will be rendered in the following page.

Click the Earth menu item from the contextual menu, you will see that contents of the Earth directory are rendered in a separate page (catalog):

  • Page for detail: The details of child nodes (if a child node is a sample content) will be rendered in this page.

Select the Power 1 - Fire menu item from the contextual menu to see the Fire content displayed in a separate page (details):

Restrict the visibility of some contents

1. Go to the Sites Explorer page and navigate to the /Sites Management/acme/events/All/Fire node.

2. Click the Content Navigation button to open the Navigation form.

3. Uncheck the Visible field and save.

4. Go back to the ACME homepage. You will see that the Fire sub-menu is not displayed in the contextual menu anymore.

Sort elements of the contextual menu

1. Go to the Sites Explorer page and navigate to the /Sites Management/acme/events/All node.

2. Select the /Sites Management/acme/events/All/Earth node.

3. Click the Content Navigation button to open the Navigation form.

4. Set the Display order field to "1" and save.

5. Select the /Sites Management/acme/events/All/Water node.

6. Click the Content Navigation button.

7. Set the Display order field to "2" and save.

8. Select the /Sites Management/acme/events/All/Air node.

9. Click the Content Navigation button.

10. Set the Display order field to "3" and save.

11. Go back to the ACME homepage. You will see that the display order from the contextual menu is Earth, Water, Air. Note that the Fire sub-menu is not displayed because it is set to "Invisible" in the previous example.

Restore a node to the contextual menu and attach it to another page

1. Go to the Sites Explorer page and navigate to the /Sites Management/acme/events/All/Fire node.

2. Click the Content Navigation button to open the Navigation form.

3. Fill values into the Navigation form fields, including:

  • Visible = true

  • Target parent navigation = News

  • Clickable = false

  • Page for list = catalog

  • Page for detail = detail

4. Save changes and go back to the Acme/Overview homepage. You will see that the Fire node is attached to the News drop-down menu from the site menu:

However, if you want to add your newly created content directly to the contextual menu, you need to add the populateToMenu action first.

Add your newly created contents to the contextual menu

1. Go to the Sites Explorer page and navigate to the /Sites Management/acme/events/All/Fire node.

2. Click the Actions button and add the exo:populateToMenu action.

3. Create a document under the /Sites Management/acme/events/All/Fire node and publish it.

4. Go back to the homepage. You will see that your newly created document is added to the contextual menu.

The sample ACME website comes with a configured navigation by content menu:

You can click the Vision sub-menu and see contents of Vision directory rendered in the catalog page:

Select the X-Ray content and see the newly implemented content using new visual effects and presentation.

  • "Benefits" and "Features" tabs:

  • Coverflow section:

  • Related documents:

The sample Product page is composed of the following fields and folders:

(The Product content type is the template specified for the Product page.)

(These folders contain documents and media files to enrich the Product page.)

Create fields in the Product content type

  • Name

Other content folders are created within the product content when the Name field is created. This can be achieved (from the .gtmpl product dialog) as follows:

<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>

Other fields are created almost in the same way:

  • Title:

<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>
  • Illustration image:

<%
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>
  • Summary:

<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>
  • Benefits:

<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>
  • Features:

<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>

Develop the Product's view form

The illustration image, title and summary are grouped together:

<!-- 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>

In which:

  • Name: The name of the product.

  • Title: The title of the product.

  • Illustration Image: The image that is used as an illustration for the product.

  • Summary: The summary about the product that goes with the illustration.

  • Benefits: The benefits of the product.

  • Features: The features of the product.

Benefits and Features fields are rendered in two tabs using the jQuery library (already integrated into eXo Platform 3.5).

<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>
  • The jQuery-based feature is used to display the product's images (in the coverflow view) from the images folder.

<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>
  • Documents and videos are simply displayed within the view form as follows:

1. Get the node path to a document or video.

2. Use some customized CSS classes to display a link for this node.

Labels and/or messages are displayed in the dialog and the view form are localized.

The use of this instruction is described as below:

<td class="FieldLabel"><%=_ctx.appRes("Product.dialog.label.summary")%></td>
(...)
<h1><%=_ctx.appRes("Product.view.label.seeItInAction")%></h1>

This can be achieved by adding locale files. For example:



<Product>
  <view>
    <label>
      <benefits>Benefits</benefits>
      <features>Features</features>
      <seeItInAction>See it in action</seeItInAction>
      <resources>Resources</resources>
      <videos>Videos</videos>
    </label>
  </view>
</Product>

Make sure that locale files are added to the resource bundle configuration. If locale files (dialogs and views) are under the classes/locale/wcm directory, use the following code:



<value>locale.wcm.dialogs</value>
<value>locale.wcm.views</value>

To add a portlet to one of your portal's pages, you should configure the pages.xml file located at /war/src/main/webapp/WEB-INF/conf/sample-ext/portal/portal/classic/.

Here is an example of the portlet configuration in the pages.xml file:

Details:

XML tag name Description
application-ref The name of the webapp that contains the portlet.
portlet-ref The name of the portlet.
title The title of the page.
access-permission Define who can access the portlet.
show-info-bar Show the top bar with the portlet title.
show-application-state Show the collapse/expand icons.
show-application-mode Show the change portlet mode icon.
preferences Contain a list of preferences specific to each portlet. Each preference has a name and a value. You can also lock it by setting the read-only element to "true". To learn more, refer to eXo JCR and Extension Services Reference.

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.

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 .war file that contains commonly used static resources (stylesheets, images, JavaScript libraries, and more) available for all gadgets in eXo Platform at runtime:

The resources are divided into 2 categories: skin and script.

Skin: is the place for the shared stylesheets of the gadgets (exo-gadget/gadget-common.css) 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 exo-gadget-resources/script , 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.

The gadget-common.css 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.

For example:

Script: 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).

jQuery and plugins:

(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).

The utilities scripts:

  • utils/pretty.date.js: Calculate the difference from a point of time in the past to the present and display "4 months 3 weeks ago", for example.

A gadget should use static resources available in exo-gadget-resources 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 exo-gadget-resources are updated to the new eXo Platform skin. To make it work, the applied gadget must use the CSS classes defined in gadget-common.css (at least for the gadget title) like the sample gadget below:

The sample gadget:

The sample user settings of a gadget

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 gadget-common.css.



<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> 

The predefined membership types are specified in the membershipType field of the OrganizationConfig plugin parameter.

The predefined groups are specified in the group field of the OrganizationConfig plugin parameter.

The predefined users are specified in the membershipType field of the OrganizationConfig plugin parameter.



<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>

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.

The configuration is done in the ldap-configuration.xml file, and this part will explain the numerous parameters which it contains.

First, start by connection settings which will tell eXo how to connect to your directory server. These settings are very close to the JNDI API context parameters. This configuration is activated by the init-param ldap.config of service LDAPServiceImpl.



<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>
  • providerURL: LDAP server URL (see PROVIDER URL). For multiple LDAP servers, use comma separated list of host:port (For example, ldap://127.0.0.1:389,10.0.0.1:389).

  • rootdn: distinguished name of user that will be used by the service to authenticate on the server (see SECURITY PRINCIPAL).

  • password: password for user rootdn (see SECURITY CREDENTIALS).

  • authenticationType: type of authentication to be used (see SECURITY AUTHENTICATION). Use one of none, simple, strong. Default is simple.

  • version: LDAP protocol version (see java.naming.ldap.version). Set to 3 if your server supports LDAP V3.

  • referralMode: one of follow, ignore, throw (see REFERRAL).

  • serverName: you will need to set this to active.directory to work with Active Directory servers. Any other value will be ignored and the service will act as on a standard LDAP.

Next, you need to configure the eXo OrganizationService to show how the directory is structured and how to interact with it. This is managed by a couple of init-params: ldap.userDN.key and ldap.attribute.mapping in the ldap-configuration.xml file (by default located at portal.war/WEB-INF/conf/organization)

ldap.attribute.mapping maps your LDAP to eXo. At first, there are two main parameters to configure in it:

Other parameters are discussed in the following sections.

Main parameters

Here are the main parameters to map eXo users to your directory:

For example:

However, if users exist deeply under userURL, eXo will be able to retrieve them.

Example:

Example: john and tom will be recognized as valid eXo users but EMEA and France entries will be ignored in the following subtree:

When a new user is created, an entry will be created with the given objectClass attributes. The classes must at least define cn and any attribute referenced in the user mapping.

For example, adding the user Marry Simons could produce:

User mapping

The following parameters maps LDAP attributes to eXo User Java objects attributes.

In the example above, the user Marry Simons could produce:

eXo Platform groups can be mapped to organizational or applicative groups defined in your directory.

Groups can be structured hierarchically under groupsURL. For example, groups, including communication, communication/marketing and communication/press, would map to:

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: ou, description and l.

For example, adding the human-resources group could produce:

Example: groups WebDesign, WebDesign/Graphists and sales could be retrieved in:

Membership types are the possible roles that can be assigned to users in groups.

eXo stores membership types in a flat structure under membershipTypeURL. For example, roles, including manager, user, admin and editor could be defined by the subtree:

When a new membership type is created, an entry will be also created with the given objectClass attributes. The classes must define the required attributes: description, cn.

For example, adding the membership type validator would produce:

For example, if membershipTypeNameAttr is cn, the role name will be manager for the following membership type entry:

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.

The parameters to configure memberships are:

When a new membership is created, an entry will be also created with the given objectClass attributes. The classes must at least define the attribute designated by membershipTypeMemberValue. Example: Adding membership validator would produce:

Values should be a user dn.

Example: james and root, who have admin role within the group human-resources, would give:

For example, in the following membership entry:

The cn attribute is used to designate the manager membership type. In other words, the name of role is given by the 'cn' attribute.

For example, the following is a filter used for a customer that needs to trigger a dynlist overlay on OpenLDAP.

Here is an alternative configuration for active directory that you can find in activedirectory-configuration.xml.



[...]
<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>  

Here is how to use the LDAPs protocol with the Active Directory:

1. Set up AD to use SSL:

i. Add the Active Directory Certificate Services role.

ii. Install the right certificate for the DC machine.

2. Enable Java VM to use the certificate from AD:

i. Import the root CA used in AD, to keystore, such as: keytool importcert file 2008.cer keypass changeit keystore /home/user/java/jdk1.6/jre/lib/security/cacerts.

ii. Set the Java options as below:

JAVA_OPTS="${JAVA_OPTS} -Djavax.net.ssl.trustStorePassword=changeit -Djavax.net.ssl.trustStore=/home/user/java/jdk1.6/jre/lib/security/ca"

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 here.

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 portal.war/WEB-INF/conf/configuration.xml:



<!--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> -->

If you want to switch between different implementations, you just need to uncomment the corresponding <import> and leave others commented:



<!--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 -->

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:

API Level Test Suite Clients Documentation Support Compatibility X.Y.Z(+1) Compatibility X.Y(+1)
Platform API
Provisional API
Experimental API Best effort Best effort
Unsupported API

Test Suite: A suite of tests that can be run against the API to detect changes.

Clients: The API has been used successfully by at least 2 different teams, using the API Documentation only.

Documentation: The API has a clean JavaDoc and reference documentation.

Support: The eXo Support team provides help on the code that uses this API, and fixes any reported bugs.

Compatibility X.Y.Z(+1): 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.

Compatibility X.Y(+1): 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.

Best Effort: You will receive assistance, but eXo Platform cannot guarantee any specific result.

Use Provisional or Experimental APIs

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.

Provisional APIs 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.

Experimental APIs 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.

Portlet API: (JSR 168 and JSR 286) A Java standard that defines how to write portlets. This is the way to develop Java applications that are integrated into eXo Platform.

WSRP 1.0 on JBoss: A network protocol for integrating remote portlets into eXo Platform.

JAX-RS: (JSR 311) A standard API that provides support for creating REST-like services.

JCR (JSR 170): A standard API that provides access to a content repository.

JCR Service Extensions: A set of APIs that provide extended functionalities for the JCR, such as observation, permissions, and access to a repository.

Java EE 6: eXo Platform supports the Java EE 5 APIs, so you can develop applications using this standard.

Cache: An API used for data caching.

Event and Listener: An API for listening and sending events within eXo Platform.

Organization: An API and SPI for accessing user, group and membership information.

Portal Container Definition: This API is used to configure your portal.

Taxonomy: An API that allows you to organize your content.

LinkManager: An API that provides a way to manage links when developing WCM features.

PublicationManager: An API that provides different ways to manage the publication of content when developing WCM features.

WCMComposer: An API to get content shown in the website. The cache management is used in this service, and methods to update the content cache.

NewFolksonomy:

ApplicationTemplateManager: An API to manage dynamic groovy templates for WCM-based products.

NodeFinder: An API to find a node with a given path.

JodConverter: An API to convert documents into different office formats.

SiteSearchService: An API that allows users to find all information matching with their given keyword.

SEOService: An API that manages SEO data of a page or a content.

TimelineService: An API that allows documents to be displayed by days, months and years.

XML Configuration: A set of DTD for configuring eXo Platform.

ActivityManager: An API to manage activities (create/delete/like activity; delete/like/create comment; get activities of space/user/connection).

IdentityManager: An API to manage identities (create identity, save profile, get connection of an identity).

RelationshipManager: 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.

SpaceService: An API that provides methods for working with space (create new space, delete, get space by url, groupid, display name, pretty name).

OpenSocial 1.1 Gadget Specification: A standard that defines how to write gadgets and provide APIs. Gadgets are particularly useful for integrating external applications into eXo Platform.

CMIS: A standard API that gives access to the content repository via REST and SOAP Web services.

FTP: A standard protocol for exchanging documents.

OpenSocial 1.1 REST Protocol: A standard API for accessing the social graph and activity streams.

WebDAV: A standard protocol for exchanging document over HTTP.

The procedure of each step will be detailed as follows:

Step 1. Copy a site's content folder with its version history.

1. Go to the Sites Management drive.

2. Open the site node, for example "acme".

3. Click Export Node to export the node with its version history as below:

4. Select Export and Export Version History to perform the exporting.

5. Navigate to the node where you want to import the file, then click Import Node to open the Import Node form.

6. Select the exported nodes and version history to be imported.

One pop-up message will appear to inform that you have imported successfully.

Step 2. Copy navigation nodes of sites.

1. Go to the Content Administration page and add a new drive to both target and source servers.

2. Export the navigation node.

3. Import the nodes navigation.

Step 3. Copy templates of node types.

1. Add the System drive to both servers.

2. Open system:/jcr:system/exo:namespaces/{namespace_name}, and export it.

3. Open system:/jcr:system/exo:namespaces/, and import the exported file as described in Step 2 .

4. Open system:/jcr:system/jcr:nodetypes/{node_type}, and export it.

5. Open system:/jcr:system/jcr:nodetypes/, and import the exported file as described in Step 4 .

Note

If you have some specific JCR namespaces and node types, you need to import them into the new server.

Step 4. Copy the WCM template.

1. Open the DMS Administration drive.

2. Open dms-system:/exo:ecm/templates/{node_type}, and export it.

3. Open dms-system:/exo:ecm/templates/, and import the exported file.

Also, for the CLV/PCLV templates, you can find all template views defined in the dms-system:/exo:ecm/views path with:

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.

Step 5. Copy a Taxonomy tree.

By importing the whole site as described in the Copy a site's content folder with its version history 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 category. 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:

1. Open the DMS Administration drive in the new server.

2. Go to dms-system:/exo:ecm/exo:taxonomyTrees/definition/.

3. Add a symlink to the Taxonomy Tree Root Node, for example collaboration:/sites content/live/acme/categories/acme.

The name of symlink is displayed as "acme".

The symlink will be generated as below:

In some cases, to see changes, you need to clear the cache by disconnecting or restarting the server.

Step 6. Copy metadata templates.

1. Open the DMS Administration drive in the new server.

2. Go to /exo:ecm/metadata/{meta_data_name}.

3. Export and import it in the same location in the new server again.

Step 7. Copy queries.

1. Open the DMS Administration drive in the new server.

2. Go to /exo:ecm/queries/{query_name}.

3. Export and import it in the same location in the new server again.

Step 8. Copy scripts.

1. Open the DMS Administration drive in the new server.

2. Go to /exo:ecm/scripts/ecm-explorer.

You will find three folders referring to the three types of groovy scripts in eXo Platform, including:

3. Export your customized script in the same location in the new server.

Step 9. Copy drive configurations.

1. Open the DMS Administration drive in the new server.

2. Go to /exo:ecm/exo:drives/{drive_name}.

3. Export and import it in the same location in the new server again.

Step 10. Copy gadgets.

1. Open the drive that points into the Portal-System Workspace.

2. Go to your gadget by following the portal-system:/production/app:gadgets/{gadget_name} path.

3. Export and import it in the same location in the new server again.

Step 11. Restart the server.

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:

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 Create Your Own Portal.

And now, you need to gather all requirements for your upgraded project by clarifying the following questions:

  • Do you actually need to migrate your project sources?

  • Have you created any new portal containers in your system?

  • Have you made any lifetime-related changes on eXo Platform? Would you like to keep these changes?

  • Have you developed a custom application? Where have you stored your application data?

  • Have you configured a dedicated JCR workspace?

  • Which eXo APIs are you using in your code?

  • Have you overridden any files of eXo Platform?

  • Have you disabled any services of eXo Platform?

  • Which Kernel configurations have you customized?

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 POM 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:



<!-- 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>

After updating Maven dependencies, you need to update configurations via answering two questions:

After that, you can put them into $PLATFORM-TOMCAT-HOME/gatein/conf.

  • In your eXo Platform extension, did you override anything in $PLATFORM-TOMCAT-HOME/bin?

    • If NO, you can skip this step, and simply keep all configurations in $PLATFORM-TOMCAT-HOME/bin.

    • If YES, you first need to keep all eXo Platform 3.5's origin configurations, then add/remove/update your extension configuration into it.

Note

$PLATFORM-TOMCAT-HOME/bin/gatein.sh and $PLATFORM-TOMCAT-HOME/bin/gatein.bat are no longer used. Therefore, you should add your customized configurations in a more official way to set environment variables via setenv.sh or setenv.bat.

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 Update project Maven dependencies section. All eXo Platform 3.5's components will be automatically included in your eXo Platform extension.

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 Profiles of eXo Platform section.

In eXo Platform 3.5, the "intranet" portal is defined in the acme-intranet.war file (not in the office-portal.war file of eXo Platform 3.0). So if you have overridden anything in the "intranet" portal, you need to synchronize your extension with the acme-intranet.war file of eXo Platform-3.5.

This section details how to update your custom eXo Platform extension, including updating Kernel XML Schema, portal and APIs.

Processing the portal data import includes the following tasks:

  • Improve the current data import strategy so that it becomes more flexible in various scenarios.

  • Deploy an extension after you have initialized the portal that allows the extension to contribute its entities to an existing site.

  • Reimport data by overwriting an existing entire configuration at each startup.

What's new?

Previous behaviorNew behavior

The previous mode for navigations is defined using the overridden configuration.

  • Merge: Merge data from the XML descriptor to the existing data.

  • Override: Destroy any existing data, and create new ones.

The previous mode has two main issues:

  • 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.

  • The behavior is configured by the overridden parameter.

The new behavior which is configured at the import level with a field parameter would have the following values:

  • conserve: Import data. However, if the navigation has been existing, it will be kept.

  • insert: Insert the missing descriptor data by adding new nodes without any modifications on the existing nodes.

  • merge: Merge the descriptor data, add missing nodes and update the nodes of the same name.

  • overwrite: Always destroy the previous data and create new ones.

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:



<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>

Note

When a mode is not specified, the default mode will be conserve.

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:

If there are other new portal containers in your eXo Platform extension, you need to update the authentication mechanism in the $PLATFORM-TOMCAT-HOME/conf/jaas.conf 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:

For more details, see the Change the JAAS realm section.