Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Polish


  • refreshDocuments (od wersji 3.2.59) - odświeża dokumenty na formularzu bez przeładowania strony. Odświeżana jest tabela z dokumentami w zakładce Dokumenty, liczba dokumentów w tytule zakładki Dokumenty oraz widok dokumentów.
    • Parametry funkcji: brak
    • Rezultat funkcji: brak

  • registerHook (od wersji 3.2.104) - pozwala wpiąć się w moment zarządzania dokumentami i wykonać jakąś akcję.
    • Parametry funkcji

      NazwaTyp

      Wartość domyślna

      OpisPrzykład
      hookObjectnullZdefiniowane hooki, które mają się wywołać: - refresh (Typ Function) Funkcja, która zostanie wywołana po odświeżeniu wszystkich elementów związanych z wyświetlaniem dokumentów. Odświeżanie następuje zawsze po operacjach na dokumentach takich jak: dodawanie, usuwanie, modyfikacja.
      Code Block
      var hookId = DocumentService.registerHook({
          refresh: function() {
             PW.ui.Message.success( 'Dokumenty odświeżone' );
          }
      });


    • Rezultat funkcji: automatycznie wygenerowany id hooka. Niezbędny do wyrejestrowania hooka.

  • unregisterHook (od wersji 3.2.104) - pozwala wyrejestrować hook na podstawie jego id otrzymanego podczas rejestracji.
    • Parametry funkcji

      NazwaTyp

      Wartość domyślna

      Opis
      idNumber Id otrzymany z funkcji rejestrującej hook.
  • changeShownDocument (od wersji 3.2.107) - pozwala zmienić wyświetlany dokument na formularzu. Dokument ten musi być dostępny do wyświetlenia przez kliknięcie myszką. Jeżeli nie jest (np. dlatego, że użytkownik ma określoną zbyt małą liczbę wyświetlanych dokumentów na formularzu w ustawieniach konta), zostanie wyświetlony błąd w logach przeglądarki.
    • Parametry funkcji

      NazwaTyp

      Wartość domyślna

      Opis
      idNumber Id dokumentu do wyświetlenia.
  • getAttachedDocuments (od wersji 4.0.16) - pobiera listę dokumentów podłączonych do procesu.
    • Parametry funkcji

      NazwaTyp

      Wartość domyślna

      Opis
      processIdString Id procesu, z którego pobrane mają zostać podłączone dokumenty.
    • Rezultat funkcji:

      NazwaTypOpisPrzykład
      documentsAttachedToProcessPromiseObiekt Promise reprezentuje ewentualne zakończenie (lub porażkę) asynchronicznej operacji wywołania zapytania pobierającego listę dokumentów podłączonych do procesu. W przypadku sukcesu zwrócona zostanie lista obiektów o następujących polach:

      - processId - id procesu
      - documentId - id dokumentu
      - documentName - nazwa dokumentu
      - documentDescription - opis dokumentu
      - documentClassId - id klasy dokumentu
      - indices - lista indeksów dokumentu (w przypadku braku uprawnień do podglądu zwracany null)
      - documentDate - data dokumentu
      - fileIds - lista wszystkich wersji dokumentu
      - owner - właściciel dokumentu

      Wywołanie metody serwisu z oczekiwaniem na wynik:

      Code Block
      foo: async function() {
      	let documentsAttachedToProcess = await DocumentService.getAttachedDocuments('id_procesu')
      		.catch(error => failureFn(error));
      	console.log(documentsAttachedToProcess[0].documentId);
      }

      Asynchroniczne wywołanie metody serwisu bez oczekiwania na wynik:

      Code Block
      foo: function() {
      	let documentsAttachedToProcess = DocumentService.getAttachedDocuments('id_procesu')
      		.then(result => successFn(result))
      		.catch(error => failureFn(error));
      	console.log('bar'); // kod wywoła się nie czekając na obsłużenie wyniku z wywołanej metody serwisu
      }
English


  • refreshDocuments (from version 3.2.59) - refreshes the documents on the form without reloading the page. The document table in the Documents tab, the number of documents in the title of the Documents tab and the document view are refreshed.
    • Function parameters: none
    • Function result: none
  • registerHook (from version 3.2.104) - allows you to pin in a document management moment and perform some action.
    • Function parameters

      NameType

      Default value

      DescriptionExample
      hookObjectnullDefined hooks to be called: - refresh (Function Type) Function that will be called after refreshing all elements related to document display. Refresh always occurs after document operations such as add, delete, modify.
      Code Block
      var hookId = DocumentService.registerHook({
          refresh: function() {
             PW.ui.Message.success( 'Dokumenty odświeżone' );
          }
      });


    • Function result: automatically generated hook id. Necessary for deregistering the hook.

  • unregisterHook (from version 3.2.104) - allows you to deregister a hook based on its id received during registration.
    • Function parameters

      NameType

      Default value

      Description
      idNumber Id received from the function that registers the hook.
  • changeShownDocument (from version 3.2.107) - allows you to change the displayed document on the form. This document must be available for display by mouse click. If it is not (e.g., because the user has specified too few displayed documents on the form in the account settings), an error will be displayed in the browser logs.
    • Function parameters

      NameType

      Default value

      Description
      idNumber Id of the document to be displayed.
  • getAttachedDocuments (from version 4.0.16) - downloads a list of documents connected to the process.
    • Function parameters

      Default value

      NameType

      Default value

      Description
      processIdString Id of the process from which the connected documents are to be downloaded.
    • Function result:

      NameTypeDescriptionExample
      documentsAttachedToProcessPromiseThe Promise object represents the possible completion (or failure) of an asynchronous operation to call a query retrieving a list of documents connected to the process. If successful, a list of objects with the following fields will be returned:

      - processId - id of the process

      - documentId - document id

      - documentName - name of the document

      - documentDescription - description of the document

      - documentClassId - id of the document class

      - indices - list of indexes of the document (in case of lack of permission to view, null is returned)

      - documentDate - document date

      - fileIds - list of all document versions

      - owner - owner of the document

      Calling the method of the service with the expectation of the result:

      Code Block
      foo: async function() {
      	let documentsAttachedToProcess = await DocumentService.getAttachedDocuments('id_procesu')
      		.catch(error => failureFn(error));
      	console.log(documentsAttachedToProcess[0].documentId);
      }

      Asynchronous service method call without waiting for the result:

      Code Block
      foo: function() {
      	let documentsAttachedToProcess = DocumentService.getAttachedDocuments('id_procesu')
      		.then(result => successFn(result))
      		.catch(error => failureFn(error));
      	console.log('bar'); // code will trigger without waiting for the result from the called service method to be served
      }