InfoQ

News

Article: Integrating Java Content Repository and Spring

Posted by Floyd Marinescu on Mar 12, 2007 06:24 PM

Community
Java
Topics
Portal/CMS
Tags
Spring ,
Java Content Repository
In this latest InfoQ article, Costin Leau provides a nice introduction to JSR 170 (Java Content Repositories) and how to integrate it with Spring Modules' JCR module, whose main objective is to simplify development with the JSR-170 API in a similar manner to that of the ORM package from the main Spring distribution.

Read  Integration Java Content Repository and Spring

According to the article, Springs JCR Module provides (summarized):
  • JcrTemplate which allows execution of JcrCallbackand exception handling (transforming checked JCR exceptions into unchecked Spring DAO exceptions).
  •  Session and can be easily used as a replacement. Moreover the template is aware of thread-bound sessions which can be used across several methods, functionality very useful when using a transactional repository.
  • RepositoryFactoryBean which configures, starts and stops the repository instances.
  • SessionFactory which unifies the Repository,Credentials and Workspace interfaces and allows automatic registration of listeners and custom namespaces.
  • Spring declarative transactional support for repositories that implement the (optional) transactional feature.
  • OpenSessionInView interceptor and filter which allow the usage of the same session per thread across different components. 
InfoQ.com's architecture is also built around JSR 170 with Apache Jackrabbit and also uses Spring Modules.

10 comments

Watch Thread Reply

Nice article about JSR-170 Content Repository! by kishore madugula Posted Mar 15, 2007 8:19 AM
Re: Nice article about JSR-170 Content Repository! by William Louth Posted Mar 15, 2007 11:02 AM
InfoQ.com use of Apache JackRabbit by William Louth Posted Mar 15, 2007 10:55 AM
Re: InfoQ.com use of Apache JackRabbit by William Louth Posted Mar 15, 2007 11:13 AM
importFile sample by Paul Russo Posted Mar 18, 2007 4:21 PM
global.re importFile sample by Alex Popescu Posted Mar 18, 2007 7:09 PM
Excellent JSR-170 overview! by Jennifer Kline Posted Apr 6, 2007 6:29 AM
Remote Storage by anand mahajan Posted Apr 15, 2007 1:33 AM
Re: Remote Storage by Konrad Pawlus Posted May 23, 2009 4:11 AM
JCR module migrated to Spring Extension JCR by Salvatore Incandela Posted Jun 15, 2009 4:02 AM
  1. Back to top

    Nice article about JSR-170 Content Repository!

    Mar 15, 2007 8:19 AM by kishore madugula

    Alfresco also very good one among those,as i used alfresco extensively,it also offers all levels support and spring,hibernate were integrated.From UI point of view it uses JSF so i suggest alfresco product while choosing among the JSR-170 Content repository implementations. Thanks, Kishore Madugula

  2. Back to top

    InfoQ.com use of Apache JackRabbit

    Mar 15, 2007 10:55 AM by William Louth

    Hi Floyd, Can you tell me how have you clustered JackRabbit? Do you use the new clustering capabilities? If not then how are things synchronized across nodes within the cluster. Also do you use a transactional back-end storage for the content repository and if so how have you and your team overcome the apparent lack of transactional integrity inherent in the design and implementation? Transaction chopping via component-resource partitioning (no sharing), chaining of execution units across threads, incorrect transaction patterns such as writes without reads (lost updates),.... kind regards, William

  3. Back to top

    Re: Nice article about JSR-170 Content Repository!

    Mar 15, 2007 11:02 AM by William Louth

    The problem I have with Alfresco is that it is a product that happens to use its own JCR implementation for content management. It is not a JCR implementation that one could easily integrate and embed within an existing application. The last time I looked you could not even create a repository object without first creating a explicit static code dependency on Spring - you needed to access the repository via an application context. It all seems so dependent on the product packaging and deployment (web application). regards, William

  4. Back to top

    Re: InfoQ.com use of Apache JackRabbit

    Mar 15, 2007 11:13 AM by William Louth

    The following blog entries are all based on transactional analysis work I recently performed for a customer that was having repository corruption issues in the pre-production phase of a project based on JackRabbit. Transaction Integrity Inspections http://blog.jinspired.com/?p=37 More Transaction Integrity Inspections http://blog.jinspired.com/?p=39 Concurrent Transactional Access http://blog.jinspired.com/?p=40 regards, William

  5. Back to top

    importFile sample

    Mar 18, 2007 4:21 PM by Paul Russo

    In the importFile springify sample, I think this line return (Node) execute(new JcrCallback() { should be return (Node) template.execute(new JcrCallback() { Correct me if I'm wrong. Thanks, Paul.

  6. Back to top

    global.re importFile sample

    Mar 18, 2007 7:09 PM by Alex Popescu

    Yes, you are right Paul. Thanks for the correction. ./alex -- :Architect of InfoQ.com: .w( the_mindstorm )p. C4Media/InfoQ Co-Founder

  7. Back to top

    Excellent JSR-170 overview!

    Apr 6, 2007 6:29 AM by Jennifer Kline

    Thanks so much for this article! I had to do some research for my development group and your piece was a great summary that covered a lot of material. The world needs more articles like this! Thanks!

  8. Back to top

    Remote Storage

    Apr 15, 2007 1:33 AM by anand mahajan

    Hi, Can u tell me how i can store contents on Remote machine. I will install application on one machine and store files on other machine. There will be firewall between both machine. Please help me. Thanks, in advance. -Andy

  9. Back to top

    Re: Remote Storage

    May 23, 2009 4:11 AM by Konrad Pawlus

    Can u tell me how i can store contents on Remote machine.
    Try:
        
            
        
    
    and run Jackrabbit in Tomcat on this remote machine.

  10. Back to top

    JCR module migrated to Spring Extension JCR

    Jun 15, 2009 4:02 AM by Salvatore Incandela

    Hi guys, I'm the "Spring Extension JCR" committer. I would announce to you that the original JCR Module was migrated to the new Spring Extension infrastructure. I've recently released a new version of this module currently 0.9! Below some useful links: http://salvatoreincandela.blogspot.com/ http://forum.springsource.org/forumdisplay.php?f=65

Educational Content

Bindings, Platforms, and Innovation

This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.

Orchestrating Long Running Activities with JBoss / JBPM

This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.

Neo4j - The Benefits of Graph Databases

This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.

Realistic about Risk: Software development with Real Options

This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.

Communication Flexibility Using Bindings

This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.

Writing DSLs in Groovy

After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.

Scaling Agile with C/ALM (Collaborative Application Lifecycle Management)

IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.

Concurrent Programming with Microsoft F#

Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.