Modifying SmartVue widgets
Each SmartVue widget category is defined in an XML file that the SmartVue installer puts on the point core. You can modify these XML files to add, change, or remove widgets that display in the SmartVue mobile application. The XML files are stored here on the point core:
- C:\Program Files\LANDesk\ManagementSuite\SmartVueDef.
NOTE: When SmartVue's LDGatherData.exe program runs, it creates a .\SmartVue folder that also contains XML files. Don't edit these files. If you modify a .\SmartVueDef XML file, the corresponding file in .\SmartVue will be overwritten when LDGatherData.exe runs.
Make sure you create a backup of any XML file that you plan to edit before you make any changes.
Here is the basic XML structure:
<?xml version="1.0" encoding="utf-8" ?>
<DataDefinition name="" id="" datasource="">
<Definition name="" id="" controlType="" dataSet="">
<Control title="" columns="" />
Each widget contains a widget definition and three sets of queries.
- <SQL>: Collects data for the widget.
- <TotalSQL>: Queries the SQL data that was collected and returns it to the widget.
- <LocationSQL>: Joins the Total SQL query results with the location information that was configured on the point core. On the point core, configure locations in Configure > SmartVue configuration > Location. You can define locations based on an LDAP directory, a computer device name prefix string, or an LDMS public query.
The following sections give more detail on the XML element attributes.
- name: The category name. This name is used in the <TotalSQL> section's WHERE condition.
- id: The unique ID for this definition. This ID is used in the browser query string. It can't contain spaces or characters like &.
- datasource: The database data source type. This is case-sensitive and must exactly match the Data source you specified in the Add database dialog box (Configure > SmartVue Configuration > Database, click Add or Edit).
- name: The widget title. This name is used in the <TotalSQL> section's WHERE condition.
- id: The unique ID for this widget. It can't contain spaces.
- controlType: The type of widget to use for this data. It must be one of the following:
- dataSet: The returned data format, either "row" or "column". For example, if the data set returned is in a format where count 1 is in column 1, count 2 is in column 2, and so on, the data set is "column". If your SQL statement returns multiple rows, it must be "row."
- seriesData: Specify "bymonth" if this is for time-based widget data. You can see examples of this in Remotecontrol.xml. This works well with bar-based templates.
Contains the SQL queries that get data for the widget.
Contains the SQL queries that return data to the widget.
The order and the names of the columns matter. The name of the column must be first. If you want something other than "Data Count" or "Count", you need to alias the first column as DataName (select a.columname DataName, …). The count must be the second column in the select list and it must be aliased as DataCount. If you have row data, is must be a SUM. (select a.columnname DataName, SUM(a.DataCount) DataCount, …).
If you want your data to be displayed by a date (on the y-axis), the alias ReportDate must be the last column in the SELECT clause (select a.columnname DataName, SUM(a.DataCount) DataCount, a.ReportDate FROM …).
The a.CountType="" condition must contain the <DataDefinition name=""> and the <Definition name=""> you specified earlier in the XML file, with no space separating the two names.
For example, if <DataDefinition name="Power Management"> and <Definition name="Devices under Power Management">, a.CountType= would be "Power ManagementDevices Under Power Management".
Non-SQL items in the TotalSQL section queries
#SVTABLE# is a placeholder place that is used to determine if queries are looking for location-specific data or non location-specific data. This placeholder is replaced dynamically.
The #SVWHERE# and #SVTIME# placeholders are used to determine whether the query should be based on location or time, depending on what the user selected in the application. There are two classes of widgets, time-based (often represented by bar graphs) or location-based (often represented by pie charts). Location-based data generally doesn't have a time period associated with it. Time-based widgets use monthly data counts.
Joins data to location.
Set locations on the point core by clicking Configure > SmartVue configuration > Location. You can define locations based on an LDAP directory, a computer device name prefix string, or an LDMS public query. You can only pick one.
Defines the row or column data and titles that the widget should display. This section is currently not used by SmartVue.
Making widgets active
When you add or change XML files in the C:\Program Files\LANDesk\ManagementSuite\SmartVueDef folder, the changes won't be visible in the SmartVue mobile application until the data collection program runs:
- C:\Program Files\LANDesk\ManagementSuite\LDGatherData.exe
If you specified a data gathering schedule for SmartVue, it will run at that time. If you want it to run right away, do the following.
To update SmartVue data
- Click Configure > SmartVue Configuration > Scheduler.
- Click Start now.
- Click OK.
The LDGatherData.exe process will take a few minutes to complete.