hi jake
On 10/11/07, Jake Roberts <ja...@quantum4d.com> wrote:
Apologies if this question has been answered elsewhere; I've poked around and
haven't seen anything. I feel like I'm missing something basic.
I'm trying to round-trip repository data to and from System View XML. But
there's a problem: When a multi-valued property that happens to have only
one value is exported to XML (System View), it becomes a single-valued
property on re-import of the same file.
Consulting the JCR spec, it looks like no provision is made for recording
the multiplicity of a property in System View XML. You get the name, the
type, and the values and that's it.
When I import the same XML file, it appears that the importer decides
whether a property is single or multi-valued based on the number of value
elements present for that property in XML. And as far as I can tell, there's
no other way it could work. The information necessary to tell a
single-valued property from a multi-valued property with a single value
isn't present. Or am I confused?
no, you're absolutely right. i assume you're using nt:unstructured.
nt:unstructured
provides 2 residual property definitions, one being singe-, the other
multi-valued.
on re-import there's no way to detect whether a property with a single v alue
was declared as a multi-value property.
In any case, the practical upshot is that I get ValueFormatExceptions on
properties that my application expects to be multi-valued, as they were
prior to export and re-import. Any suggestions on how to correctly handle
round-tripping of multi-valued props via System View XML?
by using custom node types you should be able to correctly round-trip
single-valued multi-value properties (phew;).
e.g.
[myapp:book]
- myapp:keywords (string) multiple
- myapp:title (string)
...
cheers
stefan