public final class CSProductGroupMultiple extends CSItemMultiple
The CSProductGroupMultiple
class provides a method that retrieves several product groups from the
database. This method requires that certain database and key information (article ID, for example) be specified via
the set
methods provided, prior to its invocation.
All database access/connectivity is handled internally by the CSProductGroupMultiple
class.
CSProductGroup
,
Serialized FormLEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSProductGroupMultiple()
Creates an empty
CSProductGroupMultiple object. |
CSProductGroupMultiple(java.lang.String strPropertyFile)
Creates a new
CSProductGroupMultiple , specifying a properties file that contains all of the
database connection details. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Not currently implemented for
CSProductGroupMultiple . |
boolean |
exist()
Not currently implemented for
CSProductGroupMultiple . |
void |
get()
Retrieves the details of several product groups from the database.
|
int |
getArticleID()
Gets the article ID specified as key information.
|
java.lang.String |
getGroupList()
Gets the list of IDs of the website User Groups to which the specified user belongs.
|
boolean |
getIgnoreVisibility()
Gets the flag which indicates if the display state will be ignored when product groups are are to be retrieved.
|
int |
getParentProductGroupID()
Gets the parent product group ID specified as key information.
|
java.lang.String |
getProductGroupIDList()
Gets the list of product group IDs specified as key information.
|
boolean |
getRecurse()
Gets the flag which indicates if the product group hierarchy is to be recursed and retrieved.
|
int |
getUserID()
Gets the website User ID specified as key information.
|
boolean |
isIgnoreVisibility()
Deprecated.
Replaced by
getIgnoreVisibility() |
boolean |
isRecurse()
Deprecated.
Replaced by
getRecurse() |
void |
setArticleID(int nArticleID)
Specifies the ID of the article for which its related product groups are to be retrieved.
|
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setGroupList(java.lang.String strGroupList)
Sets a list of the IDs of the User Groups to which the specified user belongs.
|
void |
setIgnoreVisibility(boolean bIgnoreVisibility)
Sets the flag which indicates if the display state will be ignored when product groups are are to be retrieved.
|
void |
setParentProductGroupID(int nParentProductGroupID)
Specifies the ID of the product group for which its child product groups are to be retrieved.
|
void |
setProductGroupIDList(java.lang.String strProductGroupIDList)
Specifies the IDs of the product groups that are to be retrieved.
|
void |
setRecurse(boolean bRecurse)
Sets the flag which indicates if the product group hierarchy is to be recursed and retrieved.
|
void |
setSortOrder(java.lang.String strSortOrderList)
Sets the order in which the product groups are to be retrieved.
|
void |
setUserID(int nUserID)
Sets the website User ID to be used as key information.
|
void |
update()
Not currently implemented for
CSProductGroupMultiple . |
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 CSProductGroupMultiple()
CSProductGroupMultiple
object.
Use the various set
methods provided to initialise the CSProductGroupMultiple
object prior to invoking any of its query methods.
public CSProductGroupMultiple(java.lang.String strPropertyFile)
CSProductGroupMultiple
, specifying a properties file that contains all of the
database connection details.
Use the various set methods provided to initialise the CSProductGroupMultiple
object prior to
invoking any of its query methods.
strPropertyFile
- the property file that contains the connection details.public java.lang.String getProductGroupIDList()
public void setProductGroupIDList(java.lang.String strProductGroupIDList)
setProductGroupIDList
followed by a call to get
returns details of all the
specified product groups.
strProductGroupIDList
- a comma-separated list of product group IDs.public int getParentProductGroupID()
public void setParentProductGroupID(int nParentProductGroupID)
setParentProductGroupID
followed by a call to get
returns details of all the
product groups that are children of the specified product group.
nParentProductGroupID
- the parent product group ID.public int getArticleID()
public void setArticleID(int nArticleID)
setArticleID
followed by a call to get
returns details of all the product groups
that are related to the specified article.
nArticleID
- the article ID.public void setUserID(int nUserID)
Do not set User ID if you are only interested in unsecured articles, as this will result in a faster query.
setUserID
and an appropriate set
method for article ID followed by a call to
get
will return realted items for articles which are either unsecured articles, or secured articles
to which the specified has access.
nUserID
- the ID of the user to be used in article security checks.public int getUserID()
public void setGroupList(java.lang.String strGroupList)
Do not set this list unless User ID is also being specified using the setUserID
method.
Specifying the website User ID is sufficient to enable full article security to be implemented. However, for
performance reasons the list of group IDs should be also specified if it is already known.
strGroupList
- comma-separated list of the IDs of the website user groups to which the specified user belongs.public java.lang.String getGroupList()
This list is built up by the get
method only if a User ID is specified using the
setUserID
method.
public void setRecurse(boolean bRecurse)
Set true
to recurse and retrieve the product group hierarchy.
Set false
to not recurse the product group hierarchy.
Default is false
.
bRecurse
- the flag indicating if the product group hierarchy is to be recursed and retrieved.public boolean getRecurse()
Set true
to recurse and retrieve the product group hierarchy.
Set false
to not recurse the product group hierarchy.
Default is false
.
@Deprecated public boolean isRecurse()
getRecurse()
public void setIgnoreVisibility(boolean bIgnoreVisibility)
Set true
to return product groups regardless of their display setting.
Set false
to return only those product groups which are displayable.
Default is false
.
bIgnoreVisibility
- the flag indicating if the display state will be ignored when product groups are are to be retrieved.public boolean getIgnoreVisibility()
Set true
to return product groups regardless of their display setting.
Set false
to return only those product groups which are displayable.
Default is false
.
@Deprecated public boolean isIgnoreVisibility()
getIgnoreVisibility()
public void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method. Default is LEVEL_ALL.
Valid detail levels for a product group are :
LEVEL_ID
Retrieves the ProductGroupID.LEVEL_ALL
Retrieves the ParentGroupID, Name and Display.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 the setProductGroupIDList
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, "ParentGroupID DESC"
would order in descending order of the product group's parent product group name. By default,
setArticleID
and setParentProductGroupID
return
product groups in the order as configured via iCM.
Available sort orders are :
GroupID - order by the product group ID
ParentGroupID - order by the parent product group ID
GroupName - order by product group name
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
CSProductGroupMultiple
.
exist
in class CSItemMultiple
true
if all product groups 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 setProductGroupIDList
followed by get
to populate this
CSProductGroupMultiple
object with the details of the product groups specified in the list. The
retrieved product groups will appear within CSProductGroupMultiple
in the order that their IDs
appear within the supplied list. Key information set using setSortOrder
,
setMaxRows
and setStartRow
is not valid in this instance.
Use setParentProductGroupID
followed by get
to populate this
CSProductGroupMultiple
object with the details of the product groups that are children of the
specified product group.
Use setArticleID
followed by get
to populate this
CSProductGroupMultiple
object with the details of the product groups that are related to the
specified article.
Each retrieved product group is stored as a CSProductGroup
object within the item ArrayList
member of CSProductGroupMultiple
- use getItems
or
iterator
to access/navigate through them. These product groups will be stored in the
ArrayList
in the order specified using the setSortOrder
method, or
the default order as specified in iCM. However, if a list of product group IDs was specified, the product groups
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 product groups 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
CSProductGroupMultiple
.
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 product groups cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
CSProductGroupMultiple
.
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 product groups cannot be found on the database.CSException
- the base class for exceptions thrown by this method.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.