Latest Posts

Archives [+]

Categories [+]

Authors [+]

Entries filed under 'crx quickstart'

    Posted by Michael Marth APR 08, 2009

    Posted in announcements, crx and crx quickstart Add comment

    Along with the release of CQ5.2 we have released an update of CRX, which is now available in version 1.4.2. Apart from bug fixes there are improvements are in the areas Quickstart, virtual repository as well as search. Also, CRX is now optionally supported on Amazon EC2 virtual machines. Please see the release notes for full details.

    Here's the download of the Developer Edition and the Documentation Pack.

    Posted by Michael Marth JAN 12, 2009

    Posted in ab testing, crx quickstart, data first, javascript, sling and tracking Comments 6

    John Resig of JQuery fame has written an interesting article about a Javascript library called Genetify by Greg Dingle which is for A/B Testing web sites. Wikipedia explains A/B Testing as:

    A/B testing, or split testing, is a method of advertising testing by which a baseline control sample is compared to a variety of single-variable test samples in order to improve response rates. A classic direct mail tactic, this method has been recently adopted within the interactive space to test tactics such as banner ads, emails and landing pages.

    Significant improvements can be seen through testing elements like copy text, layouts, images and colors. However, not all elements produce the same improvements, and by looking at the results from different tests, it is possible to identify those elements that consistently tend to produce the greatest improvements.

    In the context of a web page one might for example change the colors or the texts, display each variation to a subset of the site's visitors and determine the most successful variant by the number of page views or sold items.

    There's two things to note about Genetify: first, it takes this process to the client, i.e. the served HTML page already contains all possible variants and a particular variant is chosen on the client-side. Second, over time the optimal variation will be shown more often than suboptimal versions. This is the "genetic" part (as in Genetic Algorithms).

    John provides a good overview of the library and also points to Genetify's instructive demo. After John's post Genetify's author Greg Dingle has open-sourced Genetify on GitHub including a PHP/RDBMS-based backend which is announced and discussed in the comments of John's post. In another comment of that thread Rob Howell says:

    Also, would be very cool to see it integrated server-side into a decent CMS.

    Hmm, I happen to know a decent CMS so I had a look how Genetify could be ported (to Apache Sling actually, which makes it suitable for CQ5 or any other Sling-based web application):

    Originally, I planned to simply re-implement the PHP backend and leave the JS untouched. But I realized that the style of interaction between the JS script and the PHP-backend was so much out of tune with how one would design the interaction in a RESTful framework like Sling that I decided to tweak the JS script as well. As such, this excercise became more interesting in the sense that some differences between PHP/RDBMS-backends (I should rather say: the way PHP-based backends are usually designed) and Sling/JCR-backends became visible.

    The first difference was for recording "variants" and "goals". The variants are the permutations of the genes that are shown to a specific user. The goals are the desired outcomes that shall be measured, like buying something. Both need to be persisted, obviously. In the original version both are recorded by sending a GET request to the backend. I changed this to the (arguably more "correct") POST method. The original version sends a random number parameter with each request. As far as I understand the code this is needed to get around caching issues. Using POST would allow to drop this parameter. Whatsmore, Sling requires no backend code at all for writing a new node when the request is sent using POST method.

    The second change involves the layout of the stored data. In a RDBMS-based system one (obviously) puts the different entities into different tables (which need to be defined beforehand). In a JCR-based system one possible, if not even the natural approach is to utilize the hierarchy - and potentially not define any node types at all, like I did. Since I store all variants and goals in nodes of type nt:unstructured there is no need to define a data schema or the like beforehand. One can start writing into the empty repository.

    For example, the variants are stored in one node of type nt:unstructured that stores all the properties like on wich domain the variant was shown. The actual genes are stored in a child node below. A similar approach is taken for the goals where there is a node for each goal (named like the goal) and child nodes for the achieved goals.

    It is actually possible to create a node hierarchy like this in one POST request by simply setting parameter names accordingly:

    ./param1=value2&./childnode/childparam2=value2
    

    (this approach is also used in the blog sample application where a blog post can have an attachment which is stored as a child node of the blog post's node).

    As said above, this part did not involve server-side scripting. However, the Genetify JS script not only writes the goals, but also retrieves information about the previous performance of the genes when it starts (in order to lean towards more successful genes in the long run). I have (hopefully correctly) reverse-engineered the PHP scripts that generate this response and written an ESP script (server-side JS) that should do the same. It should be noted that the original Genetify server-side scripts do a lot more error checking which is not implemented in the ESP.

    If you want to check out the Sling'ed Genetify version grab the attached zip file, unzip it into your CRX repository at /apps/gen and point your browser to http://localhost:7402/apps/gen/index.html. The upper part of the page displays the values of two genes (the first one is "rock", "paper", or "scissors"). If you click the "vary" link below the genes will change (because keeping always the same state on one particular browser with a cookie is switched off for development). Clicking one of the two links further down "want it!" or "badly!" will be counted as an achieved goal for the genes that are curently displayed. If you click one of them and reload the page afterward the stats table will have changed. The stats table represents the success of particular genes on a particular page. For restarting just delete the results stored in /content/gen.

    While it's fun to look at how do things in Sling and how little code is needed to get things running it needs to be said that the approach presented above will not scale very well. For once, all variations are stored flat, i.e. without a hierarchy. Since each page view creates a variation the number of child nodes will quickly become much too large to be handled efficiently. The second scaling problem is the calculation of the previous results which takes will take much too long as well. Both problems could be remedied by another JCR-typical approach "Observations". A listener for /content/gen could be registered and move old variations into a properly structured archive a s well as pre-calculate the previous results table.

    Posted by Michael Marth SEP 17, 2008

    Posted in crx quickstart Comments 5

    There have been some bug fixes in Apache Sling since the last version of CRX Quickstart was released. In case you want to update CRX Quickstart with latest and greatest from Sling's svn here is a little how-to:

    1. You need to have Maven installed.
    2. Check out Sling from http://svn.apache.org/repos/asf/incubator/sling/trunk
    3. cd into launchpad/testing and execute "mvn install" (to skip the tests execute "mvn -Dmaven.test.skip=true install" instead). If the build does not fail (which it could, this is the latest in trunk) there should be a new file org.apache.sling.launchpad.testing-4-incubator-SNAPSHOT.war (or similar) in launchpad/testing/target. This is your new war file.
      If you run out of memory while compiling increase Maven's memory setting by setting the environment variable MAVEN_OPTS="-Xmx256M"
    4. cd into jcr/jackrabbit-client and execute "mvn install" again. This will create a new bundle in jcr/jackrabbit-client/target.

    When you ran CRX Quickstart it created a folder named crx-quickstart. You need to modify some files in this folder.

    1. Make a backup of the crx-quickstart folder. If you need to keep your content also do an export (see http://localhost:7402/crx)
    2. Delete crx-quickstart/launchpad
    3. Replace crx-quickstart/server/webapps/crx-launchpad.war with the .war file created above (i.e. copy and rename the file to crx-launchpad.war).
    4. Start CRX-QS and navigate your browser to http://localhost:7402/system/console/list (Sling's OSGi console). Uninstall the "Sling - Jackrabbit Embedded Repository" bundle. Install the bundle you created above.
    5. Stop CRX and delete crx-quickstart/repository

    That's all folks. This is all at your own risk and YMMV, of course.

    Update (18/9/08): I missed some steps, unfortunately. Updated the post, thanks to Bertrand for pointing this out.

    Posted by Michael Marth JUL 02, 2008

    Posted in crx, crx quickstart, screencast and tutorial Add comment

    Before Sling was released there was a change in the way Sling finds application files (e.g. .jst or .esp). While this made things easier it also broke the examples I presented in the screencasts here and here. So here is some update information on how to fix this:

    The first screencast's code is included as an example application with CRX Quickstart. So if you just stick to the example app structure you will be fine.

    For the second screencast we started out with a directory like this (leaving out the image folder):

    tss
    |-index.html
    |-admin
      |-index.html
    |-post
      |-index.html
    |-thread
      |-index.html

    and ended up (after the code was changed in the course of the screencast) with:

    tss
    |-index.jst
    |-admin
      |-index.jst
    |-post
      |-index.jst
    |-thread
      |-index.jst

    Now, in the current version the final directory structure must be:

    tss
    |-html.jst (this was the home page)
    |-admin.jst
    |-post.jst
    |-thread.jst

    So, for example in the first step I rename tss/admin/index.html to tss/admin/index.jst. Now, it should be renamed and moved to tss/admin.jst and so on. For clarity, I have attached the new resulting code to this post.

    Posted by Greg Klebus MAY 13, 2008

    Posted in announcements, crx, crx quickstart, jcr and sling Add comment

    Finally! The Website for Day JCR Cup 2008 has been launched! Check out the website today to start using CRX Special Cup edition, dubbed "CRX Quickstart", and creating great content applications. Learn great technologies using CRX and win MacBook Pro.

    Thank you very much for waiting - we wanted to make sure that Apache Sling application framework for creating the contest applications would not change in a backwards-incompatible way, forcing contest participants to change their applications with next releases of Sling. And we wanted the CRX Quickstart edition to be really fun to use.

    To make up for the waiting, we decided to extend the submission deadline to September 30, 2008.

    Best of luck, and we can't wait to see your submissions.