Open Source Dokumentenmanagement
Dokumentation

Durchsuchbare Dokumentation aufrufen | Zurück zur Dokumentationsübersicht

Navigation: Dokumentationen agorum core > Konfigurationen zu Metadaten > agorum core metadata collection


Beispiele für die metadata-collection.yml 

Diese Dokumentation enthält eine Sammlung von Beispielen für die Nutzung der agorum core metadata-collection.

Ein komplettes Projekt mit allen Beispielen finden Sie unter undefined>agorum.metadata.collection.sample-1.1.0.

Es können auch mehrere collections in einer einzigen yml-Datei vorhanden sein.

Damit die unten aufgeführten Beispiele funktionieren:

  1. Erstellen Sie ein Projekt mit dem Namen agorum.metadata.collection.sample.

metadata.yml

Folgende Metadaten sollen über die Datei metadata.yml angelegt werden:

# -- global
_group: agorum.metadata.collection.sample
_prefix: agorum_metadata_collection_sample_
_dataPrefix: MAIN_MODULE_MANAGEMENT/customers/agorum.metadata.collection.sample/Data/
_csvPrefix: /agorum/roi/customers/agorum.metadata.collection.sample/csv/
_encoding: UTF-8

_default:
  # string, long, double, date, boolean
  type: string
  # inherited, notInherited, builtIn
  kind: notInherited
  
# test
invoice_number:
  displayName: Rechnungsnummer

test_string:
  displayName: Test string

test_string_multi:
  displayName: Test string multi
  multi: true

test_date:
  displayName: Test date
  type: date

test_date_multi:
  displayName: Test date multi
  type: date
  multi: true

test_long:
  displayName: Test long
  type: long

test_long_multi:
  displayName: Test long multi
  type: long
  multi: true

test_double:
  displayName: Test double
  type: double

test_double_multi:
  displayName: Test double multi
  type: double
  multi: true

test_boolean:
  displayName: Test boolean
  type: boolean

test_boolean_multi:
  displayName: Test boolean multi
  type: boolean
  multi: true

invoice_date:
  displayName: Rechnungsdatum
  type: date
  
invoice_items:
  displayName: Rechnungspositionen
  list:
    number:
      displayName: Nummer
      type: long

    description:
      displayName: Bezeichnung
      type: string

    net:
      displayName: Nettobetrag
      type: double  

Beispiel 1

_group: agorum.metadata.collection.sample
_prefix: agorum_metadata_collection_sample_
_default:
   type: string

-test_metadata_collection_01:
  displayName: Test Metadaten Sammlung 01

  # acl ab agorum core 10.0.6
  acl: published

  usage:
    - docform
    - cmis
    - acic

  docform:

  acic:
    # acl ab agorum core 10.0.6
    acl: private

    # overwrite title of acic 
    title: 'Metadaten 01'

  items:
    - test_string:
      acic:
        title: 'Ein tolles Suchfeld'
        # remove auto subquery
        subQuery:
    - test_string_multi:
      acic:
        # disable for search
        unavailable: true
    - test_date:
      docform:
        # disable for docform
        unavailable: true
    - test_date_multi:
      acic:
        # overwrite complete subquery
        query: '${subQuery} allfields:agorum_metadata_collection_sample_test_date_multi'
        subQuery:
        - query: '${value}'
          queryPart: 'agorum_metadata_collection_sample_test_date_multi:[${valueFrom} TO ${valueTo}]'
          name: 'agorum_metadata_collection_sample_test_date_multi_from_to'
          type: 'date-range'
          titleFrom: 'x ab Datum (yyyy-mm-dd)'
          titleTo: 'x bis Datum (yyyy-mm-dd)'
          # convert: 'dateString'
    - test_long:
      acic:
        query: '${subQuery} allfields:agorum_metadata_collection_test_long'
        subQuery:
        - title: 'Eine Untersuche'
          placeholder: 'Testfeld'
          query: 'agorum_metadata_collection_test_long:${value}'
    - test_long_multi:
    - test_double:
    - test_double_multi:
    - test_boolean:
    - test_boolean_multi:
    - invoice_number:
      docform:
        extractor: date
        optional: true
    - invoice_date:
      common:
        optional: false
        displayName: 'Das Rechnungsdatum'
      docform:
        extractor: date
        optional: true
    - invoice_items:
      # when entries are defined in items, then only these entries are used, in this case only number
      items:
        - number:

Beispiel 2

_group: agorum.metadata.collection.sample
_prefix: agorum_metadata_collection_sample_
_default:
   type: string

-test_metadata_collection_02:
  displayName: Test Metadaten Sammlung 02
  usage:
    - docform
    - cmis
    - acic

  docform:
    handler: "agorum.zugferd.docform.ZugferdHandler"

  items:
    - invoice_number:
      docform:
        extractor: long
        optional: true
    - invoice_date:
      common:
        optional: false
        displayName: 'Das Rechnungsdatum'
      docform:
        extractor: date
        optional: true
    - invoice_total_gross:
      docform:
        extractor: double
    # docform verify
    - invoice_total_gross_invalid:
      displayName: Bruttobetrag ist nicht korrekt
      docform:
        type: verify
        optional: false
        verifierParameters: >-
          (agorum_metadata_collection_sample_invoice_total_gross && !AC.eq(agorum_metadata_collection_sample_invoice_total_gross, 0)) ||
          false
        verifier: javascript
   - invoice_items:
      # when entries are defined in items, then only these entries are used, in this case only number
      items:
        - number:
          docform:
            extractor: javascript
            extractorParameters: "value.trim()"
        - net:
        - description:

Beispiel 3

_group: agorum.metadata.collection.sample
_prefix: agorum_metadata_collection_sample_
_default:
   type: string

# with prefix
collection_03:
  displayName: Test Metadaten Sammlung 03
  usage:
    - docform
    - cmis
    - acic

  docform:
    handler: "agorum.zugferd.docform.ZugferdHandler"

  items:
    - invoice_number:
      docform:
        extractor: long
        optional: true
    - invoice_date:
      common:
        optional: false
        displayName: 'Das Rechnungsdatum'
      docform:
        extractor: date
        optional: true
    - invoice_items:
      # when nothing is defined in items, all items are used, that are defined in metadata invoice_items
      items:

Beispiel 4

_group: agorum.metadata.collection.sample
_prefix: agorum_metadata_collection_sample_
_default:
   type: string

# acic test
acic_collection_04:
  displayName: Test Metadaten Sammlung 04
  usage:
    - acic

  items:
    - invoice_number:
    - invoice_date:
      common:
        optional: false
        displayName: 'Das Rechnungsdatum'
    - invoice_items:
      # when nothing is defined in items, all items are used, that are defined in metadata invoice_items
      items:

Beispiel 5 (Globale Filtereinstellungen im agorum core information center)

-test_metadata_collection_05:
  displayName: Test Metadaten Sammlung 05
  usage:
    - acic

  acl: published

  acic:
    # overwrite title of acic
    title: 'Metadaten 05'
    #additionalBaseQuery: 'weitere Einschränkung der baseQuery'
    listConfig: 'Standard'
    listType: 'explorer'
    disableDefaultFilter: true
    filterSelection:
      "agorum.metadata.collection.name.agorum_metadata_collection_test_string":
        value: true
        subQuery:
          "agorum.metadata.collection.filter.subquery.agorum_metadata_collection_test_string":
            value:
              - test

    sortConfig:
      - name: 'test_sort_config'
        text: 'Meine Sortierung'
        sort:
          - property: createDate
            direction: asc

  items:
    - test_string:
    - test_string_multi:
    - test_date:
    - test_date_multi:
    - test_long:
    - test_long_multi:
    - test_double:
    - test_double_multi:
    - test_boolean:
    - test_boolean_multi:
    - invoice_date:
    - invoice_items:
      # when entries are defined in items, then only these entries are used, in this case only number
      items:
        - number:
        - description:
        - net:

Beispiel 6

-test_metadata_collection_06:
  displayName: Test Metadaten Sammlung 06
  usage:
    - acic
    - form
    - form_no_date

  acic:
    # overwrite title of acic
    title: 'Metadaten 06'

  items:
    - test_string:
    - test_date:
      form_no_date:
        unavailable: true
    - test_long:
    - test_double:
    - test_boolean:
    - invoice_number:
    - invoice_date:
      common:
        optional: false
        displayName: 'Das Rechnungsdatum'
      form_no_date:
        unavailable: true