Package de.xima.fc.api.entity
Class FormRecordMessageAPI
- java.lang.Object
-
- de.xima.fc.api.ASubAPI
-
- de.xima.fc.api.entity.AEntityAPI<FormRecordMessage>
-
- de.xima.fc.api.entity.FormRecordMessageAPI
-
public class FormRecordMessageAPI extends AEntityAPI<FormRecordMessage>
API class for reading and writingFormRecordMessage
entities.- Since:
- 8.2.0
- Author:
- XIMA Media GmbH
-
-
Field Summary
-
Fields inherited from class de.xima.fc.api.entity.AEntityAPI
entityClass
-
-
Constructor Summary
Constructors Constructor Description FormRecordMessageAPI()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IFulfillRequestedUploadResponse
fulfillUploadRequest(UserContext userContext, IFulfillRequestedUploadRequest fulfillRequestUploadRequest)
Fulfills a pending upload request.PagedResult<FormRecordMessage>
getByChatAndUser(UserContext uc, UUID chatUuid, IUser user, int page, int pageSize)
Finds the messages for the form record chat given by its UUID if the given user can access the chat.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.FormRecordMessage
getByUuid(UserContext uc, UUID uuid)
Finds the message for the given UUID.FormRecordMessage
getByUuidAndUser(UserContext uc, UUID uuid, IUser user)
Finds the message for the given UUID, which the given user can access.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.IPostFormRecordMessageResponse
postMessage(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.api.entity.AEntityAPI
create, create, delete, delete, deleteAllBy, deleteById, deleteById, getAll, getAllBy, getAttributes, getAttributes, getBy, getById, getById, getEntityRefs, getPagedResult, getSingleAttributes, getSingleAttributes, resultTotalCount, resultTotalCount, update, update
-
Methods inherited from class de.xima.fc.api.ASubAPI
getHandlerProvider
-
-
-
-
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
.- Parameters:
userContext
- The user context for of the user who initiated the fulfill upload request.fulfillRequestUploadRequest
- 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.NullPointerException
- If the request is null.
-
getByUuid
public FormRecordMessage getByUuid(UserContext uc, UUID uuid)
Finds the message for the given UUID.- 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)
Finds the message for the given UUID, which the given user can access.- 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
null
otherwise.
-
getByUser
public List<FormRecordMessage> getByUser(UserContext uc, IUser user)
Returns all messages the given user has access to. The user has access to all messages ofchats they have access
to.- 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)
-
getByUser
public 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.- 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:
getByUser(UserContext, IUser)
-
getUnreadByUser
public 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. Unread messages can only be gotten for users withUserProfile
s. For users without a profile all messages will be returned.- 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:
getByUser(UserContext, IUser)
-
getByChatAndUser
public PagedResult<FormRecordMessage> getByChatAndUser(UserContext uc, UUID chatUuid, IUser user, int page, int pageSize)
Finds the messages for the form record chat given by its UUID if the given user can access the chat.- 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).
null
if the chat given by the UUID could not be found. - See Also:
getByUser(UserContext, IUser)
-
postMessage
public IPostFormRecordMessageResponse postMessage(UserContext userContext, IPostFormRecordMessageRequest postMessageRequest) throws PostFormRecordMessageException
Posts a form record message, either to an existing chat or to a new chat. Performs all necessary actions such as triggering workflow events etc.- 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.NullPointerException
- If the request is null.
-
-