2.3 Data Tab



Manage Data Sources


The FacilitiesMap application supports unlimited connections to external data sources that can be connected to map features. This feature allows FacilitiesMap to be an incredibly robust application that allows the linkage of datasources with map features. 

Here you can manage existing data source definitions and create new data source definitions. You can also assign role permissions to the definition. Roles may be assigned to or removed from any data source definition by using the Manage Roles dialog: The default role assigned to any new data source definition is 'Everyone' with Read access only. 

Data sources reference any OleDB, ODBC based provider or MS SQL Server, Oracle Server, MySQL Server, and SQLite clients. The security of the data sources log-in credentials determine the tables or views available for derived data definitions. Utilize the provider type of 'Other' for clients other than OleDB and ODBC. 

Currently Supported Database Connections: 
  • Microsoft SQL Server 2005 
  • Microsoft SQL Server 2008 (including SQL Spatial)
  • Microsoft SQL Server 2008 R2 (including SQL Spacial)
  • Oracle 9i (including Spatial) *
  • Oracle 10g (including Spatial) *
  • Oracle 11g (including Spatial) *
*Oracle connections require proper client setup on the web server.

Add/Edit Connection


Name: Name listed in Data Source Definitions page
Connection String: The connection string used by the provider to connect to the database.  Use the "Test" button to see if the settings are correct and working.
Connection Type: MSSQLServer or Oracle
Provider Type: Leave as-is (other). 

Note that if you select Oracle, you must have the Oracle .NET binaries deployed in your application (we normally deploy these binaries only by request due to their size). If you're unable to make a connection to an Oracle server, please contact Websoft Developers.
 
The MSSQLServer connection string format looks like this:
  • Data Source=127.0.0.1;Initial Catalog=myDataBase;user id=;password=
The Oracle connection string format looks like this:
  • Data Source=localhost:1521/xe;User Id=;Password=;

Manage Data Definitions


The FacilitiesMap Application allows you to display information or attributes about geographic features when a user selects one or many of them from the map pane. In order to display this type of information either in an infobar or data report, you must setup data definitions. 

The Manage Data Definitions menu item allows you to manage existing data definitions and create new data definitions. You can also assign role permissions to the definition. Roles may be assigned to or removed from any data definition by using the Manage Roles dialog. The default role assigned to any new data definition is 'Everyone' with Read access only. 

The first 6 columns are:
Edit: Brings up the Add/Edit Data Definition page shown below
Add/Remove Roles: Adjust the roles for this data definition
View Properties: Takes you to the Manage Data Properties page with this Data Definition pre-selected.
Copy Data Definition: Copies the data definition (this requires that the user also has the role to add a Data Definition)
Reload Data Definition: Reloads the data definition
Delete: Delete the Data definition

Add Data Definition


Data Name (required): Enter unique identifier for this data definition. The name should be indicative of the type feature that is being utilized for the data definition.
Definition Type: There are two fundamental Data Definition Types available for use in the FacilitiesMap Application. 

FeatureSource Attributes/Geometry 

This type of data definition refers to an instance where the attribute information is accessed from the map server resource for a specific layer and the geometry is accessed from the same map server resource. In the case of a MapGuide Server deployment, an example would be a situation where the geometry is referencing a SDF feature source and the associated attributes are displayed from the same SDF feature source. In the case of ArcGIS Server DataSource Attributes/FeatureSource Geometry. This type of data definition refers to an instance where the attribute information is accessed from a Data Source that is defined in the Define Data Source section of the administrator and the geometry is accessed from the same map server resource. For example, map features could be accessed from a feature source such as a MapGuide Layer or ArcGIS Layer on a map and the attribute information could be retrieved from a SQL Server Database or other source. 
 

Feature Source: Refers to the layer resource that will be linked to this data definition. 
Feature Table: Select the Feature Table or Feature Class that will be used for this data definition. 
Feature Key Column: Select the primary key/unique value for the feature source table. 
Feature Linking Column: Select the field that links the field from the geometry to the data source table where the values match. (Applies only if the data definition type is DataSource Attributes/FeatureSource Geometry) 
 

DataSource Attributes/FeatureSource Geometry

If the Definition Type is DataSource Attributes/FeatureSource Geometry then these additional fields must be populated. 
Data Source: Refers to the Data Source that the Geometry should be linked to display information in the infobar or report tab. 
Data Table: Select the table from the data source that will be used to retrieve attributes for the selected features on the map. 
Data Key Column: Select the primary key/unique value for the data source table. 
Data Linking Column: Select the field that links the field from the geometry to the data source table where the values match. (Applies only if the data definition type is DataSource Attributes/FeatureSource Geometry) 
Enable Point Geometry Editing: Allows features referenced by this data definition to be manipulated and moved on the map during editing (for example, a hydrant layer). Note that this value should *only* be set if the feature layer is only of type POINT (e.g., mixed layer types are not allowed).
 

Updated Date/By Columns

 
 
Updated Date Column: Choose the column (if any) that should be treated as the "Updated Date" column when editing a feature for this data definition. When a user edits a feature for this data definition, the field corresponding to this column will be populated with the current date and time.
 
Only columns of type DateTime will be available for this option.
 
Updated By Column: Choose the column (if any) that should be treated as the "Updated By" column when editing a feature for this data definition. When a user edits a feature for this data definition, the field corresponding to this column will be populated with the user's name in the following format: UserFirstName UserLastName (UserName).
 
Only columns of type String will be available for this option. (Note:  The column length should be at a minimum 35 characters long but 50 would be a safer number.)

Filtered Layers

 
 
Once a Feature Source and Feature Table are selected, any Layers that reference that Feature Source and Feature Table will appear as Filtered Layers that can be selected. For example, if a Parcel feature source is selected, the Filtered Layer choices may appear like this:
 
Filtered Layers: Check the box next to each layer that should appear as an option in the Filtered Layer dropdown in the infobar or report tab.
Allow Filtered Layer Color Override: This will show/hide the color picker in the Filtered Layer dropdown in the infobar or report tab that allows the user to change the color of the Filtered Layer.
 

Auto-Create Reports and Searches




Auto Create: This function allows you to have the system automatically create the following reports or searches when creating the data definition. If you do not select these items now, you can manually create them later using the Application > Manage Reports & Searches menu item. By default, the data definition reports will be auto-created for all maps on the site ("Apply to Maps"). If you do not wish to associate the data definition with a specific map, select the map and use the left arrow to move it to the "Available Maps" box. This will prevent the report(s) from being available on that map.
  • Default Report: The default report is the report seen in the infobar, seen when a user selects the appropriate feature on the map.
  • Data Browser Report: The data browser report is launched from the default report, which appears as in tabulated spreadsheet format in the data browser. As this report can only be launched from the default report, ensure that the default report is checked as well.
  • Basic Search: The basic search appears above the infobar and allows users to easily search properties defined as searchable in this data definition. Note that at least one property in the data definition must be searchable in order for the search to appear.

Rebuilding a Data Definition:

The Rebuild Data Definition button allows you to re-read in the underlying feature and datasource data to verify it against the current stored properties in the database, removing invalid entries and adding new ones. This scenario typically happens when the underlying data is changed. For example, if a column name was changed, a column was deleted, or a column was added, an administrator would select the data definition and rebuild it (rather than re-create the data definition and lose all of the existing settings).

When you select the button, the following will appear: 



There are three options:
  1. Rebuild Properties: Rebuild the property definitions for this data definition by re-reading the database structure and discarding all existing data properties. All mail labels related to this data definition will be deleted as well. 
  2. Rebuild Properties With Existing Settings: Rebuild the property definitions for this data definition by re-reading the database structure and attempting to migrate all existing data properties. Property settings will be migrated if the property NAME, TYPE and LENGTH match. All mail labels related to this data definition will be deleted as well. 
  3. Cancel: Cancel and return the data definition listing. 

Deleting a Data Definition 

To delete a data definition, select the data definition row, scroll to the right of the screen and press the delete button. Note: When a data definition is deleted, all reports and searches are deleted as well. This process is irreversible. 

Manage Data Properties


Here you can manage existing properties and create new property definitions. Property definitions are tied to a Data Definition and are used to specify the individual characteristics of each data field available to the user and what functions are available to them. 

You edit the property of each field included in the data definition, including the sort order, whether or not it is displayed to the user, if it displayed when selecting multiple map elements, and whether or not the field is editable. 

Editing Properties

Use the dropdown menu to pick the Data Definition to edit.


Select Order Properties to change the order that the properties show up in the InfoBar.  A window will pop up and you can rearrange the properties by dragging and dropping or by using the arrow buttons.
Select Sort Multi Display Properties to change how features are ordered when multiple features are selected. For example, you might have a parcel layer that exposes the situs number and situs name in the multiple selection column. For street names, it's typically better to order by street name first rather than street number when selecting multiple parcels, so you would change this order to situs name and then situs number.   A window will pop up and you can rearrange the properties by dragging and dropping or by using the arrow buttons.

You can quickly edit properties directly from this listing, by clicking on the columns values directly: 

The icon columns (in displayed order):

Column 1: Display this property on Reports: This toggles the visibility of the property in all reports when viewing the data of any features of this type. This column essentially shows/hides properties from users.
Column 2: Display this property when multiple map elements of this type are selected:  This toggles the visibility of the property when multiple records (>=2) are shown in the object results. Generally you will only want to show one or two properties at the most, and the data in these fields should be fairly short.
Column 3: Allow this property to be searchable:  This toggles whether or not the property will be available as a searchable field for this data definition. Note that the data definition must also have a "Default Search" under Application->Manage Reports & Searches in order to be usable.
Column 4: Set this searchable property to be the initial search property: This toggles which searchable property will be set as the intially selected or default search field. Only one searchable property may be set as the default search property. 
Column 5: Allow this property to be editable:  This toggles whether or not the property is editable. Only visible properties are editable. 
Column 6: Make this editable property required:  This toggles whether or not the property requires values during editing. This column is ignored if the property is not editable.
Column 7: Make this property nullable: Allows this property to have a null value.
Column 8: Column Type: Shows which columns are primary keys or foreign keys (links to other tables). This value is read-only and is determined by the data schema when the data definition is created or the feature/data source is changed.

Tip: For checkboxes, click on the header icon of each column in order to select/deselect all the rows in that column.

The named columns (in displayed order):

Name: The name of the column as read from the data source.
Alias: The alias is how the property is represented to the end user. This allows properties with unfriendly field names to be represented nicely to the end user. 
Type: The data type of the column as reported by the data source.
Display Type: The display type is used to determine the web control type for searching and editing this field.
  • TextBox: a simple text box. The maximum length of the text box is determined by the length of the actual database field.
  • NumericTextBox: a textbox, except that only numbers are allowed.
  • DropDownList: a dropdown with values populated by the “Display Script” entry (see below). The "Strict?" check box, if checked, forces any edited value to conform to the values as described in the Display Script section below. In other words, if the available values as determined by the Display Script are A, B, C, D and the edited value is E, then the user would be forced to populate that property when editing with the value of A, B, C, or D only (E is invalid).  If unchecked, the user would be allowed to populate the dropdown with a custom value.  
  • Calendar: a calendar control, with a selectable date.
  • CalendarTime: a calendar control, with a selectable date and time.
Display Script: This value is only valid for properties with the Display Type of DropDownList. The display script value is used two different ways, depending on whether or not the "List?" checkbox is checked (note that the "List?" checkbox is always checked for data definitions of type: FeaturesSource Attributes/Geometry.
  • If "List?" is checked this field represents a set of distinct values (say, Apple, Orange, Pear) that are separated by returns which is used to populate the dropdown. Users will pick from this list of values in the order of the list typed. For example, to have a dropdown list contain the values of Apple, Orange, Pear, then the Display Script value should read:

    Apple
    Orange
    Pear

  • If "List?" is unchecked this field represents a valid SQL statement which should grab a distinct set of values for which are used to populate the dropdown. Note that the SQL statement should only return a single column. Users will pick from this list of values in the order of the returned data. For example, if you have a field that holds the material types of a sewer pipe, you could create a lookup SQL table called PIPE_MATERIALS which holds a field called MATERIAL. For the MATERIAL field in your PIPES data definition, you would set the Display SQL value to something like:

    SELECT MATERIAL FROM PIPE_MATERIALS ORDER BY MATERIAL

    Alternatively, you could create a distinct list without a lookup table like so:

    SELECT DISTINCT MATERIAL FROM PIPES ORDER BY MATERIAL
URL: To create a hyperlink on a field in the result set, you can set this value to a url and additionally pass other properties as URL request variables. In order to include additional properties in the url, simply enclose the property name (Name column, not Alias column) in brackets.

For example, let’s say you have a field called “APN” and you want users to click on the APN value to link directly to Google Maps. First, figure out the parameters you’ll need to pass from your properties and enter the appropriate url.

In this example, let’s say the full address is held in three fields, “SITUS_STREET”, “SITUS_NUM”, and “SITUS_ZIP”. The URL string should then look something like this:

http://maps.google.com/maps?q={SITUS_NUM}+{SITUS_STREET}, +{SITUS_ZIP}

Note that only VISIBLE properties can be referenced this way. 

URL Target: This value determines how the URL link is launched. This value has no effect if the URL value is empty.
  • Blank: no target selected
  • Report: Show the hyperlinked page in the Data/Reports tab. 
  • Infobar: Show the hyperlinked page in the Infobar/Search Results pane. 
  • New Browser: Show the hyperlinked page in a new browser window. 
URL Security Variable: If set, then additional, private parameters are passed (as a variable with this name), encrypted in the URL string. These parameters, when decrypted, include:
  • User information:  user id, username, user email, etc 
  • Site information: siteid, sitename 
  • Map information: current mapname, mapid 
  • MapGuide sites: 
    • Map resource 
    • MapGuide session ID 
URL Geometry Variable: If set, then additional geometry values are passed (as a variable with this name) in XML format. The geometry variable contains information about the selected geometry including centroid, envelope, and other values (depending on the type of geometry). This is useful if you need to pass data to an external application that requires geometry data about the passed features.

Note that none of your property changes are saved until the save button (the green checkbox) is clicked. To cancel your changes, close the window or click the cancel (red “X”) button. 


Manage Dynamic Layers


Here you can manage dynamic layers. Dynamic layers are map layers that are generated by a filter value from a parent data definition. For example, if you have a “building” layer on a map, you could generate a dynamic layer from a “rooms” layer that contains every single room for all buildings on the map. The dynamic layer has a filter definition which will cause the dynamically generated layer to only show rooms for buildings that are currently selected. Currently, dynamic layers are only supported for MapGuide Enterprise sites. 

To create a dynamic layer definition, click on “Add Dynamic Layer Parent Definition”. There are several fields: 


Dynamic Data Name: This will be the name of the dynamic filtering option that the user sees when selecting the parent data definition. 
Data Definition: The parent data definition which will be used to generate the filter for the dynamic layer(s). In the example above, this would be the data definition for the buildings layer. 
Group Label Column: The feature source column which determines how the children layers are grouped. In the example above, this might be something like “Building Name” or “Building Number”, which would cause the layers generate to be grouped by the building.
Group Ordinal Column: As above, but this determines how the grouped labels are ordered. Generally you can make this the same as the group label column, unless you want the groups to be ordered something other than alphabetical, for example. 
Clear the selection on the map after creation:  If checked, after the filter is created, automatically deselect any existing selections on the map.

Once you’ve created a dynamic layer, you’ll need to create dynamic filters, which are the definitions for the child layers that are going to be created on the fly. 

Note that these columns are based on the parent definition’s columns as created during the data definition stage. If the data definition is modified, the dynamic data definition needs to be manually modified as well, as the columns will not automatically update. 

Manage Dynamic Filters

Each dynamic data definition requires at least one filter to be operational. In the example above, we would create a dynamic filter called “Rooms”. To add a dynamic filter from a parent dynamic data definition, click on the add new filter button: 

When adding a dynamic data definition, a page similar to the data definition page will show up: 


Dynamic Filter Name: Normally this will be hidden from the end user if there is only a single filter. If there are multiple filters per dynamic data definition, then the top level layer group will contain the name(s) of the filters. 
Filter Layer: Click on the layer resource tree to find the layer that you want to dynamically generate. Once you’ve selected the appropriate layer, you can select the remaining columns. 
Feature Table: Select the appropriate feature table that contains the data you want to show.
Parent Linking Column: Similar to the data definition FeatureSource/DataSource linking column values, the parent linking column is the column from the parent data definition that holds the values which will distinctly match the Filter Linking Column values in the feature table. 

Filter Linking Column: The filter linking column is the column from the feature table that holds the values which will match the Parent Linking Column values in the parent data definition.
Filter Grouping Column: Similar to the Group Column in the dynamic data definition, this determines how the individual results from the parent linking column are grouped. In the example above, you might want to the rooms to be grouped by “Floor”.

Grouping Ordinal Column: As above, but sometimes you might want the grouped values to show in a non-alphabetical ordinal. For example, if you set the filter grouping column to “Floor”, these values might be “Basement”, “Ground Floor”, “Floor 1”, “Floor 2”, etc. Grouped alphabetically, these values don’t make sense from a geometric standpoint; instead you might want to make the grouping ordinal column be a different column such as “FloorNo”, which would have values “-1”,”0”,”1”,”2”, respectively, so that the labels appear in a logical order.

Layer Is Visible Column: This column is optional. Basically, if the value in the column evalutes to “True” then the grouped folders for the filter will appear visible by default, otherwise they will be hidden. If this column is not set, then the first grouping by ordinal will be visible by default, and the rest will be hidden. If we continue our example from earlier, then the “Basement” group would be on by default, with “Ground Floor”, “Floor 1” and “Floor 2” hidden. However, we might want the “Ground Floor” to be on instead, so we set a new column, “IsVisible” to “1” for all values of “Ground Floor” and “0” for all other values in each group. 
Modifying a Data Definition 

Layer is Selectable:  If checked, whether or not the new filtered layer will be selectable. This is useful if you have a data definition set up for this feature set (e.g., your filtered layer is "Rooms", which is derived from "Buildings" and you want users to be able to select rooms on the map and get information).

Manage Mail Labels


Mail label definitions can be created which allow selecting several features on the map and then generating a mail label for each feature of the Data Definition type.  The icon on the InfoBar on the Front End is where you create the mail label PDF.

Add/Edit Mail Label

The mail label feature allows you to create mail labels using any of the exposed data properties for a given data definition.
 
The following mail label formats are available by default:
  • Avery 5160
  • Avery 5196
  • Avery 5667
  • Avery 6466
  • Envelope Size 10
To create a mail label, select the data definition source for the mail label you want to create.


Once you've selected the appropriate data definition, create a mail label by selecting "Add Mail Label Definition".


The mail label tool allows you to create mail labels which use the data properties of the base data definition. For example, if you wanted mail labels for a parcel layer, you might want to expose the owner name, situs number, situs address, city, state and zip code. You can use the Data Property Selector for the appropriate property and hit the "+" button to add that property to the mail label template. Each line of the template will show as a separate line on the mail label. All other literals (spaces, alphanumeric characters) are represented as such on the mail label.

In the above example, the template might look like this:

{OWNER_NAME}
{SITUS_NUMBER} {SITUS_ADDRESS}
{CITY}, {STATE} {ZIPCODE}

Which would in turn translate to this:

Websoft Developers
2020 Research Park Drive
Davis, CA 95616

Name: The name displayed on the mail label to users.
Type: The format of the mail label (e.g. Avery 5160).
Data Property Placeholder Selector: An easy way to correctly add the data placeholders is to use this dropdown and then click the '+' button to add them to the Template field. 
Template: The template used to generate the mail label.  Format for Properties is {Property}.  Use the data property dropdown to see the available properties.


[Last updated for version 2904 (04/2013)]
Comments