You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Michael Dürig (JIRA)" <ji...@apache.org> on 2013/01/15 11:32:12 UTC
[jira] [Commented] (OAK-554) PropertyStates#createProperty ignores
namespace mappings when creating states of type NAME and PATH
[ https://issues.apache.org/jira/browse/OAK-554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13553644#comment-13553644 ]
Michael Dürig commented on OAK-554:
-----------------------------------
bq. only accept oak Value implementation that allows to retrieve the internal representation, which is present in the ValueImpl afaik.
I think that's what we should do.
The two {{createProperty}} methods that take a {{Value}} as argument should check whether it is a {{ValueImpl}} and unpack and return its internal representation. If this is not the case, we should fall back to the current behaviour. Except for {{NAME}} and {{PATH}} where I'd just throw an {{IllegalArguementException}}.
We can always add a further method, which takes care of that and which takes a {{NamePathMapper}} as one of its arguments if it turns out to be required.
> PropertyStates#createProperty ignores namespace mappings when creating states of type NAME and PATH
> ---------------------------------------------------------------------------------------------------
>
> Key: OAK-554
> URL: https://issues.apache.org/jira/browse/OAK-554
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: core
> Reporter: angela
>
> as far as i saw we use PropertyStates#createProperty to create and
> set an OAK property from a given JCR value or a list of JCR values.
> this works well for all types of values except for NAME, PATH which
> may contain values with remapped namespaces which will not be converted
> back to oak-values during the state creation:
> {code}
> List<String> vals = Lists.newArrayList();
> for (Value value : values) {
> vals.add(value.getString());
> }
> return new MultiGenericPropertyState(name, vals, Type.fromTag(type, true));
> {code}
> if am not mistaken {code}value.getString(){code} will return the JCR
> representation of the value instead of the oak representation as it
> would be needed here.
> possible solutions include:
> - passing namepathmapper to the create method
> - only accept oak Value implementation that allows to retrieve the
> internal representation, which is present in the ValueImpl afaik.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira