public final class CSAttributeMultiple extends CSItemMultiple
The CSAttributeMultiple
class provides a method that retrieves several attributes from the database.
This method requires that certain database and key information (product option ID, for example) be specified via the
set
methods provided, prior to its invocation.
All database access/connectivity is handled internally by the CSAttributeMultiple
class.
CSAttribute
,
Serialized FormLEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSAttributeMultiple()
Creates an empty
CSAttributeMultiple object. |
CSAttributeMultiple(java.lang.String strPropertyFile)
Creates a new
CSAttributeMultiple , specifying a properties file that contains all of the database
connection details. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Not currently implemented for
CSAttributeMultiple . |
boolean |
exist()
Not currently implemented for
CSAttributeMultiple . |
void |
get()
Retrieves the details of several attributes from the database.
|
java.lang.String |
getAttributeIDList()
Gets the list of attribute IDs specified as key information.
|
java.lang.String |
getAttributeNameList()
Gets the list of attribute names specified as key information.
|
int |
getAttributeTypeID()
Gets the attribute type ID specified as key information.
|
java.lang.String |
getAttributeTypeName()
Gets the attribute type name specified as key information.
|
int |
getProductOptionID()
Gets the product option ID specified as key information.
|
int |
getProductTypeID()
Gets the product type ID specified as key information.
|
void |
setAttributeIDList(java.lang.String strAttributeIDList)
Specifies the IDs of the attributes that are to be retrieved.
|
void |
setAttributeNameList(java.lang.String strAttributeNameList)
Specifies the names of the attributes that are to be retrieved.
|
void |
setAttributeTypeID(int nAttributeTypeID)
Specifies the ID of the attribute type for which its attributes are to be retrieved.
|
void |
setAttributeTypeName(java.lang.String strAttributeTypeName)
Specifies the name of the attribute type for which its attributes are to be retrieved.
|
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setProductOptionID(int nProductOptionID)
Specifies the ID of the product option for which its attributes are to be retrieved.
|
void |
setProductTypeID(int nProductTypeID)
Specifies the ID of the product type for which its attributes are to be retrieved.
|
void |
setSortOrder(java.lang.String strSortOrderList)
Sets the order in which the attributes are to be retrieved.
|
void |
update()
Not currently implemented for
CSAttributeMultiple . |
equals, getItems, getMaxRows, getSortOrder, getStartRow, iterator, setItems, setMaxRows, setStartRow, toString
clearRecordedGatewayMessages, clone, count, getCache, getCachingEnabled, getDatabaseVersion, getDatabaseVersion, getDebugOutput, getDetailLevel, getPreview, getPropertyFile, getPropertyFileExtension, getPropertyFilePathname, getRecordedGatewayMessages, getRecordGatewayMessages, getSendGatewayMessages, getUseCache, setDebugOutput, setPreview, setPropertyFile, setRecordGatewayMessages, setSendGatewayMessages, setUseCache
public CSAttributeMultiple()
CSAttributeMultiple
object.
Use the various set
methods provided to initialise the CSAttributeMultiple
object
prior to invoking any of its query methods.
public CSAttributeMultiple(java.lang.String strPropertyFile)
CSAttributeMultiple
, specifying a properties file that contains all of the database
connection details.
Use the various set methods provided to initialise the CSAttributeMultiple
object prior to
invoking any of its query methods.
strPropertyFile
- the property file that contains the connection details.public java.lang.String getAttributeIDList()
public void setAttributeIDList(java.lang.String strAttributeIDList)
setAttributeIDList
followed by a call to get
returns details of all the specified
attributes.
strAttributeIDList
- a comma-separated list of attribute IDs.public java.lang.String getAttributeNameList()
public void setAttributeNameList(java.lang.String strAttributeNameList)
setAttributeNameList
followed by a call to get
returns details of all the specified
attributes.
strAttributeNameList
- a comma-separated list of attribute names.public int getAttributeTypeID()
public void setAttributeTypeID(int nAttributeTypeID)
setAttributeTypeID
followed by a call to get
returns details of all the attributes
of the specified attribute type.
nAttributeTypeID
- the attribute type ID.public java.lang.String getAttributeTypeName()
public void setAttributeTypeName(java.lang.String strAttributeTypeName)
setAttributeTypeName
followed by a call to get
returns details of all the
attributes of the specified attribute type.
strAttributeTypeName
- the attribute type name.public int getProductOptionID()
public void setProductOptionID(int nProductOptionID)
setProductOptionID
followed by a call to get
returns details of all the attributes
of the specified product option.
nProductOptionID
- the product option ID.public int getProductTypeID()
public void setProductTypeID(int nProductTypeID)
setProductTypeID
followed by a call to get
returns details of all the attributes of
the specified product type.
nProductTypeID
- the product type ID.public void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method. Default is LEVEL_ALL.
Valid detail levels for an attribute are :
LEVEL_ID
Retrieves AttributeID only.LEVEL_SUMMARY
Retrieves AttributeName and CSAttributeType
details for this detail
level.LEVEL_ALL
Retrieves all attribute data and CSAttributeType
details for this
detail level.setDetailLevel
in class CSDatabaseItem
nDetailLevel
- the detail level to be used.CSParameterException
- if an invalid detail level is specified.public void setSortOrder(java.lang.String strSortOrderList) throws CSParameterException
This method should not be used if either the setAttributeIDList
or the
setAttributeNameList
key information is being supplied. One or more of the
available sort orders may be specified as a comma-delimited list. Use ASC or DESC to indicate the direction of
ordering for a sort order. For example, "TypeName DESC" would order in descending order of attribute type name.
If ProductTypeID is specified, the default ordering will be as specified in the product type section for its
associated attribute types and then by the ordering specified for the attributes within the ATTRIBUTES section,
i.e. 'ProductTypeDisplayOrder ASC,AttributeDisplayOrder ASC'
If ProductOptionID is specified, the returned attributes will be ordered as per the attribute type ordering for
the associated product type, i.e. 'ProductTypeDisplayOrder ASC'
Otherwise, the default ordering will be by the ordering specified for the attribute types/values within the
ATTRIBUTES section of iCM, i.e. 'TypeDisplayOrder ASC,AttributeDisplayOrder ASC'
Available sort orders are :
AttributeID - order by the attribute ID
AttributeName - order by the attribute name
AttributeDisplayOrder - order by the attribute display order
TypeID - order by the attribute type ID
TypeName - order by the attribute type name
TypeDisplayOrder - order by the display order of the attribute type
ProductTypeDisplayOrder - order by the display order of the product type, only valid with ProductTypeID and ProductOptionID key information
setSortOrder
in class CSItemMultiple
strSortOrderList
- a comma-separated list of one or more of the available sort orders.CSParameterException
- if an invalid sort order was specifiedpublic boolean exist() throws CSException
CSAttributeMultiple
.
exist
in class CSItemMultiple
true
if all attributes exist on the database.CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSException
- the base class for exceptions thrown by this method.public void get() throws CSException
Use get
without any key information to populate this CSAttributeMultiple
object
with the details of all the attributes from the database.
Use setAttributeIDList
followed by get
to populate this
CSAttributeMultiple
object with the details of the attributes specified in the list. The retrieved
attributes will appear within CSAttributeMultiple
in the order that their IDs appear within the
supplied list. Key information set using setMaxRows
and
setStartRow
is not valid in this instance.
Use setAttributeNameList
followed by get
to populate this
CSAttributeMultiple
object with the details of the attributes specified in the list. The retrieved
attributes will appear within CSAttributeMultiple
in the order that their names appear within the
supplied list. Key information set using setMaxRows
and
setStartRow
is not valid in this instance.
Use setAttributeTypeID
followed by get
to populate this
CSAttributeMultiple
object with the details of the attributes of the specified attribute type.
Use setAttributeTypeName
followed by get
to populate this
CSAttributeMultiple
object with the details of the attributes of the specified attribute type.
Use setProductOptionID
followed by get
to populate this
CSAttributeMultiple
object with the details of the related attributes of the specified product
option.
Use setProductTypeID
followed by get
to populate this
CSAttributeMultiple
object with the details of the related attributes of the specified product
type.
Each retrieved attribute is stored as a CSAttribute
object within the item ArrayList
member of CSAttributeMultiple
- use getItems
or iterator
to access/navigate through them. These attributes will be stored in the ArrayList
in the order
specified using the setSortOrder
method, or the default order as configured within
iCM i.e. by the product type's attribute type ordering if product type ID is being used, or by the main attribute
type ordering otherwise. However, if a list of attribute IDs or names was specified, the attributes are stored in
the same order as in the specified list.
get
in class CSItemMultiple
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 attributes 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
CSAttributeMultiple
.
update
in class CSItemMultiple
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 attributes cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
CSAttributeMultiple
.
delete
in class CSItemMultiple
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 attributes cannot be found on the database.CSException
- the base class for exceptions thrown by this method.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.