Show TOC

Configuring Data Sources and ModelsLocate this document in the navigation structure

Overview page applications present information provided by an OData service and annotation files.

OData services and annotations are configured in the "sap.app"..."dataSources" section in the application manifest file. Each OData data source should be mapped to a SAPUI5 model, which is then referenced by the cards and the global filter configuration.

Annotation files can be embedded in the OData metadata, or they can be referenced in the OData dataSource section.

Each OData type dataSources section must be exposed as an SAPUI5 model in the "sap.ui5"..."models" section. In addition, you should define a model for the i18n.properties file with i18n as the model name. If you want to use translated values in an annotation file, you must also provide an additional model for the i18n.properties file with @i18n as the model name. In the annotation file, you can reference a translation property in an annotation file using the following format:

{@i18n>@PropertyName}

For example:

<PropertyValue Property="Label" String="{@i18n>@GeneralInfoFacetLabel}"/>

In the i18n.properties file, you should have a property with @PropertyName as the key for example:

# XTIT: Title @PropertyName=Property value

Sample Code
 "sap.app": {
    ...
    "dataSources": {
        "ZCD204_EPM_DEMO_SRV": {
            "uri": "/sap/opu/odata/sap/ZCD204_EPM_DEMO_SRV/",
            "type": "OData",
            "settings": {
                "annotations": [
                    "localAnnotations_1"
                ],
                "localUri": "localService/ZCD204_EPM_DEMO_SRV/metadata.xml"
            }
        },
        "localAnnotations_1": {
            "uri": "annotations/localAnnotations_1.xml",
            "type": "ODataAnnotation",
            "settings": {
                "localUri": "annotations/localAnnotations_1.xml"
            }
        }
    }
    ...
},
...
"sap.ui5": {
    ...
    "models": {
        "i18n": {
            "type": "sap.ui.model.resource.ResourceModel",
            "uri": "i18n/i18n.properties"
        },
        "ZCD204_EPM_DEMO_SRV": {
            "dataSource": "ZCD204_EPM_DEMO_SRV",
            "settings": {}
        },
        "@i18n": {
            "type": "sap.ui.model.resource.ResourceModel",
            "uri": "i18n/i18n.properties"
        }
    },
    ...
}