Compiere 3.1

org.compiere.model
Class MProduct

java.lang.Object
  extended by org.compiere.framework.PO
      extended by org.compiere.model.X_M_Product
          extended by org.compiere.model.MProduct
All Implemented Interfaces:
Serializable, Cloneable, Comparator<PO>, Evaluatee

public class MProduct
extends X_M_Product

Product Model

Version:
$Id: MProduct.java,v 1.5 2006/07/30 00:51:05 jjanke Exp $
Author:
Jorg Janke
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.compiere.model.X_M_Product
accessLevel, M_PRODUCT_CATEGORY_ID_AD_Reference_ID, Model, PRODUCTTYPE_AD_Reference_ID, PRODUCTTYPE_ExpenseType, PRODUCTTYPE_Item, PRODUCTTYPE_Online, PRODUCTTYPE_Resource, PRODUCTTYPE_Service, SALESREP_ID_AD_Reference_ID, Table_ID, Table_Name, updatedMS
 
Fields inherited from class org.compiere.framework.PO
ACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, log, p_changeVO, p_info, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
 
Constructor Summary
MProduct(Ctx ctx, int M_Product_ID, String trxName)
          Standard Constructor
MProduct(Ctx ctx, ResultSet rs, String trxName)
          Load constructor
MProduct(MExpenseType et)
          Parent Constructor
MProduct(MResource resource, MResourceType resourceType)
          Parent Constructor
MProduct(X_I_Product impP)
          Import Constructor
 
Method Summary
protected  boolean afterSave(boolean newRecord, boolean success)
          After Save
protected  boolean beforeDelete()
          Before Delete
protected  boolean beforeSave(boolean newRecord)
          Before Save
static ArrayList<MProduct> findAll(Ctx ctx, String whereClause, String trxName)
          Get MProduct from Cache
static MProduct get(Ctx ctx, int M_Product_ID)
          Get MProduct from Cache
 int getA_Asset_Group_ID()
          Create Asset Group for this product
 MAttributeSet getAttributeSet()
          Get Attribute Set
 MProductDownload[] getProductDownloads(boolean requery)
          Get Active(!)
 int getSupportUnits()
          Get SupportUnits
static MProduct getTrial(Ctx ctx, String entityType)
          Get Trial Products for Entity Type
 int getUOMPrecision()
          Get UOM Standard Precision
 String getUOMSymbol()
          Get UOM Symbol
 boolean hasDownloads()
          Does the product have downloads
 boolean isCreateAsset()
          Create Asset for this product
 boolean isInstanceAttribute()
          Has the Product Instance Attribute
 boolean isItem()
          Product is Item
 boolean isOneAssetPerUOM()
          Create One Asset Per UOM
static boolean isProductStocked(Ctx ctx, int M_Product_ID)
          Is Product Stocked
 boolean isService()
          Is Service
 boolean isStocked()
          Product is an Item and Stocked
 boolean setExpenseType(MExpenseType parent)
          Set Expense Type
 void setM_Product_Category_ID(String oldM_Product_Category_ID, String newM_Product_Category_ID, int windowNo)
          Set Partner Location - Callout
 boolean setResource(MResource parent)
          Set Resource
 boolean setResource(MResourceType parent)
          Set Resource Type
 String toString()
          String Representation
 
Methods inherited from class org.compiere.model.X_M_Product
get_AccessLevel, getC_SubscriptionType_ID, getC_TaxCategory_ID, getC_UOM_ID, getClassification, getDescription, getDescriptionURL, getDiscontinuedBy, getDocumentNote, getGuaranteeDays, getGuaranteeDaysMin, getHelp, getImageURL, getKeyNamePair, getLicenseInfo, getM_AttributeSet_ID, getM_AttributeSetInstance_ID, getM_FreightCategory_ID, getM_Locator_ID, getM_Product_Category_ID, getM_Product_ID, getName, getProductType, getR_MailText_ID, getR_Source_ID, getS_ExpenseType_ID, getS_Resource_ID, getSalesRep_ID, getShelfDepth, getShelfHeight, getShelfWidth, getSKU, getTrialPhaseDays, getUnitsPerPallet, getUPC, getValue, getVersionNo, getVolume, getWeight, initPO, isBOM, isDiscontinued, isDropShip, isExcludeAutoDelivery, isInvoicePrintDetails, isPickListPrintDetails, isProcessing, isProductTypeValid, isPurchased, isPurchasedToOrder, isSelfService, isSold, isSummary, isVerified, isWebStoreFeatured, setC_SubscriptionType_ID, setC_TaxCategory_ID, setC_UOM_ID, setClassification, setDescription, setDescriptionURL, setDiscontinued, setDiscontinuedBy, setDocumentNote, setGuaranteeDays, setGuaranteeDaysMin, setHelp, setImageURL, setIsBOM, setIsDropShip, setIsExcludeAutoDelivery, setIsInvoicePrintDetails, setIsPickListPrintDetails, setIsPurchased, setIsPurchasedToOrder, setIsSelfService, setIsSold, setIsStocked, setIsSummary, setIsVerified, setIsWebStoreFeatured, setLicenseInfo, setM_AttributeSet_ID, setM_AttributeSetInstance_ID, setM_FreightCategory_ID, setM_Locator_ID, setM_Product_Category_ID, setM_Product_ID, setName, setProcessing, setProductType, setR_MailText_ID, setR_Source_ID, setS_ExpenseType_ID, setS_Resource_ID, setSalesRep_ID, setShelfDepth, setShelfHeight, setShelfWidth, setSKU, setSupportUnits, setTrialPhaseDays, setUnitsPerPallet, setUPC, setValue, setVersionNo, setVolume, setWeight
 
Methods inherited from class org.compiere.framework.PO
addAttachment, addAttachment, addError, afterDelete, compare, convertToBigDecimal, convertToBoolean, convertToInt, convertToTimestamp, copy, copyValues, copyValues, createAttachment, delete_Accounting, delete, delete, dump, dump, equals, get_ChangeVO, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_DisplayValue, get_EntityType, get_HashMap, get_ID, get_IDOld, get_Info, get_KeyColumns, get_Logger, get_Table_ID, get_Table_ID, get_TableName, get_Translation, get_TrxName, get_Value, get_Value, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_ValuesAsString, get_WhereClause, get_xmlDocument, get_xmlString, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, getVO, hashCode, insert_Accounting, is_Changed, is_KeyColumn, is_new, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, load, load, load, load, loadComplete, loadDefaults, loadSpecial, lock, save, save, saveNew_getID, saveNewInsertSQL, saveNewSpecial, saveUpdate, set_ChangeVO, set_ColumnUpdateable, set_CustomColumn, set_TrxName, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueString, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setContext, setCtx, setDocWorkflowMgr, setIsActive, setStandardDefaults, setUpdateable, setUpdatedBy, toStringX, unlock, update
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MProduct

public MProduct(Ctx ctx,
                int M_Product_ID,
                String trxName)
Standard Constructor

Parameters:
ctx - context
M_Product_ID - id
trxName - transaction

MProduct

public MProduct(Ctx ctx,
                ResultSet rs,
                String trxName)
Load constructor

Parameters:
ctx - context
rs - result set
trxName - transaction

MProduct

public MProduct(MExpenseType et)
Parent Constructor

Parameters:
et - parent

MProduct

public MProduct(MResource resource,
                MResourceType resourceType)
Parent Constructor

Parameters:
resource - parent
resourceType - resource type

MProduct

public MProduct(X_I_Product impP)
Import Constructor

Parameters:
impP - import
Method Detail

get

public static MProduct get(Ctx ctx,
                           int M_Product_ID)
Get MProduct from Cache

Parameters:
ctx - context
M_Product_ID - id
Returns:
MProduct

findAll

public static ArrayList<MProduct> findAll(Ctx ctx,
                                          String whereClause,
                                          String trxName)
Get MProduct from Cache

Parameters:
ctx - context
whereClause - sql where clause
trxName - trx
Returns:
list of MProduct

getTrial

public static MProduct getTrial(Ctx ctx,
                                String entityType)
Get Trial Products for Entity Type

Parameters:
ctx - ctx
entityType - entity type
Returns:
trial product or null

isProductStocked

public static boolean isProductStocked(Ctx ctx,
                                       int M_Product_ID)
Is Product Stocked

Parameters:
ctx - context
M_Product_ID - id
Returns:
true if found and stocked - false otherwise

setExpenseType

public boolean setExpenseType(MExpenseType parent)
Set Expense Type

Parameters:
parent - expense type
Returns:
true if changed

setResource

public boolean setResource(MResource parent)
Set Resource

Parameters:
parent - resource
Returns:
true if changed

setResource

public boolean setResource(MResourceType parent)
Set Resource Type

Parameters:
parent - resource type
Returns:
true if changed

getUOMPrecision

public int getUOMPrecision()
Get UOM Standard Precision

Returns:
UOM Standard Precision

getA_Asset_Group_ID

public int getA_Asset_Group_ID()
Create Asset Group for this product

Returns:
asset group id

isCreateAsset

public boolean isCreateAsset()
Create Asset for this product

Returns:
true if asset is created

getAttributeSet

public MAttributeSet getAttributeSet()
Get Attribute Set

Returns:
set or null

isInstanceAttribute

public boolean isInstanceAttribute()
Has the Product Instance Attribute

Returns:
true if instance attributes

isOneAssetPerUOM

public boolean isOneAssetPerUOM()
Create One Asset Per UOM

Returns:
individual asset

isItem

public boolean isItem()
Product is Item

Returns:
true if item

isStocked

public boolean isStocked()
Product is an Item and Stocked

Overrides:
isStocked in class X_M_Product
Returns:
true if stocked and item

isService

public boolean isService()
Is Service

Returns:
true if service (resource, online)

getUOMSymbol

public String getUOMSymbol()
Get UOM Symbol

Returns:
UOM Symbol

getProductDownloads

public MProductDownload[] getProductDownloads(boolean requery)
Get Active(!) Product Downloads

Parameters:
requery - requery
Returns:
array of downloads

hasDownloads

public boolean hasDownloads()
Does the product have downloads

Returns:
true if downloads exists

getSupportUnits

public int getSupportUnits()
Get SupportUnits

Overrides:
getSupportUnits in class X_M_Product
Returns:
units per UOM

setM_Product_Category_ID

@UICallout
public void setM_Product_Category_ID(String oldM_Product_Category_ID,
                                               String newM_Product_Category_ID,
                                               int windowNo)
                              throws Exception
Set Partner Location - Callout

Parameters:
oldC_BPartner_Location_ID - old value
newC_BPartner_Location_ID - new value
windowNo - window
Throws:
Exception

toString

public String toString()
String Representation

Overrides:
toString in class X_M_Product
Returns:
info

beforeSave

protected boolean beforeSave(boolean newRecord)
Before Save

Overrides:
beforeSave in class PO
Parameters:
newRecord - new
Returns:
true

afterSave

protected boolean afterSave(boolean newRecord,
                            boolean success)
After Save

Overrides:
afterSave in class PO
Parameters:
newRecord - new
success - success
Returns:
success

beforeDelete

protected boolean beforeDelete()
Before Delete

Overrides:
beforeDelete in class PO
Returns:
true if it can be deleted

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.