NOTE: This article is 3 years or older so its information may no longer be relevant. Read on at your own discretion! Comments for this article have automatically been locked, refer to the FAQ
for more details.
implementation is great to use if you don't want to run a Jackrabbit
server, however one of the difficulties for a first-time user is having to go through the bootstrapping
process and initialising the repository. After a bit of poking around the command line utility
code that comes with Jackalope
I put together this class that detects if the repository hasn't been initialised and does the initialisation automatically for you. It also wraps the session so you're guaranteed a valid repository with an open session when you use this.
You still need to create the database yourself before using this class.
This is the SessionWrapper
...to use it do something like this...
The code for the SessionWrapper
class is quite boiler plate Jackalope
code. The repository initialisation happens on lines 33-39
. There is some error handling thrown in and that's about it. No need to mess around with manual repository initialisation!
Hope you found this post useful...
...so please read on! I love writing articles that provide beneficial information,
tips and examples to my readers. All information on my blog is provided free of
charge and I encourage you to share it as you wish. There is a small favour I ask in return however -
engage in comments below, provide feedback, and if you see mistakes let me know.
If you want to show additional support and help me pay for web hosting and
domain name registration,
donations, no matter how small, are always welcome!
Use of any information contained in this blog post/article is subject to this disclaimer
Other posts you may like...