Show only a subtree of the taxonomy structure (depending of values of another field)
We will configure the SDL Tridion Docs SES Connector in such a way the user will only be able to browse a subtree of terms from the taxonomy depending of the selected values of another field.
About this task
In Hypothetical taxonomy tree structure we defined a certain taxonomy structure. Instead of showing the entire taxonomy structure, we will configure the field FLOCATION in such a way that it (dynamically) takes the values the user filled in for the FHEMISPHERE field and use them as entry points. For example: suppose that the user fills in the value "Northern" for the FHEMISPHERE field, the configuration will show these terms as root terms of the FLOCATION field, making only continent, countries, cities of the "Northern" hemisphere visible to the user. We will also limit the user so that he can only select countries or cities.
Some examples of the tree structure with dynamic entry points:
- If the user did not select any value for the FHEMISPHERE field yet, the SES Connector would give an error as it does not have any terms to show as root nodes.
-
So, if the user filled in "Northern" for the FHEMISPHERE field, the tree structure shown for the FLOCATION field would be:
Europe {id=17, class=continent, selectable=no} - France {id=105, class=country, selectable=yes} - Paris {id=12, class=city, selectable=yes} -
So, if the user filled in "Southern" for the FHEMISPHERE field, the tree structure shown for the FLOCATION field would be:
Australia {id=5, class=continent, selectable=no} - Australia {id=38, class=country, selectable=yes} - Sydney {id=46, class=city, selectable=yes}
Procedure
Results
<infoShareExtensionConfig version="1.0">
<metadatabindings>
<metadatabinding ishfieldname="FLOCATION" sourceref="SESExampleModelDataSource" />
<metadatabinding ishfieldname="FHEMISPHERE" sourceref="SESExampleModelDataSource" />
</metadatabindings>
<sources>
<source id="SESExampleModelDataSource" handler="SmartLogicSESConnector">
<initialize>
<parameters>
<parameter name="ses.api.url">http://smarlogic.example.com/ses</parameter>
<parameter name="ses.api.tbdb">Example</parameter>
<parameter name="metadatabinding">
<fields>
<field name="FLOCATION" level="logical">
<read>
<entrynodes>
<dynamic>
<field name="FHEMISPHERE" level="logical">
<conversion>
<relation ref="hemisphere2continent" />
</conversion>
</field>
</dynamic>
</entrynodes>
<selectable>
<condition name="CLASS">country</condition>
<condition name="CLASS">city</condition>
</selectable>
<relations>
<relation ref="narrowerterm" />
</relations>
</read>
</field>
<field name="FHEMISPHERE" level="logical">
<read>
<entrynodes>
<static>
<id>99</id> <!-- 99 is id of "Hemispheres" term -->
</static>
</entrynodes>
<selectable>
<condition name="CLASS">hemisphere</condition>
</selectable>
<relations>
<relation ref="narrowerterm" />
</relations>
</read>
</field>
</fields>
</parameter>
<parameter name="relations">
<relations>
<relation type="hierarchical" id="narrowerterm" abbreviation="NT" direction="Forward"/>
<relation type="associative" id="hemisphere2continent" abbreviation="RT" direction="Forward">
<to>
<condition name="CLASS">continent</condition>
</to>
</relation>
</relations>
</parameter>
</parameters>
</initialize>
</source>
</sources>
</infoShareExtensionConfig>