public final class CSProductOption extends CSItem
The CSProductOption
class includes methods for the retrieval of a particular product option's details.
All such methods require that certain database and key information (product option ID, for example) be specified via
the set
methods provided, prior to their invocation.
All database access/connectivity is handled internally by the CSProductOption
class.
ACCESS_GRANTED, DOES_NOT_EXIST, EMPTY, EXISTS, SECURE_ACCESS_DENIED, SECURE_ACCESS_GRANTED, UPDATE_ACTION_INSERTED, UPDATE_ACTION_UPDATED
LEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSProductOption()
Creates an empty
CSProductOption object. |
CSProductOption(CSProductOption objItem)
Creates an empty
CSProductOption object, and initialises it from the contents of the supplied
CSItem object. |
CSProductOption(java.lang.String strPropertyFile)
Creates a new
CSProductOption , specifying a property file that contains all of the database
connection details. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Not currently implemented for
CSProductOption . |
boolean |
exist()
Determines whether a product option exists on the database.
|
void |
get()
Retrieves the details of a product option from the database.
|
CSAttributeMultiple |
getAttributeMultiple()
Get the
CSAttributeMultiple object containing the CSAttribute objects associated with this
product option. |
double |
getCountryGrossPrice()
Gets the country gross price of the product option.
|
java.lang.String |
getCountryName()
Gets the official name of the country used to calculate country VAT, country net price and country gross price
when a product option is retrieved.
|
double |
getCountryNetPrice()
Gets the country net price of the product option.
|
double |
getCountryVat()
Gets the country VAT to be applied to the product option.
|
java.lang.String |
getCustomerProductID()
Gets the customer product ID of the product option.
|
java.lang.Integer |
getDecimalPlaces()
Gets the decimal places setting to be applied to the product type's price.
|
java.lang.String |
getDescription()
Gets the description of the product option.
|
int |
getDisplayOrder()
Gets the display order of the product option.
|
double |
getGrossPrice()
Gets the default country's gross price of the product option.
|
CSMediaMultiple |
getMediaMultiple()
Get the
CSMediaMultiple object containing the CSMedia objects associated with this product
option. |
double |
getNetPrice()
Gets the default country's net price of the product option.
|
java.util.Date |
getNextStockDate()
Gets the date when the product option is next due in.
|
int |
getProductOptionID()
Gets the ID of the product option to be used as key information.
|
int |
getProductTypeID()
Gets the parent product type ID of the product option.
|
java.lang.String |
getProductTypeName()
Gets the parent product type name of the product option.
|
int |
getRelatedFormID()
Gets the related form ID of the product option.
|
java.lang.String |
getShippingRate()
Gets the shipping rate to be applied to the product option.
|
int |
getShippingSchemeID()
Gets the ID of the shipping scheme to be applied to the product option.
|
java.lang.String |
getShippingSchemeName()
Gets the name of the shipping scheme to be applied to the product option.
|
int |
getStockLevel()
Gets the stock level of the product option.
|
java.lang.String |
getUserData()
Gets the user data of the product option.
|
double |
getVat()
Gets the default country's VAT to be applied to the product option.
|
double |
getVatFixed()
Gets the fixed VAT to be applied to the product option, but only if the VAT scheme requires it.
|
int |
getVatSchemeID()
Gets the ID of the VAT scheme to be applied to the product option.
|
java.lang.String |
getVatSchemeVatCode()
Gets the VAT code of the VAT scheme to be applied to the product option.
|
void |
setAttributeMultiple(CSAttributeMultiple objAttributeMultiple)
Set the
CSAttributeMultiple object containing the CSAttribute objects associated with this
product option. |
void |
setCountryGrossPrice(double nCountryGrossPrice)
Sets the country gross price of the product option.
|
void |
setCountryName(java.lang.String strCountryName)
Sets the official name of the country used to calculate country VAT, country net price and country gross price
when a product option is retrieved.
|
void |
setCountryNetPrice(double nCountryNetPrice)
Sets the country net price of the product option.
|
void |
setCountryVat(double nCountryVat)
Sets the country VAT to be applied to the product option.
|
void |
setCustomerProductID(java.lang.String strCustomerProductID)
Sets the customer product ID of the product option.
|
void |
setDecimalPlaces(java.lang.Integer nDecimalPlaces)
Sets the decimal places setting to be applied to the product type's price.
|
void |
setDescription(java.lang.String strDescription)
Sets the description of the product option.
|
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setDisplayOrder(int nDisplayOrder)
Sets the display order of the product option.
|
void |
setGrossPrice(double nGrossPrice)
Sets the default country's gross price of the product option.
|
void |
setMediaMultiple(CSMediaMultiple objMediaMultiple)
Set the
CSMediaMultiple object containing the CSMedia objects associated with this product
option. |
void |
setNetPrice(double nNetPrice)
Sets the default country's net price of the product option.
|
void |
setNextStockDate(java.util.Date objNextStockDate)
Sets the date when the product option is next due in.
|
void |
setProductOptionID(int nProductOptionID)
Sets the product option ID to be used as key information.
|
void |
setProductTypeID(int nProductTypeID)
Sets the parent product type ID of the product option.
|
void |
setProductTypeName(java.lang.String strProductTypeName)
Sets the parent product type name of the product option.
|
void |
setRelatedFormID(int id)
Sets the related form ID of the product type.
|
void |
setShippingRate(java.lang.String strShippingRate)
Sets the shipping rate to be applied to the product option.
|
void |
setShippingSchemeID(int nShippingSchemeID)
Sets the ID of the shipping scheme to be applied to the product option.
|
void |
setShippingSchemeName(java.lang.String strShippingSchemeName)
Sets the name of the shipping scheme to be applied to the product option.
|
void |
setStockLevel(int nStockLevel)
Sets the stock level of the product option.
|
void |
setUserData(java.lang.String strUserData)
Sets the user data of the product option.
|
void |
setVat(double nVat)
Sets the default country's VAT to be applied to the product option.
|
void |
setVatFixed(double nVatFixed)
Sets the fixed VAT to be applied to the product option, but only if the VAT scheme requires it.
|
void |
setVatSchemeID(int nVatSchemeID)
Sets the ID of the VAT scheme to be applied to the product option.
|
void |
setVatSchemeVatCode(java.lang.String strVatSchemeVatCode)
Sets the VAT code of the VAT scheme to be applied to the product option.
|
void |
update()
Not currently implemented for
CSProductOption . |
equals, getID, getStatus, hashCode, jsonString, serialiseWithTypes, setID, setStatus, toString, unset
clearRecordedGatewayMessages, clone, count, getCache, getCachingEnabled, getDatabaseVersion, getDatabaseVersion, getDebugOutput, getDetailLevel, getPreview, getPropertyFile, getPropertyFileExtension, getPropertyFilePathname, getRecordedGatewayMessages, getRecordGatewayMessages, getSendGatewayMessages, getUseCache, setDebugOutput, setPreview, setPropertyFile, setRecordGatewayMessages, setSendGatewayMessages, setUseCache
public CSProductOption()
CSProductOption
object.
Use the various set methods provided to initialise the CSProductOption
object prior to invoking
any of its query methods.
public CSProductOption(CSProductOption objItem)
CSProductOption
object, and initialises it from the contents of the supplied
CSItem object.
objItem
- the CSProductOption
object to be used to initialise the new onepublic CSProductOption(java.lang.String strPropertyFile)
CSProductOption
, specifying a property file that contains all of the database
connection details.
Use the various set methods provided to initialise the CSProductOption
object prior to invoking
any of its query methods.
strPropertyFile
- the property file that contains the connection details.public int getProductOptionID()
public void setProductOptionID(int nProductOptionID)
setProductOptionID
followed by a call to get
will return details of the product
option with the specified ID.
nProductOptionID
- the product option's ID to be used as key information.public int getProductTypeID()
public void setProductTypeID(int nProductTypeID)
nProductTypeID
- the product option's parent product type ID.public java.lang.String getProductTypeName()
public void setProductTypeName(java.lang.String strProductTypeName)
strProductTypeName
- the product option's parent product type name.public java.lang.String getCustomerProductID()
public void setCustomerProductID(java.lang.String strCustomerProductID)
strCustomerProductID
- the product option's customer product ID.public java.lang.String getDescription()
public void setDescription(java.lang.String strDescription)
strDescription
- the product option's description.public int getStockLevel()
public void setStockLevel(int nStockLevel)
nStockLevel
- the product option's stock level.public java.util.Date getNextStockDate()
public void setNextStockDate(java.util.Date objNextStockDate)
objNextStockDate
- the date when the product option is next due in.public int getDisplayOrder()
public void setDisplayOrder(int nDisplayOrder)
nDisplayOrder
- the product option's display order.public int getVatSchemeID()
public void setVatSchemeID(int nVatSchemeID)
nVatSchemeID
- the product option's VAT scheme ID.public java.lang.String getVatSchemeVatCode()
public void setVatSchemeVatCode(java.lang.String strVatSchemeVatCode)
strVatSchemeVatCode
- the product option's VAT scheme's VAT code.public double getVatFixed()
public void setVatFixed(double nVatFixed)
nVatFixed
- the product option's fixed VAT.public int getShippingSchemeID()
public void setShippingSchemeID(int nShippingSchemeID)
nShippingSchemeID
- the product option's shipping scheme ID.public java.lang.String getShippingSchemeName()
public void setShippingSchemeName(java.lang.String strShippingSchemeName)
strShippingSchemeName
- the product option's shipping scheme name.public java.lang.String getShippingRate()
public void setShippingRate(java.lang.String strShippingRate)
strShippingRate
- the product option's shipping rate.public java.lang.String getUserData()
public void setUserData(java.lang.String strUserData)
strUserData
- the product option's user data.public CSAttributeMultiple getAttributeMultiple()
CSAttributeMultiple
object containing the CSAttribute
objects associated with this
product option.
CSAttributeMultiple
populated with CSAttribute
objects which represent attributes
associated with this product option.public void setAttributeMultiple(CSAttributeMultiple objAttributeMultiple)
CSAttributeMultiple
object containing the CSAttribute
objects associated with this
product option.
objAttributeMultiple
- a CSAttributeMultiple
object populated with CSAttribute
objects each of which
represents an attribute item associated with this product option.public CSMediaMultiple getMediaMultiple()
CSMediaMultiple
object containing the CSMedia
objects associated with this product
option.
CSMediaMultiple
populated with CSMedia
objects which represent media items associated
with this product option.public void setMediaMultiple(CSMediaMultiple objMediaMultiple)
CSMediaMultiple
object containing the CSMedia
objects associated with this product
option.
objMediaMultiple
- a CSMediaMultiple
object populated with CSMedia
objects each of which represents a
media item associated with this product option.public java.lang.String getCountryName()
When CountryName
is used that country, and its decimal places, will override the default country
and decimal places as defined in the iCM Commerce Settings. The country's decimal places can itself be overridden
by using setDecimalPlaces
.
If set to null then the default country as defined in the iCM Commerce Settings will be used.
public void setCountryName(java.lang.String strCountryName)
When CountryName
is used that country, and its decimal places, will override the default country
and decimal places as defined in the iCM Commerce Settings. The country's decimal places can itself be overridden
by using setDecimalPlaces
.
If set to null then the default country as defined in the iCM Commerce Settings will be used.
strCountryName
- the official name of the country used to calculate country VAT, country net price and country gross
price.public double getCountryVat()
Use setCountryName
to specify the country used to calculate the country VAT, or
the default country specified in iCM will be used.
public void setCountryVat(double nCountryVat)
Use setCountryName
to specify the country used to calculate the country VAT, or
the default country specified in iCM will be used.
nCountryVat
- the product option's country VAT.public double getCountryNetPrice()
Use setCountryName
to specify the country used to calculate the country net
price, or the default country specified in iCM will be used.
public void setCountryNetPrice(double nCountryNetPrice)
Use setCountryName
to specify the country used to calculate the country net
price, or the default country specified in iCM will be used.
nCountryNetPrice
- the product option's country net price.public double getCountryGrossPrice()
Use setCountryName
to specify the country used to calculate the country gross
price, or the default country specified in iCM will be used.
public void setCountryGrossPrice(double nCountryGrossPrice)
Use setCountryName
to specify the country used to calculate the country gross
price, or the default country specified in iCM will be used.
nCountryGrossPrice
- the product option's country gross price.public double getVat()
The default country specified in iCM will be used.
public void setVat(double nVat)
The default country specified in iCM will be used.
nVat
- the default country's VAT to be applied to the product option.public double getNetPrice()
The default country specified in iCM will be used.
public void setNetPrice(double nNetPrice)
The default country specified in iCM will be used.
nNetPrice
- the default country's net price of the product option.public double getGrossPrice()
The default country specified in iCM will be used.
public void setGrossPrice(double nGrossPrice)
The default country specified in iCM will be used.
nGrossPrice
- the default country's gross price of the product option.public java.lang.Integer getDecimalPlaces()
When DecimalPlaces
is used its value will override the decimal places setting for a country
specified using setCountryName
and the decimal places as defined in the iCM
Commerce Settings.
If set to null and country name is specified using setCountryName
then the decimal places as
defined by that country will be used.
If set to null and country name is not specified then the decimal places as defined in the iCM Commerce Settings will be used.
public void setDecimalPlaces(java.lang.Integer nDecimalPlaces)
When DecimalPlaces
is used its value will override the decimal places setting for a country
specified using setCountryName
and the decimal places as defined in the iCM
Commerce Settings.
If set to null and country name is specified using setCountryName
then the decimal places as
defined by that country will be used.
If set to null and country name is not specified then the decimal places as defined in the iCM Commerce Settings will be used.
nDecimalPlaces
- the decimal places setting.public int getRelatedFormID()
public void setRelatedFormID(int id)
id
- the product type's related form ID.public void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method. Default is LEVEL_ALL.
Valid detail levels for a product option are :
LEVEL_ID
Retrieves the ProductOptionID.LEVEL_SUMMARY
Retrieves the ProductOptionID, ProductTypeID, ProductTypeName,
CustomerProductID.LEVEL_DETAIL
Will only retrieve visible product options. Retrieves all product option data;
calculated price, VAT and shipping information; associated attributes.LEVEL_ALL
Will only retrieve visible product options. Retrieves all product option data;
calculated price, VAT and shipping information; associated attributes and media.setDetailLevel
in class CSDatabaseItem
nDetailLevel
- the detail level to be used.CSParameterException
- if an invalid detail level is specified.public boolean exist() throws CSException
Use setProductOptionID
followed by exist
to ascertain if there is
a product option with the specified ID on the database.
exist
in class CSItem
true
if this product option exists on the database.CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSSecurityException
- if security has been breached.CSException
- the base class for exceptions thrown by this method.public void get() throws CSException
If it is not necessary to retrieve all the details of the product option then specify the amount of detail
required using the setDetailLevel
method before calling this method.
Use setProductOptionID
followed by get
to populate this
CSProductOption
object with the details of the product option identified by the specified ID.
Use setCountryName
to calculate country VAT, country net price and country gross
price for a country other than the default country as specified in iCM.
get
in class CSItem
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if the specified product option cannot be found on the database.CSSecurityException
- if security has been breached.CSException
- the base class for exceptions thrown by this method.public void update() throws CSException
CSProductOption
.
update
in class CSItem
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if one of the specified product option cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
CSProductOption
.
delete
in class CSItem
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if one of the specified product option cannot be found on the database.CSException
- the base class for exceptions thrown by this method.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.