You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Julio Castillo <jc...@edgenuity.com> on 2008/03/17 18:39:27 UTC

Sample architecture / code

I have made the decision to use Jackrabbit as a service from my web
application. (Meaning Model 3).

I have successfully deployed Jackrabbit against a MySQL dB. I can access the
Tomcat server through the sample populate and search jsp files.

I have decided to use WebDav as a mechanism to use it and access it rather
than RMI for simplicity from my web app. I have been looking for sample
code, test code or anything that does from the client side, but I have not
found any.

Two questions.
Is this a common architecture? Is anybody using Jackrabbit as a service?
Second question, any ideas where I can find sample code that uses WebDav
accessing the tomcat/jackrabbit server?
Alternatively, sample code using RMI would be OK, but rather not use that
method.

thanks

Julio Castillo


Re: OCM mapping to nt:file

Posted by Vpupkin <ge...@maas.de>.
Yes, thanks a lot! 
Now i have enough to thinking/testing  8-)


Christophe Lombart wrote:
> 
> ...
> Hope this help :-)
> 
> 

-- 
View this message in context: http://www.nabble.com/Sample-architecture---code-tp16102678p17146726.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: OCM mapping to nt:file

Posted by Christophe Lombart <ch...@gmail.com>.
On Fri, May 9, 2008 at 11:27 AM, Vpupkin <ge...@maas.de> wrote:

>
> Hello again,
> Thank's for your answers, now it is mostly clear for me.
> CND :  You say -"" CND : not yet supported.  ..."".  Does it means i can
> generate java-classes from XML-structure with OCM-compatible annotations?
> Have u link to impl/doc/example?


Right now, this tools generates node types from an OCM xml mapping file.
This is not yet possible to do that from the annotations. Yet another tools
to write ... :-)

>
>
> RMI - Webdav :  in my case i have already geterogen-enviroment (for
> ex.different JVM-version). Additionally in the nearest future i want to use
> it not only for java, but for JS, .NET. So WebDav as independent protocol
> looks much more flexible.
>

I advise to review Sling which is more appropriate for that kind of uses
cases.
See on http://incubator.apache.org/sling/site/index.html.



> Update/modification in the content model : "removing properties"?  Is it
> helps when i have already stored into REPO data, and then i want to change
> "a bit" the TypeDefinition ...
> ...for ex. in your example resource i want to add 1 field and rename 2nd .
> Currently we export context of old repo and convert it by XSLT into new
> structure, then store into repo back. But it is look not fine-grained as
> for
> me.


Yep, for me, this not  clear  how we can manage the different situations.  I
have to  think about  that  in more details.

>
>
> BTW: I just found the project  http://code.google.com/p/jcrom/ JCROM .
> Is it related somehow to OCM-development? Looks pretty similar ;)
>


Yes.  this is another  OCM project. Jackrabbit OCM makes a full abstraction
on JCR which is not the case of JCROM. JCROM is more simple to configure but
it seems there are less features (for the moment). Fore exemple, Jackrabbit
OCM support interfaces and ancestor. It also support many Collection and Map
types. I'm not sure this is the case of JCROM. I will add a page on the
internet site with a full feature list.


Hope this help :-)

Re: OCM mapping to nt:file

Posted by Vpupkin <ge...@maas.de>.
Hello again,
Thank's for your answers, now it is mostly clear for me.
CND :  You say -"" CND : not yet supported.  ..."".  Does it means i can
generate java-classes from XML-structure with OCM-compatible annotations?
Have u link to impl/doc/example?

RMI - Webdav :  in my case i have already geterogen-enviroment (for
ex.different JVM-version). Additionally in the nearest future i want to use
it not only for java, but for JS, .NET. So WebDav as independent protocol
looks much more flexible.

Update/modification in the content model : "removing properties"?  Is it
helps when i have already stored into REPO data, and then i want to change
"a bit" the TypeDefinition ... 
...for ex. in your example resource i want to add 1 field and rename 2nd .
Currently we export context of old repo and convert it by XSLT into new
structure, then store into repo back. But it is look not fine-grained as for
me.

BTW: I just found the project  http://code.google.com/p/jcrom/ JCROM .
Is it related somehow to OCM-development? Looks pretty similar ;)

Kindest regards,
Vasilij


Christophe Lombart wrote:
> 
> Hi,
> 
> I think we are in a second dev phase for the OCM tools. Many features are
> implemented and now I more focusing on simplications, check some uses
> cases
> and wait for the community feedback.
> So, all you are asked are tasks to be implemented or to check.
> 
> 
> CND : not yet supported. I know it becomes urgent for some of you. I think
> it is possible to make a small patch in the OCM node management project.
> 
> RMI - Webdav :  we need to add more doc and examples. Personnally, I never
> used the webdav support in my projects. RMI is certainly not a problem.
> 
> Update/modification in the content model : this is not yet supported.
> There
> are different possibilties. Adding properties or subnodes should not be
> complex. What about removing properties ?
> 
> 
> br,
> Christophe
> 
> 
> On Thu, May 8, 2008 at 7:45 PM, Vpupkin <ge...@maas.de> wrote:
> 
>>
>> Hi Christophe,
>> i am also interesting to use OCM, and your examples is really valuable
>> for
>> me!
>> Could u pls answer on some more questions:
>> 1. Is it possible somehow to make mapping from/to CND-file <->
>> JavaClassWithAnnotations?
>> 2. How to use OCM with WebDav protocol? Can  I open somehow the
>> JR-Session
>> via WebDav at all?
>> 3. How comparable RMI- and pure-jcr-API in OCM view? Looks similar,
>> but...
>> 4. Is it possible to update already existing mapping in repository
>> somehow,
>> when the class-definition is changed? If not - what is the "best
>> practice"
>> for such cases?
>  ...
> 
> 

-- 
View this message in context: http://www.nabble.com/Sample-architecture---code-tp16102678p17144432.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: OCM mapping to nt:file

Posted by Christophe Lombart <ch...@gmail.com>.
Hi,

I think we are in a second dev phase for the OCM tools. Many features are
implemented and now I more focusing on simplications, check some uses cases
and wait for the community feedback.
So, all you are asked are tasks to be implemented or to check.


CND : not yet supported. I know it becomes urgent for some of you. I think
it is possible to make a small patch in the OCM node management project.

RMI - Webdav :  we need to add more doc and examples. Personnally, I never
used the webdav support in my projects. RMI is certainly not a problem.

Update/modification in the content model : this is not yet supported. There
are different possibilties. Adding properties or subnodes should not be
complex. What about removing properties ?


br,
Christophe


On Thu, May 8, 2008 at 7:45 PM, Vpupkin <ge...@maas.de> wrote:

>
> Hi Christophe,
> i am also interesting to use OCM, and your examples is really valuable for
> me!
> Could u pls answer on some more questions:
> 1. Is it possible somehow to make mapping from/to CND-file <->
> JavaClassWithAnnotations?
> 2. How to use OCM with WebDav protocol? Can  I open somehow the JR-Session
> via WebDav at all?
> 3. How comparable RMI- and pure-jcr-API in OCM view? Looks similar, but...
> 4. Is it possible to update already existing mapping in repository somehow,
> when the class-definition is changed? If not - what is the "best practice"
> for such cases?
>
> thanks in advance,
>
> Vasilij
>
>
> Christophe Lombart wrote:
> >
> > Hi,
> >
> > There are some examples in the unit tests :
> >
> > nt:file
> >
> http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-ocm/src/test/java/org/apache/jackrabbit/ocm/testmodel/File.java
> >
> > nt:resource
> >
> http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-ocm/src/test/java/org/apache/jackrabbit/ocm/testmodel/Resource.java
> >
> > nt:folder
> >
> http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-ocm/src/test/java/org/apache/jackrabbit/ocm/testmodel/Folder.java
> >
> >
> > Let me know if you need more information
> >
> > Christophe
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Sample-architecture---code-tp16102678p17130103.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>

Re: OCM mapping to nt:file

Posted by Vpupkin <ge...@maas.de>.
Hi Christophe,
i am also interesting to use OCM, and your examples is really valuable for
me!
Could u pls answer on some more questions:
1. Is it possible somehow to make mapping from/to CND-file <->
JavaClassWithAnnotations?
2. How to use OCM with WebDav protocol? Can  I open somehow the JR-Session
via WebDav at all?
3. How comparable RMI- and pure-jcr-API in OCM view? Looks similar, but...
4. Is it possible to update already existing mapping in repository somehow,
when the class-definition is changed? If not - what is the "best practice"
for such cases? 

thanks in advance,

Vasilij


Christophe Lombart wrote:
> 
> Hi,
> 
> There are some examples in the unit tests :
> 
> nt:file
> http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-ocm/src/test/java/org/apache/jackrabbit/ocm/testmodel/File.java
> 
> nt:resource
> http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-ocm/src/test/java/org/apache/jackrabbit/ocm/testmodel/Resource.java
> 
> nt:folder
> http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-ocm/src/test/java/org/apache/jackrabbit/ocm/testmodel/Folder.java
> 
> 
> Let me know if you need more information
> 
> Christophe
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Sample-architecture---code-tp16102678p17130103.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: OCM mapping to nt:file

Posted by Christophe Lombart <ch...@gmail.com>.
Hi,

There are some examples in the unit tests :

nt:file
http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-ocm/src/test/java/org/apache/jackrabbit/ocm/testmodel/File.java

nt:resource
http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-ocm/src/test/java/org/apache/jackrabbit/ocm/testmodel/Resource.java

nt:folder
http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-ocm/src/test/java/org/apache/jackrabbit/ocm/testmodel/Folder.java


Let me know if you need more information

Christophe


On Thu, Apr 3, 2008 at 11:54 PM, Zhihai Liu <zl...@cleverex.com> wrote:
> Hi,
>
>  I am trying to get an example of OCM mapping with nt:file. How the
>  annotation or XML will be to map a Java class like below to nt:file?
>
>  public class File
>  {
>   Private String path;
>   private String mimeType;
>   private String encoding;
>   private InputStream data;
>   private Calendar lastModified;
>   // Add getters/setters
>  }
>
>  In addition, how to ensure that "data" (InputStream) is mapped to
>  jcr:content as nt:resource? I think that's required to get it indexed and
>  become searchable.
>
>  Thanks in advance.
>
>
>

OCM mapping to nt:file

Posted by Zhihai Liu <zl...@cleverex.com>.
Hi,

I am trying to get an example of OCM mapping with nt:file. How the
annotation or XML will be to map a Java class like below to nt:file?

public class File
{
  Private String path;	
  private String mimeType;
  private String encoding;
  private InputStream data;
  private Calendar lastModified;
  // Add getters/setters
}

In addition, how to ensure that "data" (InputStream) is mapped to
jcr:content as nt:resource? I think that's required to get it indexed and
become searchable. 

Thanks in advance.



RE: Sample architecture / code

Posted by Julio Castillo <jc...@edgenuity.com>.
Gregor,
Yes, I would be interested in your findings.

Let me know

Thanks

** julio 

-----Original Message-----
From: greg power [mailto:greg.power634@googlemail.com] 
Sent: Thursday, April 03, 2008 8:23 AM
To: users@jackrabbit.apache.org
Subject: Re: Sample architecture / code


Hi Julio,

I am doing (or rather starting) something very similar. However I am writing
my web client in GWT therefore I will be using GWT's excellent RPC mechanism
to communicate with AJAX client (this "feels" like RMI) rather than WebDAV.
So what I've decided to do is put the Jackrabbit code behind session EJB's
on JBoss. Jackrabbit is installed on JBoss as RAR per the documentation on
the Wiki and accessed via JNDI. The EJB's are then accessed from the GWT RPC
servlets. I hope to have a PoC for this running in the next few days, so if
you're interested let me know.

regards
gregor


Julio Castillo wrote:
> 
> I have made the decision to use Jackrabbit as a service from my web 
> application. (Meaning Model 3).
> 
> I have successfully deployed Jackrabbit against a MySQL dB. I can 
> access the Tomcat server through the sample populate and search jsp 
> files.
> 
> I have decided to use WebDav as a mechanism to use it and access it 
> rather than RMI for simplicity from my web app. I have been looking 
> for sample code, test code or anything that does from the client side, 
> but I have not found any.
> 
> Two questions.
> Is this a common architecture? Is anybody using Jackrabbit as a service?
> Second question, any ideas where I can find sample code that uses 
> WebDav accessing the tomcat/jackrabbit server?
> Alternatively, sample code using RMI would be OK, but rather not use 
> that method.
> 
> thanks
> 
> Julio Castillo
> 
> 
> 

--
View this message in context:
http://www.nabble.com/Sample-architecture---code-tp16102678p16467562.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Sample architecture / code

Posted by greg power <gr...@googlemail.com>.
Hi Julio,

I am doing (or rather starting) something very similar. However I am writing
my web client in GWT therefore I will be using GWT's excellent RPC mechanism
to communicate with AJAX client (this "feels" like RMI) rather than WebDAV.
So what I've decided to do is put the Jackrabbit code behind session EJB's
on JBoss. Jackrabbit is installed on JBoss as RAR per the documentation on
the Wiki and accessed via JNDI. The EJB's are then accessed from the GWT RPC
servlets. I hope to have a PoC for this running in the next few days, so if
you're interested let me know.

regards
gregor


Julio Castillo wrote:
> 
> I have made the decision to use Jackrabbit as a service from my web
> application. (Meaning Model 3).
> 
> I have successfully deployed Jackrabbit against a MySQL dB. I can access
> the
> Tomcat server through the sample populate and search jsp files.
> 
> I have decided to use WebDav as a mechanism to use it and access it rather
> than RMI for simplicity from my web app. I have been looking for sample
> code, test code or anything that does from the client side, but I have not
> found any.
> 
> Two questions.
> Is this a common architecture? Is anybody using Jackrabbit as a service?
> Second question, any ideas where I can find sample code that uses WebDav
> accessing the tomcat/jackrabbit server?
> Alternatively, sample code using RMI would be OK, but rather not use that
> method.
> 
> thanks
> 
> Julio Castillo
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Sample-architecture---code-tp16102678p16467562.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.