0

Is it possible to make the modeshape rest service connect to my own modeshape repository (managed via cdi)

I couldn't find anything about that. I have a modeshape server up and running inside my CDI webapp (Not on Jboss).

During development I would like to enable modeshapes the standard rest interface on to of that repository, but I didn't find anything on how to do that,

Currently I'm just configuring the modeshape rest webapp to use the same directory for data storage as my webapp, but that's an evil hack.

IMHO there must be a way to just bundle some modeshape-rest jars to my app and configure the rest servlet in there to use my existing modeshape instance?

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Xnyle
  • 83
  • 10

1 Answers1

0

You absolutely can configure the REST web service (really just a servlet web app) to find the repository via JNDI. Just change the org.modeshape.jcr.URL parameter in the web.xml file to be the JNDI name of your repository:

<context-param>
    <param-name>org.modeshape.jcr.URL</param-name>
    <param-value>jndi:jcr</param-value>
</context-param>

Remember that ModeShape's repository configuration can specify the JNDI name for the repository, and ModeShape will automatically register it.

Randall Hauch
  • 7,069
  • 31
  • 28
  • Thanks for the quick response, but I think I don't get it. What I did was to add modeshape-web-jcr-rest to my war and add the context-param. I also included all the resteasy config parameters from the modeshape-web-jcr-rest-war web.xml although I heve no idea why I should manually start another rs implementation (resteasy) as my server is already running one. Anyway, I get this error on deployment Managed bean class org.modeshape.web.jcr.rest.ModeShapeExceptionMapper must be @Dependent – Xnyle May 20 '14 at 08:35
  • Maybe you could point me to a tiny working example war file using only the modeshape-web-jcr-rest dependency and the already available jax-rs implementation? – Xnyle May 20 '14 at 08:41