Copyright © 2007, 2008 Nuxeo SAS
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License, Version
1.2; with Invariant Section “Commercial Support”, no Front-Cover Texts,
and no Back-Cover Texts. A copy of the license is available at the URL:
http://www.gnu.org/copyleft/fdl.html
Table of Contents
Nuxeo RCP (codenamed "Apogee") is a rich client platform dedicated to ECM applications, based on the Eclipse RCP framework and the Nuxeo core document management services (Nuxeo SP).
Web-based (also called "thin client") ECM applications, such as Nuxeo EP, can usually provide a user interface that's good enough for most of the use cases, specially with the advent of rich web interfaces using Ajax techniques.
There are, however, business cases where a web-based application is not the best choice from a user interface standpoint:
When user productivity is tight to the amount and customizability of information that can be displayed on the screen (including multi-screens displays).
When the user interface needs to provide a high level of interaction between its various graphical components. For instance, updating data in one part of the screen needs to trigger an immediate update in another part of the UI.
When users need to edit content that is not well-suited for being edited in a browser, for instance, rich text or images, or not at all, for instance sound and video.
When users must interface the application with hardware connected to their computer, such as a scanner or audio/photo/video capture equipment.
When users need to take their ECM applications offline and keep on working on their document management tasks.
Nuxeo RCP is a platform dedicated to developing client applications with a rich user interface that can address these needs while still providing all the document management features of the Nuxeo ECM platform.
Nuxeo RCP currently provides the following features:
All the document management functions of Nuxeo EP are also exposed as RCP graphical components, including: document tree navigation, document editing, search, users management, etc.
An XHTML editor with advanced features such as custom spellchecking.
An image browser similar to Picassa or iPhoto.
An image editor, which supports multi-views (high def., full size, medium size, thumbnail), rotate/crop/resize, pre-defined sizes, size profiles, etc.
As it is based on the highly extensible, and industry-standard, Eclipse RCP framework, Nuxeo RCP can easily be extended to provide users with user interface components, or other functions, that fit the business needs of specific use cases, for instance:
Synchronous collaborative rich text editor: a text editor component that enables user to collaboratively edit a single piece of HTML content has been developed by Nuxeo and can easily be adapted to new projects.
Presence and instant messaging: a component, based on the Jabber protocol, has already been developed to enable workers across the world to coordinate their activities around one document or set of documents.
Teletext editor: a teletext editor has been developed for one of Nuxeo's customers, the Press Association.
Audio and video editing components could be created by encapsulating existing audio / video editing libraries into Eclipse plugins.
Etc.
Nuxeo RCP has been used in several mission-critical projects, including two projects for two of the leading news agencies in the World: AFP (Agence France-Presse) and PA (Press Association).
For more information about these two projects, please refer to the
case studies that have been published on the Nuxeo website on
http://www.nuxeo.com/.
Nuxeo RCP is a set of rich client platform plugins that can connect to a Nuxeo EP server and browse its documents using native graphical widgets. It can be used to extend any product based on Eclipse RCP.
Nuxeo RCP can be used for different purposes:
As a platform, for developing specific RCP products that have to connect to a Nuxeo EP server
As a development tool, to help troubleshooting a Nuxeo EP instance, by installing Nuxeo RCP in your Eclipse IDE.
As a standalone application, to connect and browse an existing Nuxeo RCP.
In this chapter, we will install some Nuxeo RCP components in the Eclipse IDE and use them from there.
Prebuilt versions of the software are provided by Nuxeo to ease the task of trying out Nuxeo RCP for the first time.
Just download the appropriate Nuxeo RCP package for your platform (only Windows and Linux packages
are provided at the moment) from http://download.nuxeo.org/nuxeo-rcp/products/releases/,
unzip them, and launch the application.
If you already have an Eclipse 3.3 installation and you want to try out Nuxeo RCP from it, you can alternatively download the Nuxeo RCP plugins using the Eclipse updater:
In Eclipse, go to Help > Software Updates > Find and Install ...
Select "Search for new features to install"
Add a new remote site name "Nuxeo RCP" using the URL
http://download.nuxeo.org/nuxeo-rcp/updates/ or http://download.nuxeo.org/nuxeo-rcp/updates/snapshots for snapshots versions
To fully works with Nuxeo RCP, Nuxeo EP may have to be bound to its DNS address or IP address. If you have connection errors while connecting with Nuxeo RCP, try the following instructions:
in
$JBOSS_HOME/server/default/deploy/nuxeo.ear/config/nuxeo.properties
and
$JBOSS_HOME/server/default/deploy/nuxeo.ear/datasources/core-events-ds.xml
replace all "localhost" by the IP adress or DNS name of the JBoss
server
start JBoss with the -b option: ./run.sh -b IP_adress_or_DNS_of_the_server
Nuxeo RCP provides a perspective that holds the main Nuxeo RCP views: Window > Open perspective > other ... and Select Nuxeo ECM.

Create a new connection and connect to it with the ECM Applications view.
Once connected, browse the Nuxeo EP content using the ECM Navigator.

This section explains what you need and how you should prepare your environment in order to be able to develop your own plug-ins based on Nuxeo RCP.
Eclipse 3.3 with the RCP/Plug-in Developers profile, from
http://www.eclipse.org/downloads/moreinfo/rcp.php
Java 5, from http://java.sun.com/j2se/1.5.0/
Nuxeo ECM 5.2.M1 (or recent trunk version). Please refer to the installation guide for this product for more details.
The SWT HTML composer plug-in, from http://www.eclipsian.org/swt-composer/update/.
This is mandatory only if you need the HTML editing support in Nuxeo
RCP. If you dont want this you need to disable the HTML editing
plug-in from Nuxeo RCP. (Just remove it)
A SVN client or the Subversive or Subversion plug-ins for Eclipse.
Install at least Eclipse 3.3 for RCP/Plugin developers
Install the SWT HTML composer plug-in from the following
update site: http://www.eclipsian.org/swt-composer/update/
Optionally install ECF plugins if you need the chatroom and share editor support from eclipse update site
Set up your eclipse to build your nuxeo-rcp platform to build your own product can be done using nuxeo-rcp plugins from the update site.
Install the Nuxeo RCP core plug-ins (the plug-ins that are
shared with the server). For this you can use the following update
site: http://download.nuxeo.org/nuxeo-rcp/updates/
Be sure to select the plug-ins when using this update site as indicated in the figure below and click to "select required":

You can also select the source category that may be useful for debuging nuxeo-ep core plugins deployed in nuxeo-rcp.
The other way to work with nuxeo-rcp, is to checkout from source. It's useful especially for modifying the nuxeo-rcp product and contribute to the community
Install the Nuxeo RCP plug-ins from SVN. Check-out the entire directory at: http://svn.nuxeo.org/nuxeo/nuxeo-rcp/trunk
In nuxeo apogee core, do a "mvn clean install" to retrieve the needed nuxeo-ep plugins. It will create a new folder target where you can find the generated plugins
In eclipse, import the apogee core plugins (the target folder) in Window > Preferences > Plugin Development > Target Platform
In some case, eclipse doesnt build anymore, complaining missing package from SWT. To resolve it, go back to Target Platform, click on "Restore Defaults", re add nuxeo apogee core generated plugins and "Apply" the changes.
Then go into Eclipse and click on File > Import ..., then select General > Existing projects into Workspace. As the root directory select the Nuxeo RCP nuxeo-apogee-rcp folder (where you previously checked out Nuxeo RCP). Eclipse will automatically detect all the plug-ins, fragments and sites in the Apogee project. Click on the Finish button.
That's all. Now you should be able to begin coding your own Nuxeo RCP plug-ins.
Note that the source code will someday move to http://hg.nuxeo.org/nuxeo-rcp/ using
the Mercurial SCM instead of Subversion).
This section is about launching the Nuxeo-RCP product that is provide in the source of nuxeo-rcp. For those who have install from the update site, you will wont be able to use the existing Nuxeo-RCP product (Create your own).
Now, you should have all your plugins compiled and you may want to try Nuxeo RCP. First you'll need to have a running Nuxeo ECM (5.2.M1 or later).
if you want to use your RCP client from a remote computer, you
should run your Nuxeo server with a specific IP
binding
From Eclipse, you'll pop up the Debug dialog box of the Nuxeo RCP product file from the Run > open Debug dialog ... menu.
You'll create a new Eclipse application named "Nuxeo RCP" following the figures below:

In the plugin tab, click on "Validate" to make sure that your have the right configuration. If some plugins are missing, it may be because features selected in the product do not have the same version installed in your eclipse. To quickly fix it, select "Launch with: plugins selected below only", "Deselect all" and "add Required Plug-ins". To fix it permanently, remove and readd the features from the product file one by one using the product editor (that will readd the feature with the version install in your computer
Launch Nuxeo RCP by clicking on "Apply" and "Debug".
Once Nuxeo RCP is launched, you should have a connexion view called "ECM Applications" that lets you add Nuxeo ECM server and connect to them.
In this section, we're talking about building a ready-to-use Nuxeo RCP application. We'll use the classic export wizard from Eclipse. Another option would be using the custom automated build process that has been made available for Nuxeo RCP to ease automatic builds.
From the menu (File > export > Plug-in development > Eclipse product), you'll find a wizard page that you'll configure as following:

If you have the Eclipse delta pack installed, you'll even be able to build products for other platforms than yours. Click in "Finish" to build your product(s).
Adding a new software component to nuxeo RCP is finally similar to adding a classic Eclipse RCP component. However, you may have things that have been already done and you would like to reuse and the underlying application server is always different from one software to another.
This chapter will cover things that may be useful to know when starting coding for nuxeo RCP. Following the development of the "comments" component, you'll have a nice example of a nuxeo software component.
New project -> Plugin development -> plugin project
Because it is a RCP application, you should use "Eclipse version 3.3" as target platform.
Check "no" to the question "Would you like to create a rich client application?": this option is for creating a new rich client application. We won't do that because our plugin will contribute to an existing rich client application
We won't create any template as well.
The others options are up to you.
Now that we have created the plug in, we are going to create a new tab to the document editor.
org.nuxeo.ecm.rcp.editors.DocumentPage classes are editor tabs
classes you will have to subclass to create a new editor tabs in Nuxeo
RCP.
Create a new class that subclass
org.nuxeo.ecm.rcp.editors.DocumentPage. The most important part to look at
is the method createPageContent. It will create the graphical widgets of
the tab. You will create there your SWT/JFace widgets and forms, or other
content that will be in the tab.
Once the class created, you need to reference it to the extension
point "org.nuxeo.ecm.rcp.formPages".
Things have been done in the Nuxeo RCP to make easy the creation of table viewers and tree viewers.
If you are looking at DocumentCommentsPage, you'll notice that the
viewer is creating by a CommentsManager. You'll have to create your own
"Manager" if you want to use a treeViewer or a tableViewer. In Nuxeo,
there are two classes you may reuse to create a manager:
TreeViewerManager and TableViewerManager.
These ViewerManagers are another layer above JFace
StructuredViewers. The methods you have to override are:
protected ItemAdapterFactory createAdapterFactory()
protected String[] getColumns()
protected String[] getColumnsHeader()
protected int getColumnSize(int columnIndex)
The method createAdapterFactory() will provide a factory to
ViewerManagers to create JFace label and content providers. These
providers are managed underline behind adapters. So an adapter will
provide pretty the same method than JFace providers that you will have
to implement according to your needs.
For comments: see DocumentCommentsAdapter.
Here is how to add a new adapter to a ViewerManager :
protected ItemAdapterFactory createAdapterFactory() {
ItemAdapterFactory factory = new ItemAdapterFactory();
factory.registerAdapter(DocumentModel.class, new DocumentCommentsAdapter());
return factory;
}
Columns are managed with three other ViewerManagers
methods.
getColumns will provide the array of String identifier of a
column. For these columns, getColumnsHeader will provide the displayed
header text. Then the last methods getColumnSize will return the size of
the column according to its index.
Nuxeo RCP is following the Eclipse project way to internationalize messages. This chapter will explain how to quickly make your plugin "internationalizable" how to make a language pack.
Here are some simple rules we are going to follow. Theses rules are based on the way Eclipse organize externalization of strings:
The default language is English. All your messages must be in English before begining the process
For java files, we are using a .properties file is shared by Java files from the same package and plugin.
For java files that contains messages to internationalize, use the eclipse externalization tool (right clic, source > externalize strings).
Once you have the dialog box, you have to check "Use eclipse's string externalization mechanism" to use the eclipse way to manage externalization.
if you have already externalized a java file from the same package, select a Message class/.properties that has been created from the combo box.
Most of the time, you will use the default Message class/.properties, but if you're doing a externalization in a package that also exist in another plugin, it's a good idea to rename both the class and properties file to another name.
Things that has to be has to be externalize are strings that are translatable in another speaking language and they must be used in any piece of code is displaying in the user interface or logs (and nothing else).
What if the strings has a parameters? For example the strings
"You can not delete the file example.txt in this directory" has
example.txt to be changed according of the name of the file. Use wille
use the method NLS.bind: the strings would become "You can not delete
the file {0} in this directory", and you will have to change your code
to something like NLS.bind(Messages.yourMessage, thefilename).
Plugin.xml part of the code can also be translatable: you need to
change the Manifest file and add the line
Bundle-Localization: plugin
(plugin is the name of the .properties file which contains the
translatable stuff, so your .properties file in this case is
plugin.properties)
In the plugin.xml, you will replace all the translatable strings
with %the.key to get it translated according to the keys in the
plugin.properties file.
You may add to the build directory the properties file
Once you have make your plugin "translatable", you may way to contribute to your plugin with language translation other than English like, French or others.
To do so, everywhere you have created a .properties file, you can
copy your the file to a _LanguageID.properties: for example,
message.properties would become message_fr.properties.
This method is working fine but it may be interesting to give the
ability of a pack of languages. To do so, we have to create a set of
fragments (we will name them name_of_the_plugin.nl) that contain all the
other .properties file, following the same tree structure of all the
parents plugins (that the fragment are extending).
A user form in Nuxeo is defined by a specific schema with specific attributes. Most of the time, this schema won't changed but in some situation, Nuxeo may have been customised with other attributes or new ones.
The easy and current way to customize this schema in the RCP so that
it reflects with the one in the Server is to use the extension point
"org.nuxeo.ecm.rcp.usermanager.userFormsContributor".
At the moment, the only attributes that won't be touched are username and password. It has been told that these attribute are must be present in every ECM application for a user. For the other attributes, it's really up to you and the existing customized Nuxeo user schema on the server side.
If you just want to add attributes to the default schema, you'll just have to create a new plugin that extend the extension point and contribute new attributes from there.
If you don't want to use the default configuration, you can
disable the fragment
"org.nuxeo.ecm.rcp.usermanager.userformcontribution" which contain an
extension with the default attributes. You'll will then create brain new
plugin that contains ALL the attributes of the user (except username and
password of course).
Each "org.nuxeo.ecm.rcp.usermanager.userFormsContributor"
extension will provide a class that implements
"org.nuxeo.ecm.usermanager.utils.IUserFormContributor". This class will
define the way forms will retrieve data, display data and update data:
viewFormAddFields() will provide Fields associated with their
key to the view form.
editFormAddFields() will provide Fields associated with their
key to the edit and add form.
loadFromObject() will load data and provide it to the
form.
saveToObject() will save data from the form.
validate() will return a message if there is a problem in the
filled form
You may look at the javadoc comments of IUserFormContributor for
more details. Here is the default configuration you can use as a
template for new contributor:
package org.nuxeo.ecm.rcp.usermanager.userformcontribution;
import java.util.ArrayList; import java.util.Arrays;
import java.util.List; import org.nuxeo.ecm.core.api.NuxeoPrincipal;
import org.nuxeo.ecm.usermanager.utils.FieldItem;
import org.nuxeo.ecm.usermanager.utils.IUserFormContributor;
import org.nuxeo.ecm.usermanager.utils.UserManagerHelper;
import org.nuxeo.forms.utils.Form;
import org.nuxeo.forms.utils.LabelField;
import org.nuxeo.forms.utils.ListField;
import org.nuxeo.forms.utils.TextField;
public class DefaultUserFormContributor implements IUserFormContributor {
public static final String FIRSTNAME = "firstname"; //$NON-NLS-1$
public static final String LASTNAME = "lastname"; //$NON-NLS-1$
public static final String COMPANY = "company"; //$NON-NLS-1$
public static final String EMAIL = "email"; //$NON-NLS-1$
public static final String GROUPS = "groups"; //$NON-NLS-1$
public List<FieldItem> viewFormAddFields() {
ArrayList<FieldItem> list = new ArrayList<FieldItem>();
list.add(new FieldItem(LASTNAME, new LabelField( Messages.DefaultUserFormContributor_lastname)));
list.add(new FieldItem(FIRSTNAME, new LabelField( Messages.DefaultUserFormContributor_firstname)));
list.add(new FieldItem(COMPANY, new LabelField( Messages.DefaultUserFormContributor_company)));
list.add(new FieldItem(EMAIL, new LabelField( Messages.DefaultUserFormContributor_email)));
list.add(new FieldItem(GROUPS, new LabelField( Messages.DefaultUserFormContributor_groups, UserManagerHelper.getGroups())));
return list;
}
public List<FieldItem> editFormAddFields() {
ArrayList<FieldItem> list = new ArrayList<FieldItem>();
list.add(new FieldItem(LASTNAME, new TextField( Messages.DefaultUserFormContributor_lastname)));
list.add(new FieldItem(FIRSTNAME, new TextField( Messages.DefaultUserFormContributor_firstname)));
list.add(new FieldItem(COMPANY, new TextField( Messages.DefaultUserFormContributor_company)));
list.add(new FieldItem(EMAIL, new TextField( Messages.DefaultUserFormContributor_email)));
list.add(new FieldItem(GROUPS, new ListField( Messages.DefaultUserFormContributor_groups, UserManagerHelper.getGroups())));
return list;
}
public void loadFromObject(NuxeoPrincipal principal, Form form) {
form.set(LASTNAME, principal.getLastName());
form.set(FIRSTNAME, principal.getFirstName());
form.set(COMPANY, principal.getCompany());
form.set(EMAIL, principal.getModel().getProperty("user", EMAIL)); //$NON-NLS-1$
List<String> listGroup = principal.getGroups();
String s[] = listGroup.toArray(new String[listGroup.size()]);
form.set(GROUPS, s);
}
public void saveToObject(NuxeoPrincipal principal, Form form) {
principal.setLastName((String) form.get(LASTNAME));
principal.setFirstName((String) form.get(FIRSTNAME));
principal.setCompany((String) form.get(COMPANY));
principal.getModel().setProperty( "user", EMAIL, (String) form.get(EMAIL)); //$NON-NLS-1$
String[] strings = (String[]) form.get(GROUPS);
if (strings != null) {
principal.setGroups(Arrays.asList(strings));
}
}
public String validate(Form form) {
String email = (String) form.get(EMAIL);
if (email == null || email.trim().length() == 0) {
return Messages.DefaultUserFormContributor_validationEmail;
}
return null;
}
}
The Nuxeo open source ECM platform is developed and published by Nuxeo SAS, a company with offices in France and the UK.
Through our commercial offer, Nuxeo Connect, we deliver enterprise-grade functional and technical support, certified software patches and updates, and management tools that assist you during every stage of the application life-cycle - from design and development, throughout testing and deployment, to operations and monitoring. Nuxeo Connect helps reduce business and technical risks, increase productivity, speed time to deployment and improve your success rate for all Nuxeo-based projects.
We're also happy to work with partners, IT Integrators or ISVs, to deliver the best possible applications to customers.
© 2001-2007 Nuxeo SAS.