
Use the following instructions to install the WebDSL Eclipse plugin, the plugin also contains the compiler.
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
The plugin includes a new project wizard which will help you get started using WebDSL:
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.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.
If you encounter issues when running the plugin, here are a few things that you should check or try:
https://mailman.st.ewi.tudelft.nl/listinfo/webdsl and report your issue, or go to the #webdsl channel on irc.freenode.netThe 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.
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
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.
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 is automatically built as a Nix package for Mac.
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).
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
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
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
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
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&
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 compilation from source on Mac OS X (tested on version 10.5 Leopard and 10.6 Snow Leopard).
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).
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
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
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
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
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
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
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
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&
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.
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.
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