Uploaded image for project: 'Queries directory'
  1. Queries directory
  2. QUERIES-94

Improvements on QueryHelper, Query and QueryContainer API

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • 2.2.0
    • 2.2.0
    • None
    • 4.2 M11

      The method #QueryHelper.getQueriesRootNode(AmetysObjectResolver) should be modified, two ways for this :

      1. Move it to a serviceable component (maybe we will have websites implementations in the future) -> More relevant in the QueryDAO ?
      2. Transform the QueryHelper to a serviceable component

      We should avoid to call QueryHelper directly. Instead we should add and use methods on Query and QueryContainer objects like :

      • #getQueries()
      • #getQueriesContainer()
      • #getRelativePath() (optional) - Path to the container root node

      We must avoid to build the parent path of a Query[Container] object manually like this :

      StringBuilder parentPath = new StringBuilder("/jcr:root").append(ISO9075.encodePath(container.getNode().getPath()));

      This is bad and with that we are completely JCR dependent.

      We shouldn't have a StringBuilder as an argument in the QueryHelper methods because it's an alterable type and even if the StringBuilder is duplicate to be reused, it's not clear for the developer. Also, doing new StringBuilder(stringBuilder) or new StringBuilder(stringBuilder.build()) have almost the same cost.

      Methods of QueryHelper should be able to accept a QueryContainer instead of a parent path and rebuild it dynamically if necessary.

      After that, all calls to QueryHelper should be study to use Query or QueryContainer instead.

            bmaurel Bérénice Maurel
            bmaurel Bérénice Maurel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: