Getting Started

This document will teach you how to setup a new Open SUIT project in Eclipse.

Requirements

This tutorial requires:

  • An Open SUIT distribution,
  • Eclipse with the WTP (Web Tools Platform) plugin. It is bundled with the "Eclipse IDE for Java EE Developers" distribution.
  • A J2EE server compatible with Eclipse (such as a Tomcat for instance),
  • The Open SUIT plugin for Eclipse.

Installing the plugin

Explanations here.

Note: once it's installed, it's available for all of your projects using this Eclipse installation. In other words, you won't have to install it again for other projects.

Setting-up the project from scratch

Here are the steps to follow to create a new Open SUIT project in Eclipse:

  1. Create a dynamic web project
    • > File > New > Project > Web > Dynamic Web Project
      Note: if you use Maven, you'll probably create your project in a Maven way.
  2. Install Open SUIT libraries
    In order to be able to use Open SUIT you'll obviously have to add the libraries (jars) to you classpath.
    Here you have several options:
    1. If you use Maven, simply add the required dependencies to your project pom.xml:
      • Open SUIT Base (required): org.ow2.opensuit:opensuit-core,
      • Open SUIT Spring extension (optional): org.ow2.opensuit:opensuit-spring,
      • Open SUIT Chart extension (optional): org.ow2.opensuit:opensuit-chart,
    2. If you don't use Maven, you may choose to use Open SUIT libraries from the Eclipse plugin:
      • > Project > Properties > Java Build Path > Libraries > Add Library...
      • Select Open SUIT SDK,
      • Next,
      • Select the required version,
      • Finish.
    3. Otherwise, you may prefer to use Open SUIT libraries from the distribution:
      • Download the Open SUIT distribution you plan to use (see here),
      • Then copy the required jars to the /WEB-INF/lib project directory.
  3. Install Open SUIT resources
    • If need be, copy any required Open SUIT extension library and xsd from the Open SUIT /lib/optional directory to your project.
    • Copy some style (css+images) from any Open SUIT sample war (directory /resources) to your project.
  4. Create the root Open SUIT XML file:
    • > File > New > Other... > Open SUIT > Application
    • Choose a name,
    • Finish.
  5. Declare the Open SUIT servlet:
    • Open the /WEB-INF/web.xml file and add the following:
      <servlet>
              <description>The Open SUIT servlet</description>
              <servlet-name>opensuit</servlet-name>
              <servlet-class>
                      org.ow2.opensuit.core.impl.j2ee.OpenSuitServlet
              </servlet-class>
              <init-param>
                      <param-name>xml</param-name>
                      <param-value>
                              /WEB-INF/path/to/your/application.xml
                      </param-value>
              </init-param>
              <load-on-startup>0</load-on-startup>
      </servlet>
                      
      ...
              
      <servlet-mapping>
              <servlet-name>opensuit</servlet-name>
              <url-pattern>/GUI/*</url-pattern>
      </servlet-mapping>
      

That's it !

Setting-up the project from Hello World

In Eclipse, you may also prefer to use the helloworld.war sample distributed along with Open SUIT to create a new Open SUIT project. Here is how to proceed:

  1. > File > Import
  2. Select > Web > WAR File, then Next
  3. Select the WAR file, the Web project name, then a Target runtime, then Next
  4. In the Import page, don't select anything, just press Finish.

Here you go.

Configuring the plugin

Explanations here.

A few advises before starting

Here are some general advises that will help you learn and understand Open SUIT very quickly:

  • First of all, make sure you're using the Eclipse XML editor. Indeed, this editor supports XSD, that will bring you great assistance.
  • Use auto-completion (CTRL-Space)! The Eclipse XML editor will provide very detailed contextual help and edition assistance.
  • Use in-line documentation. The Open SUIT XSDs embed quite a detailed documentation about components and attributes. To see it, just move your mouse pointer over XML elements and attributes.
  • If you prefer, an HTML version of the Open SUIT XML components documentation is also available here.

Now you're ready to go. Enjoy !