The Artima Developer Community
Sponsored Link

Articles Forum
Catch Jackrabbit and the Java Content Repository API

5 replies on 1 page. Most recent reply: Feb 25, 2008 1:46 AM by Yamini Kumar

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 5 replies on 1 page
Admin Admin

Posts: 39
Nickname: admin
Registered: Jan, 2002

Catch Jackrabbit and the Java Content Repository API Posted: Jun 5, 2005 9:00 PM
Reply to this message Reply
Advertisement
The Java Content Repository API (JCR) promises to greatly simplify Java database programming. Content repositories extend databases with versioning, rich references, workspaces, extensible information models, and other features. This article reviews the JCR API and its open-source implementation, Apache Jackrabbit, from a developer's perspective.

http://www.artima.com/lejava/articles/contentrepository.html

Content repositories promise to greatly simplify database programming. Do you think databases will evolve into content respositories with time? What do you think of the JCR API?


Ben M

Posts: 1
Nickname: benm
Registered: Jun, 2005

Re: Catch Jackrabbit and the Java Content Repository API Posted: Jun 11, 2005 11:28 AM
Reply to this message Reply
Thanks for the interesting article. I'd heard about JSR-170 and Jackrabbit but hadn't had time to check it out. Looks like it could be very powerful. I've particularly thought that there is a great need for versioned data in more cases than not.

I also appreciate your keeping the article short, however, there are a couple things it seems you left out. In the introduction you say "the devil is in the details", but you never explain that statement. Is that just general pragmatism/cynicism or did you find any gotchas?

You also use the Jackrabbit API, but don't explain where our data is going. Does Jackrabbit just write to the file system by default? Is this configured in the "repository.xml" file you mentioned. Well, I suppose I can find the answers to these questions myself on the Jackrabbit site, but it would have been good to at least mention how that works.

For that matter, you mention that you can use Hibernate or JDBC with Jackrabbit, but then say that JSR-170 is almost the exact opposite of ORMs... but if your repository content is being put into a RDB, wouldn't you still need some sort of relational mapping?

Thanks again.

nafise hasani

Posts: 1
Nickname: nafise
Registered: Jul, 2005

Re: Catch Jackrabbit and the Java Content Repository API Posted: Jul 14, 2005 6:02 AM
Reply to this message Reply
Hi
by refrence to the below paragraph of your article :

"The Jackrabbit code base contains not only the JCR API reference implementation, but also a fully functional repository as well as several contributed libraries for tasks, such as accessing a remote repository via RMI. There is even a JDBC persistence manager to allow plugging in a relational database as a persistent store, and an object-relational mapping tool that allows Hibernate applications to use the repository.
"
but as I knew jackrabbit does not support JDBC persistence manager till now !!!!!!!!!!!! it only support filesystem

Dalia Kafir

Posts: 2
Nickname: cricri
Registered: Dec, 2005

Having problem running the blogging application, please HELP! Posted: Jan 4, 2006 4:38 AM
Reply to this message Reply
Hello,

I have problems running the example in your article: I cannot add a new blog entry. And, I cannot understand the generated messages...

Whenever I do: java -jar rabbitblog.jar -add "Jack Rabbit" "Carrotology " "This is a blog entry about carrots.", as described in the readme file, I get the following errors:

Exception in thread "main" java.lang.RuntimeException: A RepositoryException occ
ured
at com.artima.examples.jackrabbit.RepoTest.addBlogEntry(Unknown Source)
at com.artima.examples.jackrabbit.RepoTest.main(Unknown Source)
Caused by: org.apache.jackrabbit.core.config.ConfigurationException: Failed to c
reate configuration directory for workspace default.
at org.apache.jackrabbit.core.config.RepositoryConfig.createWorkspaceCon
fig(Repos itoryConfig.java:300)
at org.apache.jackrabbit.core.config.RepositoryConfig.init(RepositoryCon
fig.java: 219)
at org.apache.jackrabbit.core.config.RepositoryConfig.create(RepositoryC
onfig.jav a:98)
at org.apache.jackrabbit.core.config.RepositoryConfig.create(RepositoryC
onfig.jav a:72)
at org.apache.jackrabbit.core.jndi.BindableRepository.init(BindableRepos
itory.jav a:114)
at org.apache.jackrabbit.core.jndi.BindableRepository.create(BindableRep
ository.j ava:104)
at org.apache.jackrabbit.core.jndi.RegistryHelper.registerRepository(Reg
istryHelp er.java:57)
at com.artima.examples.jackrabbit.RepoTest.bindRepository(Unknown Source
)
at com.artima.examples.jackrabbit.RepoTest.getRepository(Unknown Source)

... 2 more

It is urgent. Thank you sincerely in advance.
CC

Stefano Campanini

Posts: 1
Nickname: campa
Registered: Jan, 2006

Re: Catch Jackrabbit and the Java Content Repository API Posted: Jan 19, 2006 12:13 PM
Reply to this message Reply
Hi guys,

I'm studing the JSR 170, to evluate it for a project.
Also, I have read the Frank Sommers interesting article about the JackRabbit implementation.

I don't know very well XMLdatabases, such as exists or others. I'd like to know if JCR have some advantages vs. XMLdatabases, in other words why choose JCR in place of exists for example?

I see that JCR support versioning, Access Control and different backend ways, but there are more radical differences between they ?

Bye
Stefano

Yamini Kumar

Posts: 1
Nickname: yamini1
Registered: Feb, 2008

Re: Catch Jackrabbit and the Java Content Repository API Posted: Feb 25, 2008 1:46 AM
Reply to this message Reply
Hi,
My objective is to standardize the access (read/write or both) to data content in data sources like a database (MySQL) and any other content repository that is not JSR 170 compliant like Open CMS, live link or share point. By standardizing access I mean that the client program will no longer call the respository specific API like LAPI or JDBC but rather call JCR API methods to achieve common functions like, login, logout, read and write.

I want to clear my concepts by writing a kind of sample connector for MY SQL database which can be accessed by JCR API rather than JDBC. I understand that in order to do I need to write a wrapper around JDBC API which will perform the desired operations using JDBC (as My SQL understand JDBC) but for a developer the entry point will be JCR API.

I have confusion while writing this wrapper. I have taken an example of exportsystemview() of JCR API.

The client code to access this method in CRX using JCR API is

/*
public class ExportXMLFromCRX {
public static void main(String[] args) {
String propertyName = "";
Repository repository = null;
Session repSession = null;
FileInputStream fileInputStream = null;
FileOutputStream fileOutputStream = null;
try
{
ClientRepositoryFactory factory = new ClientRepositoryFactory();
// This is mandatory for rmi access to the CRX
System.setProperty("java.rmi.server.useCodebaseOnly", "true");
repository = factory.getRepository("//localhost:1234/crx");
if(repository != null)
{
userCredentials = new SimpleCredentials(userID,password);
repSession = repository.login(new SimpleCredentials(“admin”, “admin”.toCharArray(), “crx.default”);
if(repSession != null)
{
File outputFile = new File("C:/test1.xml");
FileOutputStream out = new FileOutputStream(outputFile);
repSession.exportSystemView("/MyRootNode", out, false, false);
}//end if(repSession != null)
}// end if(repository != null)
} //end try
catch (Exception Exc)
{
System.out.println(Exc.getMessage());
}//end catch
finally
{
repSession.save(); //save to update nodes created in the CRX Session
repSession.logout(); //duly log-out of the CRX session
}//end try
}// end finally
}
}
*/

What I want is to have a different implementation of the same method which will fetch data from database in an XML format & returns the XML the way the above method does

How should I write a wrapper class for my custom method which fetches record from DB and build an XML but exposed as JCR method? If I am able to do so then the above client code can be used as it is for my MYSQL wrapper code as well. The difference will be that it will no longer fetch data from CRX and build XML but will build an XML based on my database records.

Please suggest what are the steps I need to perform to achieve this?

Flat View: This topic has 5 replies on 1 page
Topic: The Real Meaning of Model-Driven Architecture Previous Topic   Next Topic Topic: Data Binding in Java

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use