Documentation Center

Show the entire taxonomy structure

We will configure the Tridion Docs SES Connector in such a way the user will see the entire taxonomy structure.

About this task

In Hypothetical taxonomy tree structure we defined a certain taxonomy structure. We will configure the field FLOCATION in such a way that it will show the entire taxonomy tree structure (except for the continents under hemispheres). We will also limit the user so that he can only select countries or cities.

So, we want the tree structure shown for the FLOCATION field to be:

Continents                      {id=34, class=category, selectable=no}
    - Australia                 {id=5, class=continent, selectable=no}
        - Australia             {id=38, class=country, selectable=yes}
            - Sydney            {id=46, class=city, selectable=yes}
    - Europe                    {id=17, class=continent, selectable=no}
        - France                {id=105, class=country, selectable=yes}
            - Paris             {id=12, class=city, selectable=yes}
Hemispheres                     {id=99, class=category, selectable=no}
    - Northern                  {id=203, class=hemisphere, selectable=no}
    - Southern                  {id=14, class=hemisphere, selectable=no}

Procedure

  1. Open the extension configuration in Organize Space via Settings > XML Settings > Extensions.
    By default the extension configuration only contains
    <infoShareExtensionConfig version="1.0"/>
  2. Add a basic configuration and configure the field to use and the common initialization parameters for the data source.
    As an example, you can paste the following xml where you replace: the field name (FLOCATION), the field level (logical), the source id (SESExampleModelDataSource), the SES URL (http://smartlogic.example.com/ses, where smartlogic refers to an example server dedicated to logic.) and the SES model name (Example) with values appropriate for you.
    
    <infoShareExtensionConfig version="1.0">
      <metadatabindings>
        <metadatabinding ishfieldname="FLOCATION" sourceref="SESExampleModelDataSource" />
      </metadatabindings>
      <sources>
        <source id="SESExampleModelDataSource" handler="SmartLogicSESConnector">
          <initialize>
            <parameters>
              <parameter name="ses.api.url">http://smartlogic.example.com/ses</parameter>
              <parameter name="ses.api.tbdb">Example</parameter>
              <parameter name="metadatabinding">
                <fields>
                  <field name="FLOCATION" level="logical">
                    <read>
                      <entrynodes/>
                      <fieldfilters/>
                      <selectable/>
                      <relations/>
                    </read>
                  </field>
                </fields>
              </parameter>
              <parameter name="relations">
                <relations/>
              </parameter>
            </parameters>
          </initialize>
        </source>
      </sources>
    </infoShareExtensionConfig>
    
    With this basic configuration in place, the tree only shows the 2 root terms Continents and Hemispheres, nothing else. All terms would be selectable.
  3. Add the relations you want to use for the tree structure.
    In order to see the children of the root terms we need to define which relationships to use (follow) to get to the child terms.
    The relations defined for the field are applied multiple times (recursively), so you will get child terms of the root terms, child terms of the child terms, ...
    1. Define the relation in the relations parameter.
      For the example, we will just define the standard SES narrower term (NT) relationship, so you can use the following XML part for the relations parameter
      
      <parameter name="relations">
          <relations>
              <relation type="hierarchical" id="narrowerterm" abbreviation="NT" direction="Forward"/>
          </relations>
      </parameters>
      
    2. Reference the relation in the relations of the read section of the field.
      For the example, we will just refer to the standard SES narrower term (NT) relationship, so you can use the following XML part for the field relations
      
      <relations>
          <relation ref="narrowerterm" />
      </relations>
      
    With this configuration in place, the tree shown would have the 2 root terms Continents and Hemispheres, and all continents, countries, cities underneath Continents + all hemispheres underneath Hemispheres. The continents underneath the hemispheres will not be shown in the tree as they use a different relationship type than NT. All terms would be selectable.
  4. Limit the terms the user can select using conditions.
    The only supported condition name is "CLASS". Multiple conditions will be or'ed.
    For the example, we only want to select countries and cities so define these as "CLASS" conditions.
    
    <selectable>
        <condition name="CLASS">country</condition>
        <condition name="CLASS">city</condition>
    </selectable>
    
    Same tree structure is shown, but from now on only countries or cities would be selectable.

Results

Complete XML Extension Settings configuration

<infoShareExtensionConfig version="1.0">
  <metadatabindings>
    <metadatabinding ishfieldname="FCOUNTRYORCITY" sourceref="SESExampleModelDataSource" />
  </metadatabindings>
  <sources>
    <source id="SESExampleModelDataSource" handler="SmartLogicSESConnector">
      <initialize>
        <parameters>
          <parameter name="ses.api.url">http://smartlogic.example.com/ses</parameter>
          <parameter name="ses.api.tbdb">Example</parameter>
          <parameter name="metadatabinding">
            <fields>
              <field name="FCOUNTRYORCITY" level="logical">
                <read>
                  <entrynodes/>
                  <selectable>
                    <condition name="CLASS">country</condition>
                    <condition name="CLASS">city</condition>
                  </selectable>
                  <relations>
                    <relation ref="narrowerterm" />
                  </relations>
                </read>
              </field>
            </fields>
          </parameter>
          <parameter name="relations">
            <relations>
              <relation type="hierarchical" id="narrowerterm" abbreviation="NT" direction="Forward"/>
            </relations>
          </parameter>
        </parameters>
      </initialize>
    </source>
  </sources>
</infoShareExtensionConfig>