Class VorgangDao

java.lang.Object
de.xima.cmn.dao.AbstractDao<Vorgang, Long, IEntityContext>
de.xima.fc.dao.impl.GenericDao<Vorgang>
de.xima.fc.dao.impl.VorgangDao
All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IAbstractDao<Vorgang, Long, IEntityContext>, IGenericDao<Vorgang>, IVorgangDao

public class VorgangDao extends GenericDao<Vorgang> implements IVorgangDao
  • Constructor Details

    • VorgangDao

      public VorgangDao()
  • Method Details

    • delete

      public void delete(IEntityContext ec, Vorgang entity) throws de.xima.cmn.dao.exceptions.UpdateException
      Specified by:
      delete in interface de.xima.cmn.dao.interfaces.IAbstractDao<Vorgang, Long, IEntityContext>
      Overrides:
      delete in class de.xima.cmn.dao.AbstractDao<Vorgang, Long, IEntityContext>
      Throws:
      de.xima.cmn.dao.exceptions.UpdateException
    • delete

      public void delete(IEntityContext ec, Vorgang... entities) throws de.xima.cmn.dao.exceptions.DeleteException
      Specified by:
      delete in interface de.xima.cmn.dao.interfaces.IAbstractDao<Vorgang, Long, IEntityContext>
      Overrides:
      delete in class de.xima.cmn.dao.AbstractDao<Vorgang, Long, IEntityContext>
      Throws:
      de.xima.cmn.dao.exceptions.DeleteException
    • getByProzessId

      public Vorgang getByProzessId(IEntityContext ec, String prozessId)
      Specified by:
      getByProzessId in interface IVorgangDao
    • getByVerifyId

      public Vorgang getByVerifyId(IEntityContext ec, String verifyId)
      Description copied from interface: IVorgangDao
      Gets Vorgang by its Verify-ID
      Specified by:
      getByVerifyId in interface IVorgangDao
      Parameters:
      ec - IEntityContext
      verifyId - String
      Returns:
      Vorgang
    • getByUuidAndUser

      public Vorgang getByUuidAndUser(IEntityContext ec, UUID uuid, IUser user)
      Description copied from interface: IVorgangDao
      Finds the form record for the given UUID if the given user has submitted it at some point.
      Specified by:
      getByUuidAndUser in interface IVorgangDao
      Parameters:
      ec - entity 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.
    • getByUser

      public List<Vorgang> getByUser(IEntityContext ec, IUser user)
      Description copied from interface: IVorgangDao
      Gets a list of all form records the user has submitted at some point, in descending order of their (last) modification instant.
      Specified by:
      getByUser in interface IVorgangDao
      Parameters:
      ec - entity 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.
    • getByUser

      @Deprecated public PagedResult<Vorgang> getByUser(IEntityContext ec, IUser user, int page, int pageSize, int offset)
      Deprecated.
      Description copied from interface: IVorgangDao
      Gets a sub list of form records the user has submitted at some point, in descending order of their (last) modification instant.
      Specified by:
      getByUser in interface IVorgangDao
      Parameters:
      ec - entity 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.
    • allByProjekt

      public List<Vorgang> allByProjekt(IEntityContext ec, Projekt pro)
      Specified by:
      allByProjekt in interface IVorgangDao
    • allByPostfach

      public List<Vorgang> allByPostfach(IEntityContext ec, Postfach postfach)
      Specified by:
      allByPostfach in interface IVorgangDao
    • getFormData

      public String getFormData(IEntityContext ec, Vorgang v)
      Specified by:
      getFormData in interface IVorgangDao
    • setFormData

      @Deprecated public Vorgang setFormData(IEntityContext ec, Vorgang v, String formData)
      Deprecated.
      Specified by:
      setFormData in interface IVorgangDao
      Parameters:
      ec - IEntityContext
      v - the process to set the form-data to
      formData - the form-data to set
      Returns:
      the process with the new form-data
    • deleteAll

      @Deprecated public void deleteAll(IEntityContext ec, Projekt project)
      Deprecated.
      Specified by:
      deleteAll in interface IVorgangDao
      Parameters:
      ec - IEntityContext
      project - Projekt
    • bulkdDeleteAll

      @Deprecated public int bulkdDeleteAll(IEntityContext ec, Projekt project)
      Deprecated.
      Specified by:
      bulkdDeleteAll in interface IVorgangDao
      Parameters:
      ec - IEntityContext for accessing the database.
      project - Projekt to which the form record belongs.
      Returns:
      count of deleted entries
    • bulkDeleteAll

      public int bulkDeleteAll(IEntityContext ec, Projekt project)
      Specified by:
      bulkDeleteAll in interface IVorgangDao
      Parameters:
      ec - IEntityContext for accessing the database.
      project - Projekt to which the form record belongs.
      Returns:
      count of deleted entries
    • deleteAll

      @Deprecated public void deleteAll(IEntityContext ec, Postfach postfach)
      Deprecated.
      Specified by:
      deleteAll in interface IVorgangDao
      Parameters:
      ec - {IEntityContext for accessing the database.
      postfach - Postfach in which the form set is located.
    • bulkdDeleteAll

      @Deprecated public int bulkdDeleteAll(IEntityContext ec, Postfach postfach)
      Deprecated.
      Specified by:
      bulkdDeleteAll in interface IVorgangDao
      Parameters:
      ec - IEntityContext for accessing the database.
      postfach - Postfach in which the form set is located.
    • bulkDeleteAll

      public int bulkDeleteAll(IEntityContext ec, Postfach postfach)
      Specified by:
      bulkDeleteAll in interface IVorgangDao
      Parameters:
      ec - IEntityContext for accessing the database.
      postfach - Postfach in which the form set is located.
    • existsIdentityToken

      public boolean existsIdentityToken(IEntityContext ec, Vorgang formRecord, String identityToken, Projekt project)
      Description copied from interface: IVorgangDao
      Checks whether there exists any form record that
      • belongs to the same project as the given project
      • is not the same as the given form record
      • but has got the same identity token as the given token
      Specified by:
      existsIdentityToken in interface IVorgangDao
      Parameters:
      ec - Entity context for accessing the database.
      formRecord - Current form record. If null, allows all form records for the given project.
      identityToken - New identity token to be checked.
      project - Project to which the form record belongs.
      Returns:
      True iff a form record with the given identity token exists already.
    • deleteAllUnverified

      public int deleteAllUnverified(IEntityContext ec)
      Specified by:
      deleteAllUnverified in interface IVorgangDao
      Parameters:
      ec - Entity context for accessing the database.
    • correctStatus

      public Vorgang correctStatus(IEntityContext ec, Vorgang formRecord, Status targetState, IUser user)
      Specified by:
      correctStatus in interface IVorgangDao
    • bulkMarkRead

      public int bulkMarkRead(IEntityContext ec, List<Long> formRecordIds, boolean read)
      Description copied from interface: IVorgangDao
      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 entity context has permission to access the form records. If the entity context does not provide an authenticated user (e.g. a virtual user) no form records will be updated.
      Specified by:
      bulkMarkRead in interface IVorgangDao
      Parameters:
      ec - IEntityContext with an authenticated user for database transactions. For creating an entity context for an authenticated user see EntityContextFactory.newEntityContext(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.
    • bulkMove

      public int bulkMove(IEntityContext ec, Set<Long> formRecordIds, Postfach inbox)
      Description copied from interface: IVorgangDao
      Bulk moves all form records with the given IDs to the given inbox iff the authenticated user given by the entity context has permission to access the form records. If the entity context does not provide an authenticated user (e.g. a virtual user) no form records will be updated.
      Specified by:
      bulkMove in interface IVorgangDao
      Parameters:
      ec - IEntityContext with an authenticated user for database transactions. For creating an entity context for an authenticated user see EntityContextFactory.newEntityContext(IUser).
      formRecordIds - Set of IDs of the form records that the user requests to be updated.
      Returns:
      the number of updated records.
    • bulkDelete

      public int bulkDelete(IEntityContext ec, List<Long> formRecordIds)
      Description copied from interface: IVorgangDao
      Bulk deletes all form records with the given IDs iff the authenticated user given by the entity context has permission to access the form records and the form records can be deleted (the state allows deletion). If the entity context does not provide an authenticated user (e.g. a virtual user) no form records will be deleted.
      Specified by:
      bulkDelete in interface IVorgangDao
      Parameters:
      ec - IEntityContext with an authenticated user for database transactions. For creating an entity context for an authenticated user see EntityContextFactory.newEntityContext(IUser).
      formRecordIds - List of IDs of the form records that the user requests to be deleted.
      Returns:
      the number of deleted form records.
    • getByUUID

      public Vorgang getByUUID(IEntityContext ec, String uuid)
      Description copied from interface: IVorgangDao
      Returns the form record with the given UUID
      Specified by:
      getByUUID in interface IVorgangDao
      Parameters:
      ec - IEntityContext to use
      uuid - String UUID of the template
      Returns:
      The appointment template for the given UUID
    • getByUUID

      public Vorgang getByUUID(IEntityContext ec, UUID uuid)
      Description copied from interface: IVorgangDao
      Returns the form record with the given UUID
      Specified by:
      getByUUID in interface IVorgangDao
      Parameters:
      ec - IEntityContext to use
      uuid - UUID UUID of the template
      Returns:
      The appointment template for the given UUID
    • getParent

      public Vorgang getParent(IEntityContext ec, Vorgang formRecord)
      Specified by:
      getParent in interface IVorgangDao
      Parameters:
      ec - Entity context to access the database.
      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

      public List<Vorgang> getChildren(IEntityContext ec, Vorgang formRecord)
      Specified by:
      getChildren in interface IVorgangDao
      Parameters:
      ec - Entity context to access the database.
      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.
    • getCountByAuthenticatorDependentCreator

      public int getCountByAuthenticatorDependentCreator(IEntityContext ec, IAuthenticator<?> authenticator)
      Description copied from interface: IVorgangDao
      Returns the number of form records that have a creator that is dependent on this authenticator.
      Specified by:
      getCountByAuthenticatorDependentCreator in interface IVorgangDao
      Parameters:
      ec - Entity context to access the database.
      authenticator - the creator of a form record used.
      Returns:
      the number of form records that have a creator that is dependent on this authenticator.
    • getUnreadChatCounts

      public Map<Long,Integer> getUnreadChatCounts(IEntityContext ec, IUser user, Set<Long> formRecordIds)
      Description copied from interface: IVorgangDao
      Returns the number of chats that are unread for the given user and form record IDs.
      Specified by:
      getUnreadChatCounts in interface IVorgangDao
      Parameters:
      ec - entity context for accessing the database.
      user - user for which to get the unread chat counts.
      formRecordIds - form record IDs for which to get the unread chat counts.
      Returns:
      a map of form record IDs to the number of unread chats for the given user.
    • addSubmission

      @Deprecated public Vorgang addSubmission(IEntityContext ec, Vorgang formRecord, IUser user, EFormRecordSubmitContext submitContext, FrontendServer submitFrontendServer, String submitServerBaseUrl, String formData, boolean newDataEntry)
      Deprecated.
      Description copied from interface: IVorgangDao
      Adds a new submission to the form record.
      Specified by:
      addSubmission in interface IVorgangDao
      Parameters:
      ec - Entity context for accessing the database.
      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 the submission data should be stored as a new data entry.
      Returns:
      The updated form record with the added submission.
    • addSubmission

      public Vorgang addSubmission(IEntityContext ec, Vorgang formRecord, IUser user, EFormRecordSubmitContext submitContext, FrontendServer submitFrontendServer, String submitServerBaseUrl, Locale submitLocale, String formData, boolean newDataEntry)
      Description copied from interface: IVorgangDao
      Adds a new submission to the form record.
      Specified by:
      addSubmission in interface IVorgangDao
      Parameters:
      ec - Entity context for accessing the database.
      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.
      submitLocale - The locale of the submission.
      formData - The data of the submission.
      newDataEntry - Whether the submission data should be stored as a new data entry.
      Returns:
      The updated form record with the added submission.
    • getVorgaengeByBenutzer

      @Deprecated public List<Vorgang> getVorgaengeByBenutzer(IEntityContext ec, Benutzer benutzer)
      Deprecated.
      Specified by:
      getVorgaengeByBenutzer in interface IVorgangDao
    • correctStatus

      @Deprecated public Vorgang correctStatus(IEntityContext ec, Vorgang formRecord, Status targetState, Benutzer user)
      Specified by:
      correctStatus in interface IVorgangDao
    • getPreActionHook

      protected IFCDaoActionHook<Vorgang> getPreActionHook()
      Overrides:
      getPreActionHook in class GenericDao<Vorgang>
    • getPostActionHook

      protected IFCDaoActionHook<Vorgang> getPostActionHook()
      Overrides:
      getPostActionHook in class GenericDao<Vorgang>