Value Select Terms XML

Value Select Terms XML

Top  Previous  Next

Value select terms are used on to specify what columns should appear in the dataset returned by TMIS queries. For example: which fields from the topic map are required to render faceted search results or clouds.

Below is an example XML document describing some common value select query terms for use with EPiServer:

<ArrayOfValueSelectQueryTermConfiguration 

    xmlns:i="http://www.w3.org/2001/XMLSchema-instance"

    xmlns="http://schemas.datacontract.org/2004/07/NetworkedPlanet.EnterpriseService.Web.Model">

  <ValueSelectQueryTermConfiguration>

    <ColumnName>pageid</ColumnName>

    <JoinColumnName>topicid</JoinColumnName>

    <PropertyKey 

        xmlns:d3p1="http://www.networkedplanet.com/2008/07/schemas/tm/topicmapindex"

        i:nil="true" />

    <PropertyTypeName>Page ID Occurrence Type</PropertyTypeName>

    <PropertyTypeSI>http://www.networkedplanet.com/2005/01/episerver/pageid</PropertyTypeSI>

  </ValueSelectQueryTermConfiguration>

  <ValueSelectQueryTermConfiguration>

    <ColumnName>pagelink</ColumnName>

    <JoinColumnName>topicid</JoinColumnName>

    <PropertyKey 

        xmlns:d3p1="http://www.networkedplanet.com/2008/07/schemas/tm/topicmapindex"

        i:nil="true" />

    <PropertyTypeName>Page Link Occurrence Type</PropertyTypeName>

    <PropertyTypeSI>http://www.networkedplanet.com/2005/01/episerver/livepage</PropertyTypeSI>

  </ValueSelectQueryTermConfiguration>

  <ValueSelectQueryTermConfiguration>

    <ColumnName>name</ColumnName>

    <JoinColumnName>topicid</JoinColumnName>

    <PropertyKey

        xmlns:d3p1="http://www.networkedplanet.com/2008/07/schemas/tm/topicmapindex">

      <d3p1:Key>ID_TO_TOPIC_DISPLAY_NAME</d3p1:Key>

    </PropertyKey>

    <PropertyTypeName i:nil="true" />

    <PropertyTypeSI i:nil="true" />

  </ValueSelectQueryTermConfiguration>

</ArrayOfValueSelectQueryTermConfiguration>

The example requests that the returned DataSet will contain:

1.A pageid column, taken from the occurrence on the topic specified in the topicid column. The occurrence must be of type http://www.networkedplanet.com/2005/01/episerver/pageid. The values returned are the page IDs of the EPiServer pages represented by the topics in the returned DataSet.
2.A pagelink column, taken from the occurrence on the topic specified in the topicid column. The occurrence must be of type http://www.networkedplanet.com/2005/01/episerver/pagelink. The values returned are the URL links to the EPiServer page represented by the topics in the returned DataSet.
3.The display name of the topic (no language specified).

The top-level element ArrayOfValueSelectQueryTermConfiguration defines a list of ValueSelectQueryTermConfiguration elements. Each one of these represents a single query term.

Each ValueSelectQueryTermConfiguration element can be represented by a NetworkedPlanet.EnterpriseService.Web.Model.ValueSelectQueryTermConfiguration object. The API documentation for this class explains the meaning of the different fields. The way in which the terms are converted to and from XML is through the .NET framework's DataContractSerializer.

// Serialization example

DataContractSerializer ser = 

  new DataContractSerializer(typeof (List<ValueSelectQueryTermConfiguration>));

StringWriter sw = new StringWriter();

XmlTextWriter xw = new XmlTextWriter(sw);

ser.WriteObject(xw, valueSelectTermsXml);

xw.Close();

ValueSelectQueryTermsXml = sw.ToString();

// Deserialization example:

using (XmlTextReader xmlReader = new XmlTextReader(new StringReader(ValueSelectQueryTermsXml)))

{

  DataContractSerializer ser = new DataContractSerializer(typeof(List<ValueSelectQueryTermConfiguration>));

  valueSelectTermsXml = ser.ReadObject(xmlReader) as List<ValueSelectQueryTermConfiguration>;

}

In addition, where web parts require this type of definition, the customized editor web parts provide an easy-to-use GUI for creating lists of value select query terms.