jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Moseley <...@osafoundation.org>
Subject Re: PUTing an xml file causes import
Date Wed, 06 Apr 2005 16:25:38 GMT
Tobias Strasser wrote:

> i the roundtripping of XML as docview import/export works, this is 
> very handy feature. you throw in your xml, this is deserialized on the
> repository, thus offering many manipulating  and query features, and
> reassembled upon a GET request.

for some use cases, sure, i definitely see the benefit.

for my use case, a generic WebDAV server, i'm just stuffing a file in 
and expecting to get the same file out. i don't want to use JCR to query 
the contents of the file or anything fancy like that.

an input file containing xml like this:

<Note kind="blah" uuid="blah">
   <body>some text here</body>
   <createdOn>2005-03-30 11:37:06.33</createdOn>
   <displayName>Welcome to Chandler 0.5</displayName>
</Note>

is coming back out as:

<jcr:content jcr:primaryType="nt:unstructured"
              xmlns:jcr="http://www.jcp.org/jcr/nt/1.0"
              ... >
   <Note jcrPrimaryType="nt:unstructured" kind="blah" uuid="blah">
     <body>some text here</body>
     ...
   </Note>
</jcr:content>

maybe a bug, maybe not. in any event, not what i want.

> but in general, this might not be a good option, since roundtripping
> might not be feasible for some XML document, and some information
> might get lost (eg. DTD). as far as i remember, this is kind of a
> 'demo-feature' and should be configurable.

it doesn't look configurable. see DavResourceImpl:333:

	    if (fileName.endsWith(".xml")) {
		importXml(file, in, "text/xml");
	    } else {
		// todo: retrieve proper mimetype from filename
		importFile(file, in, "application/octet-stream");
	    }

since i need to subclass DavResourceImpl anyway to implement PROPPATCH, 
i will also cause it not to import XML. that way the current behavior of 
DavResourceImpl is preserved for everybody else until y'all decide 
if/how to make the behavior configurable.

Mime
View raw message