Login | About | Page IndexHome | Manual | Publications | Download | Support

Download


WebDSL in Eclipse

Use the following instructions to install the WebDSL Eclipse plugin, the plugin also contains the compiler.

Eclipse with plugin pre-installed

For quick setup, zipped eclipse installations are available with the plugin pre-installed:

Windows: http://webdsl.org/eclipse.zip

Linux: http://webdsl.org/eclipselinux.tar.gz

Mac: http://webdsl.org/eclipsemac.tar.gz

Eclipse 3.5 manual plugin install

  • Go to Help -> Install New Software...
  • In the "Work with:" text area type: http://webdsl.org/update. Important: uncheck "Group items by category" to make the plugin visible (this works around a known issue)
  • Check "WebDSL Editor" and press "Install", accept the license agreement, finish the installation, and finally restart Eclipse.

Eclipse 3.4 manual plugin install

  • Go to Help -> Software Updates...
  • In the "Available Software" tab, click "Add Site..." and enter: http://webdsl.org/update
  • Check "WebDSL Editor" and press "Install", accept the license agreement, finish the installation, and finally restart Eclipse.

Project Wizard

The plugin includes a new project wizard which will help you get started using WebDSL:

  • Right-click in the package explorer and select New -> Project...
  • Select WebDSL project and click next
  • Enter project name (project name in eclipse workspace) and application name (for the WebDSL application).
  • Select either MySQL or Sqlite database and enter the required database info (Sqlite is only for quick testing, use MySQL if you can).
  • Check "overwrite database when deployed" and click Finish
  • The WebDSL project is created and a first build is executed.
  • Right-click the project and select 'Run as...' -> 'Run on server'
  • Add an apache tomcat 6 server (point it to an extracted binary distribution, available here)
  • The application is deployed on tomcat. Manage the server using the 'Servers' eclipse view.
  • Go to http://localhost:8080/{applicationname} to see the result.
  • Make changes to the app and build the project (ctrl+alt+b or cmd+alt+b), it is automatically deployed.
  • You can also use the eclipse-build ant command (drag build.xml to Ant view) for a full build, or eclipse-build-code-only to only build the WebDSL code but not copy the project resources to the deployed directory. eclipse-build is the default target for a build of the project.

Migrating from previous version of the plugin

Since the plugin is being changed a lot at this point, updating the plugin may require a migration of old projects. Simply use the wizard to create a new project and copy the application.ini, *.app webdsl files, and any static content such as images and javascript files to the new project.

Troubleshooting

If you encounter issues when running the plugin, here are a few things that you should check or try:

  • Do you have a Java JDK 6 installed?
  • Have you tried installing the plugin in a clean Eclipse classic distribution?
  • "Transaction not successfully started" error in log -> check db settings in application.ini, see App Configuration
  • "Dispatchservlet class not found" -> rebuild the project and check whether automatic project build of eclipse is enabled
  • Currently, renaming the project in eclipse is not fully supported, check .settings/. files and application.ini for project references if you want to rename.
  • Subscribe to https://mailman.st.ewi.tudelft.nl/listinfo/webdsl and report your issue, or go to the #webdsl channel on irc.freenode.net

WebDSL on Java

The WebDSL compiler runs on the Java Virtual Machine. The latest WebDSL Java version is automatically build on our buildfarm. Download the zip file of the latest succesful build at http://hydra.nixos.org/job/webdsl/trunk/buildJavaZip/latest.

Extract the zip file, and add the webdsl/bin directory to your path.

This requires at least JDK version 6 (http://java.sun.com/javase/downloads/index.jsp).

Apache Ant (http://ant.apache.org/bindownload.cgi) is also required to run the compiler.

WebDSL Java is included in the WebDSL Eclipse plugin, we recommend using the plugin.


WebDSL on Linux (users)

First the nix package manager needs to be installed from nixos.org, which includes standard nix installation packages including Ubuntu/Debian and RPM packages and RPM. You need at least version 0.13.

To start using nix using your regular (non-root) account, do the following:

sudo chown -R $USER:$USER /nix/store /nix/var

Next, run the shell script to configure the correct paths (and add this line to your ~/.bashrc or ~/.profile file):

/etc/profile.d/nix.sh

Finally, install WebDSL using Nix:

nix-channel --add http://hydra.nixos.org/channel/latest
nix-channel --update
nix-env -i webdsl

WebDSL on Linux (developers)

We use the following subversion repository: https://svn.strategoxt.org/repos/WebDSL/webdsls/trunk

Install automake, autoconf, libtool and pkg-config from your favorite package manager. GNU Automake 1.10.2 and GNU Autoconf 2.63 do the job in Ubuntu.

Install Nix (described here) and use it to retrieve

nix-channel --add http://hydra.nixos.org/channel/latest
nix-channel --update
nix-env -i aterm-2.5 sdf2-bundle strategoxt java-front

Note: do not install automake and autoconf using nix, these packages are currently not supported. Instead, install them using your operating system's package manager (e.g., 'sudo apt-get install automake autoconf build-essential' on Debian/Ubuntu-based distributions).

Now add the nix library path to your library search path by adding the following line to your ~/.bashrc or ~/.profile:

export PKG_CONFIG_PATH=~/.nix-profile/lib/pkgconfig

If all the dependencies all successfully installed, you should be able to build WebDSL as follows:

svn co https://svn.strategoxt.org/repos/WebDSL/webdsls/trunk/
cd trunk
./bootstrap
./configure --prefix=/<path where you want to install webdsl>
make
make install
ldconfig

The last two lines should be executed as root, or with sudo.

Troubleshooting

If you forgot to run ldconfig, the dynamic linker will present the following message:

Removing servlet project files and dist directory.
Loading application settings (application.ini)...
Creating Java Servlet application in .servletapp...
Copying your application files...
Building application...
/usr/local/bin/webdslc --servlet -i test.app     
/usr/local/bin/webdslc: error while loading shared libraries: libwebdsl-front.so.0: cannot open shared object file: No such file or directory
make: *** [test.appc] Error 127

On some (64-bit?) systems the default stack size of Linux is too small for successful compilation. In this case, segmentation faults will appear during the Stratego compilation. The following command enables unlimited stack size for processes:

ulimit -s unlimited

WebDSL on Mac (users)

WebDSL is automatically built as a Nix package for Mac.

Nix requirements

Apple Xcode: install from your DVD.

MacPorts: download and install MacPorts. If you already had ports installed, you may need to do an update:

sudo port -d selfupdate

Install the required ports:

sudo port install curl m4 autoconf automake pkgconfig libtool subversion

Add to your ~/.profile:

export PATH=/opt/local/bin/:$PATH

To make sure the ports version of these tools is used instead of the older ones in XCode (assuming the default MacPorts install directory).

Nix installation

The Nix package manager needs to be installed, version 0.13 or higher.

Download the latest nix build: Download -> Latest unstable release -> Source distribution nix-0.13*.tar.gz. Untar it

tar -xzf nix-*.tar.gz

configure it (no --prefix!)

cd nix-*
./configure

and then make && sudo make install.

make && sudo make install

To start using nix using your regular (non-root) account, do the following:

sudo chown -R $USER /nix

Next, run the shell script to configure the correct paths (and add this line to your ~/.profile file):

. /usr/local/etc/profile.d/nix.sh

and restart bash or source the .profile file.

. ~/.profile

WebDSL installation with Nix

Finally, install WebDSL using Nix:

nix-channel --add http://hydra.nixos.org/channel/latest
nix-channel --update
nix-env -i webdsl

To update to the latest version:

nix-channel --update
nix-env -u webdsl

Java 6

You may have to enable Java 6 SE, open

/Applications/Utilities/Java Preferences

to configure your Java version (drag Java 6 SE to the top). Add the JAVA_HOME and PATH environment variables in your ~/.profile file:

export PATH=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands:$PATH
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home

Tomcat

Download Tomcat 6.x, Binary Distributions, Core, tar.gz direct link

extract tar.gz file

tar -xzf apache-tomcat-*.tar.gz

and add bin dir to path, e.g.:

export PATH=/Users/someone/apache-tomcat-6.0.20/bin/:$PATH

and restart bash or source the .profile file.

. ~/.profile

Make the catalina.sh file executable:

chmod +x catalina.sh

Start tomcat using:

catalina.sh run

Mysql

Mysql, tar package

Extract tar.gz file:

tar -xzf mysql*.tar.gz

and add bin dir to path, e.g.:

export PATH=/Users/someone/mysql*/bin/:$PATH

Start mysql using:

mysqld&

Known Mysql installation issues

If extracting the tar and running mysqld directly results in errors, try installing mysql using the .DMG and starting it using the prefpane or startup item included in the installation.


WebDSL on Mac (developers)

WebDSL compilation from source on Mac OS X (tested on version 10.5 Leopard and 10.6 Snow Leopard).

Nix requirements

Apple Xcode: install from your DVD.

MacPorts: download and install MacPorts. If you already had ports installed, you may need to do an update:

sudo port -d selfupdate

Install the required ports:

sudo port install curl m4 autoconf automake pkgconfig libtool subversion

Add to your ~/.profile:

export PATH=/opt/local/bin/:$PATH

To make sure the ports version of these tools is used instead of the older ones in XCode (assuming the default MacPorts install directory).

Nix installation

The Nix package manager needs to be installed, version 0.13 or higher.

Download the latest nix build: Download -> Latest unstable release -> Source distribution nix-0.13*.tar.gz. Untar it

tar -xzf nix-*.tar.gz

configure it (no --prefix!)

cd nix-*
./configure

and then make && sudo make install.

make && sudo make install

To start using nix using your regular (non-root) account, do the following:

sudo chown -R $USER /nix

Next, run the shell script to configure the correct paths (and add this line to your ~/.profile file):

. /usr/local/etc/profile.d/nix.sh

and restart bash or source the .profile file.

. ~/.profile

Installation of WebDSL requirements with Nix

Install the Stratego/XT packages:

nix-channel --add http://hydra.nixos.org/channel/latest
nix-channel --update

Next, for Mac OS X 10.5 Leopard:

nix-env -i aterm-2.5 java-front sdf2-bundle strategoxt

or for Mac OS X 10.6 Snow Leopard:

nix-env --system-filter x86_64-darwin -i aterm-2.5 java-front sdf2-bundle strategoxt

Then, update your ~/.profile again and add:

export PKG_CONFIG_PATH=~/.nix-profile/lib/pkgconfig

and restart bash or source the .profile file.

. ~/.profile

Checkout and install WebDSL

Do a checkout of the latest version of WebDSL with your favorite subversion client (be it subversion itself, or git-svn):

svn co https://svn.strategoxt.org/repos/WebDSL/webdsls/trunk webdsl

And compile it:

cd webdsls
./bootstrap
./configure --disable-shared --prefix=/usr/local
make
make install

Known Issues When Compiling WebDSL

Under Snow Leopard, the Stratego compiler is missing these two libraries:

/usr/lib/libreadline.6.0.dylib
/usr/lib/libhistory.6.0.dylib

You can fix this by installing the readline libraries with MacPorts and creating symbolic links for the missing libraries:

sudo port install readline
sudo ln -s /opt/local/lib/libreadline.6.0.dylib /usr/lib/
sudo ln -s /opt/local/lib/libhistory.6.0.dylib /usr/lib/

or, if 6.1 but not 6.0 is available (very ugly hack but it works):

sudo ln -s /opt/local/lib/libreadline.6.1.dylib /usr/lib/libreadline.6.0.dylib
sudo ln -s /opt/local/lib/libhistory.6.1.dylib /usr/lib/libreadline.6.0.dylib

Known Issues When Running WebDSL

If you run into segmentation faults when using Snow Leopard (64bit Stratego, also holds for Leopard with 64bit Stratego), the stack size must be set higher, add

ulimit -s 64000

to your ~/.profile and source it.

If WebDSL compiles fine, but running it gives unexpected rule failures (mainly when calling into libraries), it is likely that different of stratego are simultaneously linked. This can be seen in the libtool invocation that the compilation of webdsl shows in the log.

A workaround for this issue: Remove the current stratego version shown by

nix-env -q '*'

with the

nix-env -e strategoxt

command. Then, look up the other version that was being linked, also listed when running

nix-store -qR ~/.nix-profile

And install this version, e.g. if that version is 0.18pre20499:

nix-env --system-filter x86_64-darwin -i strategoxt-0.18pre20449

Java 6

You may have to enable Java 6 SE, open

/Applications/Utilities/Java Preferences

to configure your Java version (drag Java 6 SE to the top). Add the JAVA_HOME and PATH environment variables in your ~/.profile file:

export PATH=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands:$PATH
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home

and restart bash or source the .profile file.

. ~/.profile

Tomcat

Download Tomcat 6.x, Binary Distributions, Core, tar.gz direct link

extract tar.gz file

tar -xzf apache-tomcat-*.tar.gz

and add bin dir to path, e.g.:

export PATH=/Users/someone/apache-tomcat-6.0.20/bin/:$PATH

and restart bash or source the .profile file.

. ~/.profile

Make the catalina.sh file executable:

chmod +x catalina.sh

Start tomcat using:

catalina.sh run

Mysql

Mysql, tar package

Extract tar.gz file:

tar -xzf mysql*.tar.gz

and add bin dir to path, e.g.:

export PATH=/Users/someone/mysql*/bin/:$PATH

Start mysql using:

mysqld&

Known Mysql installation issues

If extracting the tar and running mysqld directly results in errors, try installing mysql using the .DMG and starting it using the prefpane or startup item included in the installation.


Using WebDSL

The installation of WebDSL will result in a webdsl script and a directory with templates being added to your install location. The script is used to invoke the compilation and deployment of WebDSL applications.

In your console, go to the location of the main .app file and invoke the webdsl script with

webdsl build

The script uses an application.ini file for configuration. If an application.ini file is not in the current directory, the script will offer an interactive way to generate it. If the application.ini is available it will be used to configure the application with e.g. database connection settings. The compilation begins by creating a .servletapp directory to which the WebDSL template, the application files, and the static resources are copied. Then the actual WebDSL compiler, webdslc, is invoked. This will either produce an error and halt, or it will produce the source code of a java web application. Upon a successful run of the webdsl compiler, the script will compile the java code, and build a war file. This war file can be copied manually to the tomcat /webapps dir, or it can be uploaded through the web deploy interface of tomcat. If the tomcat path is set in application.ini, then

webdsl deploy

will copy the war file to the /webapps directory.

If you have updated webdsl and need to copy the new WebDSL template in .servletapp use

webdsl cleanall

to remove the .servletapp directory (or simply delete it with rm) and then do a build.

The script commands can be combined, e.g.

webdsl cleanall build deploy

to clean the generated directory and its contents, regenerate, and deploy.

Example Application

1 create a hello.app file

hello.app:

application test

define page root(){
  "Hello world"
}

create or generate application.ini:

backend=servlet
tomcatpath=**path to your tomcat directory e.g. /Apps/tomcat/**
appname=hello
dbserver=localhost
dbuser=**mysql user account, e.g. root**
dbpassword=**password**
dbname=webdsldb
dbmode=create-drop
smtphost=localhost
smtpport=25
smtpuser=
smtppass=

2 create the database

mysql -u root -p

create database webdsldb;

exit

3 start tomcat in another shell:

catalina.sh run (stop with cmd/ctrl+c)

or in the background

catalina.sh start (stop with catalina.sh stop)

4 compile and deploy WebDSL app

webdsl cleanall deploy

5 open browser and go to http://localhost:8080/hello


powered by WebDSL