You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Apache Wiki <wi...@apache.org> on 2005/08/01 16:03:04 UTC

[Lenya Wiki] Update of "JcrConfiguration" by TorstenSchlabach

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Lenya Wiki" for change notification.

The following page has been changed by TorstenSchlabach:
http://wiki.apache.org/lenya/JcrConfiguration

The comment on the change is:
Initial version of the page.

New page:
= Using Lenya with JCR (1.4 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.

 1. Correct the node type configuration in Lenya's cocoon.xconf ($LENYA_HOME/webapp/WEB-INF/cocoon.xconf):

{{{
<component-instance class="org.apache.cocoon.jcr.source.JCRSourceFactory" name="jcr">
  <folder-node new-file="nt:file" new-folder="nt:folder" type="rep:root"/>
  <folder-node new-file="nt:file" new-folder="nt:unstructured" type="nt:unstructured"/>
  <folder-node type="nt:folder" new-file="nt:file"/>

  <file-node content-path="jcr:content" content-type="nt:resource" type="nt:file"/>
  <file-node content-ref="jcr:content" type="nt:linkedFile"/>

  <content-node type="nt:resource"
    content-prop="jcr:data"
    mimetype-prop="jcr:mimeType"
    lastmodified-prop="jcr:lastModified"
    validity-prop="jcr:lastModified"/>

</component-instance>
}}}

 1. 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)

 1. Stop Jetty.

 1. 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"
  shorthand="node-factory"
  default-class="org.apache.lenya.cms.jcr.JCRNodeFactory"/>
}}}

 1. Delete the content directory of your publication ($LENYA_HOME/lenya/pubs/<yourpub>/content). You don't need it anymore.

 1. Restart Jetty.

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

 * the physical location of the repository
 * the location of the repository.xml and jaas.config files (this is Jackrabbit stuff, please look there)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org