Package de.xima.fc.handler.entity
Class FormRecordMessageHandler
- java.lang.Object
-
- de.xima.fc.handler.AMSApiHandler
-
- de.xima.fc.handler.entity.GenericHandler
-
- de.xima.fc.handler.entity.FormRecordMessageHandler
-
- All Implemented Interfaces:
IAPIHandler,IFormRecordMessageHandler,IGenericHandler,Serializable
public class FormRecordMessageHandler extends GenericHandler implements IFormRecordMessageHandler
Handler implementation for reading and writingFormRecordMessageentities.- Since:
- 8.2.0
- 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 FormRecordMessageHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IFulfillRequestedUploadResponsefulfillUploadRequest(UserContext userContext, IFulfillRequestedUploadRequest fulfillRequestUploadRequest)Fulfills a pending upload request.PagedResult<FormRecordMessage>getByChatAndUser(UserContext uc, UUID chatUuid, IUser user, int page, int pageSize)Deprecated.List<FormRecordMessage>getByUser(UserContext uc, IUser user)Returns all messages the given user has access to.PagedResult<FormRecordMessage>getByUser(UserContext uc, IUser user, int page, int pageSize)Finds all form record messages the user given by the user context has access to.FormRecordMessagegetByUuid(UserContext uc, UUID uuid)Finds the message for the given UUID.FormRecordMessagegetByUuidAndUser(UserContext uc, UUID uuid, IUser user)Finds the message for the given UUID, which the given user can access.List<FormRecordMessage>getChatMessages(UserContext uc, UUID chatUuid)Returns all messages for the given chat UUID ordered by their sent instant (desc).DetailedFormRecordMessageDTOgetDetailsByUuidAndUser(UserContext uc, UUID uuid, IUser user, Locale locale)Finds the detailed message for the given UUID, which the given user can access.PagedResult<BaseFormRecordMessageDTO>getMessagePage(UserContext uc, PageQuery pageQuery, FormRecordMessagesQuery messagesQuery, boolean skipCount)Returns a page of form record messages for the given page query and messages query.PagedResult<FormRecordMessage>getUnreadByUser(UserContext uc, IUser user, int page, int pageSize)Finds all unread form record messages the user given by the user context has access to.IPostFormRecordMessageResponsepostMessage(UserContext userContext, IPostFormRecordMessageRequest postMessageRequest)Posts a form record message, either to an existing chat or to a new chat.-
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
-
fulfillUploadRequest
public IFulfillRequestedUploadResponse fulfillUploadRequest(UserContext userContext, IFulfillRequestedUploadRequest fulfillRequestUploadRequest) throws FulfillRequestedUploadRequestException
Fulfills a pending upload request. This will set the attachments on the upload request. Performs all necessary actions such as updating the form data, triggering workflow events etc. The upload request must bepending.- Specified by:
fulfillUploadRequestin interfaceIFormRecordMessageHandler- Parameters:
userContext- The user context for accessing the databasefulfillRequestUploadRequest- The request with the data to fulfill the upload request.- Returns:
- The response of the post message request
- Throws:
FulfillRequestedUploadRequestException- If the upload request could not be fulfilled.
-
getByChatAndUser
@Deprecated public PagedResult<FormRecordMessage> getByChatAndUser(UserContext uc, UUID chatUuid, IUser user, int page, int pageSize)
Deprecated.Description copied from interface:IFormRecordMessageHandlerFinds the messages for the form record chat given by its UUID if the given user can access the chat.- Specified by:
getByChatAndUserin interfaceIFormRecordMessageHandler- Parameters:
uc- user context for accessing the database.chatUuid- the UUID of the chatuser- to get the form record messages for.page- to get.pageSize- size of the page to get.- Returns:
- a list of form record messages the user has access to ordered by their sent instant (desc).
nullif the chat given by the UUID could not be found. - See Also:
IFormRecordMessageHandler.getMessagePage(UserContext, PageQuery, FormRecordMessagesQuery, boolean)
-
getByUser
public PagedResult<FormRecordMessage> getByUser(UserContext uc, IUser user, int page, int pageSize)
Description copied from interface:IFormRecordMessageHandlerFinds all form record messages the user given by the user context has access to.- Specified by:
getByUserin interfaceIFormRecordMessageHandler- Parameters:
uc- user context holding the requesting user.user- to get the form record messages for.page- to get.pageSize- size of the page to get.- Returns:
- a list of form record messages the user has access to ordered by their creation instant (desc).
- See Also:
IFormRecordMessageHandler.getByUser(UserContext, IUser)
-
getMessagePage
public PagedResult<BaseFormRecordMessageDTO> getMessagePage(UserContext uc, PageQuery pageQuery, FormRecordMessagesQuery messagesQuery, boolean skipCount)
Description copied from interface:IFormRecordMessageHandlerReturns a page of form record messages for the given page query and messages query.- Specified by:
getMessagePagein interfaceIFormRecordMessageHandler- Parameters:
uc- user context for database transactions.pageQuery- page query to get the messages.messagesQuery- messagesQuery to apply to the messages.skipCount- whether to skip the count query.- Returns:
- a list of form record messages in the order defined by the messages query.
-
getByUser
public List<FormRecordMessage> getByUser(UserContext uc, IUser user)
Description copied from interface:IFormRecordMessageHandlerReturns all messages the given user has access to. The user has access to all messages ofchats they have accessto.- Specified by:
getByUserin interfaceIFormRecordMessageHandler- Parameters:
uc- user context holding the requesting user.user- to get the form record messages for.- Returns:
- a list of form record messages the user has access to ordered by their
sent instant(desc). - See Also:
IFormRecordChatHandler.getByUser(UserContext, de.xima.fc.interfaces.user.IUser)
-
getByUuid
public FormRecordMessage getByUuid(UserContext uc, UUID uuid)
Description copied from interface:IFormRecordMessageHandlerFinds the message for the given UUID.- Specified by:
getByUuidin interfaceIFormRecordMessageHandler- Parameters:
uc- user context for accessing the databaseuuid- the UUID of the message- Returns:
- The message with the given UUID
-
getByUuidAndUser
public FormRecordMessage getByUuidAndUser(UserContext uc, UUID uuid, IUser user)
Description copied from interface:IFormRecordMessageHandlerFinds the message for the given UUID, which the given user can access.- Specified by:
getByUuidAndUserin interfaceIFormRecordMessageHandler- Parameters:
uc- user context holding the requesting user.uuid- the UUID of the messageuser- to get the form record message for.- Returns:
- The message with the given UUID which the user can access and
nullotherwise.
-
getDetailsByUuidAndUser
public DetailedFormRecordMessageDTO getDetailsByUuidAndUser(UserContext uc, UUID uuid, IUser user, Locale locale)
Description copied from interface:IFormRecordMessageHandlerFinds the detailed message for the given UUID, which the given user can access.- Specified by:
getDetailsByUuidAndUserin interfaceIFormRecordMessageHandler- Parameters:
uc- user context holding the requesting user.uuid- the UUID of the messageuser- to get the form record message for.locale- the locale for which to return the message (metadata)- Returns:
- The message with the given UUID which the user can access and
nullotherwise.
-
getChatMessages
public List<FormRecordMessage> getChatMessages(UserContext uc, UUID chatUuid)
Description copied from interface:IFormRecordMessageHandlerReturns all messages for the given chat UUID ordered by their sent instant (desc). This is intended for displaying the chat in the backoffice inbox.- Specified by:
getChatMessagesin interfaceIFormRecordMessageHandler- Parameters:
uc- user context for accessing the databasechatUuid- the UUID of the chat- Returns:
- a list of all form record messages for the chat ordered by their sent instant (desc).
-
getUnreadByUser
public PagedResult<FormRecordMessage> getUnreadByUser(UserContext uc, IUser user, int page, int pageSize)
Description copied from interface:IFormRecordMessageHandlerFinds all unread form record messages the user given by the user context has access to. Unread messages can only be gotten for users withUserProfiles. For users without a profile all messages will be returned.- Specified by:
getUnreadByUserin interfaceIFormRecordMessageHandler- Parameters:
uc- user context holding the requesting user.user- to get the unread form record messages for.page- to get.pageSize- size of the page to get.- Returns:
- a list of unread form record messages the user has access to ordered by their creation instant (desc).
- See Also:
IFormRecordMessageHandler.getByUser(UserContext, IUser)
-
postMessage
public IPostFormRecordMessageResponse postMessage(UserContext userContext, IPostFormRecordMessageRequest postMessageRequest) throws PostFormRecordMessageException
Description copied from interface:IFormRecordMessageHandlerPosts a form record message, either to an existing chat or to a new chat. Performs all necessary actions such as triggering workflow events etc.- Specified by:
postMessagein interfaceIFormRecordMessageHandler- Parameters:
userContext- The user context of the user who initiated the post message request.postMessageRequest- The request to post the message.- Returns:
- The response of the post message request.
- Throws:
PostFormRecordMessageException- If the message could not be posted.
-
-