Development Tools
From OpenLaszlo
Contents |
Laszlo-Specific Editors
Also see Editing LZX for tips on configuring generic text and XML editors to edit LZX code.
IDE4Laszlo
IDE for Laszlo is an Eclipse-based development environment for creating, editing, debugging, and testing applications based on the LZX declarative mark-up language.
As of 04/2008, there is a new contribution from Syte GMBH to the OpenLaszlo project.
They have provided a significant update to IDEforLaszlo plugin to support OpenLaszlo 4.0.10 and 3.4. The IDEforLaszlo plugin has also been updated to work with the latest release of the ATF bundle (Eclipse 3.3.0, Java6). Included are several distribution bundles, with Release Notes, and easy to install Eclipse RCP versions for Windows and Linux.
Additional local information: IDE4Laszlo wiki page
Spket IDE
Spket IDE is a powerful toolkit for JavaScript and XML development with Laszlo support built on top of Eclipse RCP(Rich Client Platform).
It is small and easy to install, with syntax highlighting, code completion for XML and JavaScript. Free for non-commercial use.
OpenLaszlo plugin for the NetBeans IDE
New @ May 2008. Requires NetBeans 6.1 & supports OpenLaszlo 4.0.12. NetBeans 6.1 has an excellent XML editor and Javascript editor, so it is easy to edit .lzx files. It is easy to deploy OpenLaszlo application to any application server such as Tomcat, GlassFish and so on.
Current feature list - screenshots
- "OpenLaszlo-4.0.12" web app from the base 4.0.12 distribution available under Samples | Web as a NetBeans web project
- "OpenLaszlo-4.0.12-servlet" web app available as a new web project template under Projects -> Web
- OpenLaszlo 4.0.12 library installed into the Libraries list of Netbeans
- support for recognizing LZX files in the XML editor (with full Navigator support and code completion, if the DTD is present in the file)
- wizards for creating new empty canvas and view LZX files
- Provides XML-code code completion (assuming the DTD is present)
LaszloParty
LaszloParty is a free IDE for OpenLaszlo developers, written in Python. This project started end of 2007. It is in an early stage, uses WxPython as GUI Framework. The Code is very slim, about 1000 lines. Contributors welcome. Confirmed to run on Windows, Linux.
Features:
- parses all .lzx files in server directory, also the custom made ones.
- XML-Editor (Laszlo-Auto-Completion, Lexing, Syntax-Check, Pretty-Print ...)
Caution: This is a preview release with very low functionality! Windows Install instructions: (provided because of mislaeding things @ website)
- Download OpenLaszlo Server Rel. 4.0.10
- Install the OpenLaszlo server at the default location "C:\Program Files\OpenLaszlo Server 4.0.10\Server"
- Download file: LaszloPartyEarlyPreview.zip (rightclick-save-as & add .zip ending)
- Download file: lnx.rng file (this file contains a patched version of the openlaszlo grammar)
- place "lnx.rng" at "C:\Program Files\OpenLaszlo Server 4.0.10\Server\lps-4.0.10\tools\lnx.rng"
- unpack LaszloPartyEarlyPreview.zip in any folder and start "LaszloParty.exe"
- if the program extends the screen space (as on my lappy, can't see the menu), press alt+space, and click maximize
Documentation Tools
LazDoc
A C# apllication to generate a doc System FOR laszlo IN laszlo
Feb 2005, Washington Publishing Company:
"In working with Laszlo, we found the need to generate documentation from our code. Doing some looking around the Laszlo Site, there are a lot of tools, but we did not see anything to help us generate documents. This led us down the path of building a Laszlo Document Builder."
Additional local information: LazDoc wiki page
LzxdocTool
Lzxdoc is a fairly simple, Python based tool that will traverse your LZX source tree and generate HTML documentaiton for the files within, much like Javadoc. It uses a stripped-down version of the documentation syntax seen in LFC files. It does not support live inline examples, HTML templates, inheritance, and probably a bunch of other stuff.
Additional Local Information: LzxdocTool wiki page
For Implementors
This section is about editing non-LZX sources.
Eclipse
Getting Eclipse
Download from http://www.eclipse.org/. BitTorrent can be faster than the http/ftp servers and mirrors.
http://www.eclipseplugincentral.com/ is a directory of plugins.
Editing Java
I think you need to create a new project file. Anyone want to check this in?
Debugging Java
What follows are instructions for source-level debugging of the LPS server. There may be other ways to make this work, but this is the first one.
- Copy
WEB-INF/lps/server/srctoWEB-INF/lps/server/build/src(this is required because eclipse requires all the source for an "external" jar to be under one folder).
- Add the following to the vm params to startup java: (these work for 1.3, I think they may be different for 1.4).
-Xdebug -Xint -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999
- Add debug="true" to the javac task in WEB-INF/lps/server/build.xml
- cd $LPS_HOME; ant install
- Install and run eclipse 3.0 against a 1.4 vm (eclipse reaquires 1.4 and won't listen to JAVA_HOME; use -vm option).
- create a project that includes as external jars everything from our
$LPS_HOME/WEB-INF/lib - Run->Debug...->Remote Java Application
- create a project that includes as external jars everything from our
+ localhost:9999
- Click 'debug'
- Use the Java perspective and rightlick on the lps.jar to get properties and associate
WEB-INF/lps/server/build/srcas the source dir for this jar. - Browse the java source and select a place for your first breakpoint. For example, LZServlet.doGet().
- Go to your web browser and hit an url like examples/hello.lzx and voila, source level debugging.
We can actually use some of this to connect to a remote server somewhere, too. In a pinch, this may be helpful for debugging deployed servers, if we can have port 9999 open (or we choose another port).
NOTE!! In this config, you have to be careful if you wanna use eclipse to edit the java src... because it's pointed to the build/src directory and not the location of the actual source. Any edits need to be moved back to server/src or they'll be lost.
Ahh...source level debugging...
I'll make some changes in the build system so we can remove the first 3 steps in the future. We'll need to leave around a debug version of the lps.jar.. maybe make a debug version of lps_noship.jar as well so we can easily debug java Mains. And an optional ant property to set up tomcat for debugging.
Emacs
Packages
Oliver uses the JDE (Java Development Environment) http://jdee.sunsite.dk/. It (and many other packages) are standard with !XEmacs.
There's a perforce mode at http://p4el.sourceforge.net/p4.el.html.
Tabs
Henry: "I also found this useful, it obliterates tabs when you save a (java) file."
(defun java-mode-untabify ()
(save-excursion
(goto-char (point-min))
(if (search-forward "\t" nil t)
(untabify (1- (point)) (point-max))))
nil)
(add-hook 'java-mode-hook
'(lambda ()
(make-local-variable 'write-contents-hooks)
(add-hook 'write-contents-hooks 'java-mode-untabify)))
(add-hook 'html-mode-hook
'(lambda ()
(make-local-variable 'write-contents-hooks)
(add-hook 'write-contents-hooks 'java-mode-untabify)))
(setq indent-tabs-mode nil)
Python
This fixes fill-paragraph for python-mode comments. python-fill is in Oliver's sandbox.
(eval-after-load "python-mode"
'(progn (load-library "python-fill")))
(add-hook 'python-mode-hook
(lambda ()
(setq fill-paragraph-function 'python-fill-paragraph-new)))
Perforce
These changes make indenting work properly in Perforce meta-data buffers. Tip o' the pin to: jik@kamens.brookline.ma.us.
(setq perforce-tmp-file-regexp "\\`\\(/var\\|/usr\\|/private\\)?/tmp/tmp\\.[0-9]+\\.[0-9]+$"
perforce-tmp-buffer-regexp "^# A Perforce .* Specification\\.$")
(setq auto-mode-alist
(append (list (cons perforce-tmp-file-regexp 'text-mode))
auto-mode-alist))
(defun maybe-perforce-text-mode ()
(save-excursion
(if (and buffer-file-name
(string-match perforce-tmp-file-regexp buffer-file-name)
(goto-char (point-min))
(looking-at perforce-tmp-buffer-regexp))
(setq indent-tabs-mode t
fill-prefix "\t"))))
(add-hook 'text-mode-hook 'maybe-perforce-text-mode 'append)
If you use NTEmacs on Windows, here is a emacs file CygwinDotEl that lets you run the Cygwin shell using M-x cygwin and then M-x shell
XML Tools
- An [XML Pretty Printer | http://software.decisionsoft.com/software/xmlpp.pl ] written in Perl
- Also see [1] xmldiff tool

