Package de.xima.fc.api.entity
Class AttachmentAPI
- java.lang.Object
-
- de.xima.fc.api.ASubAPI
-
- de.xima.fc.api.entity.AEntityAPI<Attachment>
-
- de.xima.fc.api.entity.AttachmentAPI
-
public class AttachmentAPI extends AEntityAPI<Attachment>
API class for manipulation ofAttachment
entities.- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
-
Fields inherited from class de.xima.fc.api.entity.AEntityAPI
entityClass
-
-
Constructor Summary
Constructors Constructor Description AttachmentAPI()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkAttachmentsHash(UserContext uc, String prozessId, String sessionId, int hash)
Method for checking if the hashkey is correct for the attachments of aVorgang
.Attachment
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)
List<Attachment>
getAllBy(UserContext uc, Vorgang vorgang, EAttachmentSource source, String uuid)
Attachment
getAttachment(UserContext uc, String prozessId, String sessionId, int hash)
Method for resolving a hash key to an attachment name.InputStream
getAttachmentFileStream(UserContext uc, String prozessID, Number id)
Method for reading a attachment file.InputStream
getAttachmentFileStream(UserContext uc, String prozessID, String name)
Method for reading a attachment file.List<Attachment>
getAttachmentList(UserContext uc, String prozessID)
Method for outputting all attachments of a process.List<Attachment>
getAttachmentListByType(UserContext uc, String prozessID, EAttachmentSource source)
Method for outputting all attachments by type of a process.Attachment
getByName(UserContext uc, Vorgang vorgang, String name)
Attachment
getByUUID(UserContext uc, String atid)
Attachment
getByUUID(UserContext uc, String atid, Vorgang v)
InputStream
getZippedAttachments(UserContext uc, String prozessID)
Method for reading of attachments as aInputStream
on a ZIP archive.List<Attachment>
mergeAllByUser(UserContext uc, String username, List<AttachmentPersistData> attachmentData)
Attachment
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
-
-
-
-
Method Detail
-
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
public List<Attachment> getAttachmentList(UserContext uc, String prozessID)
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
public InputStream getZippedAttachments(UserContext uc, String prozessID) throws IOException
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
public boolean deleteByUser(UserContext uc, String username, Attachment... attachments)
-
deleteByUser
public boolean deleteByUser(UserContext uc, String username, boolean force, Attachment... attachments)
-
checkAttachmentsHash
public boolean checkAttachmentsHash(UserContext uc, String prozessId, String sessionId, int hash)
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
public Attachment getAttachment(UserContext uc, String prozessId, String sessionId, int hash)
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
public Attachment createByUser(UserContext uc, String username, Attachment attachment)
-
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
public Attachment getByUUID(UserContext uc, String atid)
-
getByUUID
public Attachment getByUUID(UserContext uc, String atid, Vorgang v)
-
getByName
public Attachment getByName(UserContext uc, Vorgang vorgang, String name)
-
getAllBy
public List<Attachment> getAllBy(UserContext uc, Vorgang vorgang, EAttachmentSource source, String uuid)
-
-