InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

Article: Integrating Java Content Repository and Spring

Posted by Floyd Marinescu on Mar 12, 2007

Sections
Development,
Operations & Infrastructure
Topics
Java ,
Portal/CMS
Tags
Java Content Repository ,
Spring
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
Re: Nice article about JSR-170 Content Repository! by William Louth Posted
InfoQ.com use of Apache JackRabbit by William Louth Posted
Re: InfoQ.com use of Apache JackRabbit by William Louth Posted
importFile sample by Paul Russo Posted
global.re importFile sample by Alex Popescu Posted
Excellent JSR-170 overview! by Jennifer Kline Posted
Remote Storage by anand mahajan Posted
Re: Remote Storage by Konrad Pawlus Posted
JCR module migrated to Spring Extension JCR by Salvatore Incandela Posted
  1. Back to top

    Nice article about JSR-170 Content Repository!

    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

    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!

    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

    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
    blog.jinspired.com/?p=37

    More Transaction Integrity Inspections
    blog.jinspired.com/?p=39

    Concurrent Transactional Access
    blog.jinspired.com/?p=40

    regards, William

  5. Back to top

    importFile sample

    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

    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!

    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

    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

    by Konrad Pawlus


    Can u tell me how i can store contents on Remote machine.


    Try:

    <bean id="repository" class="org.apache.jackrabbit.rmi.repository.URLRemoteRepository">
    <constructor-arg value="http://localhost:8180/jackrabbit-webapp-1.5.5/rmi"/>
    </bean>


    and run Jackrabbit in Tomcat on this remote machine.

  10. Back to top

    JCR module migrated to Spring Extension JCR

    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:
    salvatoreincandela.blogspot.com/
    forum.springsource.org/forumdisplay.php?f=65

Educational Content

New-age Transactional Systems - Not Your Grandpa's OLTP

John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.

Cool Code

Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.

Collaboration: At the Extremities of Extreme

Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.

Yesod Web Framework

Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).

Transactions without Transactions

Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.