Package de.xima.fc.api.entity
Class AttachmentAPI
API class for manipulation of
Attachment
entities.- Author:
- XIMA MEDIA GmbH
-
Field Summary
Fields inherited from class de.xima.fc.api.entity.AEntityAPI
entityClass
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkAttachmentsHash
(UserContext uc, String prozessId, String sessionId, int hash) Method for checking if the hashkey is correct for the attachments of aVorgang
.createByUser
(UserContext uc, String username, Attachment attachment) boolean
deleteByUser
(UserContext uc, String username, boolean force, Attachment... attachments) boolean
deleteByUser
(UserContext uc, String username, Attachment... attachments) getAllBy
(UserContext uc, Vorgang vorgang, EAttachmentSource source, String uuid) getAttachment
(UserContext uc, String prozessId, String sessionId, int hash) Method for resolving a hash key to an attachment name.getAttachmentFileStream
(UserContext uc, String prozessID, Number id) Method for reading a attachment file.getAttachmentFileStream
(UserContext uc, String prozessID, String name) Method for reading a attachment file.getAttachmentList
(UserContext uc, String prozessID) Method for outputting all attachments of a process.getAttachmentListByType
(UserContext uc, String prozessID, EAttachmentSource source) Method for outputting all attachments by type of a process.getByName
(UserContext uc, Vorgang vorgang, String name) getByUUID
(UserContext uc, String atid) getByUUID
(UserContext uc, String atid, Vorgang v) getZippedAttachments
(UserContext uc, String prozessID) Method for reading of attachments as aInputStream
on a ZIP archive.mergeAllByUser
(UserContext uc, String username, List<AttachmentPersistData> attachmentData) updateByUser
(UserContext uc, String username, String oldFileName, Attachment attachment) 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, getSingleAttributes, getSingleAttributes, resultTotalCount, resultTotalCount, update, update
Methods inherited from class de.xima.fc.api.ASubAPI
getHandlerProvider
-
Constructor Details
-
AttachmentAPI
public AttachmentAPI()
-
-
Method Details
-
getAttachmentFileStream
public InputStream getAttachmentFileStream(UserContext uc, String prozessID, String name) throws FileNotFoundException Method for reading a attachment file.- Parameters:
uc
-UserContext
the user context in which the action is to be performed.prozessID
- the process ID ofVorgang
for which the attachment should be loaded.name
- of theAttachment
, which should be loaded.- Returns:
InputStream
of theAttachment
- Throws:
FileNotFoundException
- if the file couldn't found.- Since:
- 2.4.3
-
getAttachmentFileStream
public InputStream getAttachmentFileStream(UserContext uc, String prozessID, Number id) throws FileNotFoundException Method for reading a attachment file.- Parameters:
uc
-UserContext
the user context in which the action is to be performed.prozessID
- the process ID ofVorgang
for which the attachment should be loaded.id
- of theAttachment
s, which should be loaded.- Returns:
InputStream
of theAttachment
.- Throws:
FileNotFoundException
- if the file couldn't found.- Since:
- 2.4.3
-
getAttachmentList
Method for outputting all attachments of a process.- Parameters:
uc
-UserContext
the user context in which the action is to be performed.prozessID
- the process ID ofVorgang
for which the attachment should be loaded.- Returns:
List
withAttachment
s of aVorgang
.- Since:
- 2.4.3
-
getAttachmentListByType
public List<Attachment> getAttachmentListByType(UserContext uc, String prozessID, EAttachmentSource source) Method for outputting all attachments by type of a process.- Parameters:
uc
-UserContext
the user context in which the action is to be performed.prozessID
- the process ID ofVorgang
for which the attachment should be loaded.source
-EAttachmentSource
type of the attachment.- Returns:
List
withAttachment
s of aVorgang
.- Since:
- 3.1.7
-
getZippedAttachments
Method for reading of attachments as aInputStream
on a ZIP archive.- Parameters:
uc
-UserContext
the user context in which the action is to be performed.prozessID
- the process ID ofVorgang
for which the attachment should be loaded.- Returns:
InputStream
on allAttachment
s of theVorgang
as a ZIP- Throws:
IOException
- if a error occurs while reading the file.- Since:
- 2.4.3
-
deleteByUser
-
deleteByUser
public boolean deleteByUser(UserContext uc, String username, boolean force, Attachment... attachments) -
checkAttachmentsHash
Method for checking if the hashkey is correct for the attachments of aVorgang
.- Parameters:
uc
-UserContext
the user context in which the action is to be performed.prozessId
- the process ID ofVorgang
for which the attachment should be loaded.sessionId
- the current session ID of the user.hash
- to be tested against.- Returns:
true
if the hash values are identical.- Since:
- 2.4.3
-
getAttachment
Method for resolving a hash key to an attachment name.- Parameters:
uc
-UserContext
the user context in which the action is to be performed.prozessId
- the process ID ofVorgang
for which the attachment should be loaded.sessionId
- the current session ID of the user.hash
- value used to verify the the correctAttachment
is being delivered.- Returns:
Attachment
ifVorgang
exist and theAttachment
exist, otherwisenull
- Since:
- 2.4.3
-
createByUser
-
mergeAllByUser
public List<Attachment> mergeAllByUser(UserContext uc, String username, List<AttachmentPersistData> attachmentData) -
updateByUser
public Attachment updateByUser(UserContext uc, String username, String oldFileName, Attachment attachment) -
getByUUID
-
getByUUID
-
getByName
-
getAllBy
public List<Attachment> getAllBy(UserContext uc, Vorgang vorgang, EAttachmentSource source, String uuid)
-