Show TOC

Example documentationExample: Single Geographic Information on Sub-Entity Level

 

Follow the example below to include geographic information in a fact sheet on sub-entity level.

Activities

In this example, the root entity is AllocationTable, the subordinate entity is Site (navigation property: CAUKO_TO_DC). The subordinate entity generates several addresses during runtime.

Syntax Syntax

  1. <Annotations Target="CB_ALLOCATION_TABLE.SRV.AllocationTable">
  2. <Annotation Term="UI.HeaderInfo">
  3. <Annotation Term="UIBadge">
  4. .
  5. .
  6. .
  7. <Annotation Term="UI.Facets">
  8. .
  9. .
  10. .
  11. <Record Type="UI.ReferenceFacet">
  12. <Annotation Term="UI.Map"/>
  13. <PropertyValue Property="Label" String="SiteAddress"/>
  14. <PropertyValue Property="Target"
  15. <AnnotationPath="CAUKO_TO_DC/@UI.GeoLocation"/>
  16. </Record>
End of the code.
  1. On root level, you define a new facet with the term <Record Type="UI.ReferenceFacet">

    .

  2. You define the facet as a map with <Annotation Term="UI.Map"/> with several properties:

    • The label of the facet, Site Address

      The string for the relevant address can also be an alias, which can be flexibly filled.

    • Further location properties defined in the UI.GeoLocation term that is referenced by @UI.GeoLocation

    • <PropertyValue Property="Target" <AnnotationPath="CAUKO_TO_DC/@UI.GeoLocation" defines where the address data displayed on the map is coming from.

      It defines the navigation property CAUKO_TO_DC. The navigation property defines which subordinate entity is assigned to the root entity.

On sub-entity level, insert the following coding:

Syntax Syntax

  1. <Annotations Target="CB_ALLOCATION_TABLE_SRV.Site">                     
  2. <Annotation Term="UI.GeoLocation">
  3. <Record>
  4. <PropertyValue Property="Latitude" Path="YPOS"/>
  5. <PropertyValue Property="Longitude" Path="XPOS"/>
  6. <PropertyValue Property="Address">
  7. <Record>
  8. <PropertyValue Property="label"
  9. Path="FormattedAddressField"/>
  10. </Record>
  11. </PropertyValue>
  12. </Record>
  13. </Annotation>
End of the code.

<Annotations Target="CB_ALLOCATION_TABLE_SRV.Site"> defines for which subordinate entities the geolocation is defined. The tag indicates that the geolocation is defined for the entity Site of the OData Service CB_ALLOCATION_TABLE_SRV.

The tag <PropertyValue Property="label" Path="FormattedAddressField"/> represents the name of the field with a formatted address in the search model. The information is provided by the OData service. The system generates multiple addresses for the entity Site during runtime .

More Information

Extending a Search Model