You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by imadhusudhanan <ma...@gmail.com> on 2009/03/30 13:52:48 UTC

Customizing JR to access my DataBase Schema ..

Dear All,

	 AFAIK JackRabbit uses Apache Derby to deliver the node info to the webdav client. I would like to customize JR to access my DataBase Schema (a couple of tables which save node types and node relations instead jackrabbit repository). I use mysql to store the node info and a custom filestore to store BLOB objects. Kindly tell me how do I interface JR to my database schema and filestore instead using JR's own repo. Did i miss anything ??

Re: Customizing JR to access my DataBase Schema ..

Posted by imadhusudhanan <ma...@gmail.com>.
Thanks Thomas.	 Let me try using the JR's Mysql PM. I do not mind whatever schema is behind whether mine or JRs. Let me get back to u in case I face any problem configuring PM. Another question, I see the DataStore implementation creating a mysql table in db. Instead can I point the DataStore to my custom FileServer. Any configuration ?? Also


---- On Mon, 30 Mar 2009 05:23:03 -0700 Thomas Müller &lt;thomas.mueller@day.com&gt; wrote ---- 

Hi,

&gt;  AFAIK JackRabbit uses Apache Derby

You can use any database (MySQL, PostgreSQL, H2 Database Engine,
Oracle,...). Apache Derby just happens to be the default.

&gt; I would like to customize JR to access my DataBase Schema (a
&gt; couple of tables which save node types and node relations instead jackrabbit
&gt; repository).

If you use your own custom schema, you would need to write your own
JCR implementation (your own 'Jackrabbit'). Or at least your own
Persistence Manager (see
http://wiki.apache.org/jackrabbit/PersistenceManagerFAQ ). But that's
quite a lot of work. Instead, I suggest to use Jackrabbit to store the
node data, and use the regular MySQL Bundle Persistence Manager.

&gt; I use mysql to store the node info and a custom filestore to
&gt; store BLOB objects.

I suggest to use the Data Store, see http://wiki.apache.org/jackrabbit/DataStore

Regards,
Thomas

Re: Customizing JR to access my DataBase Schema ..

Posted by imadhusudhanan <ma...@gmail.com>.
Thanks Thomas.	 Let me try using the JR's Mysql PM. I do not mind whatever schema is behind whether mine or JRs. Let me get back to u in case I face any problem configuring PM. Another question, I see the DataStore implementation creating a mysql table in db. Instead can I point the DataStore to my custom FileServer. Any configuration ?? Also


---- On Mon, 30 Mar 2009 05:23:03 -0700 Thomas Müller &lt;thomas.mueller@day.com&gt; wrote ---- 

Hi,

&gt;  AFAIK JackRabbit uses Apache Derby

You can use any database (MySQL, PostgreSQL, H2 Database Engine,
Oracle,...). Apache Derby just happens to be the default.

&gt; I would like to customize JR to access my DataBase Schema (a
&gt; couple of tables which save node types and node relations instead jackrabbit
&gt; repository).

If you use your own custom schema, you would need to write your own
JCR implementation (your own 'Jackrabbit'). Or at least your own
Persistence Manager (see
http://wiki.apache.org/jackrabbit/PersistenceManagerFAQ ). But that's
quite a lot of work. Instead, I suggest to use Jackrabbit to store the
node data, and use the regular MySQL Bundle Persistence Manager.

&gt; I use mysql to store the node info and a custom filestore to
&gt; store BLOB objects.

I suggest to use the Data Store, see http://wiki.apache.org/jackrabbit/DataStore

Regards,
Thomas

Re: Customizing JR to access my DataBase Schema ..

Posted by imadhusudhanan <ma...@gmail.com>.
	 Thanks Thomas, I got it now. I m suppose to place the PM config under WorkSpace Template. By doing so I can see four tables under my db. 

---- On Tue, 31 Mar 2009 06:43:59 -0700 Thomas Müller &lt;thomas.mueller@day.com&gt; wrote ---- 

Hi,

&gt;  &lt;param name="schema" value="sampleschema"/&gt;

The parameter name 'schema' is misleading: it is the database type
(the name of the .ddl resource). In your case, it is mysql. Actually
you don't need to set it. See also
http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.html#setSchema(java.lang.String)

I believe with Jackrabbit and MySQL you can't currently use a
different database schema except the default one.

Did you check the log file?

Please use the user list for questions that are not related to
development of Jackrabbit.

Regards,
Thomas

Re: Customizing JR to access my DataBase Schema ..

Posted by Thomas Müller <th...@day.com>.
Hi,

>                         <param name="schema" value="sampleschema"/>

The parameter name 'schema' is misleading: it is the database type
(the name of the .ddl resource). In your case, it is mysql. Actually
you don't need to set it. See also
http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.html#setSchema(java.lang.String)

I believe with Jackrabbit and MySQL you can't currently use a
different database schema except the default one.

Did you check the log file?

Please use the user list for questions that are not related to
development of Jackrabbit.

Regards,
Thomas

Re: Customizing JR to access my DataBase Schema ..

Posted by imadhusudhanan <ma...@gmail.com>.
	 
My PM Configuration ... can I expect any tables getting created when I Re start my server ... I cant find any diff in mysqldump before and after this config. Kindly Help .. Is there any thing I miss &gt;&gt; 

&lt;PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager"&gt;
 &lt;param name="driver" value="org.gjt.mm.mysql.Driver"/&gt;
 &lt;param name="url" value="jdbc:mysql://localhost:3306/jbossdb?useUnicode=true&amp;#038;amp&amp;#059;characterEncoding=UTF-8" /&gt;
 &lt;param name="user" value="root" /&gt;
 &lt;param name="password" value="" /&gt;
 &lt;param name="schema" value="sampleschema"/&gt;
 &lt;param name="schemaObjectPrefix" value="J_PM_${wsp.name}_" /&gt;
 &lt;param name="externalBLOBs" value="false" /&gt;
 &lt;/PersistenceManager&gt;


---- On Mon, 30 Mar 2009 06:12:19 -0700 Thomas Müller &lt;thomas.mueller@day.com&gt; wrote ---- 

Hi,

&gt; I see the DataStore
&gt; implementation creating a mysql table in db. Instead can I point the
&gt; DataStore to my custom FileServer. Any configuration ?

Both DbDataStore (using MySQL, or another database) and FileDataStore
are supported. For configuration details, see
http://wiki.apache.org/jackrabbit/DataStore - if the documentation is
incomplete or unclear please ask again :-)

Regards,
Thomas

Re: Customizing JR to access my DataBase Schema ..

Posted by Thomas Müller <th...@day.com>.
Hi,

> I see the DataStore
> implementation creating a mysql table in db. Instead can I point the
> DataStore to my custom FileServer. Any configuration ?

Both DbDataStore (using MySQL, or another database) and FileDataStore
are supported. For configuration details, see
http://wiki.apache.org/jackrabbit/DataStore - if the documentation is
incomplete or unclear please ask again :-)

Regards,
Thomas

Re: Customizing JR to access my DataBase Schema ..

Posted by imadhusudhanan <ma...@gmail.com>.
Thanks Thomas.	 Let me try using the JR's Mysql PM. I do not mind whatever schema is behind whether mine or JRs. Let me get back to u in case I face any problem configuring PM. Another question, I see the DataStore implementation creating a mysql table in db. Instead can I point the DataStore to my custom FileServer. Any configuration ?? Also


---- On Mon, 30 Mar 2009 05:23:03 -0700 Thomas Müller &lt;thomas.mueller@day.com&gt; wrote ---- 

Hi,

&gt;  AFAIK JackRabbit uses Apache Derby

You can use any database (MySQL, PostgreSQL, H2 Database Engine,
Oracle,...). Apache Derby just happens to be the default.

&gt; I would like to customize JR to access my DataBase Schema (a
&gt; couple of tables which save node types and node relations instead jackrabbit
&gt; repository).

If you use your own custom schema, you would need to write your own
JCR implementation (your own 'Jackrabbit'). Or at least your own
Persistence Manager (see
http://wiki.apache.org/jackrabbit/PersistenceManagerFAQ ). But that's
quite a lot of work. Instead, I suggest to use Jackrabbit to store the
node data, and use the regular MySQL Bundle Persistence Manager.

&gt; I use mysql to store the node info and a custom filestore to
&gt; store BLOB objects.

I suggest to use the Data Store, see http://wiki.apache.org/jackrabbit/DataStore

Regards,
Thomas

Re: Customizing JR to access my DataBase Schema ..

Posted by Thomas Müller <th...@day.com>.
Hi,

>     AFAIK JackRabbit uses Apache Derby

You can use any database (MySQL, PostgreSQL, H2 Database Engine,
Oracle,...). Apache Derby just happens to be the default.

> I would like to customize JR to access my DataBase Schema (a
> couple of tables which save node types and node relations instead jackrabbit
> repository).

If you use your own custom schema, you would need to write your own
JCR implementation (your own 'Jackrabbit'). Or at least your own
Persistence Manager (see
http://wiki.apache.org/jackrabbit/PersistenceManagerFAQ ). But that's
quite a lot of work. Instead, I suggest to use Jackrabbit to store the
node data, and use the regular MySQL Bundle Persistence Manager.

> I use mysql to store the node info and a custom filestore to
> store BLOB objects.

I suggest to use the Data Store, see http://wiki.apache.org/jackrabbit/DataStore

Regards,
Thomas