Package de.xima.fc.entities
Class FormRecordMessageUploadRequest
- java.lang.Object
-
- de.xima.cmn.dao.model.AEntity<Long>
-
- de.xima.fc.entities.AbstractEntity
-
- de.xima.fc.entities.AbstractLockableEntity
-
- de.xima.fc.entities.FormRecordMessageUploadRequest
-
- All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IEntity<Long>
,de.xima.cmn.dao.interfaces.ILockableEntity<Long>
,ILockingVersionProviding
,INameProviding
,ITransferable
,ITransferableEntity
,ITransferableLockableEntity
,IUUIDEntity
,Serializable
,Comparable<de.xima.cmn.dao.interfaces.IEntity<Long>>
@Entity public class FormRecordMessageUploadRequest extends AbstractLockableEntity implements IUUIDEntity, INameProviding
Entity representing (pending or fulfilled) upload requests for form record messages.- Since:
- 8.2.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTR_ACCEPTED_FILE_EXTENSIONS
static String
ATTR_ATTACHMENTS
static String
ATTR_FORM_FIELD_NAME
static String
ATTR_MESSAGE
static String
ATTR_REPETITION_ID
static String
ATTR_UPLOADED_INSTANT
static String
ATTR_UPLOADER_AUTH_REF
static String
ATTR_UPLOADER_PROFILE_UUID
static String
COL_ACCEPTED_FILE_EXTENSIONS
static String
COL_ATTACHMENT_ID
static String
COL_FILE_MERGE_MODE
static String
COL_FORM_FIELD_NAME
static String
COL_MAX_FILES
static String
COL_MIN_FILES
static String
COL_MSG_ID
static String
COL_REPETITION_ID
static String
COL_UPLOAD_REQUEST_ID
static String
COL_UPLOAD_SIZE_LIMIT
static String
COL_UPLOADED_TIMESTAMP
static String
COL_UPLOADER_AUTH_REF
static String
COL_UPLOADER_PROFILE_UUID
-
Fields inherited from class de.xima.fc.entities.AbstractLockableEntity
COL_LOCKINGVERSION, lockingVersion
-
Fields inherited from class de.xima.fc.entities.AbstractEntity
COL_ID, id
-
Fields inherited from interface de.xima.fc.entities.interfaces.INameProviding
ATTR_NAME, COL_NAME
-
Fields inherited from interface de.xima.fc.entities.interfaces.ITransferableEntity
IMPORT_ID, INVALID_ID
-
Fields inherited from interface de.xima.fc.entities.interfaces.IUUIDEntity
ATTR_UUID, COL_UUID, INVALID_UUID, INVALID_UUID_OBJECT, NULL_SAFE_UUID_TYPE, NULLABLE_UUID_TYPE, TYPE_NAME_UUID
-
-
Constructor Summary
Constructors Constructor Description FormRecordMessageUploadRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAcceptedFileExtensions()
A list of comma separated file extensions that are accepted for the upload.List<Attachment>
getAttachments()
EUploadRequestFileMergeMode
getFileMergeMode()
WhengetFormFieldName()
is set: how to handle existing files of the upload element.String
getFormFieldName()
The name of the form field that this upload request is associated with.Long
getId()
The database ID of this entity that uniquely identifies it in the system.Long
getMaxNumberOfFiles()
The maximum number of files that can be uploaded.FormRecordMessage
getMessage()
Each upload request is associated with a message that contains details for the end user regarding the upload, e.g.long
getMinNumberOfFiles()
The minimum number of files that must be uploaded.String
getName()
The name of this upload request, possibly shown on the UI.Long
getRepetitionId()
When thegetFormFieldName()
refers to a repeated field, the repetition index of the field.Instant
getUploadedInstant()
The timestamp when the upload was fulfilled.String
getUploaderAuthRef()
Theuniversal reference ID
to the user that uploaded the files.UUID
getUploaderUserProfileUuid()
The UUID of theuser profile
of the uploader.Long
getUploadSizeLimit()
The maximum size of the uploaded file in bytes.String
getUUID()
The UUID that identifies this upload request.UUID
getUUIDObject()
The UUID that identifies this upload request.boolean
isFulfilled()
boolean
isPending()
void
removeAttachment(Attachment attachment)
Removes the given attachment from the list of attachments, if such an attachment exists.void
setAcceptedFileExtensions(String acceptedFileExtensions)
A list of comma separated file extensions that are accepted for the upload.void
setAttachments(List<Attachment> attachments)
void
setFileMergeMode(EUploadRequestFileMergeMode fileMergeMode)
WhengetFormFieldName()
is set: how to handle existing files of the upload element.void
setFormFieldName(String formFieldName)
The name of the form field that this upload request is associated with.void
setMaxNumberOfFiles(Long maxNumberOfFiles)
The maximum number of files that can be uploaded.void
setMessage(FormRecordMessage message)
Each upload request is associated with a message that contains details for the end user regarding the upload, e.g.void
setMinNumberOfFiles(long minNumberOfFiles)
The minimum number of files that must be uploaded.void
setName(String name)
The name of this upload request, possibly shown on the UI.void
setRepetitionId(Long repetitionId)
When thegetFormFieldName()
refers to a repeated field, the repetition index of the field.void
setUploadedInstant(Instant uploadedInstant)
The timestamp when the upload was fulfilled.void
setUploaderAuthRef(String uploaderAuthRef)
Sets theuniversal reference ID
to the user that uploaded the files.void
setUploaderUserProfileUuid(UUID uploaderUserProfileUuid)
void
setUploadSizeLimit(Long uploadSizeLimit)
The maximum size of the uploaded file in bytes.void
setUUID(String uuid)
The UUID that identifies this upload request.void
setUUIDObject(UUID uuid)
The UUID that identifies this upload request.-
Methods inherited from class de.xima.fc.entities.AbstractLockableEntity
entityHasChanged, getLockingVersion, setLockingVersion, toString
-
Methods inherited from class de.xima.fc.entities.AbstractEntity
asIntValue, isPersisted, setId, setId
-
Methods inherited from class de.xima.cmn.dao.model.AEntity
compareTo, equals, getDBTableName, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Field Detail
-
ATTR_ACCEPTED_FILE_EXTENSIONS
public static final String ATTR_ACCEPTED_FILE_EXTENSIONS
- See Also:
- Constant Field Values
-
ATTR_ATTACHMENTS
public static final String ATTR_ATTACHMENTS
- See Also:
- Constant Field Values
-
ATTR_FORM_FIELD_NAME
public static final String ATTR_FORM_FIELD_NAME
- See Also:
- Constant Field Values
-
ATTR_MESSAGE
public static final String ATTR_MESSAGE
- See Also:
- Constant Field Values
-
ATTR_REPETITION_ID
public static final String ATTR_REPETITION_ID
- See Also:
- Constant Field Values
-
ATTR_UPLOADED_INSTANT
public static final String ATTR_UPLOADED_INSTANT
- See Also:
- Constant Field Values
-
ATTR_UPLOADER_AUTH_REF
public static final String ATTR_UPLOADER_AUTH_REF
- See Also:
- Constant Field Values
-
ATTR_UPLOADER_PROFILE_UUID
public static final String ATTR_UPLOADER_PROFILE_UUID
- See Also:
- Constant Field Values
-
COL_ACCEPTED_FILE_EXTENSIONS
public static final String COL_ACCEPTED_FILE_EXTENSIONS
- See Also:
- Constant Field Values
-
COL_ATTACHMENT_ID
public static final String COL_ATTACHMENT_ID
- See Also:
- Constant Field Values
-
COL_FILE_MERGE_MODE
public static final String COL_FILE_MERGE_MODE
- See Also:
- Constant Field Values
-
COL_FORM_FIELD_NAME
public static final String COL_FORM_FIELD_NAME
- See Also:
- Constant Field Values
-
COL_MAX_FILES
public static final String COL_MAX_FILES
- See Also:
- Constant Field Values
-
COL_MIN_FILES
public static final String COL_MIN_FILES
- See Also:
- Constant Field Values
-
COL_MSG_ID
public static final String COL_MSG_ID
- See Also:
- Constant Field Values
-
COL_REPETITION_ID
public static final String COL_REPETITION_ID
- See Also:
- Constant Field Values
-
COL_UPLOADED_TIMESTAMP
public static final String COL_UPLOADED_TIMESTAMP
- See Also:
- Constant Field Values
-
COL_UPLOAD_REQUEST_ID
public static final String COL_UPLOAD_REQUEST_ID
- See Also:
- Constant Field Values
-
COL_UPLOAD_SIZE_LIMIT
public static final String COL_UPLOAD_SIZE_LIMIT
- See Also:
- Constant Field Values
-
COL_UPLOADER_AUTH_REF
public static final String COL_UPLOADER_AUTH_REF
- See Also:
- Constant Field Values
-
COL_UPLOADER_PROFILE_UUID
public static final String COL_UPLOADER_PROFILE_UUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAcceptedFileExtensions
public String getAcceptedFileExtensions()
A list of comma separated file extensions that are accepted for the upload. Can be null or empty, which means all file extensions are accepted.- Returns:
- A list of comma separated file extensions that are accepted for the upload.
-
setAcceptedFileExtensions
public void setAcceptedFileExtensions(String acceptedFileExtensions)
A list of comma separated file extensions that are accepted for the upload. Can be null or empty, which means all file extensions are accepted.- Parameters:
acceptedFileExtensions
- A list of comma separated file extensions that are accepted for the upload.
-
getAttachments
public List<Attachment> getAttachments()
-
setAttachments
public void setAttachments(List<Attachment> attachments)
-
getFileMergeMode
public EUploadRequestFileMergeMode getFileMergeMode()
WhengetFormFieldName()
is set: how to handle existing files of the upload element.- Returns:
- How to handle existing files of the upload element.
-
setFileMergeMode
public void setFileMergeMode(EUploadRequestFileMergeMode fileMergeMode)
WhengetFormFieldName()
is set: how to handle existing files of the upload element.- Parameters:
fileMergeMode
- How to handle existing files of the upload element.
-
getFormFieldName
public String getFormFieldName()
The name of the form field that this upload request is associated with. When set and a file is uploaded, the files are associated with that upload element. Can be null when the upload request is not associated with an upload form field. See alsogetFileMergeMode()
.- Returns:
- The name of the form field that this upload request is associated with.
-
setFormFieldName
public void setFormFieldName(String formFieldName)
The name of the form field that this upload request is associated with. When set and a file is uploaded, the files are associated with that upload element. Can be null when the upload request is not associated with an upload form field. See alsogetFileMergeMode()
.- Parameters:
formFieldName
- The name of the form field that this upload request is associated with.
-
getId
public Long getId()
The database ID of this entity that uniquely identifies it in the system.- Specified by:
getId
in interfacede.xima.cmn.dao.interfaces.IEntity<Long>
- Returns:
- The database ID of this entity.
-
getMaxNumberOfFiles
public Long getMaxNumberOfFiles()
The maximum number of files that can be uploaded. Can be null, which means no limit.- Returns:
- The maximum number of files that can be uploaded.
-
setMaxNumberOfFiles
public void setMaxNumberOfFiles(Long maxNumberOfFiles)
The maximum number of files that can be uploaded. Can be null, which means no limit.- Parameters:
maxNumberOfFiles
- The maximum number of files that can be uploaded.
-
getMessage
public FormRecordMessage getMessage()
Each upload request is associated with a message that contains details for the end user regarding the upload, e.g. what is wrong with the existing file.- Returns:
- The message owning this upload request.
-
setMessage
public void setMessage(FormRecordMessage message)
Each upload request is associated with a message that contains details for the end user regarding the upload, e.g. what is wrong with the existing file.- Parameters:
message
- The message owning this upload request.
-
getMinNumberOfFiles
public long getMinNumberOfFiles()
The minimum number of files that must be uploaded. Must be at least 1.- Returns:
- The minimum number of files that must be uploaded.
-
setMinNumberOfFiles
public void setMinNumberOfFiles(long minNumberOfFiles)
The minimum number of files that must be uploaded. Must be at least 1.- Parameters:
minNumberOfFiles
- The minimum number of files that must be uploaded.
-
getName
public String getName()
The name of this upload request, possibly shown on the UI.- Specified by:
getName
in interfaceINameProviding
- Returns:
- The name of this upload request.
-
setName
public void setName(String name)
The name of this upload request, possibly shown on the UI.- Parameters:
name
- The name of this upload request.
-
getRepetitionId
public Long getRepetitionId()
When thegetFormFieldName()
refers to a repeated field, the repetition index of the field. When set, only the files for that repetition instance are changed when a file is uploaded. Note that the repetition index is not the ordinal index of the repetition, but a unique identifier. An ordinal index starts at 0 is continuous. An ID may be any unique value.- Returns:
- The repetition index of the field.
-
setRepetitionId
public void setRepetitionId(Long repetitionId)
When thegetFormFieldName()
refers to a repeated field, the repetition index of the field. When set, only the files for that repetition instance are changed when a file is uploaded. Note that the repetition index is not the ordinal index of the repetition, but a unique identifier. An ordinal index starts at 0 is continuous. An ID may be any unique value.- Parameters:
repetitionId
- The repetition index of the field.
-
getUUID
public String getUUID()
The UUID that identifies this upload request. The UUID is globally unique within the system.- Specified by:
getUUID
in interfaceIUUIDEntity
- Returns:
- The UUID that identifies this upload request.
-
setUUID
public void setUUID(String uuid)
The UUID that identifies this upload request. The UUID is globally unique within the system.message
.- Specified by:
setUUID
in interfaceIUUIDEntity
- Parameters:
uuid
- The UUID that identifies this upload request.
-
getUUIDObject
public UUID getUUIDObject()
The UUID that identifies this upload request. The UUID is globally unique within the system.message
.- Specified by:
getUUIDObject
in interfaceIUUIDEntity
- Returns:
- The UUID that identifies this upload request.
-
setUUIDObject
public void setUUIDObject(UUID uuid)
The UUID that identifies this upload request. The UUID is globally unique within the system.message
.- Parameters:
uuid
- The UUID that identifies this upload request.
-
getUploadSizeLimit
public Long getUploadSizeLimit()
The maximum size of the uploaded file in bytes. Must be at least 1. Can be null, which means no limit.- Returns:
- The maximum size of the uploaded file in bytes.
-
setUploadSizeLimit
public void setUploadSizeLimit(Long uploadSizeLimit)
The maximum size of the uploaded file in bytes. Must be at least 1. Can be null, which means no limit.- Parameters:
uploadSizeLimit
- The maximum size of the uploaded file in bytes.
-
getUploadedInstant
public Instant getUploadedInstant()
The timestamp when the upload was fulfilled. null if the request is still pending and files were uploaded yet.- Returns:
- The timestamp when the upload was fulfilled.
-
setUploadedInstant
public void setUploadedInstant(Instant uploadedInstant)
The timestamp when the upload was fulfilled. null if the request is still pending and files were uploaded yet.- Parameters:
uploadedInstant
- The timestamp when the upload was fulfilled.
-
getUploaderAuthRef
@Nullable public String getUploaderAuthRef()
Theuniversal reference ID
to the user that uploaded the files. Isnull
if the upload is not yet fulfilled.- Returns:
- The universal reference ID of the uploader.
-
setUploaderAuthRef
public void setUploaderAuthRef(String uploaderAuthRef)
Sets theuniversal reference ID
to the user that uploaded the files.- Parameters:
uploaderAuthRef
- The universal reference ID of the uploader.
-
getUploaderUserProfileUuid
@Nullable public UUID getUploaderUserProfileUuid()
The UUID of theuser profile
of the uploader. May benull
if the user did not have a user profile. There might not exist a user profile anymore for this UUID.- Returns:
- The UUID of the uploader's user profile.
-
setUploaderUserProfileUuid
public void setUploaderUserProfileUuid(UUID uploaderUserProfileUuid)
-
isFulfilled
public boolean isFulfilled()
-
isPending
public boolean isPending()
-
removeAttachment
public void removeAttachment(Attachment attachment)
Removes the given attachment from the list of attachments, if such an attachment exists.- Parameters:
attachment
- The attachment to remove.
-
-