The root query retrieves the entities from censhare that can be accessed in the CI HUB panel. The default query is identical to the My work query in censhare Web. 

Introduction

The root query is responsible for the navigation structure (group assets aka folders) that are retrieved from censhare and displayed in the CI HUB panel in Adobe CC applications.

The root query is called in the Folder schema that builds the navigation structure in the CI HUB panel. The result is a hierarchical structure of group assets.

Usage

The root query for CI HUB is stored in a separate asset and part of the censhare standard product:

Asset nameCihub (top-level)
Resource keycenshare:search.cihub.groups.top-level
Asset typeModule / Search / Transformation

The query is stored in the master file:

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xi="http://www.w3.org/2001/XInclude"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:cs="http://www.censhare.com/xml/3.0.0/xpath-functions">

  <!-- search all group assets without parent groups and excluding templates sorted by name -->

  <!-- params -->
  <xsl:param name="context-id"/>
  <xsl:param name="filterAssetName" select="''"/>
  <xsl:param name="assetType" select="'all'"/>
  <xsl:param name="filterCreatedBy" select="'me'"/>

  <!-- root match -->
  <xsl:template match="/">
    <!-- get asset of logged in user -->
    <xsl:variable name="partyID" select="system-property('censhare:party-id')"/>
    <query>
      <and>
        <xsl:if test="$filterAssetName">
          <condition name="censhare:text.name" op="=" value="{$filterAssetName}"/>
        </xsl:if>
        <xsl:choose>
          <xsl:when test="$filterCreatedBy='all'">
            <!-- exclude groups created by system user and shows group has feature censhare:module-asset-source with value  -->
            <xsl:if test="$assetType != 'all'">
              <condition name="censhare:asset.type" value="{$assetType}"/>
            </xsl:if>
            <or>
              <condition name="censhare:asset.created_by" op="!=" value="1"/>
              <condition name="censhare:module-asset-source" op="=" value="optional/pim-test-data/basic-product-setup"/>
            </or>
          </xsl:when>
          <xsl:otherwise>
            <condition name="censhare:asset.created_by" value="{$partyID}"/>
            <xsl:if test="$assetType != 'all'">
              <condition name="censhare:asset.type" value="{$assetType}"/>
            </xsl:if>
          </xsl:otherwise>
        </xsl:choose>
        <condition name="censhare:asset.type" value="group.*"/>
        <!-- exclude templates -->
        <not>
          <condition name="censhare:asset-flag" value="is-template"/>
        </not>
        <!-- exclude child group hierarchies -->
        <not>
          <and>
            <condition name="censhare:asset.type" value="group.*"/>
            <relation direction="parent" type="user.*">
              <target>
                <!-- include groups assigned to a pinboard or favorites -->
                <and>
                  <condition name="censhare:asset.type" value="group.*"/>
                  <not>
                    <or>
                      <condition name="censhare:asset.name" value="Pinboard"/>
                      <condition name="censhare:asset.name" value="Favorites"/>
                    </or>
                  </not>
                </and>
              </target>
            </relation>
          </and>
        </not>
        <!-- exclude pinboard and favorites group assets assigned to a person -->
        <not>
          <and>
            <or>
              <condition name="censhare:asset.name" value="Pinboard"/>
              <condition name="censhare:asset.name" value="Favorites"/>
            </or>
            <relation direction="parent" type="user.">
              <target>
                <condition name="censhare:asset.type" value="person."/>
              </target>
            </relation>
          </and>
        </not>
      </and>
      <sortorders>
        <grouping mode="none"/>
        <order ascending="true" by="censhare:asset.name"/>
      </sortorders>
    </query>
  </xsl:template>
</xsl:stylesheet>

Customization

The standard root query works out of the box. However, you can customize the root query if desired. For more information, see Customize root query.