You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Dan Connelly <da...@comcast.net> on 2007/04/17 19:33:57 UTC

Less shredding. More satisfying.

Suppose I have an xml stream like this:

<transmission id="1234" sender="agent1">
    <document id="blabla-01" >
       <foo/>
       <bar/>
       <baz/>
    </document>
    <document id="blabla-02">
       <eeny/>
       <meeny/>
       <miney/>
       <moe/>
    </document>
</transmission>

I want to *import* this xml into JR as something like this:

/gateway/transmissions/agent1/1234/blabla-01/jcr:primaryType = nt:resource
/gateway/transmissions/agent1/1234/blabla-01/jcr:encoding = UTF-8
/gateway/transmissions/agent1/1234/blabla-01/jcr:encoding = 
mimeType=text/xml
/gateway/transmissions/agent1/1234/blabla-01/jcr:data = <document 
id="blabla-01" ><foo/><bar/><baz/></document>
/gateway/transmissions/agent1/1234/blabla-01/jcr:lastModified = 15Apr2007
/gateway/transmissions/agent1/1234/blabla-02/jcr:primaryType = nt:resource
/gateway/transmissions/agent1/1234/blabla-02/jcr:encoding = UTF-8
/gateway/transmissions/agent1/1234/blabla-02/jcr:encoding = 
mimeType=text/xml
/gateway/transmissions/agent1/1234/blabla-02/jcr:data = <document 
id="blabla-02"><eeny/><meeny/><miney/><moe/></document>
/gateway/transmissions/agent1/1234/blabla-02/jcr:lastModified = 15Apr2007

for the import, I expect to supply an XPath expression (or an XSLT) in 
order to construct the paths.  (Or, to supply a node type def XML.)

I do not want to write any "code" (such as a SAX handler) specifically 
for this data model.  

Is this supported by JCR?   By Jackrabbit?   By WebDAV tooling that 
constructs an appropriate path?

       -- Dan Connelly



Re: Less shredding. More satisfying.

Posted by Willis Morse <wi...@mac.com>.
Interesting, I'm bumping into this same issue right now. Can you  
elaborate a little more on how you're using it?

And do you have to use the server-based deployment flavors of  
Jackrabbit in order to do this? How about those of us embedding  
Jackrabbit directly into desktop apps?

- Willis Morse


On Apr 23, 2007, at 6:52 AM, Dan Connelly wrote:

> Restlet


Re: Less shredding. More satisfying.

Posted by Dan Connelly <da...@comcast.net>.
Answering my own question:

    Restlet + Jackrabbit

The xslt for Message --> Content is a bit tricky, but very usable once 
you get the trick.



Dan Connelly wrote:

> Suppose I have an xml stream like this:
>
> <transmission id="1234" sender="agent1">
>    <document id="blabla-01" >
>       <foo/>
>       <bar/>
>       <baz/>
>    </document>
>    <document id="blabla-02">
>       <eeny/>
>       <meeny/>
>       <miney/>
>       <moe/>
>    </document>
> </transmission>
>
> I want to *import* this xml into JR as something like this:
>
> /gateway/transmissions/agent1/1234/blabla-01/jcr:primaryType = 
> nt:resource
> /gateway/transmissions/agent1/1234/blabla-01/jcr:encoding = UTF-8
> /gateway/transmissions/agent1/1234/blabla-01/jcr:encoding = 
> mimeType=text/xml
> /gateway/transmissions/agent1/1234/blabla-01/jcr:data = <document 
> id="blabla-01" ><foo/><bar/><baz/></document>
> /gateway/transmissions/agent1/1234/blabla-01/jcr:lastModified = 15Apr2007
> /gateway/transmissions/agent1/1234/blabla-02/jcr:primaryType = 
> nt:resource
> /gateway/transmissions/agent1/1234/blabla-02/jcr:encoding = UTF-8
> /gateway/transmissions/agent1/1234/blabla-02/jcr:encoding = 
> mimeType=text/xml
> /gateway/transmissions/agent1/1234/blabla-02/jcr:data = <document 
> id="blabla-02"><eeny/><meeny/><miney/><moe/></document>
> /gateway/transmissions/agent1/1234/blabla-02/jcr:lastModified = 15Apr2007
>
> for the import, I expect to supply an XPath expression (or an XSLT) in 
> order to construct the paths.  (Or, to supply a node type def XML.)
>
> I do not want to write any "code" (such as a SAX handler) specifically 
> for this data model. 
> Is this supported by JCR?   By Jackrabbit?   By WebDAV tooling that 
> constructs an appropriate path?
>
>       -- Dan Connelly
>
>
>