Package de.xima.fc.handler.entity
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
public class AttachmentHandler extends GenericHandler implements IAttachmentHandler
The Class AttachmentHandler.- 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 AttachmentHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Attachment
createByUser(UserContext uc, String username, Attachment attachment)
boolean
deleteByUser(UserContext uc, String username, boolean force, Attachment... attachments)
List<Attachment>
getAllBy(UserContext uc, Vorgang vorgang, EAttachmentSource source, String uuid)
byte[]
getAllZipped(UserContext uc, String prozessID)
Attachment
getByName(UserContext uc, Vorgang vorgang, String name)
PagedResult<Attachment>
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.Attachment
getByUUID(UserContext uc, String uuid)
Attachment
getByUUID(UserContext uc, String uuid, Vorgang v)
Attachment
getByUuidAndUser(UserContext uc, UUID attachmentUuid, IUser user)
Finds the attachment for the given UUID if the user can access the attachment.List<Attachment>
mergeAllByUser(UserContext uc, String username, List<AttachmentPersistData> attachmentData)
Creates or updates a list of attachments.Attachment
updateByUser(UserContext uc, String username, String oldFileName, Attachment attachment)
-
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
-
deleteByUser
public boolean deleteByUser(UserContext uc, String username, boolean force, Attachment... attachments)
- Specified by:
deleteByUser
in interfaceIAttachmentHandler
-
getAllBy
public List<Attachment> getAllBy(UserContext uc, Vorgang vorgang, EAttachmentSource source, String uuid)
- Specified by:
getAllBy
in interfaceIAttachmentHandler
-
getAllZipped
public byte[] getAllZipped(UserContext uc, String prozessID) throws IOException
- Specified by:
getAllZipped
in interfaceIAttachmentHandler
- Throws:
IOException
-
getByUUID
public Attachment getByUUID(UserContext uc, String uuid)
- Specified by:
getByUUID
in interfaceIAttachmentHandler
-
getByUUID
public Attachment getByUUID(UserContext uc, String uuid, Vorgang v)
- Specified by:
getByUUID
in interfaceIAttachmentHandler
-
getByUuidAndUser
public Attachment getByUuidAndUser(UserContext uc, UUID attachmentUuid, IUser user)
Description copied from interface:IAttachmentHandler
Finds the attachment for the given UUID if the user can access the attachment. User can access an attachment if they canaccess the form record
of the attachment.- Specified by:
getByUuidAndUser
in interfaceIAttachmentHandler
- Parameters:
uc
- user context for database transactions.attachmentUuid
- UUID of the request attachment.user
- to get the attachment for.- Returns:
- the form record attachment if the user can access it and
null
otherwise.
-
getByName
public Attachment getByName(UserContext uc, Vorgang vorgang, String name)
- Specified by:
getByName
in interfaceIAttachmentHandler
-
getByRecordAndUser
public PagedResult<Attachment> getByRecordAndUser(UserContext uc, UUID formRecordUuid, IUser user, int page, int pageSize)
Description copied from interface:IAttachmentHandler
Finds the attachments of the form record given by its UUID if the given user can access the form record.- Specified by:
getByRecordAndUser
in interfaceIAttachmentHandler
- Parameters:
uc
- user context for accessing the database.formRecordUuid
- the UUID of the form recorduser
- to get the attachments for.page
- to get. If a page less than or equal tozero
is given, paging is disabled and all entities are returned in one page.pageSize
- size of the page to get. If a page size less thanzero
is 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).
null
if the form record given by the UUID could not be found.
-
createByUser
public Attachment createByUser(UserContext uc, String username, Attachment attachment)
- Specified by:
createByUser
in interfaceIAttachmentHandler
-
mergeAllByUser
public List<Attachment> mergeAllByUser(UserContext uc, String username, List<AttachmentPersistData> attachmentData)
Description copied from interface:IAttachmentHandler
Creates 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:
mergeAllByUser
in 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:
updateByUser
in interfaceIAttachmentHandler
-
-