Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Warning
titleWarning

This page relates to an older OpenSyllabus Version. Some parts needs revision.

Quick start for developers

...


Note
titleDocument Purpose

If you only want to test OpenSyllabus, you can download a bundle that includes a Tomcat instance configured with Sakai and OpenSyllabus.

This tutorial will show you how to load the OpenSyllabus project into Eclipse.

Anchor
Installation
Installation

Installation Guide

Installation and deployment of OpenSyllabus with Sakai 2.5 and GWT 1.5

1) First of all, a working installation of Sakai 2.5 is mandatory prior to install OpenSyllabus but at this time, OSYL is not synchronized with Sakai 2.5 trunk, thus you will need to download a bundle corresponding to a specific snapshot of Sakai 2.5 (see below).

That said, if you never have installed the Sakai Development Environment, you should read and follow the instructions at the following address. This will allow you to install and configure Subversion, Maven, Eclipse and Tomcat.

Tip
titleInstallation of Sakai 2.5 Development Environment

see http://confluence.sakaiproject.org/confluence/display/BOOT/Development+Environment+Setup+Walkthrough)

2) Next, get the OpenSyllabus source-code

The OpenSyllabus source code is not yet available from a Subversion repository but here is how to download it as an archive.

Tip
titleDownload OpenSyllabus source code

Download the 2 following zip archives: osyl-sakai-src-alpha.zip (36 MB) and osyl-src-alpha.zip (2 MB).

Extract  osyl-sakai-src-alpha.zip first, it will create a folder osyl-sakai25 then extract osyl-src-alpha.zip in that folder.

3) You also need to install the Google Web Toolkit (GWT) library on your PC

Tip
titleDownload GWT

GWT library is available here: http://code.google.com/webtoolkit/download.html.
GWT version 1.5.2 (shipping release) is mandatory.

4) Create an environment variable called GWT_HOME

The GWT_HOME environment variable must point to your GWT installation directory.

Considering <path>, the path to the GWT installation directory

Tip
titleCreate GWT_HOME environment variable

Windows: Via the Control Panel -> System -> Advanced -> Environment Variables -> System Variables -> New
and type GWT_HOME and the <path> in the appropriate fields

Linux (Bourne, Bash, and related shells):
export GWT_HOME=<path>

5) Next, get and install the google-web-toolkit-incubator library
In fact, OSYL uses some UI components (i.e. Calendar) from the GWT incubator library.
Look at this library to find some more cool GWT components.
This JAR is compatible with jvm 1.5+ and GWT version 1.5.2 is mandatory.

Tip
titleInstall the google-web-toolkit-incubator

GWT incubator library can be download from here

Put the gwt-incubator_1-4_final.jar into your GWT base directory (i.e. GWT_HOME)

6) Don't forget to put a copy of the gwt-user.jar into the TOMCAT shared/lib directory

Considering <GWT_HOME>, the path to the GWT installation directory
Considering <TOMCAT_HOME>, the path to the TOMCAT installation directory

Tip
titlePut a copy of the gwt-user library into TOMCAT shared

<GWT_HOME>/gwt-user.jar into <TOMCAT_HOME>/shared/lib

7) Next, you have to compile the JCR module first

Considering <SAKAI_HOME>, the path to the Sakai installation directory (osyl-sakai25 in our case)
Use this MAVEN command from the Sakai's base directory (i.e. <SAKAI_HOME>)

Tip
titleCompile the JCR module

cd <SAKAI_HOME>
cd jcr
mvn clean install -Dmaven.test.skip=true

8) Then compile and deploy Sakai for the first time with this command :

Considering <TOMCAT_HOME>, the path to the TOMCAT installation directory

Tip
titleCompile the Sakai project

cd ..
mvn clean install sakai:deploy -Pmini -Dmaven.test.skip=true -Dmaven.tomcat.home=<TOMCAT_HOME>

9) For subsequent compilations and deployment, you can use this command :

Considering <TOMCAT_HOME>, the path to the TOMCAT installation directory

Tip
titleFurther compilation of the Sakai project

mvn install sakai:deploy -Dmaven.test.skip=true -Dmaven.tomcat.home=<TOMCAT_HOME>

Anchor
EclipseConfig
EclipseConfig

Eclipse Configuration

Perhaps the greatest advantage of using GWT is having the capability to leverage advanced software engineering and use established Java integrated development environment (IDE).
We suggest to use the Eclipse IDE since it works very well and has support with GWT to help integration.

Create a configuration variable called GWT_HOME and pointing to your GWT installation directory.

Add a path to the gwt-incubator_1-4_final.jar library

Anchor
CodeStructure
CodeStructure

OpenSyllabus Code Structure

Let's have a look at the OpenSyllabus code structure.

  • Sakai Source Code Structure
    • osyl-core-gwt (Frontend project (GWT code)
      • client
      • public
      • shared
    • osyl (Backend project (Sakai's , ie OSYL-Sakai tool code)
      • api dir
      • impl dir
      • tool dir

...

Package

Purpose

tool/src/java/

Server-side Java source-code of the Sakai's Tool Package

tool/src/java/org/sakaiquebec/opensyllabus/client/rpc/

The two Service Interfaces required by the GWT RPC mechanism

tool/src/java/org/sakaiquebec/opensyllabus/server/

The Java source-code of the Backing Bean and the Servlet Implementation of the Service required by the GWT RPC mechanism

tool/src/webapp/

Server-side webapp files: index.jsp, WEB-INF, tools config, osylconfigs files and compiled JS & HTML stuff

tool/src/webapp/WEB-INF/

Webapp configuration files: web.xml and applicationContext.xml

tool/src/webapp/org.sakaiquebec.opensyllabus.OsylEditorEntryPoint

All the Client-side compiled JS & HTML stuff

Anchor
DevCycle
DevCycle

Development Cycle

Thus, the developer can code and debug all in Java by working depending to his needs in the backend project or in the client project.

...

We've found 3 possible use cases:

Image RemovedImage Added

Use case A - client update only

...

In "Hosted Mode", a JVM executes the GWT code as Java bytecode inside a special embedded browser window (before your Java code having been translated into JavaScript).

 
Image Removed Image Added
 
Running GWT Webapp in "Hosted Mode" makes debugging easy following a standard edit-run-debug cycle

  • Edit your source
  • Refresh
  • Check the results
    Tip
    titleTo launch a hosted mode session with OpenSyllabus from Eclipse

    Your startup file is OsylEditorEntryPoint-shell.cmd (select it, right-click on it + Open With + Default Editor).
    It should launch a program from the console.

Deployment in Web Mode

Once tested in "Hosted Mode", you can compile your Java source code to JavaScript the and deploy your Webapp. GWT Webapp that has been deployed is also said to be running in "Web Mode".

In this use case, you have to invoke the JavaScript compilation then move the compiled JavaScript to the backend code. To deploy your Webapp in production, you would move the files in your www/... directory to your web server, e.g. Tomcat Also if your backend code is already deployed in Tomcat, just replace the JavaScript code & HTML by the new one. When compiled the Client-side is now pure JavaScript and HTML.

Tip
titleTo compile your Java source code to JavaScript

Just click on the Compile/Browse button in the embedded browser window Image Removed Image Added
Or open the startup file OsylEditorEntryPoint-compile.cmd (select it, right-click on it + Open With + Default Editor).
It should launch a program from the console.

...

Tip
titleNote

To save time, use hosted mode "Hosted Mode" as much as possible for client code developments, because,it is faster than a GWT compilation.