Syntax of SAP Fiori Elements SemanticKey

An xml fragment of the annotation local file is as follows:

<Annotations Target="SEPMRA_PROD_MAN.SEPMRA_C_PD_ProductType" xmlns="http://docs.oasis-open.org/odata/ns/edm">
                <Annotation Term="Common.SemanticKey">
                    <Collection>
                        <PropertyPath>Product</PropertyPath>
                    </Collection>
                </Annotation>
            </Annotations>

Below is a line by line explanation.

  • <Annotations>Labels are used to contain a set of annotations. Annotations are used to enhance metadata of OData services, they can be used to describe how to display data in Fiori user interface.
  • TargetThe attribute specifies the target of this set of annotations. In this case, the target is SEPMRA_PROD_MAN.SEPMRA_C_PD_ProductTypethat this is an entity type in the OData service. This means that this set of annotations is used to describe how to handle data of this entity type.
  • xmlnsThe attribute defines the XML namespace of this XML document. Here, it is OData's EDM (Entity Data Model) namespace, which indicates that this document follows OData's EDM specification.

Then <Annotation>the tag:

<Annotation Term="Common.SemanticKey">
    ...
</Annotation>
  • <Annotation>Labels are used to define an annotation. Here, Termthe attribute of this annotation is Common.SemanticKey, which indicates that this annotation is used to define the semantic key of the entity type.
  • A semantic key is a special kind of key that defines the uniqueness of an entity. In the Fiori user interface, semantic keys are used to establish links between related entities and to identify entities in navigation and search.

And finally the <Collection>and <PropertyPath>tags:

<Collection>
    <PropertyPath>Product</PropertyPath>
</Collection>
  • <Collection>Tags are used to define a collection. Here, it includes all properties of the semantic key.
  • <PropertyPath>Tags are used to define a property path. Here it is, Productwhich means Productthe attribute is part of the semantic key for that entity type.

In general, the meaning of this XML is: In SEPMRA_PROD_MAN.SEPMRA_C_PD_ProductTypeentity types, Productattributes are defined as part of the semantic key. This means that in the Fiori UI, Productattributes will be used to establish links between related entities, and to identify entities in navigation and search.

Guess you like

Origin blog.csdn.net/i042416/article/details/131898213