[
https://issues.apache.org/jira/browse/OAK-1285?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jukka Zitting updated OAK-1285:
-------------------------------
Attachment: 0002-OAK-1285-QueryEngine-executeQuery-takes-NamePathMapp.patch
0001-OAK-1285-QueryEngine-executeQuery-takes-NamePathMapp.patch
The attached 0001 patch replaces the {{NamePathMapper}} argument with a
{{Map<String, String>}} of the local namespace remappings to be applied when
processing the query statement. That map is then used by the query parser to
construct a local {{NamePathMapper}} for use just for that query.
This works well except for the {{UserQueryManager}} class which doesn't have
direct access to the current set of local namespace remappings. Given how far
removed from classes like {{SessionContext}} or {{SessionNamespaces}} the
{{UserQueryManager}} is, I couldn't find any easy way to pass that information
to it.
As an alternative (see patch 0002) I tried constructing the user queries
directly using Oak names and an empty set of namespace remappings, which would
have worked nicely (no need for the duplicate oak-jcr-oak mapping of names)
except for the lack of type information in the potential value constraints
which makes it impossible to tell whether a given value constraint is a name to
be remapped or just some generic value for which remapping isn't needed.
It seems like first idea of making the set of local namespace mappings
available to the {{UserQueryManager}} for use when executing the query would be
cleaner, but I'm not sure how to best pass that information through
{{UserConfiguration}} and {{UserManager}}. [~anchela], any ideas?
A crude approach would be to replace the {{NamePathMapper}} argument with some
helper interface that provides access to both the {{NamePathMapper}} instance
and the related set of local namespace mappings.
> QueryEngine#executeQuery takes NamePathMapper which is not part of oak-api
> --------------------------------------------------------------------------
>
> Key: OAK-1285
> URL: https://issues.apache.org/jira/browse/OAK-1285
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: core
> Reporter: angela
> Assignee: Jukka Zitting
> Fix For: 0.15
>
> Attachments:
> 0001-OAK-1285-QueryEngine-executeQuery-takes-NamePathMapp.patch,
> 0002-OAK-1285-QueryEngine-executeQuery-takes-NamePathMapp.patch
>
>
> [~fmeschbe] spotted the following inconsistency in the oak api:
> o.a.j.o.api.QueryEngine#executeQuery(String statement, String language,
> long limit, long offset, Map<String, ? extends PropertyValue>
> bindings,
> NamePathMapper namePathMapper) throws ParseException;
> takes a NamePathMapper which is not part of the oak api but only defined in
> the plugins.
> to resolve that inconsistency we may consider moving the NamePathMapper to a
> new o.a.j.oak.api.namepath package and keep the implementations in the
> plugins.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)