jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Moseley <...@maz.org>
Subject xml import/export in simple webdav server
Date Mon, 11 Apr 2005 20:49:43 GMT

so far i'm using FileImportCommand and FileExportCommand to read and 
write my xml files. all is well. now i'd like to move to importing and 
exporting them because, as was pointed out earlier, it would be nice to 
have the xml data stored as nodes for searching purposes.

in XMLImportCommand, a jcr:content node is created and the resource is 
imported beneath that. however, in XMLExportCommand the jcr:content node 
itself is exported. this causes the generated xml to be wrapped in a 
jcr:content element, like so:

   <jcr:content jcr:primaryType="nt:unstructured" 
jcr:mimeType="text/xml" jcr:lastModified="2005-04-11T13:44:42.995-07:00">
     <Share jcr:primaryType="nt:unstructured" 
kind="//parcels/osaf/framework/sharing/Share" 
uuid="87b574ee-aaca-11d9-d6f9-000d935d33e8">
       ...
     </Share>
   </jcr:content>

i tried adding code in XMLExportCommand to get the primary child of the 
jcr:content node and export that, but i got an ItemNotFoundException, 
leading me to believe there isn't actually a child node beneath the 
jcr:content node. if that's the case, then what exactly does the import 
do? reviewing the spec, it looked to me like the import should have 
actually created nodes beneath the jcr:content, but maybe i 
misunderstood. if new nodes aren't created, then how does one search on 
the imported content?

so the big money question is: how do i change/extend XMLExportCommand so 
that it exports xml without the wrapping jcr:content?

also, is there any easy way for me to cause the jcr attributes to not be 
included in the exported xml? the jcr spec indicates that i could 
provide my own sax handler, but i'd rather not do that :) i'm pretty 
sure that most/all webdav clients will be smart enough to ignore the jcr 
attributes when they're parsing the xml, but if i can filter them out 
before serving my response, that would be preferable.

thanks!

Mime
View raw message