Views - Attributes Tab
The Attributes tab gives you access to the different name/value pairs which make up the attributes of the system. The Attributes tab looks like this:
Attributes enable arbitrary name/value pairs to be assigned to objects in DataSplice. This creates a list of environment variables that can be used for many different purposes, such as custom navigation. Attributes can define classes of views, such as top-level views, so a DataSplice client can display sets of views differently. For the standard DataSplice client, any top-level views defined are the only views initially available to the user as a start point. Any other views would only be available by navigating through a relationship.
Attributes are also useful in providing additional information when performing database events on a record, such as supplying the current login name or the system time. They may be used as filter values by specifying a value using the format ${ATTRIBUTE_NAME}. This allows both system and connection-defined attributes to be used in the filter, as well as values from the selected record in the parent view.
Attributes can be edited from the following areas in the Administration Client:
- System Information Options - Sets system-wide attributes
- Users and Groups - Sets attributes for a particular user or group
- Views - Sets both view and view access attributes
- Relationships - Sets attributes that define view relationships
Precedence
- System (such as user name, client version, etc.)
- View
- User
- Record (when applicable)
Built-in Attributes for the Current Connection
DS_USER- The name of the user associated with the connection (login user name).DS_DOMAIN- The domain the user logged on with.DS_APP- The name of the client application.DS_APP_VERSION- The version of the client application.DS_CURRENT_TIME- The current date and time for the DataSplice client or server.DS_EDIT_TIME- This will contain the initial time the record was edited, which makes things like time stamping offline modifications much easier.DS_VIEW- The name of the current view (if any).
Standard Attributes
DS_AUTO_COMMIT- Specifies that record modifications are automatically committed when the record being modified loses focus (by clicking somewhere off the record). This can be defined system-wide, or for individual users and views. This works like the Records > Apply Record Changes menu item, which commits only the changes for the selected record. Any other record(s) in the modification history need to be committed with the Commit Changes button
in the Remote Client application.DS_AUTO_INPUT_PANEL- Controls the automatic display of the SIP panel for views on Windows CE devices. This defaults to false. If set to true for a view (or system level), it will cause the panel to be automatically displayed when needed.DS_AUTO_RELOAD– Causes the view to refresh its displayed records whenever it is redisplayed by clicking the Back button
in the Remote Client application. This is useful when two views are related in such a way that changing data in one view can affect the other view. In such circumstances, a view with this attribute will always display the latest data.DS_CLEAR_PASSWORD- Causes the client to remove the password from the input text field on disconnect. This is useful when multiple users access the same device. This attribute will supersede the value ofDS_PERSIST_PASSWORD- i.e., the value of the latter will have no effect if the client is set to clear passwords.DS_DATE_FORMAT- The default date format to use when displaying date fields that do not otherwise have a format string defined. If no value is given to this attribute, the default format is %H:%M:%S %a, %b %Y.DS_DISPLAY_CLASS- Defines how record sets are displayed in the Remote Client. The following values are allowed:- grid - Default to grid display
- vertical - Default to vertical display
- grid_only - Only allow grid display
- vertical_only - Only allow vertical display
DS_HIDDEN_VIEW– Indicates that the view should not show in the client view list. This is useful for support views that are never accessed directly by the user. This attribute overrides any view class that might be present for the view.DS_MESSAGE_TIMEOUT- This attribute setting controls the maximum time the client will wait for a server response to any message (default: 60 seconds).
DS_NO_COMPLEX_FILTER- Determines whether creating and editing complex filters is allowed for any user or view that has this attribute defined.DS_NO_FILTER- Boolean value that specifies whether viewing and editing filters is allowed for any user or view that has this attribute defined.DS_NO_OFFLINE- Specifies whether or not a user can get an offline session. This attribute can be set at the System or User levels.DS_PERSIST_DATA- This attribute is used to control whether the data for views is flushed when sessions are changed. If this is true, the client will retain the data for the view so it does not need to be re-downloaded by the new session.DS_PERSIST_PASSWORD- Specifies whether or not the Remote Client application should remember the last user's password along with the login name. This attribute can be set at the System or User levels.DS_PING_INTERVAL- This can be set to the number of seconds the client must be idle before a ping is issued prior to a new message being sent to the server (default: 30 seconds). If this is set to 0 a ping will be sent before each message. The drawback to setting this to a low number is that it will slow down the overall performance of the client, since each ping takes a certain amount of time to succeed.DS_PING_TIMEOUT- This controls how long the client will wait for a ping response before timing out and closing the connection (default: 5 seconds).DS_PURGE_CHANGES_ON_CLEAR– This will cause uncommitted changes to be purged from the device when users select Records > Clear Screen or when the clients disconnect.DS_RESET_CRITERIA_ON_SELECT– This will cause views to reset the last used criteria and fall back to the default criteria when navigating from the Select Views form.DS_SKIP_OFFLINE_UPDATE- Clients can now specify views to skip when fetching offline records. This can significantly speed up downloads with large, static views. This attribute controls which views are skipped by default. The first time offline records are requested, theDS_SKIP_OFFLINE_UPDATEattribute setting is not checked.DS_VIEW_CLASS- This defines view groups as different classes. This allows the client to categorize views when displaying views to select, such as only displaying views with a view class of Inventory.DS_WINDMILL_UPDATE– If set, the DataSplice Remote Client application can invoke the Windmill software update client, automatically detecting newer versions of installed software. This can be used at the System, User, or Group level.
|
To set a view attribute:
|
Examples:
To set a view's DS_DISPLAY_CLASS to single record mode:
- Select
DS_DISPLAY_CLASSin the Name dropdown list. - Select vertical from the Value column.
- Click the Update button
or change focus from the pane.
To create a custom view attribute that supplies a high-limit value in relation to measurement points along a route:
- In the attribute's Name column, enter the name for the high-limit attribute, such as
HIGH_LIMIT. - In the attribute's Value column, enter the default high-limit setting, such as 1000. Or, define the attribute as a query-based attribute by setting the value as follows:
Query: view="Route Stops"; field="High Limit"; where="‘EQ Num’ = ${EQ Num} and ‘Point Num’ = ${Point Num}"For more information on query-based attributes, see the next section of this guide.
- Click the Update button
or change focus from the pane.
Query-Based Attributes
At times, it can be useful to define an attribute whose value is determined when it is used, not when it is defined. To this end, DataSplice allows you to set up query-based attributes that get their values by performing dynamic lookups against DataSplice views. When online, these lookups are done against the underlying database tables. When offline, they are done against the view data that has been downloaded to the DataSplice Remote Client.
An example will help to clarify this. Suppose maintenance personnel are assigned to specific areas of a plant and their assignments change daily. Further, suppose you would like these personnel to see only the work orders pertaining to their assigned location each day. If each maintenance worker had an ASSIGNED_LOC attribute defined, you could set up a mandatory filter on work order views like this:
However, this would require you to change the value of ASSIGNED_LOC each day for each maintenance worker. On the other hand, if your CMMS system allowed you to store such assignments in its database, you could use query-based attributes such that DataSplice would look up each worker’s assignment when he or she opened a work order view. The necessary filter would be applied at that point.
To implement this query-based attribute solution, you would create a view called LOCATION_ASSIGNMENT like this:
The sample data for the view could look like this:
You would then define an attribute called ASSIGNED_LOC as follows:
viewis the DataSplice view to query. View names containing white space should be quoted, e.g. view = "View Name";.fieldcontains the value we are looking for. The field must match the corresponding field’s display name from the DataSplice view. If the display name contains white space, then the value should be quoted, e.g. field = "field display name";.wheredetermines which row will match. Again, field references must match their corresponding display names, and any names containing white space need to be surrounded by double-quotes.
Finally, you would create your filter on the Work Order view, as described earlier:
With these settings in place, when user SJohnson opens the Work Order view, the following actions occur:
- Our query attribute causes a lookup on the LOCATION_ASSIGNMENT view. The row having a TECHNICIAN value of SJohnson is found, and the corresponding LOCATION value (BldgF) is assigned to the attribute
ASSIGNED_LOC. - Our mandatory view filter is applied so that the Work Order view only displays items for a location of BldgF.
Query attributes are most effective when there is only a single value that can match the lookup criteria. If the query returns more than one value, the first one found will be used. The only way to control which value is found first is to add an order by clause to the attribute definition.
Example:
Query:
view="LOCATION_ASSIGNMENT";
field="Location";
where = "Technician = ${DS_USER}";
orderby = "Technician"
This would cause the results to sort by technician and the ASSIGNED_LOC attribute to get the value of the first row in the resulting set. In our example, the final value would be BldgA. However, the usefulness of this method is limited, since its results depend on the data in the underlying table.
When defining query-based attributes that reference field display names containing white space in the where section, the display name must be single quoted. If a display name in the where section contains white space and is not quoted, then DataSplice will interpret that as being two distinct objects and most likely the query will fail to return the expected result. It may even result in an error message.
Query:
view="LOCATION_ASSIGNMENT";
field="Location";
where = "‘Tech Group’ = ${my_group_field}";
orderby = "Technician"