Models node
Category
You can use nodes to organize your models. Each node can have one or more other nodes and one or more nodes as children. Each node can have these attributes:
| Attribute | Description |
|---|---|
| AccessItem | List of permissions in Access Control that control access to this category. Specify one or more access IDs in a comma-separated list. |
| Description | Description of the category. |
| Id | Identifier for the category. |
| Profiles | List of profiles that have access to the models in this category. Specify one or more profile IDs in a comma-separated list. |
Model
Each node defines a specific model for the Mobile Services. Each node can have these attributes:
| Attribute | Description |
|---|---|
| DisplayName | Display name for the model. |
| Id | Unique identifier for the model. |
| Inherits | ID of the base model that the current model inherits from. The current model will inherit the properties of the base model. |
| IsRootModel | Indicates whether the model represents a root object. |
| IsSharedResource | Indicates whether the model represents a shared resource. Shared resources are common records that are used throughout the system, such as addresses and contacts. Marking a model as a shared resource affects how its records are downloaded and stored on the mobile device.
See Shared resources. |
| Moniker | Moniker of the business object that the model is bound to. If you specify a moniker, then the model can access the properties defined for that object. This means that you can use these properties in the mobile app without having to define them explicitly in the mobile model. |
| No Descriptor | Indicates whether the Mobile Metadata service will create a descriptor for this model. |
| ServiceModels | Comma-separated list of models in Rest Services that the Mobile model is associated with. If you specify a service model, then the mobile model can access the properties defined for the service model. This means that you can use these properties in the mobile app without having to define them explicitly in the mobile model. |
| ServiceType | Identifies a specific type of service that will use this model. |
Each node can have five children: , , , , and .
EndPoints
The node defines one or more endpoints for the model. An endpoint defines how a model will connect to the data source. Each node can have these attributes:
| Attribute | Description |
|---|---|
| Discriminator | Discriminator for this endpoint. A discriminator can be used to select an endpoint if there are multiple endpoints with the same number of qualifiers. |
| EndPoint | Endpoint to use in service calls for this model. The endpoint is a path that is appended to the base Rest Services URL in calls to Rest Services.
To include qualifiers in the path, enclose them in curly brackets. For example, the AssetManagement_Asset model has this endpoint, where
If a model has more than one endpoint, the mobile services will select the one where the largest number of qualifiers are met. For example, the AssetManagement_Asset model also has this endpoint:
If a service call includes both an asset type and a primary key, then the first endpoint will be selected. If it includes only a primary key, then the second endpoint will be used instead. |
MappingGroups
Mapping groups serve to make selected properties of the parent model available for display in mixed work lists.
A node has one or more nodes as children. Each node has one attribute:
| Attribute | Description |
|---|---|
| Id | Identifier for the mapping group. |
Each node has one or more nodes as children. A node serves as the parent for a collection of specific mappings. Each mapping node has these attributes:
| Attribute | Description |
|---|---|
| Id | Identifier for the mapping. |
| Source | Source of the mapping. You can specify one or more properties of the parent model. If you specify more than one property, enclose each one in curly brackets, such as {Id} {Priority.Code}. You can also specify additional characters to format how the mapped property will be displayed, such as # {ApplicationNumber}. |
Properties
The node has one or more nodes as children. Each node defines a specific property for the parent model.
Note that properties can also be defined on the views that use the model. You only need to define properties on the model itself if you always want them to be present, regardless of the view.
Each node can have these attributes:
| Attribute | Description |
|---|---|
| Bind | Specific component that the property is bound to. For example, to map InspectionModel.InspectionType to InspectionComponent.InspectionType.Code, you would specify InspectionType.Code. |
| Data Type | .NET data type of the property. |
| Foreign Key | ID of the property that serves as a foreign key to link this property to another model. This attribute can be used together with the Model attribute to define relationships between models. |
| Id | Unique identifier for the property. |
| Is Collection | Indicates whether the property carries a collection of data. |
| Is Primary | Indicates whether the property is a primary key. |
| Model | ID of the model that this property is associated with. This attribute can be used together with the Foreign Key attribute to define relationships between models. |
| Moniker | Moniker of the business object that supplies the values for this property. |
| No Descriptor | Indicates whether the Mobile Metadata service will create a descriptor for this property. |
| Treat 1 As Valid Primary Key | For internal use. |
Each node can have one child node, which defines how the property is downloaded and stored on the mobile device. The node is displayed only for properties that have a model ID entered for the Model attribute. These properties, called model properties, represent data sets rather than single values, so you may want to limit the data that is downloaded.
The node has a child node, which in turn has one node as a child. The node has one or more nodes as children, each of which can have these attributes:
| Attribute | Description |
|---|---|
| Download | Indicates whether the parent property will be downloaded to the mobile device. |
| ProcessChildAssociations | Indicates whether the download will include child properties for associated models. |
| Profiles | Profiles that this item applies to. You can enter multiple profile IDs in a comma-separated list. |
| RecursionLevel | Indicates the depth to which the recursion will execute to download data. |
| Strategy | Describes the strategy by which the data will be downloaded. You can specify one of these values:
|
Each node can have a child node, which has one or more nodes as children. And EndPoint node can have these attributes:
| Attribute | Description |
|---|---|
| Discriminator | Discriminator for this endpoint. A discriminator can be used to select an endpoint if there are multiple endpoints with the same number of qualifiers. |
| EndPoint | Endpoint to use in service calls for this model. The endpoint is a path that is appended to the base Rest Services URL in calls to Rest Services. |
PropertyGroups
The node has one or more nodes as children. A property group is a collection of properties that will be used under specified conditions. You use filters to define the conditions for a property group. Each node has these attributes:
| Attribute | Description |
|---|---|
| Moniker | Moniker of the business object that the property group is associated with. This will override the moniker of the parent model. For example, in asset property groups, this is used to override the generic Hansen.AssetManagement.Asset with the moniker of a specific asset type. |
| Name | Name of the property group. |
Each node has one node and one node as children. The node has a child node with one or more nodes as children. Each node defines a condition for the property group. If you define multiple conditions, then all conditions must be met.
| Attribute | Description |
|---|---|
| Operation | Operator for the comparison. You can specify Equal or NotEqual. |
| Property | Property that the condition will evaluate. |
| Value | Value of the condition. |
The node has one or more nodes as children. The nodes have the same attributes as the nodes under the node.
Sync
The node can be used to filter data for the parent model when it is downloaded to the local device. For example, you might only want to download assets of a specified type, or addresses with a specified street name.
See Filtering downloaded data.
The node has a child node, which in turn has one node as a child. The node has one or more nodes as children, each of which can have these attributes:
| Attribute | Description |
|---|---|
| AdditionalQueryParameters | Key/value parameters that are used to filter the data that is downloaded for this model. You can enter one or more parameters in a comma-separated list. |
| DataFilter | Filter that is used to limit the data that is downloaded for this model. |
| Profiles | Profiles that this item applies to. You can enter multiple profile IDs in a comma-separated list. |