Příklady operací nad DMS / SmartSafe

Pomocí GraphQL je možné provádět veškeré operace nad DMS. Je možné vkládat soubory, stahovat soubory, získávat a měnit metadata souborů, zjišťovat a měnit nastavení DMS apod. Níže je uvedeno několik příkladů, jak pracovat s DMS. Veškeré operace nad DMS se ve schématu skrývají pod klíčem "docs".

Získání typů souborů v rámci dané organizace a zobrazení jejich nastavení

Dotaz pro získání všech typů souborů, které jsou k dispozici v dané organizaci. Pomocí tohoto dotazu lze zjišťovat i oprávnění pro daný typ pro skupiny, agendy nebo externí informační systémy.

query findDocTypes{
  docs{
    types{
      id
      displayName
      displayName_Localization{
        cz
        en
      }
      defaultView{
        id
        displayName
      }
      defaultLtvAccept
      ident
      signatureValidationMode_ExtIs
      signatureValidationMode_ProcessInstance
      signatureValidationMode_User
      isHidden
      groupPermissions{
        group{
          name
          id
        }
      }
      agendaPermissions{
        agenda{
          displayName
          id
        }
      }
      extIsPermissions{
        extIs{
          displayName
          id
        }
      }
    }
  }
}

Získání informací o konkrétním typu

Pokud je nutné zjistit informace o jednom konkrétním typu, lze to provést následujícím dotazem na základě TdId daného typu.

Dotaz:

query findDocTypes($idTypu: TdId!)
{
  docs{
    type(id: $idTypu)
    {
      id
      displayName
      displayName_Localization{
        cz
        en
      }
      defaultView{
        id
        displayName
      }
      defaultLtvAccept
      ident
      signatureValidationMode_ExtIs
      signatureValidationMode_ProcessInstance
      signatureValidationMode_User
      isHidden
      groupPermissions{
        group{
          name
          id
        }
      }
      agendaPermissions{
        agenda{
          displayName
          id
        }
      }
      extIsPermissions{
        extIs{
          displayName
          id
        }
      }
      metadata{
        meta{
          id
          defaultDisplayName
        }
      }
    }
  }
}

Proměnné:

{
  "idTypu": "obecny_dokument"
}

Vytvoření nového/úprava typu

Pro úpravy konfigurace DMS je ve schématu položka administrationBatch. Lze spojovat více operací do jedné mutace, tj. v rámci jedné mutace vytvořit například zároveň typ, metadata a pohled. Pro přehlednost jsou příklady rozděleny podle jednotlivých druhů. Tento příklad se týká nastavení typu – druh operace se provádí pomocí klíče action. V úvahu připadá:

  • CREATE

  • UPDATE

Dotaz pro tvorbu nového typu

mutation editTypes {
  docs {
    administrationBatch(
      types: [
        {
          action: CREATE
          id: "type_invoice"
          defaultViewId: "view_sys_all_files"
          displayName_Localization: { cz: "Faktura", en: "Invoice" }
          schemaFieldNameSingular: "invoice"
          schemaFieldNamePlural: "invoices"
          schemaTypeName: "Type_invoice"
          shredAfterYears: 10
          shredMark: SHRED
          groupPermissions: [
            {
              action: SET
              groupId: "a380c2c6-68d7-4942-875a-eaf5ad5e5263"
              stateType: DMS
              permissions: {
                create: CAN_CREATE
                view: META_ALL_VERS
                edit: META_ALL_VERS
                share: CAN_SHARE_REVOKE
              }
            }
            {
              action: SET
              groupId: "a380c2c6-68d7-4942-875a-eaf5ad5e5263"
              stateType: ARCHIVE
              permissions: {
                create: CAN_CREATE
                view: META_ALL_VERS
                edit: META_ALL_VERS
                share: CAN_SHARE_REVOKE
              }
            }
          ]
        }
      ]
    ) {
      types {
        id
        displayName
      }
    }
  }
}

Dotaz pro úpravu existujícího typu

Do mutace není nutné zadávat všechny klíče, povinný je vždy klíč id, který obsahuje TdId daného typu a následně stačí pouze přidávat klíče, které se mají upravovat. Tímto způsobem je možné upravovat i oprávnění k danému typu. V tomto případě by se tedy přidávalo úplné oprávnění skupině všem uživatelům pro otevřené soubory a odebralo oprávnění všem uživatelům pro stav archivováno.

mutation editTypes {
  docs {
    administrationBatch(
      types: [
        {
          action: UPDATE
          id: "type_invoice"
          defaultViewId: "view_sys_all_files"
          displayName_Localization: { cz: "Nový název", en: "New name" }
          shredMark: ARCHIVE
          groupPermissions: [
            {
              action: SET
              groupId: "a380c2c6-68d7-4942-875a-eaf5ad5e5263"
              stateType: DMS
              permissions: {
                create: CAN_CREATE
                view: META_ALL_VERS
                edit: META_ALL_VERS
                share: CAN_SHARE_REVOKE
              }
            }
            {
              action: DELETE
              groupId: "a380c2c6-68d7-4942-875a-eaf5ad5e5263"
              stateType: ARCHIVE
              permissions: {
                create: CAN_CREATE
                view: META_ALL_VERS
                edit: META_ALL_VERS
                share: CAN_SHARE_REVOKE
              }
            }
          ]
        }
      ]
    ) {
      types {
        id
        displayName
      }
    }
  }
}

Získání metadat v rámci dané organizace a zobrazení jejich nastavení

Dotaz pro získání všech metadat, která jsou k dispozici v dané organizaci.

Dotaz:

query findAllMetadata
{
  docs{
    metadata{
      defaultDisplayName
      defaultDisplayName_Localization{
        cz
        en
      }
      id
      ident
      isSystem
      isSuggestable
      isSortable
      isRetrievable
      isReadonly
      defaultIsRequired
      defaultFormat
      memberOfAllTypes
      memberOfTypes{
        docType{
          displayName
          id
        }
      }
    }
  }
}

Vytvoření nového/úprava metadata

Pro úpravy konfigurace DMS je ve schématu položka administrationBatch. Lze spojovat více operací do jedné mutace, tj. v rámci jedné mutace vytvořit například zároveň typ, metadata a pohled. Pro přehlednost jsou příklady rozděleny podle jednotlivých druhů. Tento příklad se týká nastavení typu – druh operace se provádí pomocí klíče action. V úvahu připadá:

  • CREATE

  • UPDATE

Dotaz pro tvorbu nových metadat:

mutation addMetadata {
  docs {
    administrationBatch(
	metadata: [
        {
          action: CREATE
          id: "meta_invoice_closed"
          schemaFieldName: "meta_invoice_closed"
          defaultDisplayName_Localization: {
            cz: "Vyřízeno"
            en: "Finished"
          }
          defaultIsRequired: false
          dataType: BOOL
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_assignedTo"
          schemaFieldName: "meta_invoice_assignedTo"
          defaultDisplayName_Localization: { cz: "Přiřazeno", en: "Assigned to" }
          defaultIsRequired: false
          dataType: STRING
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_closedBy"
          schemaFieldName: "meta_invoice_closedBy"
          defaultDisplayName_Localization: { cz: "Vyřídil", en: "Closed by" }
          defaultIsRequired: false
          dataType: USER
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_startTime"
          schemaFieldName: "meta_invoice_startTime"
          defaultDisplayName_Localization: {
            cz: "Zahájení agendy"
            en: "Start time"
          }
          defaultIsRequired: false
          dataType: DATE_TIME
          defaultFormat: "D. M. YYYY H:mm"
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_arrivedOn"
          schemaFieldName: "meta_invoice_arrivedOn"
          defaultDisplayName_Localization: {
            cz: "Došla dne"
            en: "Arrived on"
          }
          defaultIsRequired: true
          dataType: DATE_TIME
          defaultFormat: "D. M. YYYY"
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_dueDate"
          schemaFieldName: "meta_invoice_dueDate"
          defaultDisplayName_Localization: { cz: "Splatnost", en: "Due date" }
          defaultIsRequired: true
          dataType: DATE_TIME
          defaultFormat: "D. M. YYYY"
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
	{
	  action: CREATE
          id: "meta_invoice_amount"
          schemaFieldName: "meta_invoice_amount"
          defaultDisplayName_Localization: { cz: "Částka", en: "Amount" }
          defaultIsRequired: true
          dataType: DECIMAL
          defaultFormat: "0.00"
          isFilterable: false
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
		}
        {
          action: CREATE
          id: "meta_invoice_currency"
          schemaFieldName: "meta_invoice_currency"
          defaultDisplayName_Localization: {
            cz: "Měna"
            en: "Currency"
          }
          defaultIsRequired: true
          dataType: ENUM
          dataTypeEnum:"sys_enum_invoice_currency"
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_variableSymbol"
          schemaFieldName: "meta_invoice_variableSymbol"
          defaultDisplayName_Localization: { cz: "Variabilní symbol", en: "Variable symbol" }
          defaultIsRequired: true
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_approvedByUser"
          schemaFieldName: "meta_invoice_approvedByUser"
          defaultDisplayName_Localization: { cz: "Schvalovatel", en: "Approved by" }
          defaultIsRequired: true
          dataType: USER
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_foreignEntity"
          schemaFieldName: "meta_invoice_foreignEntity"
          defaultDisplayName_Localization: {
            cz: "Zahraniční subjekt"
            en: "Foreign entity"
          }
          defaultIsRequired: true
          dataType: BOOL
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_ic"
          schemaFieldName: "meta_invoice_ic"
          defaultDisplayName_Localization: { cz: "IČ", en: "Identification number" }
          defaultIsRequired: true
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
       {
          action: CREATE
          id: "meta_invoice_companyName"
          schemaFieldName: "meta_invoice_companyName"
          defaultDisplayName_Localization: { cz: "Název společnosti", en: "Company name" }
          defaultIsRequired: true
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_street"
          schemaFieldName: "meta_invoice_street"
          defaultDisplayName_Localization: { cz: "Ulice", en: "Street" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_addressComplete"
          schemaFieldName: "meta_invoice_addressComplete"
          defaultDisplayName_Localization: { cz: "Adresa", en: "Address" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_landRegistryNumber"
          schemaFieldName: "meta_invoice_landRegistryNumber"
          defaultDisplayName_Localization: { cz: "Číslo popisné", en: "Land Registry Number" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_houseNumber"
          schemaFieldName: "meta_invoice_houseNumber"
          defaultDisplayName_Localization: { cz: "Číslo orientační", en: "House number" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_city"
          schemaFieldName: "meta_invoice_city"
          defaultDisplayName_Localization: { cz: "Obec", en: "City" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_zipCode"
          schemaFieldName: "meta_invoice_zipCode"
          defaultDisplayName_Localization: { cz: "PSČ", en: "ZIP code" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_country"
          schemaFieldName: "meta_invoice_country"
          defaultDisplayName_Localization: { cz: "Stát", en: "Country" }
          defaultIsRequired: true
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_unit"
          schemaFieldName: "meta_invoice_unit"
          defaultDisplayName_Localization: { cz: "Středisko", en: "Unit" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_deliveryDescription"
          schemaFieldName: "meta_invoice_deliveryDescription"
          defaultDisplayName_Localization: { cz: "Popis dodávky", en: "Delivery description" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_accountantMessage"
          schemaFieldName: "meta_invoice_accountantMessage"
          defaultDisplayName_Localization: { cz: "Zpráva pro účetní", en: "Message for accountant" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_paymentType"
          schemaFieldName: "meta_invoice_paymentType"
          defaultDisplayName_Localization: {
            cz: "Způsob platby"
            en: "Payment type"
          }
          defaultIsRequired: false
          dataType: ENUM
          dataTypeEnum:"sys_enum_invoice_payment_type"
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_tookOverDate"
          schemaFieldName: "meta_invoice_tookOverDate"
          defaultDisplayName_Localization: {
            cz: "Převzal dne"
            en: "Took over date"
          }
          defaultIsRequired: false
          dataType: DATE_TIME
          defaultFormat: "D. M. YYYY"
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_approvedByComment"
          schemaFieldName: "meta_invoice_approvedByComment"
          defaultDisplayName_Localization: { cz: "Komentář schvalovatele", en: "Approved by commentary" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
         {
          action: CREATE
          id: "meta_invoice_balanceSheet"
          schemaFieldName: "meta_invoice_balanceSheet"
          defaultDisplayName_Localization: { cz: "Účetní rozvaha", en: "Balance sheet" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
         {
          action: CREATE
          id: "meta_invoice_evidenceNumber"
          schemaFieldName: "meta_invoice_evidenceNumber"
          defaultDisplayName_Localization: { cz: "Evidenční číslo", en: "Evidence number" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_invoiceFile"
          schemaFieldName: "meta_invoice_invoiceFile"
          defaultDisplayName_Localization: {
            cz: "Soubor s fakturou"
            en: "File with invoice"
          }
          defaultIsRequired: false
          dataType: BOOL
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
      ]
    ) {
      metadata {
        id
        defaultDisplayName
      }
    }
  }
}

Dotaz pro úpravu existujícího metadata

Do mutace není nutné zadávat všechny klíče, povinný je vždy klíč id, který obsahuje TdId daného metadata a následně stačí pouze přidávat klíče, které se mají upravovat. Tímto způsobem je možné upravovat i jakým typům je metadato přístupné. V tomto případě by se měnil název metadata, nastavovala by se povinnost a přidávalo by se ještě pro typ Smlouva.

mutation editMetadata {
  docs {
    administrationBatch(
	metadata: [
        {
          action: UPDATE
          id: "meta_invoice_closed"
          defaultDisplayName_Localization: {
            cz: "Vyřízeno"
            en: "Finished"
          }
          defaultIsRequired: true
           memberOfTypes: [{ action: CREATE, typeId: "type_contract" }]
        }
      ]
    ) {
      metadata {
        id
        defaultDisplayName
      }
    }
  }
}

Získání všech pohledů v rámci dané organizace a zobrazení jejich nastavení

Dotaz pro získání všech pohledů, které jsou k dispozici v dané organizaci.

Dotaz:

query findAllViews
{
  docs{
		views{
      id
      displayName
      displayName_Localization{
        cz
        en
      }
      ident
      isHidden
      docTypes
      {
        displayName
        id
      }
      allDocTypes
			metadata{
        displayName
        meta{
          id
        }
        filesGrid{
          visibility
          order
          columnMinWidth
          columnMaxWidth
        }
        metadataGrid{
          filterVisibility
          editFormVisibility
          row
          column
        }
        panelGrid{
          visibility
          row
          column
        }
      }
    }
  }
}

Získání informací o konkrétním pohledu

Pokud je nutné zjistit informace o jednom konkrétním typu, lze to provést následujícím dotazem na základě TdId daného pohledu.

Dotaz:

query findAllViews($idPohledu:TdId!)
{
  docs{
		view(id:$idPohledu){
      id
      displayName
      displayName_Localization{
        cz
        en
      }
      ident
      isHidden
      docTypes
      {
        displayName
        id
      }
      allDocTypes
	metadata{
        displayName
        meta{
          id
        }
        filesGrid{
          visibility
          order
          columnMinWidth
          columnMaxWidth
        }
        metadataGrid{
          filterVisibility
          editFormVisibility
          row
          column
        }
        panelGrid{
          visibility
          row
          column
        }
      }
    }
  }
}

Proměnné:

{
"idPohledu": "obecny_dokument_view"
}

Vytvoření nového/úprava pohledu

Pro úpravy konfigurace DMS je ve schématu položka "administrationBatch". Lze spojovat více operací do jedné mutace, tj. v rámci jedné mutace vytvořit například zároveň typ, metadata a pohled. Pro přehlednost jsou příklady rozděleny podle jednotlivých druhů. Tento příklad se týká nastavení pohledu – druh operace se provádí pomocí klíče "action". V úvahu připadá:

  • CREATE

  • UPDATE

  • DELETE

Dotaz pro tvorbu nového pohledu

mutation addView {
  docs {
    administrationBatch(
	views: [
        {
          action: CREATE
          id: "view_invoices"
          displayName_Localization: { cz: "Faktury", en: "Invoices" }
          order: 1.03
          groupPermissions: [
            #role všichni uživatelé
            {
              action: SET
              groupId: "a380c2c6-68d7-4942-875a-eaf5ad5e5263"
              permissions: {
                view: CAN_VIEW
                edit: CAN_EDIT
                grant: CAN_GRANT_REVOKE
              }
            }
          ]
          viewType: PUBLIC
          viewAreas: [ARCHIVE]
          docTypes: ["type_invoice"]
          fileStates: [CLOSED]
          metadata: [
            {
              action: CREATE
              metaId: "meta_evidence_number"
              filesGrid: {
                visibility: true
                order: 1
                columnMinWidth: "100"
                columnMaxWidth: "150"
              }
              metadataGrid: {
                editFormVisibility: false
                filterVisibility: true
                row: 1
                column: 1
              }
              panelGrid: { visibility: true, row: 1, column: 1 }
            }
            {
              action: CREATE
              metaId: "sys_name"
              filesGrid: {
                visibility: true
                order: 2
                columnMinWidth: "100"
                columnMaxWidth: "250"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 1
                column: 2
              }
              panelGrid: { visibility: true, row: 1, column: 2 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_evidenceNumber"
              filesGrid: {
                visibility: true
                order: 3
                columnMinWidth: "150"
                columnMaxWidth: "150"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 1
                column: 3
              }
              panelGrid: { visibility: true, row: 1, column: 3 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_amount"
              filesGrid: {
                visibility: true
                order: 4
                columnMinWidth: "150"
                columnMaxWidth: "200"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 2
                column: 1
              }
              panelGrid: { visibility: true, row: 1, column: 4 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_currency"
              filesGrid: {
                visibility: true
                order: 5
                columnMinWidth: "120"
                columnMaxWidth: "120"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 2
                column: 2
              }
              panelGrid: { visibility: true, row: 2, column: 1 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_variableSymbol"
              filesGrid: {
                visibility: true
                order: 6
                columnMinWidth: "150"
                columnMaxWidth: "150"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 2
                column: 3
              }
              panelGrid: { visibility: true, row: 2, column: 3 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_dueDate"
              filesGrid: {
                visibility: true
                order: 7
                columnMinWidth: "150"
                columnMaxWidth: "150"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 2
                column: 4
              }
              panelGrid: { visibility: true, row: 2, column: 4 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_ic"
              filesGrid: {
                visibility: true
                order: 8
                columnMinWidth: "150"
                columnMaxWidth: "150"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 3
                column: 1
              }
              panelGrid: { visibility: true, row: 2, column: 4 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_companyName"
              filesGrid: {
                visibility: true
                order: 9
                columnMinWidth: "150"
                columnMaxWidth: "250"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 3
                column: 2
              }
              panelGrid: { visibility: true, row: 3, column: 1 }
            }
    		{
              action: CREATE
              metaId: "meta_invoice_landRegistryNumber"
              filesGrid: {
                visibility: true
                order: 10
                columnMinWidth: "200"
                columnMaxWidth: "200"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 3
                column: 3
              }
              panelGrid: { visibility: true, row: 3, column: 3 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_houseNumber"
              filesGrid: {
                visibility: true
                order: 11
                columnMinWidth: "200"
                columnMaxWidth: "200"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 3
                column: 4
              }
              panelGrid: { visibility: true, row: 3, column: 4 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_city"
              filesGrid: {
                visibility: true
                order: 12
                columnMinWidth: "200"
                columnMaxWidth: "250"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 4
                column: 1
              }
              panelGrid: { visibility: true, row: 3, column: 4 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_zipCode"
              filesGrid: {
                visibility: true
                order: 13
                columnMinWidth: "130"
                columnMaxWidth: "130"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 4
                column: 2
              }
              panelGrid: { visibility: true, row: 4, column: 1 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_country"
              filesGrid: {
                visibility: true
                order: 14
                columnMinWidth: "130"
                columnMaxWidth: "200"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 4
                column: 3
              }
              panelGrid: { visibility: true, row: 4, column: 2 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_arrivedOn"
              filesGrid: {
                visibility: true
                order: 15
                columnMinWidth: "150"
                columnMaxWidth: "150"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 5
                column: 1
              }
              panelGrid: { visibility: true, row: 4, column: 3 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_unit"
              filesGrid: {
                visibility: false
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 5
                column: 2
              }
              panelGrid: { visibility: true, row: 5, column: 1 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_deliveryDescription"
              filesGrid: {
                visibility: false
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 5
                column: 3
              }
              panelGrid: { visibility: true, row: 5, column: 2 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_paymentType"
              filesGrid: {
                visibility: false
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 5
                column: 4
              }
              panelGrid: { visibility: true, row: 5, column: 3 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_tookOverDate"
              filesGrid: {
                visibility: false
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 6
                column: 1
              }
              panelGrid: { visibility: true, row: 5, column: 4 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_accountantMessage"
              filesGrid: {
                visibility: false
              }
              metadataGrid: {
                editFormVisibility: false
                filterVisibility: false
              }
              panelGrid: { visibility: true, row: 6, column: 1 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_approvedByUser"
              filesGrid: {
                visibility: true
                order: 16
                columnMinWidth: "200"
                columnMaxWidth: "250"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 6
                column: 2
              }
              panelGrid: { visibility: true, row: 4, column: 4 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_approvedByComment"
              filesGrid: {
                visibility: false
                order: 16
              }
              metadataGrid: {
                editFormVisibility: false
                filterVisibility: true
                row: 6
                column: 3
              }
              panelGrid: { visibility: true, row: 4, column: 4 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_assignedTo"
              filesGrid: {
                visibility: true
                order: 17
                columnMinWidth: "200"
                columnMaxWidth: "250"
              }
              metadataGrid: {
                editFormVisibility: false
                filterVisibility: true
                row: 6
                column: 4
              }
              panelGrid: { visibility: true, row: 7, column: 1 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_invoiceFile"
              filesGrid: {
                visibility: true
                order: 18
                columnMinWidth: "200"
                columnMaxWidth: "200"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 7
                column: 1
              }
              panelGrid: { visibility: true, row: 7, column: 2 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_closed"
              filesGrid: {
                visibility: true
                order: 19
                columnMinWidth: "120"
                columnMaxWidth: "120"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 7
                column: 2
              }
              panelGrid: { visibility: true, row: 7, column: 3 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_closedBy"
              filesGrid: {
                visibility: true
                order: 20
                columnMinWidth: "200"
                columnMaxWidth: "250"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 7
                column: 3
              }
              panelGrid: { visibility: true, row: 7, column: 4 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_startTime"
			  defaultSort: true
              defaultSortOrder: DESC
              filesGrid: {
                visibility: true
                order: 21
                columnMinWidth: "140"
                columnMaxWidth: "140"
              }
              metadataGrid: {
                editFormVisibility: false
                filterVisibility: true
                row: 7
                column: 4
              }
              panelGrid: { visibility: true, row: 8, column: 1 }
            }
            {
              action: CREATE
              metaId: "sys_size"
              filesGrid: {
                visibility: true
                order: 22
                columnMinWidth: "125"
                columnMaxWidth: "125"
              }
              metadataGrid: {
                editFormVisibility: false
                filterVisibility: true
                row: 8
                column: 1
              }
              panelGrid: { visibility: true, row: 8, column: 2 }
            }
            {
              action: CREATE
              metaId: "sys_authorAgenda"
              displayName_Localization:{
                cz: "Odkaz na agendu"
                en: "Link to agenda"
              }
              filesGrid: {
                visibility: true
                order: 23
                columnMinWidth: "120"
                columnMaxWidth: "120"
              }
              metadataGrid: {
                editFormVisibility: false
                filterVisibility: false
              }
              panelGrid: { visibility: true, row: 8, column: 3 }
              isReadonly: true
            }
            {
              action: CREATE
              metaId: "sys_class"
              isReadonly: false
              panelGrid: { visibility: false }
              filesGrid: { visibility: false }
              metadataGrid: {
             filterVisibility: false
                editFormVisibility: true
                row: 8
                column: 2
              }
            }
            {
              action: CREATE
              metaId: "sys_rank"
              isReadonly: false
              panelGrid: { visibility: false }
              filesGrid: { visibility: false }
              metadataGrid: {
                filterVisibility: false
                editFormVisibility: true
                row: 8
                column: 3
              }
            }
      ]}]
    ) {
      views {
        id
        displayName
      }
    }
  }
}

Dotaz pro úpravu existujícího pohledu

Do mutace není nutné zadávat všechny klíče, povinný je vždy klíč id, který obsahuje TdId daného pohledu a následně stačí pouze přidávat klíče, které se mají upravovat. Tímto způsobem je možné upravovat i pozice jednotlivých metadat v rámci pohledu. V tomto případě by se pohled přesune na pořadí 99, bude nově zobrazen i v dokumentové části, budou se v něm zobrazovat otevřené i archivované soubory a metadato meta_evidence_number se přesune v gridu na pozici 99.

Dotaz:

mutation editView {
  docs {
    administrationBatch(
	views: [
        {
          action: UPDATE
          id: "view_invoices"
          displayName_Localization: { cz: "Faktury", en: "Invoices" }
          order: 99
          viewType: PUBLIC
          viewAreas: [DMS, ARCHIVE]
          fileStates: [OPEN, CLOSED]
          metadata: [
            {
              action: UPDATE
              metaId: "meta_evidence_number"
              filesGrid: {
                visibility: true
                order: 99
                columnMinWidth: "100"
                columnMaxWidth: "150"
              }
            }
      ]}]
    ) {
      views {
        id
        displayName
      }
    }
  }
}

Nastavení hodnot tříd a klasifikací

Mutace pro nastavení hodnot tříd a klasifikací.

Nastavuje se vždy číselník kompletně, není možné přidávat a odebírat jednotlivé hodnoty.

Dotaz:

mutation addEnums {
  enums {
    class(
      value: {
        displayName_Localization: { cz: "class enum", en: "class enum" }
        values: [
          {
            value: "class_public"
            displayName_Localization: { cz: "Veřejné", en: "Public" }
          }
        ]
      }
    ) {
      id
    }
    rank(
      value: {
        displayName_Localization: { cz: "rank enum", en: "rank enum" }
        values: [
          {
            value: "rank_public"
            displayName_Localization: { cz: "Veřejné", en: "Public" }
          }
          {
            value: "rank_secret"
            displayName_Localization: { cz: "Tajné", en: "Secret" }
          }
        ]
      }
    ) {
      id
    }
  }
}

Komplexní použití administrationBatch

Ukázka komplexního použití administrationBatch, kdy se pomocí mutace vytváří zároveň typ, metadata i pohled.

mutation configureInvoice {
  docs {
    administrationBatch(
      types: [
        {
          action: CREATE
          id: "type_invoice"
          defaultViewId: "view_sys_all_files"
          displayName_Localization: { cz: "Faktura", en: "Invoice" }
          schemaFieldNameSingular: "invoice"
          schemaFieldNamePlural: "invoices"
          schemaTypeName: "Type_invoice"
          shredAfterYears: 10
          shredMark: SHRED
          groupPermissions: [
            {
              action: SET
              groupId: "a380c2c6-68d7-4942-875a-eaf5ad5e5263"
              stateType: DMS
              permissions: {
                create: CAN_CREATE
                view: META_ALL_VERS
                edit: META_ALL_VERS
                share: CAN_SHARE_REVOKE
              }
            }
            {
              action: SET
              groupId: "a380c2c6-68d7-4942-875a-eaf5ad5e5263"
              stateType: ARCHIVE
              permissions: {
                create: CAN_CREATE
                view: META_ALL_VERS
                edit: META_ALL_VERS
                share: CAN_SHARE_REVOKE
              }
            }
          ]
        }
      ]
 metadata: [
        {
          action: CREATE
          id: "meta_invoice_closed"
          schemaFieldName: "meta_invoice_closed"
          defaultDisplayName_Localization: {
            cz: "Vyřízeno"
            en: "Finished"
          }
          defaultIsRequired: false
          dataType: BOOL
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_assignedTo"
          schemaFieldName: "meta_invoice_assignedTo"
          defaultDisplayName_Localization: { cz: "Přiřazeno", en: "Assigned to" }
          defaultIsRequired: false
          dataType: STRING
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_closedBy"
          schemaFieldName: "meta_invoice_closedBy"
          defaultDisplayName_Localization: { cz: "Vyřídil", en: "Closed by" }
          defaultIsRequired: false
          dataType: USER
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_startTime"
          schemaFieldName: "meta_invoice_startTime"
          defaultDisplayName_Localization: {
            cz: "Zahájení agendy"
            en: "Start time"
          }
          defaultIsRequired: false
          dataType: DATE_TIME
          defaultFormat: "D. M. YYYY H:mm"
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_arrivedOn"
          schemaFieldName: "meta_invoice_arrivedOn"
          defaultDisplayName_Localization: {
            cz: "Došla dne"
            en: "Arrived on"
          }
          defaultIsRequired: true
          dataType: DATE_TIME
          defaultFormat: "D. M. YYYY"
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_dueDate"
          schemaFieldName: "meta_invoice_dueDate"
          defaultDisplayName_Localization: { cz: "Splatnost", en: "Due date" }
          defaultIsRequired: true
          dataType: DATE_TIME
          defaultFormat: "D. M. YYYY"
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
		{
		  action: CREATE
          id: "meta_invoice_amount"
          schemaFieldName: "meta_invoice_amount"
          defaultDisplayName_Localization: { cz: "Částka", en: "Amount" }
          defaultIsRequired: true
          dataType: DECIMAL
          defaultFormat: "0.00"
          isFilterable: false
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
		}
        {
          action: CREATE
          id: "meta_invoice_currency"
          schemaFieldName: "meta_invoice_currency"
          defaultDisplayName_Localization: {
            cz: "Měna"
            en: "Currency"
          }
          defaultIsRequired: true
          dataType: ENUM
          dataTypeEnum:"sys_enum_invoice_currency"
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_variableSymbol"
          schemaFieldName: "meta_invoice_variableSymbol"
          defaultDisplayName_Localization: { cz: "Variabilní symbol", en: "Variable symbol" }
          defaultIsRequired: true
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_approvedByUser"
          schemaFieldName: "meta_invoice_approvedByUser"
          defaultDisplayName_Localization: { cz: "Schvalovatel", en: "Approved by" }
          defaultIsRequired: true
          dataType: USER
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_foreignEntity"
          schemaFieldName: "meta_invoice_foreignEntity"
          defaultDisplayName_Localization: {
            cz: "Zahraniční subjekt"
            en: "Foreign entity"
          }
          defaultIsRequired: true
          dataType: BOOL
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_ic"
          schemaFieldName: "meta_invoice_ic"
          defaultDisplayName_Localization: { cz: "IČ", en: "Identification number" }
          defaultIsRequired: true
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
       {
          action: CREATE
          id: "meta_invoice_companyName"
          schemaFieldName: "meta_invoice_companyName"
          defaultDisplayName_Localization: { cz: "Název společnosti", en: "Company name" }
          defaultIsRequired: true
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_street"
          schemaFieldName: "meta_invoice_street"
          defaultDisplayName_Localization: { cz: "Ulice", en: "Street" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_addressComplete"
          schemaFieldName: "meta_invoice_addressComplete"
          defaultDisplayName_Localization: { cz: "Adresa", en: "Address" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_landRegistryNumber"
          schemaFieldName: "meta_invoice_landRegistryNumber"
          defaultDisplayName_Localization: { cz: "Číslo popisné", en: "Land Registry Number" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_houseNumber"
          schemaFieldName: "meta_invoice_houseNumber"
          defaultDisplayName_Localization: { cz: "Číslo orientační", en: "House number" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_city"
          schemaFieldName: "meta_invoice_city"
          defaultDisplayName_Localization: { cz: "Obec", en: "City" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_zipCode"
          schemaFieldName: "meta_invoice_zipCode"
          defaultDisplayName_Localization: { cz: "PSČ", en: "ZIP code" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_country"
          schemaFieldName: "meta_invoice_country"
          defaultDisplayName_Localization: { cz: "Stát", en: "Country" }
          defaultIsRequired: true
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_unit"
          schemaFieldName: "meta_invoice_unit"
          defaultDisplayName_Localization: { cz: "Středisko", en: "Unit" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_deliveryDescription"
          schemaFieldName: "meta_invoice_deliveryDescription"
          defaultDisplayName_Localization: { cz: "Popis dodávky", en: "Delivery description" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_accountantMessage"
          schemaFieldName: "meta_invoice_accountantMessage"
          defaultDisplayName_Localization: { cz: "Zpráva pro účetní", en: "Message for accountant" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_paymentType"
          schemaFieldName: "meta_invoice_paymentType"
          defaultDisplayName_Localization: {
            cz: "Způsob platby"
            en: "Payment type"
          }
          defaultIsRequired: false
          dataType: ENUM
          dataTypeEnum:"sys_enum_invoice_payment_type"
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_tookOverDate"
          schemaFieldName: "meta_invoice_tookOverDate"
          defaultDisplayName_Localization: {
            cz: "Převzal dne"
            en: "Took over date"
          }
          defaultIsRequired: false
          dataType: DATE_TIME
          defaultFormat: "D. M. YYYY"
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_approvedByComment"
          schemaFieldName: "meta_invoice_approvedByComment"
          defaultDisplayName_Localization: { cz: "Komentář schvalovatele", en: "Approved by commentary" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
         {
          action: CREATE
          id: "meta_invoice_balanceSheet"
          schemaFieldName: "meta_invoice_balanceSheet"
          defaultDisplayName_Localization: { cz: "Účetní rozvaha", en: "Balance sheet" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
         {
          action: CREATE
          id: "meta_invoice_evidenceNumber"
          schemaFieldName: "meta_invoice_evidenceNumber"
          defaultDisplayName_Localization: { cz: "Evidenční číslo", en: "Evidence number" }
          defaultIsRequired: false
          dataType: STRING
          isSearchable: true
          isSuggestable: true
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
        {
          action: CREATE
          id: "meta_invoice_invoiceFile"
          schemaFieldName: "meta_invoice_invoiceFile"
          defaultDisplayName_Localization: {
            cz: "Soubor s fakturou"
            en: "File with invoice"
          }
          defaultIsRequired: false
          dataType: BOOL
          isFilterable: true
          isSortable: true
          isRetrievable: true
          memberOfTypes: [{ action: CREATE, typeId: "type_invoice" }]
        }
      ]
views: [
        {
          action: CREATE
          id: "view_invoices"
          displayName_Localization: { cz: "Faktury", en: "Invoices" }
          order: 1.03
          groupPermissions: [
            #role všichni uživatelé
            {
              action: SET
              groupId: "a380c2c6-68d7-4942-875a-eaf5ad5e5263"
              permissions: {
                view: CAN_VIEW
                edit: CAN_EDIT
                grant: CAN_GRANT_REVOKE
              }
            }
          ]
          viewType: PUBLIC
          viewAreas: [ARCHIVE]
          docTypes: ["type_invoice"]
          fileStates: [CLOSED]
          metadata: [
            {
              action: CREATE
              metaId: "meta_evidence_number"
              filesGrid: {
                visibility: true
                order: 1
                columnMinWidth: "100"
                columnMaxWidth: "150"
              }
              metadataGrid: {
                editFormVisibility: false
                filterVisibility: true
                row: 1
                column: 1
              }
              panelGrid: { visibility: true, row: 1, column: 1 }
            }
            {
              action: CREATE
              metaId: "sys_name"
              filesGrid: {
                visibility: true
                order: 2
                columnMinWidth: "100"
                columnMaxWidth: "250"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 1
                column: 2
              }
              panelGrid: { visibility: true, row: 1, column: 2 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_evidenceNumber"
              filesGrid: {
                visibility: true
                order: 3
                columnMinWidth: "150"
                columnMaxWidth: "150"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 1
                column: 3
              }
              panelGrid: { visibility: true, row: 1, column: 3 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_amount"
              filesGrid: {
                visibility: true
                order: 4
                columnMinWidth: "150"
                columnMaxWidth: "200"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 2
                column: 1
              }
              panelGrid: { visibility: true, row: 1, column: 4 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_currency"
              filesGrid: {
                visibility: true
                order: 5
                columnMinWidth: "120"
                columnMaxWidth: "120"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 2
                column: 2
              }
              panelGrid: { visibility: true, row: 2, column: 1 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_variableSymbol"
              filesGrid: {
                visibility: true
                order: 6
                columnMinWidth: "150"
                columnMaxWidth: "150"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 2
                column: 3
              }
              panelGrid: { visibility: true, row: 2, column: 3 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_dueDate"
              filesGrid: {
                visibility: true
                order: 7
                columnMinWidth: "150"
                columnMaxWidth: "150"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 2
                column: 4
              }
              panelGrid: { visibility: true, row: 2, column: 4 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_ic"
              filesGrid: {
                visibility: true
                order: 8
                columnMinWidth: "150"
                columnMaxWidth: "150"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 3
                column: 1
              }
              panelGrid: { visibility: true, row: 2, column: 4 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_companyName"
              filesGrid: {
                visibility: true
                order: 9
                columnMinWidth: "150"
                columnMaxWidth: "250"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 3
                column: 2
              }
              panelGrid: { visibility: true, row: 3, column: 1 }
            }
    		{
              action: CREATE
              metaId: "meta_invoice_landRegistryNumber"
              filesGrid: {
                visibility: true
                order: 10
                columnMinWidth: "200"
                columnMaxWidth: "200"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 3
                column: 3
              }
              panelGrid: { visibility: true, row: 3, column: 3 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_houseNumber"
              filesGrid: {
                visibility: true
                order: 11
                columnMinWidth: "200"
                columnMaxWidth: "200"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 3
                column: 4
              }
              panelGrid: { visibility: true, row: 3, column: 4 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_city"
              filesGrid: {
                visibility: true
                order: 12
                columnMinWidth: "200"
                columnMaxWidth: "250"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 4
                column: 1
              }
              panelGrid: { visibility: true, row: 3, column: 4 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_zipCode"
              filesGrid: {
                visibility: true
                order: 13
                columnMinWidth: "130"
                columnMaxWidth: "130"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 4
                column: 2
              }
              panelGrid: { visibility: true, row: 4, column: 1 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_country"
              filesGrid: {
                visibility: true
                order: 14
                columnMinWidth: "130"
                columnMaxWidth: "200"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 4
                column: 3
              }
              panelGrid: { visibility: true, row: 4, column: 2 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_arrivedOn"
              filesGrid: {
                visibility: true
                order: 15
                columnMinWidth: "150"
                columnMaxWidth: "150"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 5
                column: 1
              }
              panelGrid: { visibility: true, row: 4, column: 3 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_unit"
              filesGrid: {
                visibility: false
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 5
                column: 2
              }
              panelGrid: { visibility: true, row: 5, column: 1 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_deliveryDescription"
              filesGrid: {
                visibility: false
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 5
                column: 3
              }
              panelGrid: { visibility: true, row: 5, column: 2 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_paymentType"
              filesGrid: {
                visibility: false
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 5
                column: 4
              }
              panelGrid: { visibility: true, row: 5, column: 3 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_tookOverDate"
              filesGrid: {
                visibility: false
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 6
                column: 1
              }
              panelGrid: { visibility: true, row: 5, column: 4 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_accountantMessage"
              filesGrid: {
                visibility: false
              }
              metadataGrid: {
                editFormVisibility: false
                filterVisibility: false
              }
              panelGrid: { visibility: true, row: 6, column: 1 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_approvedByUser"
              filesGrid: {
                visibility: true
                order: 16
                columnMinWidth: "200"
                columnMaxWidth: "250"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 6
                column: 2
              }
              panelGrid: { visibility: true, row: 4, column: 4 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_approvedByComment"
              filesGrid: {
                visibility: false
                order: 16
              }
              metadataGrid: {
                editFormVisibility: false
                filterVisibility: true
                row: 6
                column: 3
              }
              panelGrid: { visibility: true, row: 4, column: 4 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_assignedTo"
              filesGrid: {
                visibility: true
                order: 17
                columnMinWidth: "200"
                columnMaxWidth: "250"
              }
              metadataGrid: {
                editFormVisibility: false
                filterVisibility: true
                row: 6
                column: 4
              }
              panelGrid: { visibility: true, row: 7, column: 1 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_invoiceFile"
              filesGrid: {
                visibility: true
                order: 18
                columnMinWidth: "200"
                columnMaxWidth: "200"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 7
                column: 1
              }
              panelGrid: { visibility: true, row: 7, column: 2 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_closed"
              filesGrid: {
                visibility: true
                order: 19
                columnMinWidth: "120"
                columnMaxWidth: "120"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 7
                column: 2
              }
              panelGrid: { visibility: true, row: 7, column: 3 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_closedBy"
              filesGrid: {
                visibility: true
                order: 20
                columnMinWidth: "200"
                columnMaxWidth: "250"
              }
              metadataGrid: {
                editFormVisibility: true
                filterVisibility: true
                row: 7
                column: 3
              }
              panelGrid: { visibility: true, row: 7, column: 4 }
            }
            {
              action: CREATE
              metaId: "meta_invoice_startTime"
			  defaultSort: true
              defaultSortOrder: DESC
              filesGrid: {
                visibility: true
                order: 21
                columnMinWidth: "140"
                columnMaxWidth: "140"
              }
              metadataGrid: {
                editFormVisibility: false
                filterVisibility: true
                row: 7
                column: 4
              }
              panelGrid: { visibility: true, row: 8, column: 1 }
            }
            {
              action: CREATE
              metaId: "sys_size"
              filesGrid: {
                visibility: true
                order: 22
                columnMinWidth: "125"
                columnMaxWidth: "125"
              }
              metadataGrid: {
                editFormVisibility: false
                filterVisibility: true
                row: 8
                column: 1
              }
              panelGrid: { visibility: true, row: 8, column: 2 }
            }
            {
              action: CREATE
              metaId: "sys_authorAgenda"
              displayName_Localization:{
                cz: "Odkaz na agendu"
                en: "Link to agenda"
              }
              filesGrid: {
                visibility: true
                order: 23
                columnMinWidth: "120"
                columnMaxWidth: "120"
              }
              metadataGrid: {
                editFormVisibility: false
                filterVisibility: false
              }
              panelGrid: { visibility: true, row: 8, column: 3 }
              isReadonly: true
            }
            {
              action: CREATE
              metaId: "sys_class"
              isReadonly: false
              panelGrid: { visibility: false }
              filesGrid: { visibility: false }
              metadataGrid: {
             filterVisibility: false
                editFormVisibility: true
                row: 8
                column: 2
              }
            }
            {
              action: CREATE
              metaId: "sys_rank"
              isReadonly: false
              panelGrid: { visibility: false }
              filesGrid: { visibility: false }
              metadataGrid: {
                filterVisibility: false
                editFormVisibility: true
                row: 8
                column: 3
              }
            }
      ]}]
    ) {
      types {
        id
        displayName
      }
      metadata {
        id
        defaultDisplayName
      }
      views {
        id
        displayName
      }
    }
  }
}

Zobrazení všech souborů

Dotaz pro zobrazení všech souborů, ke kterým má daný uživatel/ExtIS oprávnění.

query allFiles{
  docs{
    files{
      allFiles{
        edges{
          node{
            sys{
              name
              id
              state
              authorUser{
                completeName
              }
              authorAgenda{
                agendaName
              }
              authorExtIS{
                displayName
              }
              documentFileId
              size
              downloadLinkGuest
              downloadLinkInternal
            }
          }
        }
      }
    }
  }
}

Nalezení konkrétního souboru na základě ID

Dotaz pro nalezení konkrétního souboru na základě ID (opět je nutné myslet na oprávnění = pokud uživatel/ExtIS nemá oprávnění k souboru, nic se nevrátí).

query findFileByID($idSouboru:Guid){
  docs{
    files{
      anyFileBy(id:$idSouboru){
          sys{
            name
            id
            state
            authorUser{
              completeName
            }
            authorAgenda{
              agendaName
            }
            authorExtIS{
              displayName
            }
            documentFileId
            size
            downloadLinkGuest
            downloadLinkInternal
           }
        }
     }
  }
}

Proměnné:

{
  "idSouboru": "098cc14d-666b-4140-a6ae-53d4c69d9cc0"
}

Prohledávání souborů konkrétního typu na základě podmínek

Jednotlivé typy souborů je možné prohledávat na základě podmínek nad metadaty. Princip skládání podmínek je stejný jako v bodu 3.2.5.3. Pro příklad jsou zde vyhledávány všechny soubory typu faktura, které nejsou příloha a obsahují v názvu řetězec zadaný v proměnné.

query findInvoiceBy($retezec:String!){
  docs{
    files{
      invoices(where:
        {
        	and:[
            {
              containsString:{
		value: $retezec
                expr:{
                  sys: NAME
                }
              }
            },
            {
              eqBoolean:{
                left:{
                  meta: META_MAIN_FILE
                },
                right:{
                  const: true
                }
              }
            }
          ]
      	}
      )
      {
        edges{
          node{
            sys{
              name
              id
            }
            meta_description
            meta_mainFile
            meta_amount
          }
        }
      }
    }
  }
}

Proměnné:

{
  "retezec": "test"
}