Dec
12
Introducing µjax \ˈmī-(ˌ)krōˈjaks\
filed under sling microsling tutorial crx microjax | posted by David Nuescheler
µjax (microjax or ujax) is a client sided javascript persistence layer that leverages the symbiosis of a (JCR compliant) Content Repository and the agile patterns of browser based ajax development, to form a completely new way of developing applications.
microjax is a part of Apache Sling which is currently in incubation.
As an important differentiator to other Ajax frameworks µjax focuses on adding an attractive server-sided persistence and does not focus on providing a rich application framework with components, widgets or visual effects. µjax can be combined with any Ajax framework of your choosing.
µjax uses XHR & JSON based AJAX techniques to retrieve content and uses regular form input to write content.
Download, Register & Install
Prerequisites
Knowledge of Javascript and HTML are required.
An understanding of JCR is certainly very helpful to quickly start developing in µjax.
Download
The µjax pre-release can be downloaded attached (below) to this post pre-packed with the attached CRX builds. (Windows, Unix, Linux & macosx)
Keep in mind:
Nightly builds are intended to provide CRX Developers with the latest enhancements and bug fixes. A NIGHTLY BUILD IS NOT AN OFFICIAL RELEASE AND IT IS NOT TESTED BY QA. USE IT AT YOUR OWN RISK. IT IS RECOMMENDED NOT TO USE A NIGHTLY BUILD ON A PRODUCTION SYSTEM, BUT TO USE IT FOR DEVELOPMENT PURPOSES ONLY. DAY MANAGEMENT AG CANNOT BE HELD RESPONSIBLE FOR ANY DAMAGE THAT COULD BE CAUSED BY A NIGHTLY BUILD.
Register
To be able to install CRX you will have to get an evaluation license, which can be obtained by filling out the following form.
Install
µjax is only installed in the default installation of CRX, so please select that option in your downloaded CRX installer.
The installation is very straight forward and does not have dependencies beyond a JDK 1.4 or greater.
Mount your workspace
To be able to interact with the content repository for development purposes
it is recommended to use webdav and connect to
http://localhost:7402/crx/repository/crx.default
On Windows use "My Network Places" / "Add new network place"
On macosx use "Go" / "Connect to Server" in Finder
Look around
Explore you content repository at http://localhost:7402/crx, as soon as you start developing your applications you will find both your code and also the content your applications create in the "Content Explorer".
First Steps
To get started please either use the test application below or just extract the "firststeps.zip" (below) and drag and drop the "apps" folder into root folder of your webdav mount.
Test application:
Put the source code below into a test.html file and drag this into your mounted webdav drive:
<html><head><title>Hello World</title> <script src="/ujax/ujax.js"></script> </head> <body> <script> var welcomeNode=ujax.getContent("/content/welcome"); </script> <h1>Welcome String: <script>if(welcomeNode)
{ document.write(welcomeNode.hello); }
</script></h1> <form action="/content/welcome" method="POST"> <input name="hello" value="" /> <input type="submit"> </form> <script>ujax.wizard();</script> </body> </html>
and hit http://localhost:7402/test.html
in your browser.
µjax Version of "Stefano's Linotype"
To get a feeling of a more real-life application feel free to download an µjax-ed version of Stefano's Linotype you can simply extract the "linotype.zip" (attached below) into the /apps folder of your webdav drive pointing at http://localhost:7402/
After the installation hit http://localhost:7402/content/linotype/posts/*.post.html and hit the save button to create your first blogentry. After creating the post you can surf to http://localhost:7402/content/linotype.html
Please keep in mind that this is really just prototype to explain the µjax basic concepts and how they could be applied to existing web applications without a lot of effort.
Subscribe, Save and Share
Related Posts
9 comments
-
Bertrand Delacretaz on 12/12/2007
Note that people can turn to the sling-dev mailing list [1] for questions about µjax and µsling, or to the CRX discussion group [2] for CRX-specific questions.
[1] http://incubator.apache.org/sling/site/project-information.html#ProjectInformation-lists
[2] http://tech.groups.yahoo.com/group/jcr-crx/ -
Joseph Ottinger on 16/1/2008
I installed the ujax version of CRX, and ... the directions above don't work for me? I get "Not Found" for each url.
-
David Nuescheler on 16/1/2008
Hi Joe,
thanks for bringing that to our attention.
...using all these Apples actually led to issue that a broken installer was uploaded for windows and nobody noticed.
Sorry for that, we will fix that as soon as possible and keep you posted.
(.ps: the unix installer works ;) -
David Nuescheler on 20/1/2008
Hi Joe,
after looking a little bit more detailed into the issue I found out that the above microjax install requires JDK 1.5.
After installing 1.5 you can change the JVM by going to "Start / All Programs / Day CRX 1.3.2 / Start CRX 1.3.2" and double-click "CRX 1.3.2" and change the "Java VM" param to the javaw.exe in your JDK installation directory of 1.5
Sorry for the inconvenience.
regards,
david -
Fabien Calais on 7/3/2008
after installing, i cannot access to the page http://localhost:7402/test.html
and when i hit http://localhost:7402/
i have an http 404 error message
any idea? -
Fabien Calais on 7/3/2008
hi,
after investigate
if i use the JDK 1.5., i can access http://localhost:7402/test.html
but i cannot access http://localhost:7402/crx
if i use JDK 1.4 from the installation of the crx i can access to http://localhost:7402/crx but cannot access to http://localhost:7402/test.html
is there any solution to test it ? -
Rene Robinson on 8/3/2008
So, I'm interested in seeing the linotype application, but the directions are missing/confusing. I dropped the linotype folder into apps and tried the URL given, no go. I tried creating the linotype folder under content with posts, etc...no go.
solutions?
Rene' Robinson (you know where to find me...) -
an anonymous coward on 9/3/2008
-
Randell Browning on 29/4/2008
Have you created the node property sling:resourceType on the node linotype that you created under the content node and assigned it a value to point to the desired script you want to call under the apps node?
crx-ujax_unix_macosx_installer.sh
crx-ujax_windows_installer.exe
firststeps.zip
linotype.zip