public abstract class BaseAttachmentRepository
extends com.labvantage.sapphire.BaseCustom
| Constructor and Description |
|---|
BaseAttachmentRepository() |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
canBrowseRepository()
Override and return true if the repository can browse a repository (default false)
It is recomended to only enable this if an unmanaged repository.
|
abstract boolean |
canCompress()
Override and return true if the repository does not require local compression (as it does its own) or false if the system controls compression (default false)
|
abstract boolean |
canEncrypt()
Override and return true if the repository does not require local encrypting (as it does its own) or false if the system controls encrytion (default false)
|
abstract boolean |
canGenerateThumbnail()
Override and return true if the repository does its own thumbnail generation (default false)
|
abstract boolean |
canHash()
Override and return true if the repository does not require local hashing (as it does its own) or false if the system controls hashing (default false)
|
abstract boolean |
checkHash(Attachment attachment)
Override and add any hashing logic for validating the attachment.
|
abstract void |
cleanUpRepository(Attachment oldAttachment)
Override and implement this method to handle the deletion of the sdi attachment record.
|
abstract boolean |
enableCaching()
Override and return true if the repository does not require local caching or false if the system controls caching (default false)
|
PropertyList |
getAttachmentPolicy()
Returns the attachment policy property list
|
abstract java.lang.String |
getBrowseButtonText()
Returns the text for support of the browse button.
|
abstract java.lang.String[] |
getBrowseIncludes()
Returns the array of script includes for support of the browse button.
|
abstract java.lang.String |
getBrowseScript(java.lang.String attachmentElementId)
Returns the script for support of the browse button.
|
java.lang.ClassLoader |
getClassLoader() |
java.io.InputStream |
getDirectInputStream(PropertyList propertyList)
Overridable method to return inputstream directly
|
static java.io.InputStream |
getDirectInputStream(java.lang.String repositoryId,
java.lang.String repositoryNodeId,
PropertyList props,
com.labvantage.sapphire.services.SapphireConnection sapphireConnection) |
java.lang.String |
getFileViewerHTML(java.lang.String fileViewerId,
PropertyList propertyList,
PageContext pageContext)
Overridable method to return fileviewerhtml directly
|
static java.lang.String |
getFileViewerHTML(java.lang.String repositoryId,
java.lang.String repositoryNodeId,
java.lang.String fileViewerId,
PropertyList propertyList,
PageContext pageContext,
com.labvantage.sapphire.services.SapphireConnection sapphireConnection) |
static BaseAttachmentRepository |
getRepository(java.lang.String filerepositoryid,
java.lang.String filerepositorynode,
com.labvantage.sapphire.services.SapphireConnection conn)
Will return an Attachment Repository object based on the repository property tree id and node.
|
PropertyList |
getRepositoryProperties()
Returns the list of properties for the repository
|
protected com.labvantage.sapphire.services.SapphireConnection |
getSapphireConnection()
Returns the sapphire connection object
|
abstract void |
getSDIAttachment(Attachment attachment,
Attachment.ThumbnailGeneration thumbnailGeneration)
Override and implement this method to handle the getting of the sdi attachment record.
|
protected DataSet |
getUniqueFilesInAudit(Attachment oldAttachment)
Will return a dataset of audit records where the files are not in any other audit record or in the sdiattachment table.
|
boolean |
isCleanUpRepositoryEnabled()
Returns true if clean up repository is enabled and false if not
|
protected boolean |
isFilePresentInOtherAttachments(Attachment oldAttachment,
boolean postDelete)
Will return true if the repository reference is found on another attachment record or inside the audit table
|
protected boolean |
isFilePresentInOtherAttachments(Attachment oldAttachment,
boolean postDelete,
boolean checkAudit)
Will return true if the repository reference is found on another attachment record or inside the audit table
|
boolean |
isManaged()
Returns true if this is a managed repository and false if not
It is recommended to use managed repositories where possible as they are more secure and robust.
|
abstract void |
postAddSDIAttachment(Attachment attachment)
Override and implement this method to handle the addition of the sdi attachment record.
|
abstract void |
postDeleteSDIAttachment(Attachment oldAttachment)
Override and implement this method to handle the deletion of the sdi attachment record.
|
abstract void |
postEditSDIAttachment(Attachment attachment,
Attachment oldAttachment)
Override and implement this method to handle the update of the sdi attachment record.
|
abstract void |
preAddSDIAttachment(Attachment attachment)
Override and implement this method to handle the addition of the sdi attachment record.
|
abstract void |
preDeleteSDIAttachment(Attachment attachment)
Override and implement this method to handle the deletion of the sdi attachment record.
|
abstract boolean |
preEditSDIAttachment(Attachment attachment,
Attachment oldAttachment)
Override and implement this method to handle the update of the sdi attachment record.
|
protected void |
setAttachmentPolicy(PropertyList attachmentPolicy) |
protected void |
setClassLoader(java.lang.ClassLoader classLoader) |
protected void |
setCleanUpRepository(boolean enableCleanUpRepository) |
protected void |
setManaged(boolean managed) |
protected void |
setRepositoryProperties(PropertyList repositoryProperties) |
protected void |
setSapphireConnection(com.labvantage.sapphire.services.SapphireConnection sapphireConnection)
Sets a sapphire connection
|
protected void |
transferData(java.io.InputStream inputStream,
java.io.File output,
boolean closeInput,
boolean closeOutput) |
protected void |
transferData(java.io.InputStream inputStream,
java.io.OutputStream outputStream,
boolean closeInput,
boolean closeOutput) |
getAccessorErrorIds, getAccessorErrorMsgs, getActionProcessor, getConfigurationProcessor, getConnectionid, getConnectionId, getConnectionProcessor, getDAMProcessor, getDepartmentList, getHttpProcessor, getQueryProcessor, getRakFile, getSDCProcessor, getSDIProcessor, getSequenceProcessor, getTranslationProcessor, setConnectionId, setLanguage, setRakFileprotected void setClassLoader(java.lang.ClassLoader classLoader)
public java.lang.ClassLoader getClassLoader()
public static BaseAttachmentRepository getRepository(java.lang.String filerepositoryid, java.lang.String filerepositorynode, com.labvantage.sapphire.services.SapphireConnection conn) throws SapphireException
filerepositoryid - The property tree id of the repositoryfilerepositorynode - The node in the property tree of the repositoryconn - The sapphire connectionSapphireExceptionprotected void setSapphireConnection(com.labvantage.sapphire.services.SapphireConnection sapphireConnection)
sapphireConnection - The sapphire connection objectprotected void setCleanUpRepository(boolean enableCleanUpRepository)
protected void setManaged(boolean managed)
protected void setAttachmentPolicy(PropertyList attachmentPolicy)
protected void setRepositoryProperties(PropertyList repositoryProperties)
protected com.labvantage.sapphire.services.SapphireConnection getSapphireConnection()
public boolean isManaged()
public boolean isCleanUpRepositoryEnabled()
public PropertyList getAttachmentPolicy()
public PropertyList getRepositoryProperties()
public abstract boolean checkHash(Attachment attachment)
public abstract boolean canGenerateThumbnail()
public abstract boolean canBrowseRepository()
public abstract java.lang.String[] getBrowseIncludes()
public abstract java.lang.String getBrowseScript(java.lang.String attachmentElementId)
attachmentElementId - The element id of the attachment elementpublic abstract java.lang.String getBrowseButtonText()
public abstract boolean enableCaching()
public abstract boolean canEncrypt()
public abstract boolean canCompress()
public abstract boolean canHash()
public abstract void getSDIAttachment(Attachment attachment, Attachment.ThumbnailGeneration thumbnailGeneration) throws SapphireException
attachment - The attachment object we are working onthumbnailGeneration - The thumbnail rules as to generate the thumbnail or not. You can chose to return the external thumbnail or allow the system to generate one.SapphireExceptionpublic abstract void preAddSDIAttachment(Attachment attachment) throws SapphireException
attachment - The attachment object we are working onSapphireExceptionpublic abstract void postAddSDIAttachment(Attachment attachment) throws SapphireException
attachment - The attachment object we are working onSapphireExceptionpublic abstract boolean preEditSDIAttachment(Attachment attachment, Attachment oldAttachment) throws SapphireException
attachment - The attachment object we are working onSapphireExceptionpublic abstract void postEditSDIAttachment(Attachment attachment, Attachment oldAttachment) throws SapphireException
attachment - The attachment object we are working onoldAttachment - The attachment object representing the state before the updateSapphireExceptionpublic abstract void preDeleteSDIAttachment(Attachment attachment) throws SapphireException
attachment - The attachment object we are working onSapphireExceptionpublic abstract void postDeleteSDIAttachment(Attachment oldAttachment) throws SapphireException
oldAttachment - The attachment object as it was before deletionSapphireExceptionpublic abstract void cleanUpRepository(Attachment oldAttachment) throws SapphireException
oldAttachment - The attachment object as it was before deletionSapphireExceptionprotected boolean isFilePresentInOtherAttachments(Attachment oldAttachment, boolean postDelete)
oldAttachment - postDelete - protected boolean isFilePresentInOtherAttachments(Attachment oldAttachment, boolean postDelete, boolean checkAudit)
oldAttachment - postDelete - checkAudit - protected DataSet getUniqueFilesInAudit(Attachment oldAttachment)
protected void transferData(java.io.InputStream inputStream,
java.io.File output,
boolean closeInput,
boolean closeOutput)
throws SapphireException
SapphireExceptionprotected void transferData(java.io.InputStream inputStream,
java.io.OutputStream outputStream,
boolean closeInput,
boolean closeOutput)
throws SapphireException
SapphireExceptionpublic java.io.InputStream getDirectInputStream(PropertyList propertyList) throws SapphireException
propertyList - SapphireExceptionpublic java.lang.String getFileViewerHTML(java.lang.String fileViewerId,
PropertyList propertyList,
PageContext pageContext)
throws SapphireException
propertyList - SapphireExceptionpublic static java.lang.String getFileViewerHTML(java.lang.String repositoryId,
java.lang.String repositoryNodeId,
java.lang.String fileViewerId,
PropertyList propertyList,
PageContext pageContext,
com.labvantage.sapphire.services.SapphireConnection sapphireConnection)
throws SapphireException
SapphireExceptionpublic static java.io.InputStream getDirectInputStream(java.lang.String repositoryId,
java.lang.String repositoryNodeId,
PropertyList props,
com.labvantage.sapphire.services.SapphireConnection sapphireConnection)
throws SapphireException
SapphireException