Responder Developer Guide
Archive Explorer Queries

Resource Center Home

You can add your own query to the Queries field in Archive Explorer (Figure 1). This field allows you to determine what data is displayed in the Archive Explorer incidents grid. The default queries are: Date Range, Feeder and Device Type.

Figure 1

To modify an existing query or create your own, you will need to edit ArchiveQueriesConfig.xml. This file is installed with Responder Server. By default it is installed here: \Program Files\Miner and Miner\Responder\Server. Open this file with any application that allows you to edit XML (e.g., Notepad, XML Spy).

The XML is grouped into several QueryPackages. You will edit the IncidentArchiveQueries query package.

  1. Look for <QueryPackage Key="IncidentArchiveQueries">. This section contains a QueryClass section for each value in the Query field (Incidents by Date Range, Incidents by Feeder, Incidents by Device Type). When you add your custom query to this section, it will be included in the Query drop-down list.
  2. You can copy an existing QueryClass and manipulate it (easiest choice) or create your own (most room for error). Below is an example of a QueryClass in ArchiveQueriesConfig.xml.
XML Snippet
Copy Code
 1 <QueryClass Key="IncidentDateRange" Caption="Incidents by Date Range">
 2   <Properties>
 3     <!--NOTE: DateTime format for xml file must be in SortableDateTimeFormat yyyy'-'MM'-'dd'T'HH':'mm':'ss-->
 4     <b:Property Key="BeginTime" Value="2007-01-01T00:00:00"/>
 5     <b:Property Key="EndTime" Value="2007-12-31T23:59:00"/>
 6     <b:Property Key="ShowCanceledChildren" Value="true"/>  
 7   </Properties>
 8   <Inputs>
 9     <Input Type="Miner.Responder.ArchiveExplorer.Filters.IncidentDateRangeInput,Miner.Responder.ArchiveExplorer"/>
10   </Inputs>
11   <Filters>
12     <Filter Type="Miner.Responder.ArchiveExplorer.Filters.IncidentDateRangeFilter,Miner.Responder.ArchiveExplorer"/>
13   </Filters>
14   <Request Type="Miner.Responder.Shared.Requests.FindIncidentArchiveRequest,Miner.Responder.Shared"/>
15 </QueryClass>
  1. The line numbers below correspond with the XML snippet above.

  2. Line 1: Create a unique key for your query and enter a value for the Caption attribute. The Caption value is displayed in the Query field in Archive Explorer.
  3. Lines 4-6: Enter the properties required by the input control. In the example above, the Date Range query prompts the user for a Begin Time and an End Time. The ShowCanceledChildren property determines whether cancelled incident children (e.g., devices, location features, etc.) are included in the query. You may have any number of properties, depending on the query.

    Figure 2, User input control for Incidents by Date Range query

  4. Line 9: The Input type value points to the control in which the user enters the input data. If more than one input control is specified, the controls are stacked vertically in the dialog (see Figure 2). Available input controls reside in Miner.Data.Decoration. You may elect to create your own input control by implementing Miner.Data.Decoration.IUserInput. 
  5. Line 12: The Filter section uses the Properties to build a WHERE clause. When multiple properties are specified, they are connected using only AND statements (not OR). Data must meet all criteria to be included in the query. Available filters reside in the Miner.Responder.ArchiveExplorer.Filters namespace. You may also elect to create your own custom filter by deriving from Miner.Data.Decoration.FilterBase.
  6. Line 14: The Request section determines which request object is used. Request objects reside in the Miner.Responder.Shared.Requests namespace. You may also elect to create your own custom request object by deriving from RequestDataSetMixin and implementing IFilterDataRequest.

Return to Overview

 

 


Send Comment to ArcFMdocumentation@schneider-electric.com