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 ofAttachmententities.- 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 booleancheckAttachmentsHash(UserContext uc, String prozessId, String sessionId, int hash)Method for checking if the hashkey is correct for the attachments of aVorgang.AttachmentcreateByUser(UserContext uc, String username, Attachment attachment)booleandeleteByUser(UserContext uc, String username, boolean force, Attachment... attachments)booleandeleteByUser(UserContext uc, String username, Attachment... attachments)List<Attachment>getAllBy(UserContext uc, Vorgang vorgang, EAttachmentSource source, String uuid)AttachmentgetAttachment(UserContext uc, String prozessId, String sessionId, int hash)Method for resolving a hash key to an attachment name.InputStreamgetAttachmentFileStream(UserContext uc, String prozessID, Number id)Method for reading a attachment file.InputStreamgetAttachmentFileStream(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.AttachmentgetByName(UserContext uc, Vorgang vorgang, String name)AttachmentgetByUUID(UserContext uc, String atid)AttachmentgetByUUID(UserContext uc, String atid, Vorgang v)InputStreamgetZippedAttachments(UserContext uc, String prozessID)Method for reading of attachments as aInputStreamon a ZIP archive.List<Attachment>mergeAllByUser(UserContext uc, String username, List<AttachmentPersistData> attachmentData)AttachmentupdateByUser(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, 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-UserContextthe user context in which the action is to be performed.prozessID- the process ID ofVorgangfor which the attachment should be loaded.name- of theAttachment, which should be loaded.- Returns:
InputStreamof 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-UserContextthe user context in which the action is to be performed.prozessID- the process ID ofVorgangfor which the attachment should be loaded.id- of theAttachments, which should be loaded.- Returns:
InputStreamof 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-UserContextthe user context in which the action is to be performed.prozessID- the process ID ofVorgangfor which the attachment should be loaded.- Returns:
ListwithAttachments 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-UserContextthe user context in which the action is to be performed.prozessID- the process ID ofVorgangfor which the attachment should be loaded.source-EAttachmentSourcetype of the attachment.- Returns:
ListwithAttachments of aVorgang.- Since:
- 3.1.7
-
getZippedAttachments
public InputStream getZippedAttachments(UserContext uc, String prozessID) throws IOException
Method for reading of attachments as aInputStreamon a ZIP archive.- Parameters:
uc-UserContextthe user context in which the action is to be performed.prozessID- the process ID ofVorgangfor which the attachment should be loaded.- Returns:
InputStreamon allAttachments of theVorgangas 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-UserContextthe user context in which the action is to be performed.prozessId- the process ID ofVorgangfor which the attachment should be loaded.sessionId- the current session ID of the user.hash- to be tested against.- Returns:
trueif 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-UserContextthe user context in which the action is to be performed.prozessId- the process ID ofVorgangfor which the attachment should be loaded.sessionId- the current session ID of the user.hash- value used to verify the the correctAttachmentis being delivered.- Returns:
AttachmentifVorgangexist and theAttachmentexist, 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)
-
-