Helma Logo
main list history

Version 31 by earl on 27. September 2009, 22:54

30You need [Apache Ant][ant] to build Helma NG. Change to the helma-ng directory you just checked out and run ant it with the "jar" `jar` target:
36If this worked then you should now have a file called lib/helma`lib/helma.jarjar`. 
42The new project should have two subdirectories, "src" `src` and "war"`war`. Again, the src `src` dir is only relevant for Java code, as we'll put our JavaScript code directly in war/WEB-INF `war/WEB-INF` and our jar files in war/WEB-INF/lib`war/WEB-INF/lib`.
44Next, copy over some jar files from the Helma NG lib directory to the war/WEB-INF/lib `war/WEB-INF/lib` of your project. You'll probably need the following:
58From the SDK directory, copy demos/new_project_template and rename it to your application's name (say "Demo`Demo`").
60Open Demo/build`Demo/build.xmlxml`, locate the property appengine`appengine.sdk sdk` and modify it so that it points to the path of the SDK root directory on your machine.
65            description="Copies the App Engine JARs to the WAR."
67            flatten="true"
74Again in build`build.xml xml` locate the "war" `war` target and add a dependency on the "copyjars" `copyjars` target so that it looks like:
77            description="Assemble the application directory"
79Run "ant" `ant` in the same directory as "build`build.xml" xml` so that the WEB-INF `WEB-INF` directory will be created.
81Next, copy over some jar files from the Helma NG lib directory to the www/WEB-INF/lib `www/WEB-INF/lib` of your project. You'll probably need the following:
95 1. Copy the modules directory from the Helma NG directory to war/WEB-INF `war/WEB-INF` (or `www/WEB-INF`, if you created the project from the command-line) so that the resulting directory is called `WEB-INF/modules`.
97 2. Copy the demo app from apps/demo Helma NG's `apps/demo` to war/WEB-INF `war/WEB-INF` (or `www/WEB-INF`, respectively) so that the resulting directory is called `WEB-INF/demo`. Note that the demo app contains a symbolic link, which is not supported by Google App Engine. Copying files with `cp -rL` will take care of dereferncing dereferencing the link.
99 3. Copy or move the static directory from within the demo app two levels up to the war directory (war/static)(`war/static` or `www/static`).
105That's it - save all your changes and click on the green Run button in Eclipse or run the dev_appserver.sh script `ant dev_appserver` to start the development server. If everything worked as planned you should be able to access the [demo app](http://helma-ng.appspot.com/) on http://localhost:8080/.

Version 30 by hannes on 21. September 2009, 15:35

28<tt style="font-weight:bold;color:#d33;">git `git clone git://github.com/hns/helma-ng.git</tt>git`
34<tt style="font-weight:bold;color:#d33;">ant jar</tt>`ant jar`
46* <tt style="font-weight:bold;color:#d33;">lib/js`lib/js.jar</tt>jar`
47* <tt style="font-weight:bold;color:#d33;">lib/helma`lib/helma.jar</tt>jar`
48* <tt style="font-weight:bold;color:#d33;">lib/log4j-1`lib/log4j-1.2.15.jar</tt>jar`
81* <tt style="font-weight:bold;color:#d33;">lib/js`lib/js.jar</tt>jar`
82* <tt style="font-weight:bold;color:#d33;">lib/helma`lib/helma.jar</tt>jar`
83* <tt style="font-weight:bold;color:#d33;">lib/log4j-1`lib/log4j-1.2.15.jar</tt>jar`
91 1. Copy the modules directory from the Helma NG directory to war/WEB-INF so that the resulting directory is called <tt style="font-weight:bold;color:#d33;">WEB-INF/modules</tt>`WEB-INF/modules`.
93 2. Copy the demo app from apps/demo to war/WEB-INF so that the resulting directory is called <tt style="font-weight:bold;color:#d33;">WEB-INF/demo</tt>`WEB-INF/demo`. Note that the demo app contains a symbolic link, which is not supported by Google App Engine. Copying files with <tt style="font-weight:bold">cp -rL</tt> `cp -rL` will take care of dereferncing the link.
97 4. Edit <tt style="font-weight:bold;color:#d33;">WEB-INF/web`WEB-INF/web.xml</tt> xml` to look [like the attached file](http://dev.helma.org/static/files/3318/web.xml), or just download and overwrite the file.
99 5. Edit <tt style="font-weight:bold;color:#d33;">WEB-INF/appengine-web`WEB-INF/appengine-web.xml</tt> xml` to look [like the attached file](http://dev.helma.org/static/files/3318/appengine-web.xml), or just download and overwrite the file.
107The setup is much the same as with the Helma NG demo application, only that you point the JackServlet to your own Jack web appliction in <tt style="font-weight:bold;color:#d33;">WEB-INF/web`WEB-INF/web.xml</tt>xml`.
109For example, assuming you have the following simple Jack application in <tt style="font-weight:bold;color:#d33;">app/main`app/main.js</tt>: js`:
115You would then set the <tt style="font-weight:bold;color:#d33;">modulePath</tt> `modulePath` servlet init-parameter in [web.xml](http://dev.helma.org/static/files/3318/web.xml) to <tt style="font-weight:bold;">app</tt>`app`, <tt style="font-weight:bold;color:#d33;">moduleName</tt> `moduleName` to <tt style="font-weight:bold;">main</tt>`main`, and <tt style="font-weight:bold;color:#d33;">functionName</tt> `functionName` to <tt style="font-weight:bold;">handler</tt>`handler`.

Version 29 by hannes on 21. September 2009, 10:59

1#MARKDOWN
2

Version 28 by hannes on 16. September 2009, 17:18

15This article covers two options, one using the Helma NG webapp framework, and one using the *Jack|http://github.com/tlrobinson/jack/tree/master* [Jack] interface for JavaScript web applications.

Version 27 by hannes on 16. September 2009, 17:02

17### Prerequisites: Installing App Engine SDK and Helma NG
40### Creating a new Web App project with the Eclipse plugin
58### Creating a new Web App project from the command line

Version 26 by hannes on 16. September 2009, 16:59

17=== ### Prerequisites: Installing App Engine SDK and Helma NG
40=== ### Creating a new Web App project with the Eclipse plugin
58=== ### Creating a new Web App project from the command line
93=== ### Running Helma NG apps
109=== ### Running Jack apps
125=== ### Attachments

Version 25 by hannes on 16. September 2009, 16:29

1With Google's *announcement|http://googleappengine.blogspot.com/2009/04/seriously-this-time-new-language-on-app.html* of *Java support|http://code.google.com/appengine/docs/java/overview.html* for App Engine there is all of a sudden a very attractive new option for hosting Java based web applications. Of course my first impulse was to check if it would run *Rhino|http://www.mozilla.org/rhino/* and Helma NG (I had little hopes for Helma 1 as it runs a lot of background threads and relies heavily on relational or file based database backends, both of which are not available on App Engine).#MARKDOWN
3To my surprise, Rhino works perfectly out With Google's [announcement][1] of the box, and I only had to make a few changes to Helma NG to get the demo app *running on [Java support][2] for App Engine|http://helma-ng.appspot.com/*. This Engine there is somewhat in contradiction with what *others have found|http://olabiniall of a sudden a very attractive new option for hosting Java based web applications.com/blog/tag/gae/*, and I discovered only later that I Of course my first impulse was partly lucky to check if it would run [Rhino] and Helma NG (I had little hopes for not stomping on any SecurityExceptions, but on the other hand it's by virtue of Rhino not doing Helma 1 as it runs a lot of tricks under the hood, background threads and Helma NG doing all its relies heavily on relational or file reading through a unified *resource framework|http://github.com/hns/helma-ng/tree/10f5c896b0e9d9e2193ee24174d084965400520f/src/org/helma/repository*.based database backends, both of which are not available on App Engine).
5[1]: http://googleappengine.blogspot.com/2009/04/seriously-this-time-new-language-on-app.html
6[2]: http://code.google.com/appengine/docs/java/overview.html
7[rhino]: http://www.mozilla.org/rhino/
8
9To my surprise, Rhino works perfectly out of the box, and I only had to make a few changes to Helma NG to get the demo app [running on App Engine][3]. This is somewhat in contradiction with what [others have found][ola], and I discovered only later that I was partly lucky for not stomping on any SecurityExceptions, but on the other hand it's by virtue of Rhino not doing a lot of tricks under the hood, and Helma NG doing all its file reading through a unified [resource framework][4].
10
11[3]: http://helma-ng.appspot.com/
12[ola]: http://olabini.com/blog/tag/gae/
13[4]: http://github.com/hns/helma-ng/tree/master/src/org/helma/repository
14
10First, install the App Engine SDK for Java as described on the *Google pages|http://code.google.com/appengine/docs/java/gettingstarted/installing.html*[Google pages][gae-install]. Whether you use the Eclipse plugin or the command line SDK shouldn't make a difference. I'm using Eclipse, but things should work in a similar fashion with the command line SDK.
12[gae-install]: http://code.google.com/appengine/docs/java/gettingstarted/installing.html
13
15You can *download [download the latest release|http://github.com/hns/helma-ng/downloads* release][download] or get the current snapshot *from Github|http://github.com/hns/helma-ng/tree/master*[from Github][github], either by clicking the download button or using the following git command:
17[download]: http://github.com/hns/helma-ng/downloads
18[github]: http://github.com/hns/helma-ng/tree/master
19
20You need *Apache Ant|http://ant.apache.org/* [Apache Ant][ant] to build Helma NG. Change to the helma-ng directory you just checked out and run ant it with the "jar" target:
22[ant]: http://ant.apache.org/
23
24
41From here, you have two options: Run an app using the Helma NG webapp framework, or one using the *Jack|http://github.com/tlrobinson/jack/tree/master* [Jack] interface.
43[jack]: http://github.com/tlrobinson/jack/tree/master
44
52    <target name="copyjars"
54      <copy todir="${war.dir}/WEB-INF/lib"
56        <fileset dir="${appengine.sdk}/lib/user"
57          <include name="\*\*/*.jar" />
58        </fileset>
59      </copy>
60    </target>
60    <target name="war" depends="enhance,copyjars"
73From here, you have two options: Run an app using the Helma NG webapp framework, or one using the *Jack|http://github.com/tlrobinson/jack/tree/master* [Jack] interface.
79# 1. Copy the modules directory from the Helma NG directory to war/WEB-INF so that the resulting directory is called <tt style="font-weight:bold;color:#d33;">WEB-INF/modules</tt>.
80# Copy the demo app from apps/demo to war/WEB-INF so that the resulting directory is called <tt style="font-weight:bold;color:#d33;">WEB-INF/demo</tt>. Note that the demo app contains a symbolic link, which is not supported by Google App Engine. Copying files with <tt style="font-weight:bold">cp -rL</tt> will take care of dereferncing the link.
81# Copy or move the static directory from within the demo app two levels up to the war directory (war/static).
82# Edit <tt style="font-weight:bold;color:#d33;">WEB-INF/web.xml</tt> to look *like the attached file|http://dev.helma.org/static/files/3318/web.xml*, or just download and overwrite the file.
83# Edit <tt style="font-weight:bold;color:#d33;">WEB-INF/appengine-web.xml</tt> to look *like the attached file|http://dev.helma.org/static/files/3318/appengine-web.xml*, or just download and overwrite the file.
81That's it - save all your changes and click on the green Run button in Eclipse or run the dev_appserver 2.sh script Copy the demo app from apps/demo to start war/WEB-INF so that the development serverresulting directory is called <tt style="font-weight:bold;color:#d33;">WEB-INF/demo</tt>. If everything worked as planned you should be able to access Note that the *demo app|http://helma-ngdemo app contains a symbolic link, which is not supported by Google App Engine.appspot.com/* on http://localhost:8080/. Copying files with <tt style="font-weight:bold">cp -rL</tt> will take care of dereferncing the link.
83 3. Copy or move the static directory from within the demo app two levels up to the war directory (war/static).
84
85 4. Edit <tt style="font-weight:bold;color:#d33;">WEB-INF/web.xml</tt> to look [like the attached file](http://dev.helma.org/static/files/3318/web.xml), or just download and overwrite the file.
86
87 5. Edit <tt style="font-weight:bold;color:#d33;">WEB-INF/appengine-web.xml</tt> to look [like the attached file](http://dev.helma.org/static/files/3318/appengine-web.xml), or just download and overwrite the file.
88
89That's it - save all your changes and click on the green Run button in Eclipse or run the dev_appserver.sh script to start the development server. If everything worked as planned you should be able to access the [demo app](http://helma-ng.appspot.com/) on http://localhost:8080/.
90
86Helma NG uses *Jack|http://github.com/tlrobinson/jack/tree/master* [Jack] to as web application connector, so you are not bound to use the Helma webapp infrastructure. If you prefer, you can use Helma NG as a container for Jack applications fully compatible with the *ServerJS [ServerJS Securable Modules proposal|https://wikiproposal](https://wiki.mozilla.org/ServerJS/Modules/SecurableModules*org/ServerJS/Modules/SecurableModules).
92    function handler(env)
93      return [200, {"Content-Type": "text/plain"}, ["Hello World!"]];
94    
94You would then set the <tt style="font-weight:bold;color:#d33;">modulePath</tt> servlet init-parameter in *web[web.xml|http://devxml](http://dev.helma.org/static/files/3318/web.xml* xml) to <tt style="font-weight:bold;">app</tt>, <tt style="font-weight:bold;color:#d33;">moduleName</tt> to <tt style="font-weight:bold;">main</tt>, and <tt style="font-weight:bold;color:#d33;">functionName</tt> to <tt style="font-weight:bold;">handler</tt>.

Version 24 by hannes on 13. July 2009, 11:08

82# Edit <tt style="font-weight:bold;color:#d33;">WEB-INF/appengine-web.xml</tt> to look *like the attached file|http://dev.helma.org/static/files/3318/appengine-web.xml*, or just download and overwrite the file.

Version 23 by simono on 04. July 2009, 19:08

52        <include name="**/*\*\*/*.jar" />

Version 22 by hannes on 16. June 2009, 10:20

13You can *download the latest release|http://github.com/hns/helma-ng/downloads* or get a the current snapshot from *Subversion|https://dev*from Github|http://github.helma.org/svn/helma-ng/trunk* or *Git|http://github.com/hns/helma-ng/tree/master*. For Subversion, either by clicking the command is:download button or using the following git command:
15<tt style="font-weight:bold;color:#d33;">svn co https&#58;//dev.helma.org/svn/helma-ng/trunk/ helma-ng</tt>
16
17For Git:
18
21

Version 21 by bard on 30. May 2009, 13:23

27=== Creating a new Web App projectproject with the Eclipse plugin
29Once you have everything in place, create a new, empty App Engine application. With Use the Eclipse plugin you do this using the new project wizard and selecting select "Web Application Project" in the Google category. This will ask you for a project name and a package name. The package name doesn't matter unless you plan to write Java code, but it is required so just enter anything.
34
35* <tt style="font-weight:bold;color:#d33;">lib/js.jar</tt>
36* <tt style="font-weight:bold;color:#d33;">lib/helma.jar</tt>
37* <tt style="font-weight:bold;color:#d33;">lib/log4j-1.2.15.jar</tt>
38
39App Engine has its own web server of course, so you don't need the jetty or servlet jar files.
40
41From here, you have two options: Run an app using the Helma NG webapp framework, or one using the *Jack|http://github.com/tlrobinson/jack/tree/master* interface.
42
43=== Creating a new Web App project from the command line
44
45From the SDK directory, copy demos/new_project_template and rename it to your application's name (say "Demo").
46
47Open Demo/build.xml, locate the property appengine.sdk and modify it so that it points to the path of the SDK root directory on your machine.
48
49Also add the following:
50
51  <target name="copyjars"
52          description="Copies the App Engine JARs to the WAR.">
53    <copy todir="${war.dir}/WEB-INF/lib"
54          flatten="true">
55      <fileset dir="${appengine.sdk}/lib/user">
56        <include name="**/*.jar" />
57      </fileset>
58    </copy>
59  </target>
60
61Again in build.xml locate the "war" target and add a dependency on the "copyjars" target so that it looks like:
62
63  <target name="war" depends="enhance,copyjars"
64          description="Assemble the application directory">
65
66Run "ant" in the same directory as "build.xml" so that the WEB-INF directory will be created.
67
68Next, copy over some jar files from the Helma NG lib directory to the www/WEB-INF/lib of your project. You'll probably need the following:

Version 20 by hannes on 19. May 2009, 14:53

70=== Attachments
71
72

Version 19 by hannes on 19. May 2009, 14:52

47# Copy the modules directory from the Helma NG directory to war/WEB-INF so that the resulting directory is called <tt style="font-weight:bold;color:#d33;">war/WEB-INF/modules</tt>>WEB-INF/modules</tt>.
48# Copy the demo app from apps/demo to war/WEB-INF so that the resulting directory is called <tt style="font-weight:bold;color:#d33;">war/WEB-INF/demo</tt>>WEB-INF/demo</tt>. Note that the demo app contains a symbolic link, which is not supported by Google App Engine. Copying files with <tt style="font-weight:bold">cp -rL</tt> will take care of dereferncing the link.
49# Edit <tt style="font-weight:bold;color:#d33;">war/WEB-INF/web>WEB-INF/web.xml</tt> to look *like the attached file|http://dev.helma.org/static/files/3318/web.xml*, or just download and overwrite the file.
57The setup is much the same as with the Helma NG demo application, only that you point the JackServlet to your own Jack web appliction in <tt style="font-weight:bold;color:#d33;">war/WEB-INF/web>WEB-INF/web.xml</tt>.
65You would then set the <tt style="font-weight:bold;color:#d33;">modulePath</tt> servlet init-parameter in *WEB-INF/web*web.xml|http://dev.helma.org/static/files/3318/web.xml* to <tt style="font-weight:bold;">app</tt>, <tt style="font-weight:bold;color:#d33;">moduleName</tt> to <tt style="font-weight:bold;">main</tt>, and <tt style="font-weight:bold;color:#d33;">functionName</tt> to <tt style="font-weight:bold;">handler</tt>.

Version 18 by hannes on 19. May 2009, 14:51

50# Edit <tt style="font-weight:bold;color:#d33;">war/WEB-INF/web.xml</tt> to look *like this|http://devthe attached file|http://dev.helma.org/static/files/3318/web.xml*, or just download and overwrite the file.
66You would then set the <tt style="font-weight:bold;color:#d33;">modulePath</tt> servlet init-parameter in web*WEB-INF/web.xml xml|http://dev.helma.org/static/files/3318/web.xml* to <code>app</code><tt style="font-weight:bold;">app</tt>, <tt style="font-weight:bold;color:#d33;">moduleName</tt> to <code>main</code><tt style="font-weight:bold;">main</tt>, and <tt style="font-weight:bold;color:#d33;">functionName</tt> to <code>handler</code><tt style="font-weight:bold;">handler</tt>.

Version 17 by hannes on 19. May 2009, 14:48

70<% this.attachments %>

Version 16 by hannes on 19. May 2009, 14:46

5This article covers two options, one using the Helma NG webapp framework, and one using the *Jack|http://github.com/tlrobinson/jack/tree/master* interface for JavaScript web applications. Both are currently unfinished and subject to change, but it's enough to get your feet wet.

Version 15 by hannes on 19. May 2009, 14:45

1<b>NOTE: this guide is out of date already. The servlet name has changed to org.helma.jack.JackServlet, and the servlet parameters to moduleName, functionName, and helmaHome, respectively. I'll update this page as soon as the dust has settled. Sorry for the inconvenience and thanks for checking out Helma NG!</b>
2
14There hasn't been a release of Helma NG in recent times, so you have to You can *download the latest release|http://github.com/hns/helma-ng/downloads* or get it a snapshot from either *Subversion|https://dev.helma.org/svn/helma-ng/trunk* or *Git|http://github.com/hns/helma-ng/tree/master*. For Subversion, the command is:
42From here, you have two options: Run an app using the Helma NG webapp framework, or one using the *Jack|http://github.com/tlrobinson/jack/tree/master* interface. The first is currently subject to major redesign, while the latter is rather unfinished, so choose your tools wisely :-)
48# Copy over the modules directory from the Helma NG directory to the war/WEB-INF so that the resulting directory is called <tt style="font-weight:bold;color:#d33;">war/WEB-INF/modules</tt>.
49# Copy the demo app itself from apps/demo to war/WEB-INF so that the resulting directory is called <tt style="font-weight:bold;color:#d33;">war/WEB-INF/demo</tt>. Note that the demo app contains a symbolic link, which is not supported by Google App Engine. Copying files with <tt style="font-weight:bold">cp -rL</tt> will take care of dereferncing the link.
50# Edit the <tt style="font-weight:bold;color:#d33;">web>war/WEB-INF/web.xml</tt> file in the war/WEB-INF directory to look *like this|http://dev.helma.org/static/files/3318/web-helmaorg/static/files/3318/web.xml*, or just copy download and overwrite the file if you are lazyfile.
52That's it - save all your changes and click on the green Run button in Eclipse or run the dev_appserver.sh script to start the development server. If everything worked as planned you should be able to access the *demo app|http://helma-ng.appspot.com/* on http://localhost:8080/.
54<b>Note:</b> The Helma webapp framework is currently in state of major redesign. If you're looking for a stable development platform I recommend to wait until the upcoming 0.3 release.
55
57Helma NG provides a servlet to run uses *Jack|http://github.com/tlrobinson/jack/tree/master* applications without using Helma's own module to as web application connector, so you are not bound to use the Helma webapp infrastructure. In this modeIf you prefer, you get can use Helma NG as a relatively naked JavaScript runtime that is container for Jack applications fully compliant to compatible with the *ServerJS Securable Modules proposal|https://wiki.mozilla.org/ServerJS/Modules/SecurableModules*.
59Copy over The setup is much the modules directory from same as with the Helma NG directory to the war/WEB-INF so that the resulting directory is called war/WEB-INF/modulesdemo application, but for a minimal runtime, just copy only that you point the following two files:JackServlet to your own Jack web appliction in <tt style="font-weight:bold;color:#d33;">war/WEB-INF/web.xml</tt>.
60* <tt style="font-weight:bold;color:#d33;">modules/global.js</tt> - for basic functionality such as module and resource loading
61* <tt style="font-weight:bold;color:#d33;">modules/helma/jack.js</tt> - for helper functions used by the jack servlet
61ThenFor example, create a directory called <tt style="font-weight:bold;color:#d33;">war/WEB-INF/myapp</tt>, and assuming you have the following simple Jack application in that directory a file called <tt style="font-weight:bold;color:#d33;">main>app/main.js</tt> with the following content:js</tt>:
64    return [200, {"Content-Type": "text/plain"}, ["Hello World!"];]];
67FinallyYou would then set the <tt style="font-weight:bold;color:#d33;">modulePath</tt> servlet init-parameter in web.xml to <code>app</code>, edit <tt style="font-weight:bold;color:#d33;">web.xml</tt> file in war/WEB-INF >moduleName</tt> to look *like this|http://dev.helma.org/static/files/3318/web-jack.xml*<code>main</code>, or just download and overwrite the file<tt style="font-weight:bold;color:#d33;">functionName</tt> to <code>handler</code>.
69Save all your changes and click on After starting the green Run button in Eclipse to start the development server. You server you should now see be able to access your minimal Jack app on at http://localhost:8080/.
71If you don't want or need Helma NG, another option for running Jack on App Engine is using the JackServlet Tom Robinson's original *Jack library|http://jackjs.org/*.
72
73<b>Note:</b> Jack support in Helma NG is very new, and thus quite incomplete. Feel welcome to close any gaping holes!

Version 14 by hannes on 22. April 2009, 15:24

1<b>NOTE: this guide is out of date already. The servlet name has changed to org.helma.jack.JackServlet, and the servlet parameters to moduleName, functionName, and helmaHome, respectively. I'll update this page as soon as the dust has settled. Sorry for the inconvenience and thanks for checking out Helma NG!</b>
2

Version 13 by hannes on 10. April 2009, 10:40

74If you don't want or need Helma NG, another option for running Jack on App Engine is using the JackServlet Tom Robinson's original *Jack library|http://jackjs.org/*.
75

Version 12 by zumbrunn on 09. April 2009, 14:43

19<tt style="font-weight:bold;color:#d33;">git clone git@githubgit://github.com:hns/helma-ngcom/hns/helma-ng.git</tt>

Version 11 by hannes on 09. April 2009, 13:22

21You need *Apache Ant|http://ant.apache.org/* to build Helma NG. Change to the helma-ng directory you just checked ou tand out and run ant it with the "jar" target:

Version 10 by hannes on 09. April 2009, 12:40

70Finally, edit <tt style="font-weight:bold;color:#d33;">web.xml</tt> file in war/WEB-INF to look *like this|http://dev.helma.org/static/files/3318/web-jack.xml*, or just download and copy overwrite the file.

Version 9 by hannes on 09. April 2009, 12:27

11Next, we you need Helma NG, which is effectively Rhino with a thin layer of server-related functionality on top. Helma NG currently comes with its own copy of Rhino as we are using some experimental JS 1.8 features, but this may change as soon as these features are included in a Rhino release.
74<b>Note</b>: <b>Note:</b> Jack support in Helma NG is very new, and thus quite incomplete. Feel welcome to close any gaping holes!

Version 8 by hannes on 09. April 2009, 12:26

1With Google's *announcement|http://googleappengine.blogspot.com/2009/04/seriously-this-time-new-language-on-app.html* of *Java support|http://code.google.com/appengine/docs/java/overview.html* for App Engine we have there is all of a sudden a very attractive new option for hosting Java based web applications. Of course my first impulse was to check if it would run *Rhino|http://www.mozilla.org/rhino/* and Helma NG (I had little hopes for Helma 1 as it runs a lot of background threads and relies heavily on relational or file based database backends, both of which are not available on App Engine).

Version 7 by hannes on 09. April 2009, 12:25

54<b>Note:</b> The Helma webapp framework is currently in state of major redesign. If you're looking for a stable development platform I recommend to wait until the upcoming 0.3 release.
55
73<b>Note</b>: Jack support in Helma NG is very new, and thus quite incomplete. Feel welcome to close any gaping holes!

Version 6 by hannes on 09. April 2009, 12:21

35* lib/js<tt style="font-weight:bold;color:#d33;">lib/js.jarjar</tt>
36* lib/helma<tt style="font-weight:bold;color:#d33;">lib/helma.jarjar</tt>
37* lib/log4j-1<tt style="font-weight:bold;color:#d33;">lib/log4j-1.2.15.jarjar</tt>
45# Copy over the modules directory from the Helma NG directory to the war/WEB-INF so that the resulting directory is called war/WEB-INF/modules<tt style="font-weight:bold;color:#d33;">war/WEB-INF/modules</tt>.
46# Copy the demo app itself from apps/demo to war/WEB-INF so that the resulting directory is called war/WEB-INF/demo<tt style="font-weight:bold;color:#d33;">war/WEB-INF/demo</tt>.
47# Edit the web<tt style="font-weight:bold;color:#d33;">web.xml xml</tt> file in the war/WEB-INF directory to look *like this|http://dev.helma.org/static/files/3318/web-helma.xml*, or just copy the file if you are lazy.
53Coming soonHelma NG provides a servlet to run *Jack|http://github.com/tlrobinson/jack/tree/master* applications without using Helma's own module infrastructure. In this mode, you get a relatively naked JavaScript runtime that is fully compliant to the *ServerJS Securable Modules proposal|https://wiki.mozilla.org/ServerJS/Modules/SecurableModules*.
54
55Copy over the modules directory from the Helma NG directory to the war/WEB-INF so that the resulting directory is called war/WEB-INF/modules, but for a minimal runtime, just copy the following two files:
56* <tt style="font-weight:bold;color:#d33;">modules/global.js</tt> - for basic functionality such as module and resource loading
57* <tt style="font-weight:bold;color:#d33;">modules/helma/jack.js</tt> - for helper functions used by the jack servlet
58
59Then, create a directory called <tt style="font-weight:bold;color:#d33;">war/WEB-INF/myapp</tt>, and in that directory a file called <tt style="font-weight:bold;color:#d33;">main.js</tt> with the following content:
60
61  function handler(env) {
62    return [200, {"Content-Type": "text/plain"}, "Hello World!"];
63  }
64
65Finally, edit <tt style="font-weight:bold;color:#d33;">web.xml</tt> file in war/WEB-INF to look *like this|http://dev.helma.org/static/files/3318/web-jack.xml*, or just download and copy the file.
66
67Save all your changes and click on the green Run button in Eclipse to start the development server. You should now see your minimal Jack app on http://localhost:8080/.
68

Version 5 by hannes on 09. April 2009, 11:54

49# Copy or move the static directory from within the demo app two levels up to the war directorydirectory (war/static).

Version 4 by hannes on 09. April 2009, 11:53

50# Edit the web.xml file in the war/WEB-INF directory to looke like thislook *like this|http://dev.helma.org/static/files/3318/web-helma.xml*, or just copy the file if you are lazy.

Version 3 by hannes on 09. April 2009, 11:50

3To my surprise, Rhino works perfectly out of the box, and I only had to make a few changes to Helma NG to get it runningthe demo app *running on App Engine|http://helma-ng.appspot.com/*. This is somewhat in contradiction with what *others have found|http://olabini.com/blog/tag/gae/*, and I discovered only later that I was partly lucky for not stomping on any SecurityExceptions, but on the other hand it's by virtue of Rhino not doing a lot of tricks under the hood, and Helma NG doing all its file reading through a unified *resource framework|http://github.com/hns/helma-ng/tree/10f5c896b0e9d9e2193ee24174d084965400520f/src/org/helma/repository*.
7=== Getting Prerequisites: Installing App Engine SDK and building Helma NG
27=== Creating a new Web App project
28
29Once you have everything in place, create a new, empty App Engine application. With the Eclipse plugin you do this using the new project wizard and selecting "Web Application Project" in the Google category. This will ask you for a project name and a package name. The package name doesn't matter unless you plan to write Java code, but it is required so just enter anything.
30
31The new project should have two subdirectories, "src" and "war". Again, the src dir is only relevant for Java code, as we'll put our JavaScript code directly in war/WEB-INF and our jar files in war/WEB-INF/lib.
32
33Next, copy over some jar files from the Helma NG lib directory to the war/WEB-INF/lib of your project. You'll probably need the following:
34
35* lib/js.jar
36* lib/helma.jar
37* lib/log4j-1.2.15.jar
38
39App Engine has its own web server of course, so you don't need the jetty or servlet jar files.
40
41From here, you have two options: Run an app using the Helma NG webapp framework, or one using the *Jack|http://github.com/tlrobinson/jack/tree/master* interface. The first is currently subject to major redesign, while the latter is rather unfinished, so choose your tools wisely :-)
42
30To run the Helma NG *demo application|http://helma-ng.appspot.com/* follow these steps:
31
32# Copy over the modules directory from the Helma NG directory to the war/WEB-INF so that the resulting directory is called war/WEB-INF/modules.
33# Copy the demo app itself from apps/demo to war/WEB-INF so that the resulting directory is called war/WEB-INF/demo.
34# Copy or move the static directory within the demo app to the war directory.
35# Edit the web.xml file in the war/WEB-INF directory to looke like this, or just copy the file if you are lazy.
36
37That's it - save all your changes and click on the green Run button in Eclipse to start the development server. If everything worked as planned you should be able to access the *demo app|http://helma-ng.appspot.com/* on http://localhost:8080/.
38
32
33Coming soon.

Version 2 by hannes on 09. April 2009, 11:21

9First, install the App Engine SDK for Java as described on the *Google pages|http://code.google.com/appengine/docs/java/gettingstarted/installing.html*. Whether you use the Eclipse plugin or the command line SDK shouldn't make a difference. I'm using Eclipse, but things should work in a similar fashion with the command line SDK.
10
11Next, we need Helma NG, which is effectively Rhino with a thin layer of server-related functionality on top. Helma NG currently comes with its own copy of Rhino as we are using some experimental JS 1.8 features, but this may change as soon as these features are included in a Rhino release.
12
13There hasn't been a release of Helma NG in recent times, so you have to get it from either *Subversion|https://dev.helma.org/svn/helma-ng/trunk* or *Git|http://github.com/hns/helma-ng/tree/master*. For Subversion, the command is:
14
15<tt style="font-weight:bold;color:#d33;">svn co https&#58;//dev.helma.org/svn/helma-ng/trunk/ helma-ng</tt>
16
17For Git:
18
19<tt style="font-weight:bold;color:#d33;">git clone git@github.com:hns/helma-ng.git</tt>
20
21You need *Apache Ant|http://ant.apache.org/* to build Helma NG. Change to the helma-ng directory you just checked ou tand run ant it with the "jar" target:
22
23<tt style="font-weight:bold;color:#d33;">ant jar</tt>
24
25If this worked then you should now have a file called lib/helma.jar.
26

Version 1 by hannes on 09. April 2009, 11:03

1With Google's *announcement|http://googleappengine.blogspot.com/2009/04/seriously-this-time-new-language-on-app.html* of *Java support|http://code.google.com/appengine/docs/java/overview.html* for App Engine we have all of a sudden a very attractive new option for hosting Java based web applications. Of course my first impulse was to check if it would run *Rhino|http://www.mozilla.org/rhino/* and Helma NG (I had little hopes for Helma 1 as it runs a lot of background threads and relies heavily on relational or file based database backends, both of which are not available on App Engine).
3To my surprise, Rhino works perfectly out of the box, and I only had to make a few changes to Helma NG to get it running. This is somewhat in contradiction with what *others have found|http://olabini.com/blog/tag/gae/*, and I discovered only later that I was partly lucky for not stomping on any SecurityExceptions, but on the other hand it's by virtue of Rhino not doing a lot of tricks under the hood, and Helma NG doing all its file reading through a unified *resource framework|http://github.com/hns/helma-ng/tree/10f5c896b0e9d9e2193ee24174d084965400520f/src/org/helma/repository*.
4
5This article covers two options, one using the Helma NG webapp framework, and one using the *Jack|http://github.com/tlrobinson/jack/tree/master* interface for JavaScript web applications. Both are currently unfinished and subject to change, but it's enough to get your feet wet.
6
7=== Getting and building Helma NG
8
9=== Running Helma NG apps
10
11=== Running Jack apps