Package de.xima.fc.handler.entity
Class VorgangHandler
- java.lang.Object
-
- de.xima.fc.handler.AMSApiHandler
-
- de.xima.fc.handler.entity.GenericHandler
-
- de.xima.fc.handler.entity.VorgangHandler
-
- All Implemented Interfaces:
IAPIHandler,IGenericHandler,IVorgangHandler,Serializable
public class VorgangHandler extends GenericHandler implements IVorgangHandler
The Class VorgangHandler.- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class de.xima.fc.handler.entity.GenericHandler
LOG
-
-
Constructor Summary
Constructors Constructor Description VorgangHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IExclusiveFormRecordLockResultacquireExclusiveFormRecordLock(UserContext uc, IBasicFormRecordRequestData req)VorgangaddAttachment(UserContext uc, Vorgang vorgang, Attachment attachment)VorgangaddAttachment(UserContext uc, Long vorgangId, Long attachmentId)VorgangaddSubmission(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.intbulkDelete(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).intbulkMarkRead(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.intbulkMove(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.VorgangchangeStatusChangedReadFlag(UserContext uc, Vorgang process, boolean read)VorgangcorrectStatus(UserContext uc, Vorgang formRecord, Status targetState, Benutzer user)Deprecated.VorgangcorrectStatus(UserContext uc, Vorgang formRecord, Status targetState, IUser user)Deprecated.voiddelete(UserContext uc, Vorgang formRecord)List<Vorgang>getAllByPostfach(UserContext uc, Postfach postfach)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.PagedResult<Vorgang>getByUser(UserContext uc, IUser user, int page, int pageSize, int offset)Deprecated.VorganggetByUuidAndUser(UserContext uc, UUID uuid, IUser user)Finds the form record for the given UUID if the given user has submitted it at some point.List<Vorgang>getChildren(UserContext uc, Vorgang formRecord)Map<String,String>getCustomAttributes(UserContext uc, Vorgang process)Returns thecustom attributesof aform record.Map<String,String>getCustomData(UserContext uc, Vorgang process)Returns theVorgang.getCustomData()() custom data} of aform record.DetailedFormRecordDTOgetDetailsByUuidAndUser(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.List<IFormRecordBaseData>getFormRecordBaseData(UserContext uc, de.xima.cmn.criteria.QueryCriteriaManager qcm)IFormRecordDoiInitDatagetFormRecordDoiInitData(UserContext uc, Vorgang formRecord)IFormRecordReviewDatagetFormRecordReviewData(UserContext uc, IInboxFormRecordRequest inboxRequest)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.List<IFormRecordUploadElementData>getFormRecordUploadElementData(UserContext uc, IInboxFormRecordUploadElementDataRequest request)VorganggetParent(UserContext uc, Vorgang formRecord)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.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.List<Vorgang>getVorgaengeByBenutzer(UserContext uc, Benutzer benutzer)Deprecated.List<ExtendedEntityModel<Vorgang>>getVorgaengeData(UserContext uc, Projekt pro, de.xima.cmn.criteria.QueryCriteriaManager qcm, EProjectSpecificDBTable tableType, Postfach... inboxes)List<ExtendedEntityModel<Vorgang>>getVorgaengeData(UserContext uc, Projekt pro, Postfach pf, de.xima.cmn.criteria.QueryCriteriaManager qcm, EProjectSpecificDBTable tableType)longgetVorgaengeDataTotalCount(UserContext uc, Projekt pro, de.xima.cmn.criteria.QueryCriteriaManager qcm, EProjectSpecificDBTable tableType, Postfach... inboxes)longgetVorgaengeDataTotalCount(UserContext uc, Projekt pro, Postfach pf, de.xima.cmn.criteria.QueryCriteriaManager qcm, EProjectSpecificDBTable tableType)ExtendedEntityModel<Vorgang>getVorgangsData(UserContext uc, Projekt pro, Vorgang v, de.xima.cmn.criteria.QueryCriteriaManager qcm, EProjectSpecificDBTable tableType)ExtendedEntityModel<Vorgang>getVorgangsData(UserContext uc, String prozessId, de.xima.cmn.criteria.QueryCriteriaManager qcm, EProjectSpecificDBTable tableType)IReceiveMessagesResponsereceiveMessages(UserContext uc, IReceiveMessagesRequest messagesRequest)Receives messages for a form record.IExclusiveFormRecordLockResultreleaseExclusiveFormRecordLock(UserContext uc, IBasicFormRecordRequestData req)ISendMessageResponsesendMessage(UserContext uc, ISendMessageRequest messageRequest)Sends a form record message.-
Methods inherited from class de.xima.fc.handler.entity.GenericHandler
create, create, delete, delete, deleteBy, deleteById, deleteById, getAll, getAllBy, getAttributes, getAttributes, getBy, getById, getById, getById, getEntityRefs, getSingleAttributes, getSingleAttributes, resultTotalCount, serializableList, update, update
-
Methods inherited from class de.xima.fc.handler.AMSApiHandler
getName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.fc.com.interfaces.IAPIHandler
getName
-
Methods inherited from interface de.xima.fc.handler.interfaces.entity.IGenericHandler
create, create, delete, delete, deleteBy, deleteById, deleteById, getAll, getAllBy, getAttributes, getAttributes, getBy, getById, getById, getById, getEntityRefs, getSingleAttributes, getSingleAttributes, resultTotalCount, update, update
-
-
-
-
Method Detail
-
getByUuidAndUser
public Vorgang getByUuidAndUser(UserContext uc, UUID uuid, IUser user)
Description copied from interface:IVorgangHandlerFinds the form record for the given UUID if the given user has submitted it at some point.- Specified by:
getByUuidAndUserin interfaceIVorgangHandler- Parameters:
uc- user 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.
-
getDetailsByUuidAndUser
public DetailedFormRecordDTO getDetailsByUuidAndUser(UserContext uc, UUID uuid, IUser user, Locale locale)
Description copied from interface:IVorgangHandlerFinds the detailed form record data for the form record with the given UUID if the given user has submitted it at some point.- Specified by:
getDetailsByUuidAndUserin interfaceIVorgangHandler- Parameters:
uc- user context for accessing the database.uuid- the UUID of the form recorduser- 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.
nullotherwise.
-
getByUser
public List<Vorgang> getByUser(UserContext uc, IUser user)
Description copied from interface:IVorgangHandlerGets a list of all form records the user has submitted at some point, in descending order of their (last) modification instant.- Specified by:
getByUserin interfaceIVorgangHandler- 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.
-
getByUser
@Deprecated public PagedResult<Vorgang> getByUser(UserContext uc, IUser user, int page, int pageSize, int offset)
Deprecated.Description copied from interface:IVorgangHandlerGets a sub list of form records the user has submitted at some point, in descending order of their (last) modification instant.- Specified by:
getByUserin interfaceIVorgangHandler- 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.
- See Also:
IVorgangHandler.getFormRecordsPage(UserContext, PageQuery, FormRecordsQuery, boolean)
-
getFormRecordsPage
public PagedResult<BaseFormRecordDTO> getFormRecordsPage(UserContext uc, PageQuery page, FormRecordsQuery query, boolean skipCount)
Description copied from interface:IVorgangHandlerReturns a page of form records that apply to the given page query and form records query.- Specified by:
getFormRecordsPagein interfaceIVorgangHandler- 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.
-
addAttachment
public Vorgang addAttachment(UserContext uc, Long vorgangId, Long attachmentId)
- Specified by:
addAttachmentin interfaceIVorgangHandler
-
addAttachment
public Vorgang addAttachment(UserContext uc, Vorgang vorgang, Attachment attachment)
- Specified by:
addAttachmentin interfaceIVorgangHandler
-
getAllByPostfach
public List<Vorgang> getAllByPostfach(UserContext uc, Postfach postfach)
- Specified by:
getAllByPostfachin interfaceIVorgangHandler
-
getVorgaengeData
public List<ExtendedEntityModel<Vorgang>> getVorgaengeData(UserContext uc, Projekt pro, de.xima.cmn.criteria.QueryCriteriaManager qcm, EProjectSpecificDBTable tableType, Postfach... inboxes)
- Specified by:
getVorgaengeDatain interfaceIVorgangHandler
-
getVorgaengeDataTotalCount
public long getVorgaengeDataTotalCount(UserContext uc, Projekt pro, de.xima.cmn.criteria.QueryCriteriaManager qcm, EProjectSpecificDBTable tableType, Postfach... inboxes)
- Specified by:
getVorgaengeDataTotalCountin interfaceIVorgangHandler
-
getVorgangsData
public ExtendedEntityModel<Vorgang> getVorgangsData(UserContext uc, String prozessId, de.xima.cmn.criteria.QueryCriteriaManager qcm, EProjectSpecificDBTable tableType)
- Specified by:
getVorgangsDatain interfaceIVorgangHandler
-
getVorgangsData
public ExtendedEntityModel<Vorgang> getVorgangsData(UserContext uc, Projekt pro, Vorgang v, de.xima.cmn.criteria.QueryCriteriaManager qcm, EProjectSpecificDBTable tableType)
- Specified by:
getVorgangsDatain interfaceIVorgangHandler
-
getCustomAttributes
public Map<String,String> getCustomAttributes(UserContext uc, Vorgang process)
Description copied from interface:IVorgangHandlerReturns thecustom attributesof aform 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 aLazyInitializationException.Returns an empty map when the form record does not exist anymore.
- Specified by:
getCustomAttributesin interfaceIVorgangHandler- Parameters:
uc- The context with the user who requested the custom attributes.process- TheformRecordfor which to retrieve the custom attributes.- Returns:
- The custom attributes of the form record, never null, but may be empty.
-
getCustomData
public Map<String,String> getCustomData(UserContext uc, Vorgang process)
Description copied from interface:IVorgangHandlerReturns theVorgang.getCustomData()() custom data} of aform 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 aLazyInitializationException.Returns an empty map when the form record does not exist anymore.
- Specified by:
getCustomDatain interfaceIVorgangHandler- Parameters:
uc- The context with the user who requested the custom data.process- TheformRecordfor which to retrieve the custom data.- Returns:
- The custom data of the form record, never null, but may be empty.
-
getFormRecordReviewData
public IFormRecordReviewData getFormRecordReviewData(UserContext uc, IInboxFormRecordRequest inboxRequest)
- Specified by:
getFormRecordReviewDatain interfaceIVorgangHandler
-
getFormRecordUploadElementData
public List<IFormRecordUploadElementData> getFormRecordUploadElementData(UserContext uc, IInboxFormRecordUploadElementDataRequest request)
- Specified by:
getFormRecordUploadElementDatain interfaceIVorgangHandler
-
getFormRecordBaseData
public List<IFormRecordBaseData> getFormRecordBaseData(UserContext uc, de.xima.cmn.criteria.QueryCriteriaManager qcm)
- Specified by:
getFormRecordBaseDatain interfaceIVorgangHandler
-
getFormRecordDoiInitData
public IFormRecordDoiInitData getFormRecordDoiInitData(UserContext uc, Vorgang formRecord)
- Specified by:
getFormRecordDoiInitDatain interfaceIVorgangHandler
-
bulkMarkRead
public int bulkMarkRead(UserContext uc, List<Long> formRecordIds, boolean read)
Description copied from interface:IVorgangHandlerBulk 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. avirtual user) no form records will be updated.- Specified by:
bulkMarkReadin interfaceIVorgangHandler- Parameters:
uc-UserContextwith an authenticated user for database transactions. For creating a user context for an authenticated user seeUserContextFactory.forUser(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(UserContext uc, Set<Long> formRecordIds, Postfach inbox)
Description copied from interface:IVorgangHandlerBulk 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. avirtual user) no form records will be updated.- Specified by:
bulkMovein interfaceIVorgangHandler- Parameters:
uc-UserContextwith an authenticated user for database transactions. For creating a user context for an authenticated user seeUserContextFactory.forUser(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(UserContext uc, List<Long> formRecordIds)
Description copied from interface:IVorgangHandlerBulk 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. avirtual user) no form records will be deleted.- Specified by:
bulkDeletein interfaceIVorgangHandler- Parameters:
uc-UserContextwith an authenticated user for database transactions. For creating a user context for an authenticated user seeUserContextFactory.forUser(IUser).formRecordIds-Listof IDs of the form records that the user requests to be deleted.- Returns:
- the number of deleted form records.
-
delete
public void delete(UserContext uc, Vorgang formRecord)
- Specified by:
deletein interfaceIVorgangHandler
-
getParent
public Vorgang getParent(UserContext uc, Vorgang formRecord)
- Specified by:
getParentin interfaceIVorgangHandler- 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
nullif no parent exists.
-
getChildren
public List<Vorgang> getChildren(UserContext uc, Vorgang formRecord)
- Specified by:
getChildrenin interfaceIVorgangHandler- 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.
-
acquireExclusiveFormRecordLock
public IExclusiveFormRecordLockResult acquireExclusiveFormRecordLock(UserContext uc, IBasicFormRecordRequestData req)
- Specified by:
acquireExclusiveFormRecordLockin interfaceIVorgangHandler
-
releaseExclusiveFormRecordLock
public IExclusiveFormRecordLockResult releaseExclusiveFormRecordLock(UserContext uc, IBasicFormRecordRequestData req)
- Specified by:
releaseExclusiveFormRecordLockin interfaceIVorgangHandler
-
correctStatus
@Deprecated public Vorgang correctStatus(UserContext uc, Vorgang formRecord, Status targetState, IUser user)
Deprecated.- Specified by:
correctStatusin interfaceIVorgangHandler
-
correctStatus
@Deprecated public Vorgang correctStatus(UserContext uc, Vorgang formRecord, Status targetState, Benutzer user)
Deprecated.- Specified by:
correctStatusin interfaceIVorgangHandler
-
getVorgaengeByBenutzer
@Deprecated public List<Vorgang> getVorgaengeByBenutzer(UserContext uc, Benutzer benutzer)
Deprecated.- Specified by:
getVorgaengeByBenutzerin interfaceIVorgangHandler
-
getVorgaengeData
public List<ExtendedEntityModel<Vorgang>> getVorgaengeData(UserContext uc, Projekt pro, Postfach pf, de.xima.cmn.criteria.QueryCriteriaManager qcm, EProjectSpecificDBTable tableType)
- Specified by:
getVorgaengeDatain interfaceIVorgangHandler
-
getVorgaengeDataTotalCount
public long getVorgaengeDataTotalCount(UserContext uc, Projekt pro, Postfach pf, de.xima.cmn.criteria.QueryCriteriaManager qcm, EProjectSpecificDBTable tableType)
- Specified by:
getVorgaengeDataTotalCountin interfaceIVorgangHandler
-
changeStatusChangedReadFlag
public Vorgang changeStatusChangedReadFlag(UserContext uc, Vorgang process, boolean read)
- Specified by:
changeStatusChangedReadFlagin interfaceIVorgangHandler
-
addSubmission
public Vorgang addSubmission(UserContext uc, Vorgang formRecord, IUser user, EFormRecordSubmitContext submitContext, FrontendServer submitFrontendServer, String submitServerBaseUrl, Locale submitLocale, String formData, boolean newDataEntry)
Description copied from interface:IVorgangHandlerAdds a new submission to the form record.- Specified by:
addSubmissionin interfaceIVorgangHandler- Parameters:
uc- The user context.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 this submission should be stored as a new data entry.- Returns:
- The updated
form recordwith the added submission.
-
getStateHistoryEntries
public PagedResult<EndUserStateHistoryEntryDTO> getStateHistoryEntries(UserContext uc, PageQuery page, FormRecordHistoryEntriesPageQuery filter)
Description copied from interface:IVorgangHandlerReturns 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.- Specified by:
getStateHistoryEntriesin interfaceIVorgangHandler- 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.
-
getUnreadChatCounts
public Map<Long,Integer> getUnreadChatCounts(UserContext uc, IUser user, Set<Long> formRecordIds)
Description copied from interface:IVorgangHandlerReturns the number of chats that are unread for the given user and the form records with the given IDs.- Specified by:
getUnreadChatCountsin interfaceIVorgangHandler- 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.
-
sendMessage
public ISendMessageResponse sendMessage(UserContext uc, ISendMessageRequest messageRequest)
Description copied from interface:IVorgangHandlerSends a form record message. Depending on the user (and how they authenticated) the message may also be sent to third party message services.- Specified by:
sendMessagein interfaceIVorgangHandler- Parameters:
uc- user context for accessing the database.messageRequest- The parameters for sending the message.- Returns:
- The response of sending the message.
-
receiveMessages
public IReceiveMessagesResponse receiveMessages(UserContext uc, IReceiveMessagesRequest messagesRequest)
Description copied from interface:IVorgangHandlerReceives messages for a form record. Depending on the user (and how they authenticated) the messages may also be received from third party message services.- Specified by:
receiveMessagesin interfaceIVorgangHandler- Parameters:
uc- user context for accessing the database.messagesRequest- The parameters for receiving the messages.- Returns:
- The response of receiving the messages.
-
-