Class ProtokollUtils

    • Field Detail

      • INST

        public static final ProtokollUtils INST
        The singleton instance of this utility class. It is mutable and not thread-safe.
    • Method Detail

      • removeClientUUIDToDelete

        public void removeClientUUIDToDelete​(String clientUUID)
        Unmarks a client and allows protocol entries for the client to be created again. Should be used after addClientUUIDToDelete(String), after the client was deleted.
        Parameters:
        clientUUID - The client for which protocol entries may be created again.
      • addClientUUIDToDelete

        public void addClientUUIDToDelete​(String clientUUID)
        Marks a client for which no protocol entries should be created. When a client is deleted, all entities belonging to that client are deleted as well. This would usually result in the creation of more protocol entries. But it is pointless to create these entries when the client is deleted anyway.
        Parameters:
        clientUUID - The Mandant.getUUIDObject() of the client for which no protocol entries are to be created.
      • addMandantPeBase

        @Deprecated
        public void addMandantPeBase​(Mandant mandant,
                                     ProtocolEntryClient entry,
                                     IEntityContext ec)
        Diese Methode dient dazu, einen Protokolleintrag zu einem Mandanten hinzuzufügen. Diese Protokolleinträge dienen dazu alle Aktionen die innerhalb eines Mandanten geschehen zu protokollieren. Protokolleinträge, die Projekte oder Vorgänge betreffen werden hier nicht berücksichtigt. Die Bidirektionale Zuordnung des Protokolls zu dem AProtocolEntry-Objekt erfolgt innerhalb dieser Methode.
        Parameters:
        mandant - - Mandant-Instanz, für welchen der Eintrag angelegt werden soll
        entry - - Der Protokolleintrag der angelegt werden soll
        ec - - EntityContext der genutzt wird um Abfragen zu tätigen und den Protokolleintrag zu persistieren
      • addClientProtocolEntry

        public void addClientProtocolEntry​(Mandant client,
                                           ProtocolEntryClient entry,
                                           IEntityContext ec)
        Fills in missing pieces of information of a ProtocolEntryClient, and saves that entry in the database.
        Parameters:
        client - The client for which the protocol entry is created.
        entry - The protocol entry to save. Specific data such as AProtocolEntry.getBemerkung() should be set.
        ec - An entity context for interacting with the database.
      • togglePreserveFlag

        public <T extends AProtocolEntry> T togglePreserveFlag​(T entry,
                                                               IEntityContext ec)
        Negates the AProtocolEntry.isPreserve() flag of the given entry and saves the modifications to the database.
        Parameters:
        entry - Protocol entry to modify.
        ec - Current entity context for the database.
        Returns:
        The modified protocol entry.
      • addProjectProtocolEntry

        public void addProjectProtocolEntry​(Projekt project,
                                            ProtocolEntryClient entry,
                                            IEntityContext ec)
        Fills in missing pieces of information of a ProtocolEntryClient for a certain form, and saves that entry in the database.
        Parameters:
        project - The form for which to create a protocol entry.
        entry - The protocol entry to save. Specific data such as AProtocolEntry.getBemerkung() should be set.
        ec - An entity context for interacting with the database.
      • addProcessProtocolEntry

        public void addProcessProtocolEntry​(Vorgang formRecord,
                                            ProtocolEntryProcessing entry,
                                            IEntityContext ec)
        Fills in missing pieces of information of a ProtocolEntryProcessing, and saves that entry in the database.
        Parameters:
        formRecord - The form record for which the protocol entry is created.
        entry - The protocol entry to save. Specific data such as AProtocolEntry.getBemerkung() should be set.
        ec - An entity context for interacting with the database.
      • addTriggerFiredProtocolEntry

        public void addTriggerFiredProtocolEntry​(IEntityContext ec,
                                                 Mandant client,
                                                 Benutzer user,
                                                 Vorgang formRecord,
                                                 WorkflowTask task)
        Adds the protocol entry for when a workflow trigger was fired.
        Parameters:
        ec - Current entity context for accessing the database.
        client - Client to which the form record belongs.
        user - User who initiated the trigger. This will be logged, use UserMgmtUtils.ANONYMOUS when that is not desired.
        formRecord - Form record for which the trigger was fired.
        task - Task with the trigger that was fired.
      • addStateChangeProtocolEntry

        public void addStateChangeProtocolEntry​(IEntityContext ec,
                                                Mandant client,
                                                Benutzer user,
                                                Vorgang formRecord,
                                                WorkflowState oldState,
                                                WorkflowState newState)
        Adds a protocol entry for a state change, i.e. when the Vorgang.getCurrentStatus() is changed.
        Parameters:
        ec - Current entity context for accessing the database.
        client - Client to which the form record belongs.
        user - User who initiated the state changed. This will be logged, use UserMgmtUtils.ANONYMOUS when that is not desired.
        formRecord - Form record for which the state was changed.
        oldState - The old state of the form record.
        newState - The new state of the form record.
      • addSystemPeDokumentation

        @Deprecated
        public void addSystemPeDokumentation​(ProtocolEntrySystem entry,
                                             IEntityContext ec)
        Diese Methode dient dazu, einen Protokolleintrag zu allen im System vorhanden Mandanten hinzuzufügen. Diese Protokolleinträge dienen dazu alle Aktionen die innerhalb eines Mandanten geschehen sind zu protokollieren. Protokolleinträge, die Projekte oder Vorgänge betreffen, werden hier nicht berücksichtigt. Die Bidirektionale Zuordnung des Protokolls zu dem AProtocolEntry-Objekt erfolgt innerhalb dieser Methode.
        Parameters:
        entry - the protocol entry to write
        ec - the enity context to user for writing the protocol entry