Package org.compiere.model
Class MImage
java.lang.Object
org.compiere.model.PO
org.compiere.model.X_AD_Image
org.compiere.model.MImage
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparator<Object>
,I_AD_Image
,I_Persistent
,Evaluatee
,ImmutablePOSupport
Image Model
(DisplayType = 32)
- Version:
- $Id: MImage.java,v 1.5 2006/07/30 00:51:02 jjanke Exp $
- Author:
- Jorg Janke
- See Also:
-
Field Summary
Fields inherited from class org.compiere.model.X_AD_Image
ENTITYTYPE_AD_Reference_ID
Fields 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_ID
Fields inherited from interface org.compiere.model.I_AD_Image
accessLevel, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Image_ID, COLUMNNAME_AD_Image_UU, COLUMNNAME_AD_Org_ID, COLUMNNAME_AD_StorageProvider_ID, COLUMNNAME_BinaryData, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_Description, COLUMNNAME_EntityType, COLUMNNAME_ImageURL, COLUMNNAME_IsActive, COLUMNNAME_Name, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, Model, Table_ID, Table_Name
-
Constructor Summary
ConstructorDescriptionMImage
(Properties ctx, int AD_Image_ID, String trxName) ConstructorMImage
(Properties ctx, String AD_Image_UU, String trxName) UUID based ConstructorMImage
(Properties ctx, ResultSet rs, String trxName) Load ConstructorMImage
(Properties ctx, MImage copy) Copy constructorMImage
(Properties ctx, MImage copy, String trxName) Copy constructorCopy constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
beforeSave
(boolean newRecord) Before Savestatic MImage
get
(int AD_Image_ID) Get MImage from Cache (immutable)static MImage
get
(Properties ctx, int AD_Image_ID) Get MImage (Immutable) from Cachebyte[]
Load binary data through storage providerbyte[]
static MImage
getCopy
(Properties ctx, int AD_Image_ID, String trxName) Get updateable copy of MImage from cachebyte[]
getData()
Get DatagetIcon()
Get IcongetImage()
Get Imagemark PO as immutableprotected boolean
Executed after the Delete operation is committed in the database.protected void
Call after ID have been assigned for new recordvoid
setBinaryData
(byte[] BinaryData) Set Binary Datavoid
setByteData
(byte[] BinaryData) Set binary data of imagevoid
setImageURL
(String ImageURL) Set Image URLvoid
Set Storage Provider.toString()
String RepresentationMethods inherited from class org.compiere.model.X_AD_Image
get_AccessLevel, getAD_Image_ID, getAD_Image_UU, getAD_StorageProvider, getAD_StorageProvider_ID, getDescription, getEntityType, getImageURL, getKeyNamePair, getName, initPO, setAD_Image_ID, setAD_Image_UU, setAD_StorageProvider_ID, setDescription, setEntityType, setName
Methods 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_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
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
Methods inherited from interface org.compiere.model.I_AD_Image
getAD_Client_ID, getAD_Org_ID, getCreated, getCreatedBy, getUpdated, getUpdatedBy, isActive, setAD_Org_ID, setIsActive
Methods inherited from interface org.compiere.model.I_Persistent
save
-
Constructor Details
-
MImage
UUID based Constructor- Parameters:
ctx
- ContextAD_Image_UU
- UUID keytrxName
- Transaction
-
MImage
Constructor- Parameters:
ctx
- contextAD_Image_ID
- imagetrxName
- transaction
-
MImage
Load Constructor- Parameters:
ctx
-rs
-trxName
- transaction
-
MImage
Copy constructor- Parameters:
copy
-
-
MImage
Copy constructor- Parameters:
ctx
-copy
-
-
MImage
Copy constructor- Parameters:
ctx
-copy
-trxName
-
-
-
Method Details
-
get
Get MImage from Cache (immutable)- Parameters:
AD_Image_ID
- id- Returns:
- MImage
-
get
Get MImage (Immutable) from Cache- Parameters:
ctx
- contextAD_Image_ID
- id- Returns:
- MImage
-
getCopy
Get updateable copy of MImage from cache- Parameters:
ctx
- contextAD_Image_ID
-trxName
- transaction name- Returns:
- MImage
-
getImage
Get Image- Returns:
- image or null
-
getIcon
Get Icon- Returns:
- icon or null
-
setImageURL
Set Image URL- Specified by:
setImageURL
in interfaceI_AD_Image
- Overrides:
setImageURL
in classX_AD_Image
- Parameters:
ImageURL
- url
-
setBinaryData
public void setBinaryData(byte[] BinaryData) Set Binary Data- Specified by:
setBinaryData
in interfaceI_AD_Image
- Overrides:
setBinaryData
in classX_AD_Image
- Parameters:
BinaryData
- binary data of an image
-
getBinaryData
public byte[] getBinaryData()Load binary data through storage provider- Specified by:
getBinaryData
in interfaceI_AD_Image
- Overrides:
getBinaryData
in classX_AD_Image
- Returns:
- Binary Data
-
getData
public byte[] getData()Get Data- Returns:
- binary data of an image
-
toString
String Representation- Overrides:
toString
in classX_AD_Image
- Returns:
- String
-
beforeSave
protected boolean beforeSave(boolean newRecord) Before Save- Overrides:
beforeSave
in classPO
- Parameters:
newRecord
- new- Returns:
- true
-
getImageStoragePath
- Returns:
- relative image storage path (without the image id/name)
-
setStorageProvider
Set Storage Provider.
Used by storage provider migration process to migrate storage provider.- Parameters:
p
- Storage provider
-
getByteData
public byte[] getByteData()- Returns:
- binary data of image
-
setByteData
public void setByteData(byte[] BinaryData) Set binary data of image- Parameters:
BinaryData
-
-
postDelete
protected boolean postDelete()Description copied from class:PO
Executed after the Delete operation is committed in the database.- Overrides:
postDelete
in classPO
- Returns:
- true if post delete is a success
-
saveNew_afterSetID
protected void saveNew_afterSetID()Description copied from class:PO
Call after ID have been assigned for new record- Overrides:
saveNew_afterSetID
in classPO
-
markImmutable
Description copied from interface:ImmutablePOSupport
mark PO as immutable- Specified by:
markImmutable
in interfaceImmutablePOSupport
- Returns:
- PO
-