Running/Debugging your Views

Introduction

To get the QualiPSo Factory running in production mode, follow the steps detailed in the Environment installation page.

To get it running in a development mode (via Eclipse) for debugging a view in particular or just run the module without making a new war for production mode, there are two different ways :

  1. Test your module alone in eclipse (Single View Mode) : you can take advantage of all Dev. Mode's functionalities (automatic refresh, debugger, etc), but without any connection with other modules (except OpenParts and QGWT).
  2. Test your module inside the whole UI in eclipse (Whole Factory Mode) : you can take Advantage of Dev. Mode AND still get all connection with all modules.

Be sure that the first configuration step of the development guidelines has been achieved. Then, a run/debug configuration has to be set as below (depending on the mode you want to use).

Running/Debugging in the Single View Mode

Files configuration

In order to be able to run/debug the view you want (so, display it in a web browser) you first need to configure three files (their location is detailed in the module tree).

ProjectDev.gwt.xml

The entry point of the debug mode is that file. So, your module has to inherit the OPContainer class.

<module rename-to='projectdev'>
        <inherits name="org.qualipso.factory.ui.shared.OpenParts.OPContainer" />
</module>
web.xml

That file is needed by the Jetty server (included inside Eclipse).

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
        
        <display-name>Factory UI Project service test</display-name>
        
        <servlet>
                <display-name>ProjectServlet</display-name>
                <servlet-name>ProjectServlet</servlet-name>
                <servlet-class>org.qualipso.factory.ui.service.project.server.ProjectServletImpl</servlet-class>
        </servlet>

        <servlet-mapping>
                <servlet-name>ProjectServlet</servlet-name>
                <url-pattern>/project/project</url-pattern>
        </servlet-mapping>
</web-app>
index.html

That html file has to be configured in order to specify which view will be debugged. There are for main parameters :

  1. part_name: the service name defined via the @OPServiceName annotation
  2. part_resource (optional): the resource name defined via the @OPResourceName annotation (you can have several objects inside the model/ folder)
  3. part_view: the view name defined via the parameter actionName in the @OPViewFactory annotation
  4. part_params (optional): the parameters eventually needed by the view (the syntax used : "[paramName1], [paramValue1], [paramName2], [paramValue2] (...)")
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
        <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
        <meta http-equiv="Content-Style-Type" content="text/css" />
        <meta http-equiv="Content-Script-Type" content="text/javascript" />
        
        <meta http-equiv="imagetoolbar" content="no" />
        
        <meta name="author" content="Jerome Blanchard, Christophe Bouthier" />
        <meta name="copyright" content="copyright 2009-2010 - INRIA" />
        
[1]     <meta name="part_name" content="project" />
[2]     <meta name="part_resource" content="project" />
[3]     <meta name="part_view" content="update" />
[4]     <meta name="part_params" content="path, /" />
        <script type="text/javascript" src='projectdev/projectdev.nocache.js'></script>
        
        <title>Factory UI - Test page for Project service</title>
</head>
<body id="factory.qualipso.org">

        <iframe src="javascript:''" id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>

</body>
</html>

Eclipse configuration

So, the configuration inside Eclipse is the following one:

Click on Run > Run/Debug Configurations... > Web Application > New
First step: Set the Main class

The Project field is the name of the package which you want to debug (here, factory-ui-service-project). The Main class field is always com.google.gwt.dev.DevMode.

Second step: Choose a server

For that run/debug mode, we use the Jetty server included in Eclipse. So, set the checkbox Run built-in server.

Third step: Set the development modules

We just use Project and ProjectDev modules.

Forth step: Set the arguments

In the (x)=Arguments tab, add Program arguments and VM arguments (be aware that the environment variable $PROJECTS_FOLDER have to be modified regarding your own environment).

Program arguments:

-port 8888 -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -startupUrl index.html -logLevel INFO -war 
$PROJECTS_FOLDER/factory-ui/factory-ui-service-project/war org.qualipso.factory.ui.service.project.Project 
org.qualipso.factory.ui.service.project.dev.ProjectDev

VM arguments:

-Xmx512m
Fifth step: Configure the Classpath

In that mode, only your module and the two frameworks projects (OpenParts and QGWT) have to be set here. So, do as follow :

Click on Add projects... (for OpenParts and QGWT)

Click on Advanced... 
        Select the following folders for each module :
                src/main/java
                src/main/webapp
                src/main/resources
                target/generated-sources/gwt
Sixth step: Launch
Click on Run/Debug

Then, the Development Mode tab appear in the bottom. Just copy/paste the URL provided in your internet browser (the GWT browser plugin is required).

Running/Debugging in the Whole Factory Mode

In order to do this, you need to have deployed the whole UI at least once on JBoss (so that GWT Dev. Mode can recognize the modules).

For the server part, each required project has to be compiled, as explained in the Server Environment Installation page.

For the UI part, you need to compile things in order (cf. UI Environment installation). Then, an EAR is generated and can be deployed on a JBoss server.

Eclipse configuration

So, the configuration inside Eclipse is the following one:

Click on Run > Run/Debug Configurations... > Web Application > New
First step: Set the Main class

The Project field is the name of the main project (factory-ui-core). The Main class field is always com.google.gwt.dev.DevMode.

Second step: Choose a server

For that run/debug mode, we don't use the Jetty server included in Eclipse because we are using the JBoss one outside Eclipse. So, unckeck the checkbox Run built-in server.

Third step: Set the development modules

We just use the modules included in the main project (factory-ui-core) :

  1. Security
  2. Membership
  3. Main
  4. Login
  5. Core
  6. CoreDev

You have to specify the URL of the running factory on the external JBoss (here, http://localhost:8080/factory/).

Forth step: Set the arguments

In the (x)=Arguments tab, add Program arguments and VM arguments (be aware that environment variables $JBOSS_HOME and $PROJECTS_FOLDER have to be modified regarding your own environment).

Program arguments:

-noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -startupUrl http://localhost:8080/factory/ -logLevel INFO -war 
$PROJECTS_FOLDER/factory-ui/factory-ui-core/war org.qualipso.factory.ui.core.core.Core org.qualipso.factory.ui.core.dev.CoreDev 
org.qualipso.factory.ui.core.login.Login org.qualipso.factory.ui.core.main.Main org.qualipso.factory.ui.core.membership.Membership 
org.qualipso.factory.ui.core.security.Security org.qualipso.factory.ui.shared.OpenParts.OPContainer org.qualipso.factory.ui.shared.QGWT.QGWT 
org.qualipso.factory.ui.service.git.Git org.qualipso.factory.ui.service.project.Project org.qualipso.factory.ui.service.issuetracker.IssueTracker

VM arguments:

-Xmx512m -Dqualipso.factory.config=$JBOSS_HOME$/server/default/conf/factory.config
Fifth step: Configure the Classpath

In that mode, all the modules and the two frameworks projects (OpenParts and QGWT) have to be set here. The required projects are the following ones:

  1. factory-ui-core
  2. factory-ui-shared-OpenParts
  3. factory-ui-shared-QGWT
  4. factory-ui-service-project
  5. factory-ui-service-issuetracker
  6. factory-ui-service-git

So, do as follow :

Click on Add projects... (for all required projects)

Click on Advanced... 
        Select the following folders for each required module :
                src/main/java
                src/main/resources
                target/generated-sources/gwt
Sixth step: Launch
Click on Run/Debug

Then, the Development Mode tab appear in the bottom. Just copy/paste the URL provided in your internet browser (the GWT browser plugin is required). The JBoss server has to be running with the EAR generated first.

Frequently Asked Questions

Problem: ServletAsync cannot be resolved...

  • The "generated-sources/gwt" directory is not automatically added to the build path (for some reason; it should, according to the maven-gwt plugin; although it probably isn't completely integrated into eclipse). Add it as a source directory.

Problem: How to run it?

  • See section Testing a View Alone in Dev. Mode.

Problem: tried with 'gwt:run' (just out of curiosity) but got:

[WARNING] Your POM <build><outputdirectory> does not match your hosted webapp WEB-INF/classes folder for GWT Hosted browser to see your classes.
...
...
  • You MUST specify the GWT module to run using -Dgwt.module

Question: The list of files appeared, but not the rewritten URL. To see the initial page I had to remove the 'main' from the end of the address: 'http://localhost:8081/factory-ui-1.0-SNAPSHOT/main'.

  • In fact, the first time you load http://localhost:8081/factory-ui-1.0-SNAPSHOT/, you should get a list of file, but you don't need to change anything on the url. If you do a reload of the http://localhost:8081/factory-ui-1.0-SNAPSHOT/ URL (and NOT on the page), you will get the ui. It is important NOT to do a page reload (which will reload the page with the file list), but to RE-ENTER the correct url (http://localhost:8081/factory-ui-1.0-SNAPSHOT/).

    The problem is that, when passing this url, the web server should read one element in the web.xml config file of factory-ui, and DIRECTLY go to the main module and load its index page. And this is working... almost. This is working but NOT the first time.

    Right now, we don't know exactly why (this is on the list of things to investigate).