How to Configure a Query Layer

This section explains how to configure a query as a layer.

Queries from the Organization, Workflow and Integration modules and the Events and Dispatch solutions written to georeferenced objects, as well as queries from other modules and solutions that include objects with Georeference attributes can be used as layers. In addition, the Latitude and Longitude columns and the column with the object ID (for example, Asset ID for organizational queries) must be enabled in the results for each query in the system and listed in the RequiredValues parameter in the XML file (see table below). During query creation, in the Filters step, the query must be filtered by the object type that will be used in the layer. Next, when choosing columns, the object type must be specified in the Applicable To column to filter the default properties and custom attributes applied to the object. All default object properties must be selected. Otherwise, no data will be plotted on the map. Also, note that you will only be able to view layers based on queries of which you are author, editor, or an audience member.

Before the query can be configured here, it must be registered in the system. For details on how to register system queries in each module, see the respective query sections of each module. For details on how to create a Georeference attribute for a system object, see Chapter 17: Administration -> Customizations -> Objects and Attributes -> How to Create an Attribute for an Object (Except Events).

Query layers are registered in QueryLayer nodes, as in the example below.

 

  <QueryLayer ShowRawDataInsteadOfTemplate="false">

    <Id>PoliceStations</Id>

    <Name>Police Stations</Name>

    <Type>Organization</Type>

    <Description></Description>

    <Area>Integrator</Area>

    <Controller>Map</Controller>

    <Action>GetMarkers</Action>

    <Icon id="icon_layer_policestations" />

    <Template id="asset_template" />

    <RequiredColumns>Oid:ID, assetaddress:Address</RequiredColumns>

    <RequiredValues>Oid:ID, Latitude, Longitude</RequiredValues>

    <SearchKey>Title</SearchKey>

    <AutoRefresh>15</AutoRefresh>

  </QueryLayer>

 

In the XML structure of the layer, the following elements can be configured:

Parameter

Required?

Description

QueryLayer

Yes

Used to register the layer, and contains the ShowRawDataInsteadOfTemplate and UseCacheServer attributes. Valid values for these attribute: "True" and "False". If the first attribute is true, the pop-up template will be disregarded and the content will be displayed in JSON format. If false, the information will be displayed according to the template defined. The second attribute is not required. If "True" the data for the layer will be obtained from from the Modulo Integration Service. If "False", the layer will use the data from the system. Note that the template used here must have been previously configured, as detailed in Appendix -> Layers for the Integration Map -> How to Configure a Pop-Up Template for a Layer.

Id

Yes

Unique identifier for the layer. This value must be the same as the GUID or name of the query registered in the system and cannot be the same as any other layer ID.

Name

Yes

Defines the name to be displayed on the menu, representing the map layer.

Type

Yes

Used to indicate the module where the query was created. Valid values: "Organization" for organizational queries, "REST" for REST queries, "EventsManager" for scheduled event queries, "Events" for Workflow queries, and "AssistedDispatch" for call queries. Valid values for queries that can contain objects with Georeference attributes: "EnterpriseRiskManagement" for queries from the ERM solution.

Description

No

This parameter is used to help identify the layer in the XML only.

Area

Yes

Area of the system to which the layer belongs. Valid values: "Integrator" for query layers and "EventsManager" for scheduled event layers accessed directly via API.

Controller

Yes

Section of the system area to which the layer belongs. Valid values: "Map" for the "Integrator" area and "MapQueries" for the "EventsManager" area.

Action

Yes

Action executed to retrieve the information. Valid values: "GetMarkers" (default) and "GetServiceUnits" (if the ObjectType parameter is included with the value "ServiceUnit") for the "Integrator" area; and "GetDailyEvents", "GetNextDayEvents", "GetMonthEvents", "GetNextSevenDaysEvents", and "GetClosedEvents" for the "EventsManager" area.

Icon

Yes

Identifier of the icon configured for the layer. For details on how to configure icons, see Appendix -> Layers for the Integration Map -> How to Configure an Icon for a Layer.

Template

Yes

Identifier of the template configured for the pop-up displayed when an object in the layer is clicked. For details on how to configure this template, see Appendix -> Layers for the Integration Map -> How to Configure a Pop-Up Template for a Layer.

RequiredColumns

No

Defines that at least one of the entries in the query results must contain values for the columns (properties) listed in this parameter. These columns must also be enabled in the results of the query. If this condition is not met, the layer will not be displayed and the system will show an error message instead.

 

This field must be completed with the name of each column (exactly as it appears in the system), as well as the display name to be used for it in error messages. These are separated by a colon, with each group of names separated by a comma and a space. If the name displayed in the system is the same as the name of the variable, it can be entered just once, without the need for a colon. For example, real name1:display name1, real name2:display name2, real name3.

RequiredValues

No

Defines that all of the entries in the query results must contain values for the columns (properties) listed in this parameter. These columns must also be enabled in the results of the query. If this condition is not met, the layer will not be displayed and the system will show an error message instead.

 

This field must be completed with the name of each column (exactly as it appears in the system), as well as the display name to be used for it in error messages. These are separated by a colon, with each group of names separated by a comma and a space. If the name displayed in the system is the same as the name of the variable, it can be entered just once, without the need for a colon. For example, real name1:display name1, real name2:display name2, real name3.

 

Note that the Latitude and Longitude columns, as well as the column with the object ID, must be included in this parameter for all queries, as these properties are required for objects to be plotted on the map. This allows the system to show an error message when a layer is not displayed because these columns are not present.

SearchKey

No

Indicates which property of the object included in the query will be used to locate it in the system when users search for the object in the Search field of the Layers window. In other words, this defines which property users should enter when searching for an object in the window on the map. To allow users to search for objects by name, use the value "Title". If the search field is to be used to locate points of interest and service units specifically, use the value "AssetTypeName", as these objects are assets with distinct asset types. For details on other values that can be used here, please contact the support team.

AutoRefresh

No

Indicates the frequency, in seconds, with which the layer will be automatically updated to match the latest information available from its data source.