In the ConSol CM Web Client, resource data sets are displayed in short form at various locations, based on templates. For example, in the ticket history, the resource name, inventory number and location might be required, whereas in the Quick Search only the name and inventory number should be displayed. This section will show you where short forms are used and how the respective templates are configured using the Admin Tool.
Templates are always defined for a Resource Type. In our example, HP_Printer is a Resource Type, i.e., the templates will be valid for all real-world HP printers which are stored in the ConSol CM system.
The configuration is based on the following principle (very similar to the display of customer data):
To create and edit resource data format templates, edit the desired Resource Type in the Admin Tool and enter the names of the templates. Name them however you like resp. following any naming conventions defined by your organization.
Figure 539: ConSol CM Admin Tool - Resource data format template definition for a Resource Type
In the next step, you have to create the respective templates and store them in the Scripts and Templates section, as described in the following section.
The templates are written in FreeMarker notation. For detailed information, please refer to the FreeMarker web site.
Within the templates, you work with three object types:
Please note that there might be more than one Resource Field Group within a Resource Type!
Figure 540: ConSol CM Admin Tool - Objects used in resource data template definition
The resource templates must be single-row! They must not contain line-breaks!
// Example 1
// Resource Field group is named vehicleProperties, Resource Fields are named vehicleIdentification and vehicleLicense
${resource.get("vehicleProperties", "vehicleIdentification") + ' (' + resource.get("vehicleProperties", "vehicleLicense") + ')'}
// Example 2
// // Resource Field group is named publicTransportProperties, Resource Fields is named passName
${resource.get("publicTransportProperties", "passName")}
Starting with ConSol CM version 6.10.5.4, enum values can be localized, i.e. you can have the localized value displayed in the Web Client. For example, an enum "SLA_country" contains a list of countries where an SLA might be valid. In the Admin Tool, technical values are used and a localized value has to be defined for each desired language. In the Web Client, the correct country name in the respective browser locale should be displayed. If the locale of the browser is not configured explicitly, the standard CM locale will be used.
The following example works with the "SLA_country" enum.
SLA: ${resource.getFieldValue("SLA_Fields_basic","SLA_Name")!} (${localize(resource.getFieldValue("SLA_Fields_basic","SLA_country"))!})
Figure 541: ConSol CM Web Client: Display of an enum value based on a resource template
The following Template types can be defined:
This template must always be defined. If it is not, there will be an error in the Web Client (unknown is displayed as name of all resources of this type). The template will be used for all locations in the Web Client for which no other templates have been defined and will also be used as REST template for CM.Track in case there is no dedicated Rest template. The templates which are described in the subsequent sections will override the default template for the specific Web Client location.
The template is used for
This template defines the format of the resource data in the result of the Quick Search. For an example see section Quick Search.
This template defines the format of the resource data in the result of the search (in suggestion lists) for resources when a resource is linked to another object, e.g., a ticket. For an example see section Search.
This template defines the format of the resource data in the result of the REST API. In the standard configuration, no resource data are displayed in the ConSol CM portal, CM.Track, which is based on the REST API. This template will only be effective when you address the REST API directly, e.g., for programming with ConSol CM interfaces. For an example see section Rest.
This template defines the format of the resource data in the result of the ticket, customer and resource history, e.g., when a relation to or from a resource was added. For an example see section History Sections of Resource Page, Customer Page and Ticket.
The following locations are specified:
Figure 542: ConSol CM Web Client - Header of the resource page
Used template: Default (see example above)
ConSol CM Web Client - Dragged resource in drag-and-drop operations
Used template: Default (see example above)
Figure 543: ConSol CM Web Client - Resource name in Favorites
Used template: Default (see example above)
Figure 544: ConSol CM Web Client - Results for Quick Search (resource)
Used template: Quick Search, if this is defined. If not, Default.
Figure 545: ConSol CM Web Client - Resource in suggestion list, format based on search template
Used template: Search, if this is defined. If not, Default.
The history template for a resource will be displayed, for example, in the ticket history for the extended level, if Show all entries has been selected.
Figure 546: ConSol CM Web Client - History template for resource data
Used Template: History, if this is defined. If not, Default.
The following example shows a REST client request for resource data and the resulting answer of the ConSol CM server via REST API. The value within the <mark> tag in the XML output is the resource information which is formatted using the REST template. In the example, the resource name (My new HP Printer) and the inventory number (4712) are part of the template.
Figure 547: REST API - List of all resources
Figure 548: REST API - Details of one selected resource (ID 2)
Used template: REST, if defined. If not, Default.