jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Justin Lipton" <justin.lip...@exari.com>
Subject RE: properties with XML-Values; patch
Date Thu, 21 Feb 2008 10:03:48 GMT
I like Julian's example of  <xhtml:em>important</xhtml:em> which is an
illustration of mixed content XML but it is also convenient where you have a
straight multivalued property e.g.

<D:prop><X:contributors><X:contributor>Angela
Schreiber</X:contributor><X:contributor>Julian
Reschke</X:contributor></X:contributors></D:prop>

There are obviously other ways of achieving this CSV, different property
names (X:contributor1, X:contributor2) etc but XML is probably the least
nasty.

Cheers,
Justin.
-----Original Message-----
From: Julian Reschke [mailto:julian.reschke@gmx.de] 
Sent: Thursday, 21 February 2008 8:26 PM
To: dev@jackrabbit.apache.org
Subject: Re: properties with XML-Values; patch

Angela Schreiber wrote:
> ...
> so, i'd like to understand what is the goal of custom xml properties.
> ...

Well, the same as using XML instead of text, I guess. Such as putting things
like marked-up text into properties:

   <D:prop><X:comment foo='bar' xmlns:xhtml="..." xmlns:X="...">This is an
<xhtml:em>important</xhtml:em> change.</X:comment></D:prop>

In JCR (and therefore Jackrabbit), this kind of structure would preferably
be stored in nodes, not properties, I assume (a design that I don't
necessarily like).

So what we *have* to do is to make sure that somebody wants to set a
property value as above, it will either work, or fail upon PROPPATCH.

For the latter, check whether the property XML element ("comment") has
element child nodes. If it does, reject the request.

If we want enable Jackrabbit to store things like that, we need to map the
WebDAV property to something over than a single-valued string. It may be
possible to use JCR child nodes, but I'm not sure how that fits into the
Jackrabbit WebDAV design.

An alternative would be to tunnel the value in a way that it as least
unlikely to be confused with other property values, such as a multivalued
string property:

comment[0] = "WebDAV XML property"
comment[1] = content serialized as XML, including containing element,
attributes and namespace decls. (*)

BR, Julian

(*) See <http://greenbytes.de/tech/webdav/rfc4918.html#rfc.section.4.3.1>




!DSPAM:47bd43db284891850820625!



Mime
View raw message