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:
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.
|