e4xd and jhino - javascript server-side soft-coding
A new and experimental core for a complete rewrite of Openmocha.
The e4xd sub-project provides the javascript server-side for
the Openmocha project, a javascript application server with a
"soft-coding" framework.
The soft-coding allows modifications and development work from the
"inside" of the running web application. The behavior of the web
application can be changed in ways that closely relates to the
hierarchical content structure of the resulting website, without
the need to "hard-code" these changes in code files.
Every content object becomes "sovereign" and can define its own
behavior, overriding what it would inherit from the hard-coded
prototypes or from other soft-coded objects higher up in the
content structure hierarchy.
The e4xd objectengine leverages naming conventions for hard-coded
filenames and soft-coded object property names to overlay the
hard-coded and soft-coded properties and methods and determine
the behavior of an object at runtime.
Internally, these conventions follow the existing ones of the Helma
framework, but expand that philosophy, adding additional conventions
and accomodating to the needs of the soft-coding environment.
The jhino sub-project provides a base application scaffold for the
soft-coding environment. It leverages the e4xd object engine and adds
an additional layer of conventions, resulting in a basic scaffold
for a working base application with CRUD type functionality and
access control. Basically, jhino already provides a fully working
soft-coding environment, but requires the standard Helma development
tools such as the shell and inspector to do the actual "soft-coding".
The e4xd javascript server-side currently requires a patched version
of Helma and Rhino. In the case of Rhino, e4xd depends on the JOMP
patch and Helma needs to be modified to do the additional file suffix
mapping required by e4xd.
create an admin account at http://localhost:8080/exampleapp/register
copy the authentication code to the server.properties file
login at http://localhost:8080/exampleapp/login
Prerequisites and System Requirements
To run OpenMocha a Java Virtual Machine 1.4 or better is required.
For FreeBSD and other operating systems with ports collection you may
install a JRE or JDK from the ports collection. For Windows, Linux and
Solaris you can get a Java runtime or development kit from
http://java.sun.com/j2se/downloads/. If you are on Mac OS X then you
already have a Java runtime that will work well with OpenMocha.
While you can integrate OpenMocha with other tools such as Apache
and MySQL, you do not have to. OpenMocha is pre-configured to be
deployed on its own and comes with a built-in object oriented
database and web server.
Getting started with OpenMocha
On the e4xd.org site, you should be able to find a working build to
download and simply start with ./start.sh
For FreeBSD, Linux, Solaris, Mac OS X and other Unix flavors, start
the Helma framework by invoking ./start.sh from the command line. On
Windows, invoke start.bat instead.
If the java command can not be found, make sure the JAVA_HOME
environment variable is set to the location of your Java installation.
With Helma running, you should be able to connect using your
browser and the URL http://127.0.0.1:8080/ or http://localhost:8080/
To initialize the setup, complete the user registration form
at http://127.0.0.1:8080/exampleapp/register and follow the
instructions to copy the security information into the
server.properties file. You may then login to your new OpenMocha
server via http://127.0.0.1:8080/exampleapp/login and start
configuring and deploying your web applications.
Installing jhino modules in a existing Helma setup
In addition to the full openmocha build, there is also a build that
contains only the jhino modules and patched jar files, in order to
add jhino to your own helma install. You would need to replace the
helma.jar and rhino.jar in your Helma install with the patched
versions. The "objectengine" and "jhino" modules are expected
to be placed in Helma's modules directory and the exampleapp would
normally go into Helma's apps directory. You could then start the
example app from your manage application or add it to the
apps.properties file to have it start automatically.
Other than what you find on the (possibly not yet existing) e4xd.org
website, the best places to get in touch are the openmocha mailing
list and google group or the
#helma@irc.freenode.net IRC channel
.
Over the past days, I did some experimenting with the JOMP patch for Rhino and the mapping of additional filename extensions to HopObject properties. I probably took it a bit to far and made the list of supported file suffixes to long, even introducing duplicates, but I would like to propose supporting additional filename based conventions for Helma 1.7.
Here is what I added for my experiments:
foo.macro --> becomes a hobj.foo_macro function with "params" as first argument
foo.get --> becomes a hobj.foo_action_get function
foo.post --> becomes a hobj.foo_action_post function
foo.put --> becomes a hobj.foo_action_put function
foo.delete --> becomes a hobj.foo_action_delete function
foo.e4x --> becomes a hobj.foo_e4x xml object
foo.json --> becomes a hobj.foo_json js object
Then I also needed a mapping that would not be generally useful, but only interesting in the context of my experiments:
foo.control --> becomes a hobj.foo_control function with "view" as first argument
And on top of all that, I added some duplicates:
foo.view --> the same as foo.skin
foo.action --> the same as foo.hac
Maybe instead of adding direct built-in support for additional filename conventions to Helma, we could instead add functionality that would make it easy to script/configure such additional conventions as needed.
Besides a few new features, like the newly added res.resetBuffer() method and the ability to name type.properties files after their prototype, this update brings bug fixes in many different areas. See the
changelog
for the detailed list of fixes.
The new 1.6.1 version of Helma also includes an updated version of Rhino, with some E4X related fixes. The new packages now also include the
jala modules
and
updated documentation
.
At this point of course just a case of
totally unimportant historical Internet trivia
. The surprising thing is not that the Netscape browser will finally die, but that it was still alive until now. I hadn't noticed ;-)
From the comments on
the slashdot posting
... tieTYT tells an anecdote about what AOL did to Netscape:
[...]one of the things they did was realize that pop-up blocking was one of the new cool things for browsers to have. But the marketing team stepped in and said, "Hold on just a second. We can't have the browser blocking OUR pop-ups." So they added rule to block all pop-ups except those that came from the netscape web page.
The netscape homepage happened to have a pop-up on it and of course, this is the default home page of the browser. When you initially ran netscape, first thing you saw was a pop-up and the page behind it claiming, "New Feature: pop-up blocker".
You can't escape bad karma. What AOL does to Netscape, Time Warner tends to do to AOL. We'll see.
One thing that
Matthew King's comparison
doesn't mention is the 1024 byte per attribute value limit of
Amazon's SimpleDB
, which means it's really more an index for what you put into
S3
.
David Greenspan, JD Zamfirescu, and Aaron Iba have
released AppJet
. Like
OpenMocha
, it's a web-based soft-coding framework that streamlines the easy development and deployment of small web apps using server-side javascript and like OpenMocha, it's powered by Helma.
Unlike OpenMocha, they went the extra miles of making the framework very approachable by well integrating AppJet online hosting of your custom apps, by designing the framework in a way that I think developers used to PHP like environments will appreciate and by gearing it towards very simple, small apps at the beginning.
The key that enables a hosted app service like this to deploy many small apps from many users without fuss is to properly seal the server-side javascript environments of the different apps from each other. Security is the main factor there of course, but efficiency is the other. I've been experimenting with this a bit for a future update to OpenMocha and learned that it is trickier than I would like it to be.
No surprise then that this is exactly the area of their code that they consider to be their crown jules and that they won't be able to open source. They do intend to open-source the Javascript framework that runs within (and around, presumably) that virtualization. Actually, the source of the framework that runs within the virtualization
is already visible online
.
I particularly like the way they encourage appjet apps to be an open collection, in a sense becoming an appjet code library. That's an aspect that already was very successful in the
old days of WebCrossing
and that I think is an essential part of a web-soft-coding environment.
Indeed, facilitating easy code reuse and sharing is a focal point that would benefit the Helma community at large as well. I need to setup something like a code bin, where we can easily upload, categorize, search and find code snippets for reuse in other Helma apps.
Joshua Paine
has ported the
js lib for working with couchdb
from AJAX and crockford's json to helma.http and helma's json support. Definitely a candidate for inclusion as part of the modules in the next Helma release, I'd say. Now, if we use the onInit and onPersist hooks and suppress the embedded db, we could directly leverage all the fancyness of HopObjects for
CouchDB
, including the caching :-)
var c = new CouchDB('testing','localhost',8888);
c.createDb();
c.save({ title:'Testing', content:[1,2,3] });
Congrats! You just created a DB and saved a document in it.