Interface IVorgangHandler

    • Method Detail

      • getByUuidAndUser

        Vorgang getByUuidAndUser​(UserContext uc,
                                 UUID uuid,
                                 IUser user)
        Finds the form record for the given UUID if the given user has submitted it at some point.
        Parameters:
        uc - user context for accessing the database.
        uuid - the UUID of the form record
        user - to get the form record for.
        Returns:
        The form record with the given UUID if it exists and the user has submitted it at one point. null otherwise.
        Since:
        8.2.0
      • getDetailsByUuidAndUser

        @Nullable
        DetailedFormRecordDTO getDetailsByUuidAndUser​(UserContext uc,
                                                      UUID uuid,
                                                      IUser user,
                                                      Locale locale)
        Finds the detailed form record data for the form record with the given UUID if the given user has submitted it at some point.
        Parameters:
        uc - user context for accessing the database.
        uuid - the UUID of the form record
        user - to get the form record for.
        Returns:
        The detailed form record data for the form record with the given UUID if it exists and the user has submitted it at one point. null otherwise.
        Since:
        8.2.0
      • getByUser

        List<Vorgang> getByUser​(UserContext uc,
                                IUser user)
        Gets a list of all form records the user has submitted at some point, in descending order of their (last) modification instant.
        Parameters:
        uc - user context for database transactions.
        user - that has submitted the form records at some point.
        Returns:
        a list of all form records the user has submitted at some point, in descending order of their (last) modification instant.
        Since:
        8.2.0
      • getByUser

        @Deprecated
        PagedResult<Vorgang> getByUser​(UserContext uc,
                                       IUser user,
                                       int page,
                                       int pageSize,
                                       int offset)
        Gets a sub list of form records the user has submitted at some point, in descending order of their (last) modification instant.
        Parameters:
        uc - user context for database transactions.
        user - that has submitted the form records at some point.
        page - to get. Identifies the page by page number. The first page number is 1.
        pageSize - size of the page to get. Defines the size of the returned sub list.
        offset - The number of form records to skip before starting to collect the result. The offset starts at the beginning of the page given by the page number parameter.
        Returns:
        a sub list of form records the user has submitted at some point, in descending order of their (last) modification instant.
        Since:
        8.2.0
        See Also:
        getFormRecordsPage(UserContext, PageQuery, FormRecordsQuery, boolean)
      • getFormRecordsPage

        PagedResult<BaseFormRecordDTO> getFormRecordsPage​(UserContext uc,
                                                          PageQuery page,
                                                          FormRecordsQuery query,
                                                          boolean skipCount)
        Returns a page of form records that apply to the given page query and form records query.
        Parameters:
        uc - user context for database transactions.
        page - to get. Defines the page number and size of the returned sub list.
        query - defines the filters and sorting of the form records to get.
        skipCount - whether to skip the count query.
        Returns:
        a page of form records that apply to the given page query and form records query.
        Since:
        8.4.0
      • getCustomAttributes

        Map<String,​String> getCustomAttributes​(UserContext uc,
                                                     Vorgang formRecord)
        Returns the custom attributes of a form record. This is needed because the custom attributes are loaded lazily. If you load a form record via the API and then attempt to access its custom attributes, you will get a LazyInitializationException.

        Returns an empty map when the form record does not exist anymore.

        Parameters:
        uc - The context with the user who requested the custom attributes.
        formRecord - The formRecord for which to retrieve the custom attributes.
        Returns:
        The custom attributes of the form record, never null, but may be empty.
        Since:
        4.2.0
      • getCustomData

        Map<String,​String> getCustomData​(UserContext uc,
                                               Vorgang formRecord)
        Returns the Vorgang.getCustomData() () custom data} of a form record. This is needed because the custom data are loaded lazily. If you load a form record via the API and then attempt to access its custom attributes, you will get a LazyInitializationException.

        Returns an empty map when the form record does not exist anymore.

        Parameters:
        uc - The context with the user who requested the custom data.
        formRecord - The formRecord for which to retrieve the custom data.
        Returns:
        The custom data of the form record, never null, but may be empty.
        Since:
        8.3.3
      • bulkMarkRead

        int bulkMarkRead​(UserContext uc,
                         List<Long> formRecordIds,
                         boolean read)
        Bulk updates the 'read' value of all form records with the given IDs to the given 'read' value iff the authenticated user given by the user context has permission to access the form records. If the user context does not provide an authenticated user (e.g. a virtual user) no form records will be updated.
        Parameters:
        uc - UserContext with an authenticated user for database transactions. For creating a user context for an authenticated user see UserContextFactory.forUser(IUser).
        formRecordIds - List of IDs of the form records that the user requests to be updated.
        read - Boolean value to set the attribute 'gelesen' to
        Returns:
        the number of updated records
        Throws:
        de.xima.cmn.dao.exceptions.UpdateException - if the given user context does not provide an authenticated user.
        Since:
        6.2.1
      • bulkMove

        int bulkMove​(UserContext uc,
                     Set<Long> formRecordIds,
                     Postfach inbox)
        Bulk moves all form records with the given IDs to the given inbox iff the authenticated user given by the user context has permission to access the form records. If the user context does not provide an authenticated user (e.g. a virtual user) no form records will be updated.
        Parameters:
        uc - UserContext with an authenticated user for database transactions. For creating a user context for an authenticated user see UserContextFactory.forUser(IUser).
        formRecordIds - Set of IDs of the form records that the user requests to be updated.
        Returns:
        the number of updated records.
        Throws:
        de.xima.cmn.dao.exceptions.UpdateException - if the given user context does not provide an authenticated user.
        Since:
        8.0.2
      • bulkDelete

        int bulkDelete​(UserContext uc,
                       List<Long> formRecordIds)
        Bulk deletes all form records with the given IDs iff the authenticated user given by the user context has permission to access the form records and the form records can be deleted (the state allows deletion). If the user context does not provide an authenticated user (e.g. a virtual user) no form records will be deleted.
        Parameters:
        uc - UserContext with an authenticated user for database transactions. For creating a user context for an authenticated user see UserContextFactory.forUser(IUser).
        formRecordIds - List of IDs of the form records that the user requests to be deleted.
        Returns:
        the number of deleted form records.
        Throws:
        de.xima.cmn.dao.exceptions.DeleteException - if the given entity context does not provide an authenticated user.
        Since:
        6.2.1
      • getParent

        @Nullable
        Vorgang getParent​(UserContext uc,
                          Vorgang formRecord)
        Parameters:
        uc - The user context for the user who initiated this query.
        formRecord - Form record for which to find the parent.
        Returns:
        The parent form record of the given form record, or null if no parent exists.
      • getChildren

        List<Vorgang> getChildren​(UserContext uc,
                                  Vorgang formRecord)
        Parameters:
        uc - The user context for the user who initiated this query.
        formRecord - Form record for which to find the parent.
        Returns:
        All children of the given form record, or an empty list if no children exist.
      • addSubmission

        Vorgang addSubmission​(UserContext uc,
                              Vorgang formRecord,
                              IUser user,
                              EFormRecordSubmitContext submitContext,
                              FrontendServer submitFrontendServer,
                              String submitServerBaseUrl,
                              Locale submitLocale,
                              String formData,
                              boolean newDataEntry)
        Adds a new submission to the form record.
        Parameters:
        uc - The user context.
        formRecord - The form record to which the submission should be added.
        user - user who submitted the form record.
        submitContext - The context in which the form record was submitted.
        submitFrontendServer - The frontend server that received the submission.
        submitServerBaseUrl - The base URL of the server that received the submission.
        formData - The data of the submission.
        newDataEntry - Whether this submission should be stored as a new data entry.
        Returns:
        The updated form record with the added submission.
        Since:
        8.2.0
      • getStateHistoryEntries

        PagedResult<EndUserStateHistoryEntryDTO> getStateHistoryEntries​(UserContext uc,
                                                                        PageQuery page,
                                                                        FormRecordHistoryEntriesPageQuery filter)
        Returns the state history entries of the form record with the given UUID in the filter if the given user in the filter has submitted it at some point.
        Parameters:
        uc - user context for accessing the database.
        page - to get. Defines the page number and size of the returned sub list.
        filter - defines the filters and sorting of the form records to get.
        Returns:
        a page of state history entries of the form record with the given UUID if it exists and the user has submitted it at some point.
        Throws:
        de.xima.cmn.http.exception.NotFoundException - if the form record with the given UUID does not exist or if the user cannot access it.
        de.xima.cmn.http.exception.BadRequestException - if the filter is invalid.
        Since:
        8.4.0
      • getUnreadChatCounts

        Map<Long,​Integer> getUnreadChatCounts​(UserContext uc,
                                                    IUser user,
                                                    Set<Long> formRecordIds)
        Returns the number of chats that are unread for the given user and the form records with the given IDs.
        Parameters:
        uc - user context for accessing the database.
        formRecordIds - the IDs of the form records to get the unread chat counts for.
        Returns:
        a map of form record IDs to the number of chats that are unread for the given user.
        Since:
        8.4.0
      • sendMessage

        ISendMessageResponse sendMessage​(UserContext uc,
                                         ISendMessageRequest messageRequest)
        Sends a form record message. Depending on the user (and how they authenticated) the message may also be sent to third party message services.
        Parameters:
        uc - user context for accessing the database.
        messageRequest - The parameters for sending the message.
        Returns:
        The response of sending the message.
        Since:
        8.4.0
      • receiveMessages

        IReceiveMessagesResponse receiveMessages​(UserContext uc,
                                                 IReceiveMessagesRequest messagesRequest)
        Receives messages for a form record. Depending on the user (and how they authenticated) the messages may also be received from third party message services.
        Parameters:
        uc - user context for accessing the database.
        messagesRequest - The parameters for receiving the messages.
        Returns:
        The response of receiving the messages.
        Since:
        8.4.0