|
ALBPM Process API (PAPI) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Represents an Attachment associated with an instance.
This class contains information about attachment properties: content type, creator name, created time, description, edition time (version) filename, name, remarks size and other properties. It also contains methods to determine if the file exists and to save the file as another file. To add an attachment to an instance, useProcessServiceSession.instanceAttach(InstanceInfo, String, String, String, java.io.File, String).ProcessServiceNESession.getAttachmentsByInstance(String).ProcessServiceSession.obtainEditionLock(Attachment) then
ProcessServiceSession.checkOutAttachment(Attachment, String).ProcessServiceSession.checkInAttachment(Attachment, String, java.io.File).
| Field Summary | |
static int |
DESCRIPT_LENGTH
Constant for the maximum length of description. |
static int |
FILENAME_LENGTH
Constant for the maximum length of a filename. |
static int |
REMARK_LENGTH
Constant for maximum length of remarks. |
| Method Summary | |
boolean |
existsFile(String directory)
Returns true if the attachment has already been checked out in the specified directory. |
long |
getContentSize()
Gets the content size in bytes. |
String |
getContentType()
Gets the file content type. |
Time |
getCreationTime()
Gets the attachment creation time. |
String |
getCreatorName()
Gets the Id of the participant who created this attachment. |
String |
getDescription()
Gets the attachment description. |
Time |
getEditionTime()
Gets the edition time, which is the version creation time. |
String |
getFileExtension()
Gets the file extension, for example txt, doc. |
String |
getFileName()
Gets the filename used to save the attachment to disk. |
String |
getId()
Gets the attachment Id. |
int |
getIn()
Gets the attachment identification number. |
String |
getInstanceId()
Gets the instance Id of the instance where this attachment was attached. |
int |
getInstanceIn()
Gets the instance identification number of the instance where this attachment was attached. |
String |
getLocaleSize(Locale locale)
Gets the size of this attachment, formatted using the specified locale. |
String |
getLockerName()
Gets the uid of the participant who has locked this attachment, or the empty string is this attachment is not locked. |
String |
getName()
Gets the name of this attachment. |
String |
getOsInfo()
Deprecated. Method getOsInfo is deprecated. |
int |
getProcessIn()
Gets the process identification number associated with this attachment. |
String |
getRemarks()
Gets the remarks for this version of the attachment. |
Object |
getVar(String variableId)
Returns Object value of the VarDefinition specified by variableId. |
int |
getVersion()
Gets the version number of this attachment. |
boolean |
isFileModified(String directory)
Returns true if the attachment has already been checked out in the specified directory, and the file has been modified. |
boolean |
isLocked()
Returns true if this attachment has been locked. |
boolean |
isLockedByParticipant(String participantId)
Returns true if this attachment has been locked by the specified participant. |
void |
saveAs(String attachmentsDirectory,
File file)
Saves the file in the specified directory. |
| Field Detail |
public static final int DESCRIPT_LENGTH
public static final int FILENAME_LENGTH
public static final int REMARK_LENGTH
| Method Detail |
public long getContentSize()
getContentSize in interface AttachmentInterfacepublic String getContentType()
getContentType in interface AttachmentInterfacepublic Time getCreationTime()
getCreationTime in interface AttachmentInterfacepublic String getCreatorName()
getCreatorName in interface AttachmentInterfacepublic String getDescription()
getDescription in interface AttachmentInterfacepublic Time getEditionTime()
getEditionTime in interface AttachmentInterfacenull if it is not lockedpublic String getFileExtension()
public boolean isFileModified(String directory)
directory - directory to check for the file. Cannot be null.
public String getFileName()
public String getId()
getId in interface AttachmentInterfacepublic int getIn()
public String getInstanceId()
public int getInstanceIn()
public String getLocaleSize(Locale locale)
locale - locale to use for formatting. Cannot be null.
public boolean isLocked()
public boolean isLockedByParticipant(String participantId)
participantId - uid of participant to check. Cannot be null.
public String getLockerName()
getLockerName in interface AttachmentInterfacepublic String getName()
ProcessServiceSession.instanceAttach(InstanceInfo, String, String, String, java.io.File), so there
is no guarantee that it is the filename.
getName in interface AttachmentInterfacepublic String getOsInfo()
public int getProcessIn()
public String getRemarks()
getRemarks in interface AttachmentInterface
public Object getVar(String variableId)
throws InvalidVariableIdException
variableId - VarDefinition Id. Cannot be null.
InvalidVariableIdException - if there is no matching VarDefinition.public int getVersion()
getVersion in interface AttachmentInterface
public boolean existsFile(String directory)
throws IOException
directory - directory to check. Cannot be null.
IOException - if an IO error occured searching the file.
public void saveAs(String attachmentsDirectory,
File file)
throws FileNotFoundException,
SecurityException,
IOException
attachmentsDirectory - where to save the file. Cannot be null.file - file to save. Cannot be null.
FileNotFoundException - if unable to find the file.
SecurityException - if unable to write the file to the specified directory
IOException - if an IO error occured reading or writing the file.
|
ALBPM Process API (PAPI) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||