Package de.xima.fc.dao.impl
Class VorgangDao
- java.lang.Object
-
- de.xima.cmn.dao.AbstractDao<T,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 Summary
Constructors Constructor Description VorgangDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description VorgangaddSubmission(IEntityContext ec, Vorgang formRecord, IUser user, EFormRecordSubmitContext submitContext, FrontendServer submitFrontendServer, String submitServerBaseUrl, String formData, boolean newDataEntry)Adds a new submission to the form record.List<Vorgang>allByPostfach(IEntityContext ec, Postfach postfach)List<Vorgang>allByProjekt(IEntityContext ec, Projekt pro)intbulkdDeleteAll(IEntityContext ec, Postfach postfach)Deprecated.intbulkdDeleteAll(IEntityContext ec, Projekt project)Deprecated.intbulkDelete(IEntityContext ec, List<Long> formRecordIds)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).intbulkDeleteAll(IEntityContext ec, Postfach postfach)intbulkDeleteAll(IEntityContext ec, Projekt project)intbulkMarkRead(IEntityContext ec, 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 entity context has permission to access the form records.intbulkMove(IEntityContext ec, 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 entity context has permission to access the form records.VorgangcorrectStatus(IEntityContext ec, Vorgang formRecord, Status targetState, Benutzer user)Deprecated.VorgangcorrectStatus(IEntityContext ec, Vorgang formRecord, Status targetState, IUser user)voiddeleteAll(IEntityContext ec, Postfach postfach)Deprecated.voiddeleteAll(IEntityContext ec, Projekt project)Deprecated.intdeleteAllUnverified(IEntityContext ec)booleanexistsIdentityToken(IEntityContext ec, Vorgang formRecord, String identityToken, Projekt project)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 tokenVorganggetByProzessId(IEntityContext ec, String prozessId)List<Vorgang>getByUser(IEntityContext ec, IUser user)Gets a list of all form records the user has submitted at some point, in descending order of their (last) modification instant.PagedResult<Vorgang>getByUser(IEntityContext ec, IUser user, int page, int pageSize)Gets a sub list of form records the user has submitted at some point, in descending order of their (last) modification instant.VorganggetByUUID(IEntityContext ec, String uuid)Returns the form record with the given UUIDVorganggetByUUID(IEntityContext ec, UUID uuid)Returns the form record with the given UUIDVorganggetByUuidAndUser(IEntityContext ec, UUID uuid, IUser user)Finds the form record for the given UUID if the given user has submitted it at some point.VorganggetByVerifyId(IEntityContext ec, String verifyId)GetsVorgangby its Verify-IDList<Vorgang>getChildren(IEntityContext ec, Vorgang formRecord)intgetCountByAuthenticatorDependentCreator(IEntityContext ec, IAuthenticator<?> authenticator)Returns the number of form records that have a creator that is dependent on this authenticator.StringgetFormData(IEntityContext ec, Vorgang v)VorganggetParent(IEntityContext ec, Vorgang formRecord)protected IFCDaoActionHook<Vorgang>getPostActionHook()protected IFCDaoActionHook<Vorgang>getPreActionHook()List<Vorgang>getVorgaengeByBenutzer(IEntityContext ec, Benutzer benutzer)Deprecated.VorgangsetFormData(IEntityContext ec, Vorgang v, String formData)Deprecated.-
Methods inherited from class de.xima.fc.dao.impl.GenericDao
getEntityRefs, read
-
Methods inherited from class de.xima.cmn.dao.AbstractDao
all, bulkDelete, bulkUpdate, cb, checkLockingVersion, cq, create, create, delete, delete, deleteAll, executePagedDaoAction, getAttributes, getAttributes, getSingleAttributes, getSingleAttributes, getTransactionHandler, notifyListener, notifyListener, read, registerListener, registerListener, registerListener, resultTotalCount, setTransactionHandler, singleElement, unregisterListener, unregisterListener, unregisterListener, update, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.cmn.dao.interfaces.IAbstractDao
all, bulkDelete, bulkUpdate, checkLockingVersion, create, create, delete, delete, deleteAll, executePagedDaoAction, getAttributes, getAttributes, getSingleAttributes, getSingleAttributes, getTransactionHandler, read, registerListener, registerListener, registerListener, resultTotalCount, setTransactionHandler, singleElement, unregisterListener, unregisterListener, unregisterListener, update, update
-
Methods inherited from interface de.xima.fc.dao.interfaces.IGenericDao
count, findAll, findSingle, getEntityRefs, read
-
-
-
-
Method Detail
-
getByProzessId
public Vorgang getByProzessId(IEntityContext ec, String prozessId)
- Specified by:
getByProzessIdin interfaceIVorgangDao
-
getParent
public Vorgang getParent(IEntityContext ec, Vorgang formRecord)
- Specified by:
getParentin interfaceIVorgangDao- 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
nullif no parent exists.
-
getChildren
public List<Vorgang> getChildren(IEntityContext ec, Vorgang formRecord)
- Specified by:
getChildrenin interfaceIVorgangDao- 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.
-
getByVerifyId
public Vorgang getByVerifyId(IEntityContext ec, String verifyId)
Description copied from interface:IVorgangDaoGetsVorgangby its Verify-ID- Specified by:
getByVerifyIdin interfaceIVorgangDao- Parameters:
ec-IEntityContextverifyId-String- Returns:
Vorgang
-
getByUuidAndUser
public Vorgang getByUuidAndUser(IEntityContext ec, UUID uuid, IUser user)
Description copied from interface:IVorgangDaoFinds the form record for the given UUID if the given user has submitted it at some point.- Specified by:
getByUuidAndUserin interfaceIVorgangDao- Parameters:
ec- entity context for accessing the database.uuid- the UUID of the form recorduser- 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.
nullotherwise.
-
getByUser
public List<Vorgang> getByUser(IEntityContext ec, IUser user)
Description copied from interface:IVorgangDaoGets a list of all form records the user has submitted at some point, in descending order of their (last) modification instant.- Specified by:
getByUserin interfaceIVorgangDao- 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
public PagedResult<Vorgang> getByUser(IEntityContext ec, IUser user, int page, int pageSize)
Description copied from interface:IVorgangDaoGets a sub list of form records the user has submitted at some point, in descending order of their (last) modification instant.- Specified by:
getByUserin interfaceIVorgangDao- Parameters:
ec- entity context for database transactions.user- that has submitted the form records at some point.page- to get.pageSize- size of the page to get. Defines the size of the returned sub list.- 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:
allByProjektin interfaceIVorgangDao
-
existsIdentityToken
public boolean existsIdentityToken(IEntityContext ec, Vorgang formRecord, String identityToken, Projekt project)
Description copied from interface:IVorgangDaoChecks 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:
existsIdentityTokenin interfaceIVorgangDao- Parameters:
ec- Entity context for accessing the database.formRecord- Current form record. Ifnull, 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.
-
allByPostfach
public List<Vorgang> allByPostfach(IEntityContext ec, Postfach postfach)
- Specified by:
allByPostfachin interfaceIVorgangDao
-
getFormData
public String getFormData(IEntityContext ec, Vorgang v)
- Specified by:
getFormDatain interfaceIVorgangDao
-
setFormData
@Deprecated public Vorgang setFormData(IEntityContext ec, Vorgang v, String formData)
Deprecated.- Specified by:
setFormDatain interfaceIVorgangDao- Parameters:
ec-IEntityContextv- the process to set the form-data toformData- the form-data to set- Returns:
- the process with the new form-data
-
bulkDeleteAll
public int bulkDeleteAll(IEntityContext ec, Postfach postfach)
- Specified by:
bulkDeleteAllin interfaceIVorgangDao- Parameters:
ec-IEntityContextfor accessing the database.postfach-Postfachin which the form set is located.
-
bulkDeleteAll
public int bulkDeleteAll(IEntityContext ec, Projekt project)
- Specified by:
bulkDeleteAllin interfaceIVorgangDao- Parameters:
ec-IEntityContextfor accessing the database.project-Projektto which the form record belongs.- Returns:
- count of deleted entries
-
getByUUID
public Vorgang getByUUID(IEntityContext ec, String uuid)
Description copied from interface:IVorgangDaoReturns the form record with the given UUID- Specified by:
getByUUIDin interfaceIVorgangDao- Parameters:
ec-IEntityContextto useuuid-StringUUID of the template- Returns:
- The appointment template for the given UUID
-
getByUUID
public Vorgang getByUUID(IEntityContext ec, UUID uuid)
Description copied from interface:IVorgangDaoReturns the form record with the given UUID- Specified by:
getByUUIDin interfaceIVorgangDao- Parameters:
ec-IEntityContextto useuuid-UUIDUUID of the template- Returns:
- The appointment template for the given UUID
-
getCountByAuthenticatorDependentCreator
public int getCountByAuthenticatorDependentCreator(IEntityContext ec, IAuthenticator<?> authenticator)
Description copied from interface:IVorgangDaoReturns the number of form records that have a creator that is dependent on this authenticator.- Specified by:
getCountByAuthenticatorDependentCreatorin interfaceIVorgangDao- 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.
-
deleteAllUnverified
public int deleteAllUnverified(IEntityContext ec)
- Specified by:
deleteAllUnverifiedin interfaceIVorgangDao- Parameters:
ec- Entity context for accessing the database.
-
correctStatus
public Vorgang correctStatus(IEntityContext ec, Vorgang formRecord, Status targetState, IUser user)
- Specified by:
correctStatusin interfaceIVorgangDao
-
bulkMarkRead
public int bulkMarkRead(IEntityContext ec, List<Long> formRecordIds, boolean read)
Description copied from interface:IVorgangDaoBulk 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. avirtual user) no form records will be updated.- Specified by:
bulkMarkReadin interfaceIVorgangDao- Parameters:
ec-IEntityContextwith an authenticated user for database transactions. For creating an entity context for an authenticated user seeEntityContextFactory.newEntityContext(IUser).formRecordIds-Listof IDs of the form records that the user requests to be updated.read-Booleanvalue 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:IVorgangDaoBulk 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. avirtual user) no form records will be updated.- Specified by:
bulkMovein interfaceIVorgangDao- Parameters:
ec-IEntityContextwith an authenticated user for database transactions. For creating an entity context for an authenticated user seeEntityContextFactory.newEntityContext(IUser).formRecordIds-Setof 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:IVorgangDaoBulk 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. avirtual user) no form records will be deleted.- Specified by:
bulkDeletein interfaceIVorgangDao- Parameters:
ec-IEntityContextwith an authenticated user for database transactions. For creating an entity context for an authenticated user seeEntityContextFactory.newEntityContext(IUser).formRecordIds-Listof IDs of the form records that the user requests to be deleted.- Returns:
- the number of deleted form records.
-
addSubmission
public Vorgang addSubmission(IEntityContext ec, Vorgang formRecord, IUser user, EFormRecordSubmitContext submitContext, FrontendServer submitFrontendServer, String submitServerBaseUrl, String formData, boolean newDataEntry)
Description copied from interface:IVorgangDaoAdds a new submission to the form record.- Specified by:
addSubmissionin interfaceIVorgangDao- Parameters:
ec- Entity context for accessing the database.formRecord- Theform recordto 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 recordwith the added submission.
-
getVorgaengeByBenutzer
@Deprecated public List<Vorgang> getVorgaengeByBenutzer(IEntityContext ec, Benutzer benutzer)
Deprecated.- Specified by:
getVorgaengeByBenutzerin interfaceIVorgangDao
-
bulkdDeleteAll
@Deprecated public int bulkdDeleteAll(IEntityContext ec, Postfach postfach)
Deprecated.- Specified by:
bulkdDeleteAllin interfaceIVorgangDao- Parameters:
ec-IEntityContextfor accessing the database.postfach-Postfachin which the form set is located.
-
bulkdDeleteAll
@Deprecated public int bulkdDeleteAll(IEntityContext ec, Projekt project)
Deprecated.- Specified by:
bulkdDeleteAllin interfaceIVorgangDao- Parameters:
ec-IEntityContextfor accessing the database.project-Projektto which the form record belongs.- Returns:
- count of deleted entries
-
deleteAll
@Deprecated public void deleteAll(IEntityContext ec, Postfach postfach)
Deprecated.- Specified by:
deleteAllin interfaceIVorgangDao- Parameters:
ec- {IEntityContextfor accessing the database.postfach-Postfachin which the form set is located.
-
deleteAll
@Deprecated public void deleteAll(IEntityContext ec, Projekt project)
Deprecated.- Specified by:
deleteAllin interfaceIVorgangDao- Parameters:
ec-IEntityContextproject-Projekt
-
correctStatus
@Deprecated public Vorgang correctStatus(IEntityContext ec, Vorgang formRecord, Status targetState, Benutzer user)
Deprecated.- Specified by:
correctStatusin interfaceIVorgangDao
-
getPostActionHook
protected IFCDaoActionHook<Vorgang> getPostActionHook()
- Overrides:
getPostActionHookin classGenericDao<Vorgang>
-
getPreActionHook
protected IFCDaoActionHook<Vorgang> getPreActionHook()
- Overrides:
getPreActionHookin classGenericDao<Vorgang>
-
-