Displaying record details

The RecordDetailsConfig type defines the configuration for a record details query.

A record details query is a query for a single, specific record. Configuration information for this type of query is provided in a RecordDetailsConfig component. This component lets you configure aspects of the returned record, such as its primary key (record specifier) and which standard attributes and/or managed attributes should be returned.

RecordDetailsConfig syntax

The format of the RecordDetailsConfig type is:
<RecordDetailsConfig Id="?">
   <StateName>?</StateName>
   <RecordSelector Name="?" Spec="?"/>
   <Column>?</Column>
</RecordDetailsConfig>
The meanings of the RecordDetailsConfig elements and attributes are as follows:
Element/Attribute Meaning
Id Required. An arbitrary identifier for this RecordDetailsConfig.
RecordSelector Name Spec Required. A RecordSelector selects a record based on a Key/Value pair that is unique to that record (typically, this is the record specifier). Name specifies the key (name) of the unique attribute while Spec is the value of the key.
Column Optional. Specifies a standard or managed attribute that should be returned with the record. You can specify multiple instances of the Column element. Note that you do not have to specify the primary key, because it is automatically returned. If no Column elements are specified, then all the record's assignments are returned.
StateName Specifies an existing named state in the request, using these rules:
  • If the request has multiple named states, then the StateName element must reference one (and only one) of the named states.
  • If the request has only one named state, then it is optional as to whether the StateName element is used to reference that named state (as the state will be used in any event in the RecordDetailsConfig).
  • If the request has an unnamed state, then the StateName element cannot be used.

RecordDetailsConfig example

The following request is for details on the record with a primary key of 34750:
<Request xmlns="http://www.endeca.com/MDEX/conversation/3/0">
   <State/>
   <RecordDetailsConfig Id="RecDetails">
      <RecordSelector Name="WineID" Spec="34750"/>
      <Column>WineType</Column>
      <Column>Description</Column>
   </RecordDetailsConfig>
 </Request>

Two record assignment attributes (WineType and Description) will be returned in the results, as well as the primary key (WineID) of the record.

RecordDetails result

The record details returned from the record query are contained in the RecordDetails element. The RecordDetails element is wrapped in a Results component, together with the original State.

The following example details of the requested record is returned in a RecordDetails component by the Conversation Web Service:
<cs:RecordDetails Id="RecDetails">
   <cs:Record>
      <cs:attribute name="Description" type="mdex:string">ring">Dense and vegetal, with peach flavors.</cs:attribute>
      <cs:attribute name="WineID" type="mdex:int">34750</cs:attribute>
      <cs:attribute name="WineType" type="mdex:string" displayName="Red">Red</cs:attribute>
   </cs:Record>
   <cs:DimensionHierarchy>
      <cs:DimensionValueWithPath>
         <cs:DimensionValue DimensionName="WineType" Spec="Red">Red</cs:DimensionValue>
         <cs:DimensionValue DimensionName="WineType" Spec="/">WineType</cs:DimensionValue>
      </cs:DimensionValueWithPath>
   </cs:DimensionHierarchy>
   <cs:Column ColumnKey="Description" DisplayName="Description" SpecColumn="false"/>
   <cs:Column ColumnKey="WineID" DisplayName="WineID" SpecColumn="true"/>
   <cs:Column ColumnKey="WineType" DisplayName="WineType" SpecColumn="false"/>
   ...
</cs:RecordDetails>

The assigned attributes of the requested record are in the Record element.

In addition, the attributes on the Column elements contain the following additional property information:
  • ColumnKey identifies the name (in an NCName format) of the standard or managed attribute.
  • DisplayName specifies the name of the attribute in an easy-to-understand format.
  • SpecColumn identifies whether the attribute is a primary key (i.e., whether it is a single-assign property with a unique key/value pair). Note that all unique, single-assign properties in the Dgraph are returned, even if they are not assigned to the record.

The application front end can iterate through this record details list, extract the identifying information for the record, and display a table containing the results.