Uploaded image for project: '[Read Only] - Hippo Site Toolkit 2'
  1. [Read Only] - Hippo Site Toolkit 2
  2. HSTTWO-2782

Support in HstQuery API to easily query for sub types of multiple bean types or primary node types

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 2.28.05
    • None
    • None

    Description

      HstQuery interface allows for queries for certain node types and its subtypes yes/no. Or for a list of names types. If you want to combine type A and its subtypes plus type B (no subtype of A), then you have to create your own list of type A. A HstFilterUtils could help building this list. It could contain the following code.

      NodeTypeManager ntMgr = session.getWorkspace().getNodeTypeManager();
      NodeTypeIterator allTypes = ntMgr.getAllNodeTypes();
      while (allTypes.hasNext()) {
      NodeType nt = allTypes.nextNodeType();
      if (nt.isNodeType("myproject:base"))

      { Filter orFilter = query.createFilter() orFilter.addEqualTo("jcr:primaryType",nt.getName()) }

      }
      Filter orFilter = query.createFilter()
      orFilter.addEqualTo("jcr:primaryType", "hippostd:gallery);

      Attachments

        Activity

          People

            Unassigned Unassigned
            bleunis Bert Leunis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: