天天看点

什么是 SAP vocabulary-based annotations

我们在 SAP Fiori Elements 应用的本地注解里,能看到大量如下以 Common 和 UI 为前缀的注解属性:

什么是 SAP vocabulary-based annotations
这些 Common,UI,实际是命名空间(namespace), 定义在本地注解文件(文件夹localService下面) 的开头部分:
什么是 SAP vocabulary-based annotations

<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
    <edmx:Reference Uri="../../catalogservice;v=2/Vocabularies(TechnicalName='%2FIWBEP%2FVOC_COMMON',Version='0001',SAP__Origin='LOCAL')/$value">
        <edmx:Include Namespace="com.sap.vocabularies.Common.v1" Alias="Common"/>
    </edmx:Reference>
    <edmx:Reference Uri="../../catalogservice;v=2/Vocabularies(TechnicalName='%2FIWBEP%2FVOC_UI',Version='0001',SAP__Origin='LOCAL')/$value">
        <edmx:Include Namespace="com.sap.vocabularies.UI.v1" Alias="UI"/>
    </edmx:Reference>      

com.sap.vocabularies.Common.v1: Common terms for all SAP vocabularies

https://sap.github.io/odata-vocabularies/vocabularies/Common.html
什么是 SAP vocabulary-based annotations

com.sap.vocabularies.UI.v1:Terms for presenting data in user interfaces

https://sap.github.io/odata-vocabularies/vocabularies/UI.html
什么是 SAP vocabulary-based annotations

SAP 为 Fiori Elements 定义的所有 OData vocabulary 注解,都能在这个链接里找到:

https://sap.github.io/odata-vocabularies/
什么是 SAP vocabulary-based annotations

vocabulary-based annotations 有两种类型:

In-place: 是 OData 服务元数据的一部分。

Ex-place: 在 metadata document 之外,由一个注解提供类Annotation Provider Class,简称 APC 额外提供。APC 同 OData 服务的绑定关系,通过事物码 /IWBEP/REG_VOCAN 维护。

These annotations are available using a query to the SAP Gateway catalog service, /sap/opu/odata/IWFND/CATALOGSERVICE;v=2/. Entity Set: ‚Annotations‘.

例如下图所示:

什么是 SAP vocabulary-based annotations
什么是 SAP vocabulary-based annotations

继续阅读