Using Lenya with JCR (2.0 only)

Note: The JCR support for Lenya is in an early stage and should be considered experimental at this point in time. It should probably not be used for any productive purposes at this point in time.

The currently implemented approach

Currently the integration of Lenya with JCR is based upon the writetable and traversable JCRSource provided by Cocoon. At an earlier stage in Lenya history, the developers have introduced the lenya:-Protocol as the contract between the sitemap and retrieving and storing content. This investment has been leveraged now by providing a mapping of the lenya: to the jcr: protocol in order to integrate with JCR.

Practical Setup

  1. Install Lenya as you would usually do.
  2. Set the JCRNodeFactory as default node factory in
    • java/org/apache/lenya/lenya.roles. You need to search for the existing entry and change it.
          <role name="org.apache.lenya.cms.repository.NodeFactory"
  3. Start Jetty.
  4. Call the "Import into JCR" usecase to migrate the content:
    •     http://localhost:8888/index.html?lenya.usecase=jcr.import
      (select your publication and click OK)
  5. Delete the content directory of your publication ($LENYA_HOME/lenya/pubs/<yourpub>/content). You don't need it anymore.

You can log into Lenya again and you should be able to work with the application exactly as before. Just your content comes from and will be stored in the JCR repository.

What you should know

As Lenya leverages the Cocoon JCRSource implementation, any configuration of the repository itself has to be done exactly as you would to this in Cocoon. Search cocoon.xconf (in Lenya) for the component (not: component-instance) configuration for the component with the role javax.jcr.Repository. There you will find information such as

More on the Cocoon JCRSource can be found here:

What's missing (at least)

Note once again: This is experimental!

JcrConfiguration (last edited 2009-09-20 23:27:52 by localhost)