jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torgeir Veimo <torg...@pobox.com>
Subject Re: multivalue problem
Date Fri, 01 Dec 2006 19:41:58 GMT
On Fri, 2006-12-01 at 18:08 +0000, Torgeir Veimo wrote:
> On Fri, 2006-12-01 at 16:21 +0000, Torgeir Veimo wrote:
> > I've got a node type def like this;
> > 
> > [nen:protected] > mix:referenceable mixin orderable
> > - nen:owner (string) mandatory multiple
> > + nen:ace(nen:ace)=nen:ace multiple
> > 
> > I've verified that this definition is in fact effective in the
> > repository;
> 
> I'm exporting with session.exportSystemView() and importing with
> session.importXML().
> 
> The export file contains fragments such as 
> 
> <sv:property sv:name="nen:owner"
> sv:type="String"><sv:value>authenticated</sv:value></sv:property>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


I tried adding some debug statements into PropInfo.apply(), and I get
output such as 

19:36:41,310 DEBUG PropInfo  - try setting single-value:
{http://netenviron.com/nen/1.0}owner, value: authenticated

if (va.length == 1) {
    // could be single- or multi-valued (n == 1)
    try {
        // try setting single-value
        log.debug("try setting single-value: " + name + ", value: " +
va[0].getString());
        node.setProperty(name, va[0]);
    } catch (ValueFormatException vfe) {
        // try setting value array
        log.debug("try setting value array: " + name + ", value: " +
va[0].getString());
        node.setProperty(name, va, type);
    } catch (ConstraintViolationException cve) {
        log.debug("exception: try setting value array: " + name + ",
value: " + va[0].getString());
        // try setting value array
        node.setProperty(name, va, type);
    }

I'd expect a ValueFormatException being thrown, and the value set again
as multivalue, but that does not happen.

If I create a new node of same type after the import, it fails unless I
set it as multivalue. If I try to save an imported node again with a
multivalue property, it fails, complaining that the property is single
value.

-- 
Torgeir Veimo <torgeir@pobox.com>


Mime
View raw message