jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Guggisberg" <stefan.guggisb...@gmail.com>
Subject Re: incorrect system view export if property is String[1]
Date Fri, 07 Mar 2008 09:57:37 GMT
On Fri, Mar 7, 2008 at 9:58 AM, Jukka Zitting <jukka.zitting@gmail.com> wrote:
> Hi,
>
>  2008/3/6 Martin Zdila <m.zdila@mwaysolutions.com>:
>
> >  i think i've found a bug. if i have multivalue with only one item, then export
>  >  is ambiguous. after import i see only String property. please check
>  >  attachments. should i report it to jira?
>
>  Yes, please.
>
>  The problem is that there is an ambiguity related to multivalued
>  properties in the system view format specified in JSR 170. Normally
>  the import can determine whether a property should be multivalued or
>  not by looking at the matching property definition associated with the
>  node type. But with nt:unstructured there is both a single- and a
>  multivalued property definition that matches the imported property. In
>  such cases Jackrabbit looks at the number of values in the imported
>  property, and defaults to the single-valued property definition if
>  just a single value is being imported like in your String[1] case.
>
>  We can't really solve the problem by improving the heuristics on the
>  import side, so we should add some explicit property metadata like
>  rep:multivalued="true" to the system view export to help solve the
>  ambiguity.
>

you might also use specific node types instead of the generic nt:unstructured
(if that's an option) in order to avoid this issue.

e.g.

[myapp:book]
  - myapp:title (string) mandatory
  - myapp:authors (string) multiple mandatory
  ...

cheers
stefan


>
>  >  the other strange thing is that document view export is empty. is it ok? why?
>
>  That's a long-lived known issue, see
>  https://issues.apache.org/jira/browse/JCR-325.
>
>  The reason is basically that since we currently can't import
>  multivalued properties in document view, we think it's better also not
>  to export them to avoid giving people the wrong idea. There is no
>  concept of multivalued attributes in XML, so while the JCR spec
>  specifies a way to handle that case it also leaves a lot of freedom to
>  implementations to decide if they want to support that feature.
>
>  In the general case it is impossible to properly import multivalued
>  properties using the document view, but there are a lot of heuristics
>  we could apply to make that feature work reasonably well in practice.
>  I spent some time on that issue two years ago, but dropped the effort
>  since it's rather complex and there is no clear need for such
>  functionality.
>
>  BR,
>
>  Jukka Zitting
>

Mime
View raw message