Skip to content

Latest commit

 

History

History
119 lines (94 loc) · 3.79 KB

DdlAnnotationLayoutRule.md

File metadata and controls

119 lines (94 loc) · 3.79 KB

<-- previous rule | overview | next rule -->

Standardize annotation layout

Standardizes spaces, one-liners and alignment of DDL annotations.

Starting new lines before a comma is not supported. Spaces before '@' and around '.' will always be removed.

Options

  • Spaces
  • Space after colon
  • Space inside braces { ... }
  • Space inside array brackets [ ... ]
  • One-liners
  • Maximum line length for one-liners [120]
  • Max. number of elements for one-liners in entity annotations: [4]
  • Max. number of elements for one-liners in select lists etc.: [4]
  • Alignment
  • Align values of nested elements (unless an element contains a dot)
  • Align 'tables' of structure-identical annotations in arrays

Examples

@ObjectModel.lifecycle.draft.notificationBeforeExpiryInterval: 'PT10D'
@ObjectModel. lifecycle. draft .expiryInterval:'PT28D'
@ObjectModel.usageType: { serviceQuality: #D,
                            sizeCategory:#XXL,
                                 dataClass :#MIXED }

@ObjectModel.supportedCapabilities: [#ANALYTICAL_QUERY,
                                      #ANALYTICAL_DOCUMENT_STORE,
                                    #ANALYTICAL_KPI,
                                        #ANALYTICAL_PROVIDER ]
@ObjectModel.action:[{instance:{bound:true}},{enabled:true},{feature:''}]

@UI.selectionVariant: [ {
  qualifier: 'params',
  parameters: [ {
    name: 'P_AnyParam',
    value: 'any'
  }, {
    name: 'P_OtherParam',
    value: 'other'
  }, {
    name:  'P_Third',
    value: 'third'
} ] } ]

define view entity C_AnyEntity
  as select from I_OtherEntity

{
      @Consumption.filter: { selectionType: #SINGLE,
                             multipleSelections  :false,
                            mandatory:false}
      @Search.defaultSearchElement: true
      @  Search.fuzzinessThreshold :0.7
  key AnyKeyField,

      @ObjectModel.text.element:[   'SemanticObjectName']
      @Consumption.valueHelpDefinition:
      [
        {
          entity:
          {
            name: 'I_AnyName',
            element: 'ElementName'
          }
        }
      ]
      AnyNonKeyField
}

Resulting code:

@ObjectModel.lifecycle.draft.notificationBeforeExpiryInterval: 'PT10D'
@ObjectModel.lifecycle.draft.expiryInterval: 'PT28D'
@ObjectModel.usageType: { serviceQuality: #D, sizeCategory: #XXL, dataClass: #MIXED }

@ObjectModel.supportedCapabilities: [ #ANALYTICAL_QUERY,
                                      #ANALYTICAL_DOCUMENT_STORE,
                                      #ANALYTICAL_KPI,
                                      #ANALYTICAL_PROVIDER ]
@ObjectModel.action: [ { instance: { bound: true } },
                       { enabled: true },
                       { feature: '' } ]

@UI.selectionVariant: [ { qualifier: 'params',
                          parameters: [ { name: 'P_AnyParam',   value: 'any'   },
                                        { name: 'P_OtherParam', value: 'other' },
                                        { name: 'P_Third',      value: 'third' } ] } ]

define view entity C_AnyEntity
  as select from I_OtherEntity

{
      @Consumption.filter: { selectionType: #SINGLE, multipleSelections: false, mandatory: false }
      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.7
  key AnyKeyField,

      @ObjectModel.text.element: [ 'SemanticObjectName' ]
      @Consumption.valueHelpDefinition: [ { entity: { name: 'I_AnyName', element: 'ElementName' } } ]
      AnyNonKeyField
}

Related code