Class AttachmentHandler
java.lang.Object
de.xima.fc.handler.AMSApiHandler
de.xima.fc.handler.entity.GenericHandler
de.xima.fc.handler.entity.AttachmentHandler
- All Implemented Interfaces:
IAPIHandler, IAttachmentHandler, IGenericHandler, Serializable
The Class AttachmentHandler.
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Field Summary
Fields inherited from class GenericHandler
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateByUser(UserContext uc, String username, Attachment attachment) booleandeleteByUser(UserContext uc, String username, boolean force, Attachment... attachments) getAllBy(UserContext uc, Vorgang vorgang, EAttachmentSource source, String uuid) byte[]getAllZipped(UserContext uc, String prozessID) getByName(UserContext uc, Vorgang vorgang, String name) getByRecordAndUser(UserContext uc, UUID formRecordUuid, IUser user, int page, int pageSize) Finds the attachments of the form record given by its UUID if the given user can access the form record and the attachment.getByUUID(UserContext uc, String uuid) getByUUID(UserContext uc, String uuid, Vorgang v) getByUuidAndUser(UserContext uc, UUID attachmentUuid, IUser user) Finds the attachment for the given UUID if the user can access the attachment.mergeAllByUser(UserContext uc, String username, List<AttachmentPersistData> attachmentData) Creates or updates a list of attachments.updateByUser(UserContext uc, String username, String oldFileName, Attachment attachment) Methods inherited from class GenericHandler
create, create, delete, delete, deleteBy, deleteById, deleteById, getAll, getAllBy, getAttributes, getAttributes, getBy, getById, getById, getById, getEntityRefs, getSingleAttributes, getSingleAttributes, resultTotalCount, serializableList, update, updateMethods inherited from class AMSApiHandler
getNameMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IAPIHandler
getNameMethods inherited from interface IGenericHandler
create, create, delete, delete, deleteBy, deleteById, deleteById, getAll, getAllBy, getAttributes, getAttributes, getBy, getById, getById, getById, getEntityRefs, getSingleAttributes, getSingleAttributes, resultTotalCount, update, update
-
Constructor Details
-
AttachmentHandler
public AttachmentHandler()
-
-
Method Details
-
deleteByUser
public boolean deleteByUser(UserContext uc, String username, boolean force, Attachment... attachments) - Specified by:
deleteByUserin interfaceIAttachmentHandler
-
getAllBy
public List<Attachment> getAllBy(UserContext uc, Vorgang vorgang, EAttachmentSource source, String uuid) - Specified by:
getAllByin interfaceIAttachmentHandler
-
getAllZipped
- Specified by:
getAllZippedin interfaceIAttachmentHandler- Throws:
IOException
-
getByUUID
- Specified by:
getByUUIDin interfaceIAttachmentHandler
-
getByUUID
- Specified by:
getByUUIDin interfaceIAttachmentHandler
-
getByUuidAndUser
Description copied from interface:IAttachmentHandlerFinds the attachment for the given UUID if the user can access the attachment. User can access an attachment if they canaccess the form recordof the attachment and the attachment itself.- Specified by:
getByUuidAndUserin interfaceIAttachmentHandler- Parameters:
uc- user context for database transactions.attachmentUuid- UUID of the request attachment.user- to get the attachment for. The user is assumed to be the end user.- Returns:
- the form record attachment if the user can access it and
nullotherwise.
-
getByName
- Specified by:
getByNamein interfaceIAttachmentHandler
-
getByRecordAndUser
public PagedResult<Attachment> getByRecordAndUser(UserContext uc, UUID formRecordUuid, IUser user, int page, int pageSize) Description copied from interface:IAttachmentHandlerFinds the attachments of the form record given by its UUID if the given user can access the form record and the attachment.- Specified by:
getByRecordAndUserin interfaceIAttachmentHandler- Parameters:
uc- user context for accessing the database.formRecordUuid- the UUID of the form recorduser- to get the attachments for. The user is assumed to be the end user.page- to get. If a page less than or equal tozerois given, paging is disabled and all entities are returned in one page.pageSize- size of the page to get. If a page size less thanzerois given, paging is disabled and all entities are returned in one page.- Returns:
- a list of form record attachment of the form record the user has access to ordered by their upload date
(desc).
nullif the form record given by the UUID could not be found.
-
createByUser
- Specified by:
createByUserin interfaceIAttachmentHandler
-
mergeAllByUser
public List<Attachment> mergeAllByUser(UserContext uc, String username, List<AttachmentPersistData> attachmentData) Description copied from interface:IAttachmentHandlerCreates or updates a list of attachments. This behaves as ifIAttachmentHandler.createByUser(UserContext, String, Attachment)orIAttachmentHandler.updateByUser(UserContext, String, String, Attachment)had been called on each attachment. This method allows the attachments to be created / updated in a batch, so they do not have to be send individually over the network.- Specified by:
mergeAllByUserin interfaceIAttachmentHandler- Parameters:
uc- User context of the user who initiated the action.username- Name of the user.attachmentData- List of attachments to create or update.- Returns:
- The created or updated attachments.
-
updateByUser
public Attachment updateByUser(UserContext uc, String username, String oldFileName, Attachment attachment) - Specified by:
updateByUserin interfaceIAttachmentHandler
-