Package org.compiere.model
Class MArchive
java.lang.Object
org.compiere.model.PO
org.compiere.model.X_AD_Archive
org.compiere.model.MArchive
- All Implemented Interfaces:
Serializable,Cloneable,Comparator<Object>,I_AD_Archive,I_Persistent,Evaluatee
Archive Model
- Version:
- $Id: MArchive.java,v 1.3 2006/07/30 00:58:36 jjanke Exp $
- Author:
- Jorg Janke
- See Also:
-
Field Summary
FieldsFields inherited from class org.compiere.model.PO
ACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, LOCAL_TRX_PREFIX, log, p_ctx, p_info, UUID_NEW_RECORD, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_IDFields inherited from interface org.compiere.model.I_AD_Archive
accessLevel, COLUMNNAME_AD_Archive_ID, COLUMNNAME_AD_Archive_UU, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_AD_Process_ID, COLUMNNAME_AD_StorageProvider_ID, COLUMNNAME_AD_Table_ID, COLUMNNAME_BinaryData, COLUMNNAME_C_BPartner_ID, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_Description, COLUMNNAME_Help, COLUMNNAME_IsActive, COLUMNNAME_IsReport, COLUMNNAME_Name, COLUMNNAME_Record_ID, COLUMNNAME_Record_UU, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, Model, Table_ID, Table_Name -
Constructor Summary
ConstructorsConstructorDescriptionMArchive(Properties ctx, int AD_Archive_ID, String trxName) Standard ConstructorMArchive(Properties ctx, String AD_Archive_UU, String trxName) UUID based ConstructorMArchive(Properties ctx, ResultSet rs, String trxName) Load ConstructorMArchive(Properties ctx, PrintInfo info, String trxName) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbeforeSave(boolean newRecord) Called before Save for Pre-Save Operation.
Default implementation is nop, to be implemented in sub-classes that needed it.static MArchive[]get(Properties ctx, String whereClause) Get Archivesstatic MArchive[]get(Properties ctx, String whereClause, String trxName) Get ArchivesReturns the archive path (snippet), containing client, org and archive id.byte[]Get data as byte[] from storage providerbyte[]Get byte data from BinaryData column.Get Created By (User) NameGet Data as Input Streamstatic int[]getReportAndDocumentCountByRecordId(int AD_Table_ID, int Record_ID, String trxName) Deprecated.static int[]getReportAndDocumentCountByRecordId(int AD_Table_ID, int Record_ID, String Record_UU, String trxName) Get number of document and report archive by table and record UUIDstatic intgetReportCountByTableId(int AD_Table_ID, String trxName) Get number of report archive by table idprotected booleanAsk provider to remove archive contentSave the Archive as zip file, used by Pack Out when storage provider is not DBprotected voidAsk provider to flush buffer data (if any)voidsetBinaryData(byte[] inflatedData) Save Binary Data through storage providervoidsetByteData(byte[] BinaryData) Store byte data to BinaryData column.voidsetInputStream(InputStream inputStream) Save Binary Data through storage provider from InputStreamvoidSet Storage Provider.toString()String RepresentationMethods inherited from class org.compiere.model.X_AD_Archive
get_AccessLevel, getAD_Archive_ID, getAD_Archive_UU, getAD_Process, getAD_Process_ID, getAD_StorageProvider, getAD_StorageProvider_ID, getAD_Table, getAD_Table_ID, getC_BPartner, getC_BPartner_ID, getDescription, getHelp, getKeyNamePair, getName, getRecord_ID, getRecord_UU, initPO, isReport, setAD_Archive_ID, setAD_Archive_UU, setAD_Process_ID, setAD_StorageProvider_ID, setAD_Table_ID, setC_BPartner_ID, setDescription, setHelp, setIsReport, setName, setRecord_ID, setRecord_UUMethods inherited from class org.compiere.model.PO
afterDelete, afterSave, beforeDelete, buildInsertSQL, checkImmutable, clearCrossTenantSafe, clone, columnExists, columnExists, compare, copyPO, copyValues, copyValues, createAttachment, delete, delete, delete_Accounting, delete_Tree, deleteEx, deleteEx, dump, dump, equals, get_Attribute, get_Attributes, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_DisplayValue, get_HashMap, get_ID, get_IDOld, get_KeyColumns, get_Logger, get_OptimisticLockingColumns, get_Table_ID, get_TableAttribute, get_TableAttributeAsBoolean, get_TableAttributeAsInt, get_TableAttributes, get_TableName, get_Translation, get_Translation, get_Translation, get_Translation, get_Translation, get_TrxName, get_UUID, get_Value, get_Value, get_ValueAsBoolean, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueE, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_WhereClause, get_WhereClause, get_xmlDocument, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getDoc, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, getUUIDColumnName, getUUIDColumnName, hashCode, insert_Accounting, insert_Tree, insert_Tree, is_Changed, is_Immutable, is_new, is_UseOptimisticLocking, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, isReplication, load, load, load, load, loadByUU, loadComplete, loadDefaults, loadPO, loadSpecial, lock, makeImmutable, retrieveIdOfParentValue, retrieveIdOfParentValue, save, save, saveCrossTenantSafe, saveCrossTenantSafeEx, saveCrossTenantSafeEx, saveEx, saveEx, saveNew_getID, saveNewSpecial, saveReplica, saveUpdate, set_Attribute, set_ColumnUpdateable, set_CustomColumn, set_CustomColumnReturningBoolean, set_OptimisticLockingColumns, set_TrxName, set_TrxName, set_UseOptimisticLocking, set_Value, set_Value, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueOfColumn, set_ValueOfColumnReturningBoolean, set_ValueOfColumnReturningBoolean, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setCrossTenantSafe, setDoc, setDocWorkflowMgr, setIsActive, setProcessedOn, setReplication, setStandardDefaults, setUpdateable, setUpdatedBy, toInsertSQL, unlock, update_Tree, validForeignKeys, validForeignKeysExMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongMethods inherited from interface org.compiere.model.I_AD_Archive
getAD_Client_ID, getAD_Org_ID, getCreated, getCreatedBy, getUpdated, getUpdatedBy, isActive, setAD_Org_ID, setIsActiveMethods inherited from interface org.compiere.model.I_Persistent
save
-
Field Details
-
provider
-
-
Constructor Details
-
MArchive
UUID based Constructor- Parameters:
ctx- ContextAD_Archive_UU- UUID keytrxName- Transaction
-
MArchive
Standard Constructor- Parameters:
ctx- contextAD_Archive_ID- idtrxName- transaction
-
MArchive
Load Constructor- Parameters:
ctx- contextrs- result settrxName- transaction
-
MArchive
Constructor- Parameters:
ctx- contextinfo- print infotrxName- transaction
-
-
Method Details
-
get
Get Archives- Parameters:
ctx- contextwhereClause- optional where clause (starting with AND)- Returns:
- archives
-
get
Get Archives- Parameters:
ctx- contextwhereClause- optional where clause (starting with AND)trxName- optional trx name- Returns:
- archives
-
toString
String Representation- Overrides:
toStringin classX_AD_Archive- Returns:
- info
-
getBinaryData
public byte[] getBinaryData()Get data as byte[] from storage provider- Specified by:
getBinaryDatain interfaceI_AD_Archive- Overrides:
getBinaryDatain classX_AD_Archive- Returns:
- byte[] or null
-
getInputStream
Get Data as Input Stream- Returns:
- input stream or null
-
setInputStream
Save Binary Data through storage provider from InputStream- Parameters:
inputStream-
-
setBinaryData
public void setBinaryData(byte[] inflatedData) Save Binary Data through storage provider- Specified by:
setBinaryDatain interfaceI_AD_Archive- Overrides:
setBinaryDatain classX_AD_Archive- Parameters:
inflatedData- inflated data
-
getCreatedByName
Get Created By (User) Name- Returns:
- name
-
getArchivePathSnippet
Returns the archive path (snippet), containing client, org and archive id. The process, table and record id are only included when they are not null.- Returns:
- archive path
-
getByteData
public byte[] getByteData()Get byte data from BinaryData column. Usually, your code should call getBinaryData() instead (using provider).- Returns:
- byte[]
-
setByteData
public void setByteData(byte[] BinaryData) Store byte data to BinaryData column. Usually, your code should call setBinaryData() instead (using provider).- Parameters:
BinaryData-
-
beforeSave
protected boolean beforeSave(boolean newRecord) Description copied from class:POCalled before Save for Pre-Save Operation.
Default implementation is nop, to be implemented in sub-classes that needed it.- Overrides:
beforeSavein classPO- Parameters:
newRecord- true if it is a new record- Returns:
- true if record can be saved
-
postDelete
protected boolean postDelete()Ask provider to remove archive content- Overrides:
postDeletein classPO- Returns:
- true if post delete is a success
-
saveNew_afterSetID
protected void saveNew_afterSetID()Ask provider to flush buffer data (if any)- Overrides:
saveNew_afterSetIDin classPO
-
setStorageProvider
Set Storage Provider. Also used temporarily for the migration of storage provider.- Parameters:
p- Storage provider
-
saveAsZip
Save the Archive as zip file, used by Pack Out when storage provider is not DB- Returns:
- File - the temporary file
-
getReportAndDocumentCountByRecordId
@Deprecated public static int[] getReportAndDocumentCountByRecordId(int AD_Table_ID, int Record_ID, String trxName) Deprecated.Get number of document and report archive by table and record id- Parameters:
AD_Table_ID-Record_ID-trxName-- Returns:
- int[], [0] = report count and [1] = document count
-
getReportAndDocumentCountByRecordId
public static int[] getReportAndDocumentCountByRecordId(int AD_Table_ID, int Record_ID, String Record_UU, String trxName) Get number of document and report archive by table and record UUID- Parameters:
AD_Table_ID-Record_ID- - record ID used when UUID is empty, or as C_BPartner_ID when searching for C_BPartnerRecord_UU- - record UUIDtrxName-- Returns:
- int[], [0] = report count and [1] = document count
-
getReportCountByTableId
Get number of report archive by table id- Parameters:
AD_Table_ID-trxName-- Returns:
- Number of report archive for AD_Table_ID
-
getReportAndDocumentCountByRecordId(int, int, String, String)instead