public class CSObjectMultiple extends CSItemMultiple
The CSObjectMultiple
class includes methods for the retrieval, update and removal of several objects.
It also provides a method that checks for the existence of several objects. All such methods require that certain
database and key information (object IDs, for example) be specified via the set
methods provided,
prior to their invocation.
The ability to search object data for specific information is also handled by this class. Values of all fields that have been flagged as searchable within the OBJECT TYPES section of iCM can be searched using this class.
All database access/connectivity is handled internally by the CSObjectMultiple
class.
EXAMPLES
Retrieve full details of the two objects whose IDs are 1204 and 1278 respectively, change their email address, and then save them back again :
try
{
CSObjectMultiple obj = new CSObjectMultiple("dbprops.dat");
obj.setObjectList("1204,1278");
obj.setDetailLevel(CSObjectMultiple.LEVEL_SUMMARY);
obj.get();
ArrayList arrObj = obj.getItems();
((CSObject)arrObj.get(0)).setItem("EMAILADDR","tech@gossinteractive.com");
((CSObject)arrObj.get(1)).setItem("EMAILADDR","tech@gossinteractive.com");
obj.update();
}
catch ( CSException e )
{
System.err.println("ERROR : " + e.getMessage());
}
Remove the user profile object with the label 1806
:
try
{
CSObjectMultiple obj = new CSObjectMultiple("dbprops.dat");
obj.setLabelList("1806");
obj.setType("UserProfile");
obj.delete();
}
catch ( CSException e )
{
System.err.println("ERROR : " + e.getMessage());
}
Search for the IDs of all objects whose email address ends with @gossinteractive.com
:
try
{
CSObjectMultiple obj = new CSObjectMultiple("dbprops.dat");
obj.setUseSearchables(true);
obj.setVar("EMAILADDR");
obj.setValue("%@gossinteractive.com");
obj.setLogic(CSObjectMultiple.LOGIC_LIKE);
obj.setType("UserProfile");
obj.setDetailLevel(CSObjectMultiple.LEVEL_ID);
obj.get();
}
catch ( CSException e )
{
System.err.println("ERROR : " + e.getMessage());
}
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DIRECTION_BOTH
A valid value for the
setRelatedDirection method. |
static java.lang.String |
DIRECTION_DESTINATION
A valid value for the
setRelatedDirection method. |
static java.lang.String |
DIRECTION_SOURCE
A valid value for the
setRelatedDirection method. |
static java.lang.String |
LOGIC_BETWEEN
One of the logic values that may be passed to the
setLogic method. |
static java.lang.String |
LOGIC_CONTAINS
One of the logic values that may be passed to the
setLogic method. |
static java.lang.String |
LOGIC_EQUAL
One of the logic values that may be passed to the
setLogic method. |
static java.lang.String |
LOGIC_FUZZY
One of the logic values that may be passed to the
setLogic method. |
static java.lang.String |
LOGIC_GREATERTHAN
One of the logic values that may be passed to the
setLogic method. |
static java.lang.String |
LOGIC_GREATERTHANEQUAL
One of the logic values that may be passed to the
setLogic method. |
static java.lang.String |
LOGIC_LESSTHAN
One of the logic values that may be passed to the
setLogic method. |
static java.lang.String |
LOGIC_LESSTHANEQUAL
One of the logic values that may be passed to the
setLogic method. |
static java.lang.String |
LOGIC_LIKE
One of the logic values that may be passed to the
setLogic method. |
static int |
OBJECT_CREATED
A valid value that can be passed to
setDateAction(int) . |
static int |
OBJECT_LAST_UPDATED
A valid value that can be passed to
setDateAction(int)
OBJECT_LAST_UPDATED indicates that just objects updated within the specified time frame/by the specified user should be retrieved. |
LEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSObjectMultiple()
Creates an empty
CSObjectMultiple object. |
CSObjectMultiple(java.lang.String strPropertyFile)
Creates an empty
CSObjectMultiple object, specifying a property file that contains all of the
database connection details. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Removes several iCM objects from the database.
|
boolean |
exist()
Checks for the existence of several iCM objects on the database.
|
java.lang.String |
generateXMLDocAsString(java.lang.String exportType)
Returns a string containing an XML document which represents the objects contained in the CSObjectMultiple that are of the specified type.
|
void |
get()
Retrieves the details of several iCM objects from the database.
|
int |
getDateAction()
Gets the type of events that are of interest when
setStartDate , and setEndDate are used. |
java.util.Date |
getEndDate()
Gets the end date of the time frame used by
setDateAction(int) . |
java.lang.String |
getLabelGreaterThan()
Gets a string which the label should be greater than.
|
java.lang.String |
getLabelGreaterThanOrEquals()
Gets a string which the label should be greater than or equal to.
|
java.lang.String |
getLabelLessThan()
Gets a string which the label should be less than.
|
java.lang.String |
getLabelLessThanOrEquals()
Gets a string which the label should be less than or equal to.
|
java.lang.String |
getLabelLike()
Gets the pattern which the label should match according to the SQL LIKE operator.
|
java.lang.String |
getLabelList()
Gets the list of object labels currently specified as key information.
|
java.lang.String |
getLogic()
Relevant only when the
setUseSearchables method is being used. |
java.util.ArrayList |
getObjectArray()
Deprecated.
Use
CSItemMultiple.getItems() instead. |
java.lang.String |
getObjectList()
Gets the list of object IDs currently specified as key information.
|
java.lang.Boolean |
getPublicOnly()
If this property is set to true, the only objects returned or counted will be objects that have a type
identified as public which is also not one of a limited set of public types reserved for the use of iCM
|
java.lang.String |
getRelatedDirection()
Gets the direction of the relationship between the object specified via the
setRelatedObjectID and those to be retrieved via the get method. |
int |
getRelatedObjectID()
Gets the related object ID currently specified as key information.
|
java.util.Map<java.lang.String,java.lang.Float> |
getResultScores() |
java.lang.String |
getSolrURL()
Gets the URL of the Solr server
Must be supplied when
setUseSearchables is set to true . |
java.util.Date |
getStartDate()
Gets the start date of the time frame used by
setDateAction(int) . |
boolean |
getTolerateNotFound()
Set true to prevent throwing on ID or TYPE/LABEL not found
|
java.lang.String |
getType()
Gets the object definition/type currently specified as key information.
|
boolean |
getUpdateData()
Indicates whether or not any properties that exist in the type definition
should be added to any existing object data when the object data is
retrieved.
|
int |
getUser()
Gets the user id that the CreatedBy/LastUpdatedBy property of retrieved objects should match.
|
int |
getUserAction()
Gets the type of events that are of interest when
setUser , or setUsername(String) are used. |
java.lang.String |
getUsername()
Gets the username that the CreatedBy/LastUpdatedBy property of retrieved objects should match.
|
java.lang.String |
getUserProfileType()
Gets the object type that is used to store user profile information.
|
boolean |
getUseSearchables()
Determines whether this object has been requested to perform a search against its searchable values or not.
|
java.lang.String |
getValue()
Relevant only when the
setUseSearchables method is being used. |
java.lang.String |
getValue2()
Relevant only when the
setUseSearchables method is being used. |
java.lang.String |
getVar()
Relevant only when the
setUseSearchables method is being used. |
java.lang.String |
getVarSubtype()
Relevant only when the
setUseSearchables method is being used. |
java.lang.String |
getVarType()
Relevant only when the
setUseSearchables method is being used. |
void |
setDateAction(int nDateAction)
Sets the type of events that are of interest when
setStartDate , and setEndDate are used. |
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setEndDate(java.util.Date value)
Sets the end date of the time frame used by
setDateAction(int) . |
void |
setLabelGreaterThan(java.lang.String value)
Sets a string which the label should be greater than.
|
void |
setLabelGreaterThanOrEquals(java.lang.String value)
Sets a string which the label should be greater than or equal to.
|
void |
setLabelLessThan(java.lang.String value)
Sets a string which the label should be less than.
|
void |
setLabelLessThanOrEquals(java.lang.String value)
Sets a string which the label should be less than or equal to.
|
void |
setLabelLike(java.lang.String strLabelLike)
Sets the pattern which the label should match according to the SQL LIKE operator.
|
void |
setLabelList(java.lang.String strLabelList)
Sets the list of object labels to be used along with the type (
setType ) as key
information. |
void |
setLogic(java.lang.String strLogic)
Use in conjunction with the
setUseSearchables method only. |
void |
setObjectArray(java.util.ArrayList arrObjectArray)
Deprecated.
Use
CSItemMultiple.setItems(ArrayList) instead. |
void |
setObjectList(java.lang.String strObjectList)
Sets the list of object IDs to be used as key information.
|
void |
setPublicOnly(java.lang.Boolean publicOnly)
If this property is set to true, the only objects returned or counted will be objects that have a type
identified as public which is also not one of a limited set of public types reserved for the use of iCM.
|
void |
setRelatedDirection(java.lang.String strRelatedDirection)
Sets the direction of the relationship between the object specified via the
setRelatedObjectID and those to be retrieved via the get method. |
void |
setRelatedObjectID(int nRelatedObjectID)
Sets the related object ID to be used as key information.
|
void |
setSolrURL(java.lang.String solrURL)
Gets the URL of the Solr server
Must be supplied when
setUseSearchables is set to true . |
void |
setSortOrder(java.lang.String strSortOrderList)
Sets the order in which the objects are to be retrieved.
|
void |
setStartDate(java.util.Date value)
Sets the start date of the time frame used by
setDateAction(int) . |
void |
setTolerateNotFound(boolean tolerateNotFound)
Set true to prevent throwing on ID or TYPE/LABEL not found
|
void |
setType(java.lang.String strType)
Sets the object definition/type to be used as key information.
|
void |
setUpdateData(boolean value)
Indicates whether or not any properties that exist in the type definition
should be added to any existing object data when the object data is
retrieved.
|
void |
setUser(int nUserId)
Sets the user id that the CreatedBy/LastUpdatedBy property of retrieved objects should match.
|
void |
setUserAction(int value)
Sets the type of changes that are of interest when
setUser , or setUsername(String) are used. |
void |
setUsername(java.lang.String strUsername)
Sets the username that the CreatedBy/LastUpdatedBy property of retrieved objects should match.
|
void |
setUserProfileType(java.lang.String strType)
Sets the object type that is used to store user profile information.
|
void |
setUseSearchables(boolean bUseSearchables)
Specifies whether to perform a search against the searchable values of an object or not.
|
void |
setValue(java.lang.String strValue)
Use in conjunction with the
setUseSearchables method only. |
void |
setValue2(java.lang.String strValue)
Use in conjunction with the
setUseSearchables method only. |
void |
setVar(java.lang.String strVar)
Use in conjunction with the
setUseSearchables method only. |
void |
setVarSubtype(java.lang.String strVarSubtype)
Use in conjunction with the
setUseSearchables method only. |
void |
setVarType(java.lang.String strVarType)
Use in conjunction with the
setUseSearchables method only. |
java.lang.String |
toString()
Outputs the contents of this
CSObjectMultiple object to a String object in a
user-friendly format. |
void |
update()
Updates the details of several iCM objects on the database.
|
equals, getItems, getMaxRows, getSortOrder, getStartRow, iterator, setItems, setMaxRows, setStartRow
clearRecordedGatewayMessages, clone, count, getCache, getCachingEnabled, getDatabaseVersion, getDatabaseVersion, getDebugOutput, getDetailLevel, getPreview, getPropertyFile, getPropertyFileExtension, getPropertyFilePathname, getRecordedGatewayMessages, getRecordGatewayMessages, getSendGatewayMessages, getUseCache, setDebugOutput, setPreview, setPropertyFile, setRecordGatewayMessages, setSendGatewayMessages, setUseCache
public static final java.lang.String DIRECTION_BOTH
setRelatedDirection
method.
DIRECTION_BOTH
indicates ANY relationship between the object specified via
setRelatedObjectID
and other iCM objects.public static final java.lang.String DIRECTION_SOURCE
setRelatedDirection
method.
DIRECTION_SOURCE
indicates relationships whereby the object specified via the
setRelatedObjectID
method is a related object of one or more iCM objects.public static final java.lang.String DIRECTION_DESTINATION
setRelatedDirection
method.
DIRECTION_DESTINATION
indicates relationships whereby the object specified via the
setRelatedObjectID
method has one or more iCM objects as its related object(s).public static final int OBJECT_CREATED
setDateAction(int)
.
OBJECT_CREATED
indicates that just objects created within the specified time frame/by the specified user should be retrieved.
Refer to the help for setDateAction(int)
for more information.
public static final int OBJECT_LAST_UPDATED
setDateAction(int)
OBJECT_LAST_UPDATED
indicates that just objects updated within the specified time frame/by the specified user should be retrieved.
Refer to the help for setDateAction(int)
for more information.
public static final java.lang.String LOGIC_LIKE
setLogic
method.
LOGIC_LIKE
indicates that the contents of the field specified via the
setVar
method will be compared to the value specified via the
setValue
method. The %
character may be used to indicate a wildcard
match. For example, %@gossinteractive.com
will match if the field's value ends with
@gossinteractive.com
. If no %
is found within the supplied value, the two must be an
exact match.
public static final java.lang.String LOGIC_BETWEEN
setLogic
method.
LOGIC_BETWEEN
will find a match if the contents of the element specified via the
setVar
method lies within the range of values specified via the
setValue
and setValue2
methods.
public static final java.lang.String LOGIC_CONTAINS
setLogic
method.
LOGIC_CONTAINS
will find a match if the the element specified via the
setVar
method contains the value specified via the
setValue
method.
public static final java.lang.String LOGIC_GREATERTHAN
setLogic
method.
LOGIC_GREATERTHAN
will find a match if the contents of the field specified via the
setVar
method are deemed to be greater than the value specified via the
setValue
method.
public static final java.lang.String LOGIC_LESSTHAN
setLogic
method.
LOGIC_LESSTHAN
will find a match if the contents of the field specified via the
setVar
method are deemed to be less than the value specified via the
setValue
method.
public static final java.lang.String LOGIC_LESSTHANEQUAL
setLogic
method.
LOGIC_LESSTHANEQUAL
will find a match if the contents of the field specified via the
setVar
method are deemed to be less than or equal to the value specified via the
setValue
method.
public static final java.lang.String LOGIC_GREATERTHANEQUAL
setLogic
method.
LOGIC_GREATERTHANEQUAL
will find a match if the contents of the field specified via the
setVar
method are deemed to be greater than or equal to the value specified via the
setValue
method.
public static final java.lang.String LOGIC_EQUAL
setLogic
method.
LOGIC_EQUAL
will find a match if the contents of the field specified via the
setVar
method are deemed to be equal to the value specified via the
setValue
method.
public static final java.lang.String LOGIC_FUZZY
setLogic
method.
LOGIC_FUZZY
will find a match if the contents of the field specified via the
setVar
method are deemed to be approximately equal to the value specified via the
setValue
method according to the edit distance optionally specified by setValue2
which should be greater than 0 and less than 1 (1 is not a valid value). The default is 0.5.
public CSObjectMultiple()
CSObjectMultiple
object.
Use the various set
methods provided to initialise the CSObjectMultiple
object
prior to invoking any of its query methods.
public CSObjectMultiple(java.lang.String strPropertyFile)
CSObjectMultiple
object, specifying a property file that contains all of the
database connection details.
Use the various set methods provided to initialise the CSObjectMultiple
object prior to invoking
any of its query methods.
strPropertyFile
- the name of the property file from which the database connection details are to be readpublic void setDateAction(int nDateAction) throws CSParameterException
setStartDate
, and setEndDate
are used.
Valid actions are :
More than one action can be specified by ORing valid actions together. For example, specify CSObjectMultiple.OBJECT_CREATED | CSObjectMultiple.OBJECT_LAST_UPDATED to retrieve both created and updated objects.
Use in conjunction with setStartDate
, and setEndDate
to indicate the type of change and the time frame within which the changes need to have occurred.
CSParameterException
- CSParameterExceptionpublic int getDateAction()
setStartDate
, and setEndDate
are used.
public void setStartDate(java.util.Date value)
setDateAction(int)
.
Objects created/modified after this date and before the date specified via setEndDate(Date)
(inclusive)
will be retrieved. Defaults to 7 days before the current date.
Use in conjunction with setDateAction
to indicate
the changes that are of interest.
public java.util.Date getStartDate()
setDateAction(int)
.
public void setEndDate(java.util.Date value)
setDateAction(int)
.
Objects created/modified before this date and after the date specified via setEndDate
(inclusive)
will be retrieved. Defaults to the current date.
Use in conjunction with setDateAction
to indicate
the changes that are of interest.
public java.util.Date getEndDate()
setDateAction(int)
.
public void setUserAction(int value) throws CSParameterException
setUser
, or setUsername(String)
are used.
Valid actions are :
More than one action can be specified by ORing valid actions together. The default, for example, is CSObjectMultiple.OBJECT_CREATED | CSObjectMultiple.OBJECT_LAST_UPDATED.CSParameterException
- CSParameterExceptionpublic int getUserAction()
setUser
, or setUsername(String)
are used.
public void setUser(int nUserId)
nUserId
- The user id to be used for queryingpublic int getUser()
public void setUsername(java.lang.String strUsername)
strUsername
- The username to be used for queryingpublic java.lang.String getUsername()
public boolean getTolerateNotFound()
public void setTolerateNotFound(boolean tolerateNotFound)
public void setUserProfileType(java.lang.String strType)
The type is used to identify insert/update/delete of UserProfile objects so that the site user search index is kept up to date.
strType
- The object typepublic java.lang.String getUserProfileType()
The type is used to identify insert/update/delete of UserProfile objects so that the site user search index is kept up to date.
public void setUseSearchables(boolean bUseSearchables)
The object definition CSObjectDefinition
associated with this CSObject
will indicate which
values should be made 'searchable'. Specify true
here in order to retrieve the IDs of all objects
whose searchable data matches the criteria specified via the setVar
,
setValue
and setLogic
methods. The
setType
method may also be used to restrict the search to a specific type (e.g.
UserProfile) of object. Restrict this further by using the setLabelList
method as
well to ensure that only a particular objects of the specified type are searched.
bUseSearchables
- Set to true
to perform a searchpublic boolean getUseSearchables()
true
if a search is to be performedpublic void setSolrURL(java.lang.String solrURL)
Must be supplied when setUseSearchables
is set to true
.
public java.lang.String getSolrURL()
Must be supplied when setUseSearchables
is set to true
.
public void setVar(java.lang.String strVar)
setUseSearchables
method only.
Specifies the name of the data field whose value is to be compared to the value supplied via the
setValue
method.
strVar
- The fully qualified field name, for example BILLTO.ELECTRONICINFO.EMAIL
public java.lang.String getVar()
setUseSearchables
method is being used.
Gets the name of the field whose value is to be compared to the value supplied via the
setValue
method.
BILLTO.ELECTRONICINFO.EMAIL
public void setVarType(java.lang.String strVarType)
setUseSearchables
method only.
Specifies the data type of the data field whose value is to be compared to the value supplied via the
setValue
method. The VarType
value may be used in place of or in
addition to the setType
method. When used in addion to setType
it removes the need to load the data type definition in order to ascertain the data type from the
original object type definition.
When specified, VarType
must have one of the following
legal values (see the iCM object type definition for the correct selection for a particular case) :
char
- a text valuelongchar
- a long text valueinteger
- an integer valuenumeric
- a floating point valuedatetime
- a timestamp valuestrVarType
- The data type of the Value
, as above.public java.lang.String getVarType()
setUseSearchables
method is being used.
Gets the data type of the field whose value is to be compared to the value supplied via the
setValue
method.
setVarType
method.public void setVarSubtype(java.lang.String strVarSubtype)
setUseSearchables
method only.
Specifies the data subtype of the data field whose value is to be compared to the value supplied via the
setValue
method. The VarSubtype
value may be used in place of or in
addition to the setType
method. When used in addition to setType
it removes the need to load the data type definition in order to ascertain the data type from the
original object type definition.
When specified, Varsubtype
must be a valid Solr object field prefix e.g. OBJECT_LL_
strVarSubtype
- The data type of the Value
, as above.public java.lang.String getVarSubtype()
setUseSearchables
method is being used.
Gets the data subtype of the field whose value is to be compared to the value supplied via the
setValue
method.
setVarSubtype
method.public void setValue(java.lang.String strValue)
setUseSearchables
method only.
Specifies the value that is to be used as the only or lower range setting in a filtering operation on the field
whose fully qualified name is supplied via the setVar
method.
Value
, setVar
and setLogic
can be used to
filter the retrieved objects. setValue
specifies the value that is to be compared to the contents
of the object property whose name is supplied via the setVar()
method. The operation specified via
the setLogic()
method will determine the type of comparison undertaken.
If specifying a date value, the date should be specified using the date formatter for the current locale as this will also be used to interpret the supplied string. For example:
objObjectMultiple.setValue( DateFormat.getDateInstance().format(dtMyDate) );
dtMyDate
is an object of type java.util.Date
.
When the setLogic
method is used to specify a LOGIC_BETWEEN
operation, the
setValue2
method should be used to supply the upper range limit for the filtering
operation.
strValue
- The filter valuepublic java.lang.String getValue()
setUseSearchables
method is being used.
Gets the value that is to be used as the only or lower range setting in a filtering operation on the field whose
fully qualified name is supplied via the setVar
method.
Value
, setVar
and setLogic
can be used to
filter the retrieved objects. setValue
specifies the value that is to be compared to the contents
of the object property column whose fully qualified name is supplied via the setVar()
method. The
operation specified via the setLogic()
method will determine the type of comparison undertaken.
public void setValue2(java.lang.String strValue)
setUseSearchables
method only.
Specifies the value that is to be used as the second (upper) filter value in a LOGIC_BETWEEN
filtering operation. The Value2
setting is only used when setLogic
is
used to set a LOGIC_BETWEEN
. filtering logic. It is ignored in all other cases.
Value
and Value2
represent the lower and upper boundaries respectively of the
allowed range. If specifying a date value, the date should be specified using the date formatter for the current
locale as this will also be used to interpret the supplied string. (See setValue
for an
example.)
See the setVar
, setLogic
and
setValue
documentation for details of setting up and using the filtering process.
strValue
- The filter valuepublic java.lang.String getValue2()
setUseSearchables
method is being used.
Gets the value that is to be used as the second (upper) filter value in a LOGIC_BETWEEN
filtering
operation. The Value2
setting is only used when setLogic
is used to set
a LOGIC_BETWEEN
. filtering logic. It is ignored in all other cases.
Value
and Value2
represent the lower and upper boundaries respectively of the
allowed range.
See the setVar
, setLogic
and
setValue
documentation for details of setting up and using the filtering process.
public void setLogic(java.lang.String strLogic) throws CSParameterException
setUseSearchables
method only.
Specifies the logic to be used when comparing the contents of the field specified via the
setVar
method and the value specified via the setValue
and
optionally the setValue2
methods.
Valid logic operations are :
CSObjectMultiple.LOGIC_EQUAL
- the field's value must be equal to the supplied value
CSObjectMultiple.LOGIC_LESSTHAN
- the field's value must be less than the supplied value
CSObjectMultiple.LOGIC_LESSTHANEQUAL
- the field's value must be less than or equal to the
supplied value
CSObjectMultiple.LOGIC_GREATERTHAN
- the field's value must be greater than the supplied
value
CSObjectMultiple.LOGIC_GREATERTHANEQUAL
- the field's value must be greater than or equal to
the supplied value
CSObjectMultiple.LOGIC_LIKE
- the field's value must be LIKE
the supplied
value, %
can be used as a wildcard character
CSObjectMultiple.LOGIC_BETWEEN
- the field's value must lie BETWEEN
the two
supplied values (Value and Value2)
strLogic
- One of the above logic valuesCSParameterException
- if an invalid logic value is specifiedpublic java.lang.String getLogic()
setUseSearchables
method is being used.
Gets the logic operation that is to be used when comparing the contents of the field specified via the
setVar
method and the value specified via the setValue
method.
Valid logic operations are :
CSObjectMultiple.LOGIC_EQUAL
- the field's value must be equal to the supplied value
CSObjectMultiple.LOGIC_LESSTHAN
- the field's value must be less than the supplied value
CSObjectMultiple.LOGIC_LESSTHANEQUAL
- the field's value must be less than or equal to the
supplied value
CSObjectMultiple.LOGIC_GREATERTHAN
- the field's value must be greater than the supplied
value
CSObjectMultiple.LOGIC_GREATERTHANEQUAL
- the field's value must be greater than or equal to
the supplied value
CSObjectMultiple.LOGIC_LIKE
- the field's value must be LIKE
the the supplied
value, %
can be used as a wildcard character
CSObjectMultiple.LOGIC_BETWEEN
- the field's value must lie BETWEEN
the two
supplied values (Value and Value2)
public void setRelatedDirection(java.lang.String strRelatedDirection)
setRelatedObjectID
and those to be retrieved via the get
method.
Valid values are :
BOTH
- the object supplied is either a related object of the iCM objects to be retrieved, or
has those objects as its related objects
SOURCE
- the iCM object(s) to be retrieved are related objects of the one supplied
DESTINATION
- the object supplied is a related object of the iCM objects to be retrieved
strRelatedDirection
- The direction of the relationshippublic java.lang.String getRelatedDirection()
setRelatedObjectID
and those to be retrieved via the get
method.
Valid values are :
BOTH
- the object supplied is either a related object of the iCM objects to be retrieved, or
has those objects as its related objects
SOURCE
- the iCM object(s) to be retrieved are related objects of the one supplied
DESTINATION
- the object supplied is a related object of the iCM objects to be retrieved
public void setType(java.lang.String strType)
setLabelList
) as an alternative to specifying a list of object IDs (setObjectList
).
It can also be used in conjunction with the setUseSearchables
method to
perform a search against the searchable data of a particular type of object e.g. UserProfile.
strType
- The object definition/type e.g. 'UserProfile'public java.lang.String getType()
setLabelList
) as an alternative to specifying a list of
object IDs (setObjectList
).
public void setPublicOnly(java.lang.Boolean publicOnly)
publicOnly
- Whether or not the query will only return/count public objectspublic java.lang.Boolean getPublicOnly()
public void setObjectList(java.lang.String strObjectList)
Use setObjectList
followed by a call to exist
to determine whether the listed
objects exist on the database.
Use setObjectList
followed by a call to get
to retrieve details of the listed
objects from the database.
Use setObjectList
followed by a call to delete
to remove the listed objects from
the database.
strObjectList
- A comma-separated list of object IDspublic java.lang.String getObjectList()
public void setLabelList(java.lang.String strLabelList)
setType
) as key
information. A type and list of labels can be specified as alternative key information to the object list (setObjectList
).
Use setLabelList
followed by a call to exist
to determine whether the listed
objects exist on the database.
Use setLabelList
followed by a call to get
to retrieve details of the listed
objects from the database. This can also be used in conjunction with setType
and
setUseSearchables
to search against the data for a particular set of objects
only.
Use setLabelList
followed by a call to delete
to remove the listed objects from
the database.
strLabelList
- A comma-separated list of object labelspublic java.lang.String getLabelList()
public void setLabelLike(java.lang.String strLabelLike)
Use setLabelLike
to specify a label pattern to match against. This may optionally be used in conjunction
with setType
. When using setLabelLike
, setLabelList
should not be specified.
Use setLabelLike
followed by a call to get
to
retrieve details of objects with labels that match the supplied pattern from the database.
setLabelLike
can also be used in conjunction with setUseSearchables
in order
to query against the searchable data for only objects that have a label matching the supplied pattern.
strLabelLike
- A pattern which the object label should match according to the SQL LIKE operatorpublic java.lang.String getLabelLike()
public void setLabelGreaterThan(java.lang.String value)
Sets a string which the label should be greater than. Use setLabelGreaterThan
to specify a label string
to compare against. This should used in conjunction with setType
. When using
setLabelGreaterThan
, setLabelList
should not be specified.
Use setLabelGreaterThan
in conjunction with setType
followed by a call to get
to retrieve details of objects that have labels greater than the specified string.
setLabelGreaterThan
can also be used in conjunction with setUseSearchables
in
order to query against the searchable data for only objects that have labels greater than the specified string.
value
- A string which the label should be greater thanpublic java.lang.String getLabelGreaterThan()
public void setLabelGreaterThanOrEquals(java.lang.String value)
Sets a string which the label should be greater than or equal to. Use setLabelGreaterThanOrEquals
to
specify a label string to compare against. This should used in conjunction with setType
. When
using setLabelGreaterThanOrEquals
, setLabelList
should not be specified.
Use setLabelGreaterThanOrEquals
in conjunction with setType
followed by a call to
get
to retrieve details of objects that have labels greater than or equal to the
specified string. setLabelGreaterThanOrEquals
can also be used in conjunction with
setUseSearchables
in order to query against the searchable data for only objects that
have labels greater than or equal to the specified string.
value
- A string which the label should be greater than or equal topublic java.lang.String getLabelGreaterThanOrEquals()
public void setLabelLessThan(java.lang.String value)
Sets a string which the label should be less than. Use setLabelLessThan
to specify a label string to
compare against. This should used in conjunction with setType
. When using
setLabelLessThan
, setLabelList
should not be specified.
Use setLabelLessThan
in conjunction with setType
followed by a call to get
to retrieve details of objects that have labels less than the specified string.
setLabelLessThan
can also be used in conjunction with setUseSearchables
in
order to query against the searchable data for only objects that have labels less than the specified string.
value
- A string which the label should be less thanpublic java.lang.String getLabelLessThan()
public void setLabelLessThanOrEquals(java.lang.String value)
Sets a string which the label should be less than or equal to. Use setLabelLessThanOrEquals
to specify
a label string to compare against. This should used in conjunction with setType
. When using
setLabelLessThanOrEquals
, setLabelList
should not be specified.
Use setLabelLessThanOrEquals
in conjunction with setType
followed by a call to
get
to retrieve details of objects that have labels less than or equal to the
specified string. setLabelLessThanOrEquals
can also be used in conjunction with
setUseSearchables
in order to query against the searchable data for only objects that
have labels less than or equal to the specified string.
value
- A string which the label should be less than or equal topublic java.lang.String getLabelLessThanOrEquals()
public void setRelatedObjectID(int nRelatedObjectID)
Use setRelatedObjectID
followed by a call to get
to retrieve details of all objects
that are related to the one specified. The direction of the relationship must be supplied via the
setRelatedDirection
method.
nRelatedObjectID
- The ID of the object whose related objects are requiredpublic int getRelatedObjectID()
public void setObjectArray(java.util.ArrayList arrObjectArray)
CSItemMultiple.setItems(ArrayList)
instead.CSObject
s that contain the details to be written to the database by the
update
method.
arrObjectArray
- One or more CSObject
objectspublic java.util.ArrayList getObjectArray()
CSItemMultiple.getItems()
instead.CSObject
s containing the details that are to be written to the database by the
update
method.
ArrayList
containing one or more CSObject
objectspublic void setUpdateData(boolean value)
value
- true if any missing properties in the object data that exist in the type
definition should be added automaticallypublic boolean getUpdateData()
public void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method.
Valid detail levels for an object are :
CSObjectMultiple.LEVEL_ID - the object ID
CSObjectMultiple.LEVEL_SUMMARY - the object type and label
CSObjectMultiple.LEVEL_DETAIL - the object's date and time created/last updated, and the name of the person that create/last updated it
CSObjectMultiple.LEVEL_ALL - the object's data
Each detail level processes the information specified alongside it in addition to the information specified for all detail levels listed above it.
setDetailLevel
in class CSDatabaseItem
nDetailLevel
- The detail level to be usedCSParameterException
- if an invalid detail level is specified.public void setSortOrder(java.lang.String strSortOrderList) throws CSParameterException
This method should not be used if the setObjectList
or
setLabelList
key information is supplied. Otherwise, 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, "OBJECTID DESC" would order in descending object ID order. ASC is assumed if neither
ASC or DESC are specified. The default sort order when performing a search (setUseSearchables
)
is ASC (ascending value order). Otherwise, it is DATETIMECREATED DESC,DATETIMELASTUPDATED DESC.
Available sort orders when not in search mode are :
OBJECTID - order by object ID
TYPE - order by object type
LABEL - order by object label
DATETIMECREATED - order by creation date
DATETIMELASTUPDATED - order by date time last updated
Available sort orders when in search mode are :
ASC - ascending value order
DESC - descending value order
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 specified.public boolean exist() throws CSException
Use setObjectList
followed by exist
to determine whether objects
with the specified IDs exist on the database.
Use setLabelList
and setType
followed by
exist
to determine whether objects of the supplied type with the specified labels exist.
exist
in class CSItemMultiple
true
if all listed objects exist on the databaseCSParameterException
- if an invalid combination of key information has been suppliedCSDatabaseException
- if there are problems accessing the databaseCSException
- the base class for exceptions thrown by this method.public void get() throws CSException
Use setObjectList
followed by get
to populate this
CSObjectMultiple
object with details of all the objects identified by the specified IDs. The
retrieved objects will appear within CSObjectMultiple
in the order that their IDs appear within
the supplied list - as such, setSortOrder
, setMaxRows
and
setStartRow
are not valid in this instance.
Use setLabelList
and setType
followed by get
to populate this CSObjectMultiple
object with the details of all objects of that type (e.g.
'UserProfile') whose label is listed. The retrieved objects will appear within CSObjectMultiple
in
the order that their labels appear within the supplied list - as such, setSortOrder
,
setMaxRows
and setStartRow
are not valid in this instance.
Use setRelatedObjectID
followed by get
to populate this
CSObjectMultiple
object with the details of all the objects that are related to the one supplied.
The direction of the relationship(s) must be provided via the
setRelatedDirection
method.} By default the objects will be retrieved in
descending creation date and last updated order. This can be overridden if required by using the
setSortOrder
method. The setStartRow
and setMaxRows
methods can be
used to restrict the number of objects that are retrieved.
Use setType
followed by get
to populate this
CSObjectMultiple
object with the details of all the objects that use the supplied definition. By
default the objects will be retrieved in descending creation date and last updated order. This can be overridden
if required by using the setSortOrder
method. The setStartRow
and
setMaxRows
methods can be used to restrict the number of objects that are retrieved.
If none of setObjectList
, setLabelList
, setRelatedObjectID
or
setType
are specified, ALL objects will be retrieved.
As an alternative to any of the above, the details of all objects whose 'searchable' values match a set of
criteria, can be retrieved by using the setUseSearchables
,
setVar
, setValue
and setLogic
methods. This object's definition will determine which values are currently flagged as searchable - refer to the
OBJECT TYPES section of iCM. By default the objects will be retrieved in ascending value order. This can be
overridden if required by using the setSortOrder
method. The setType
and
setLabelList
methods may also be used in conjunction with these search methods to
restrict the objects that are searched.
Each retrieved object will be stored as a CSObject
object within the item ArrayList
member
of this CSObjectMultiple
object - use getItems
or iterator
to access/navigate through the objects.
get
in class CSItemMultiple
CSParameterException
- if an invalid combination of key information has been suppliedCSDatabaseException
- if there are problems accessing the databaseCSNotFoundException
- if one of the specified objects cannot be found on the databaseCSSecurityException
- if security has been breachedCSException
- the base class for exceptions thrown by this method.public void update() throws CSException
Use setItems
followed by update
to save the supplied object details
to the database.
update
in class CSItemMultiple
CSParameterException
- if an invalid combination of key information has been suppliedCSDatabaseException
- if there are problems accessing the databaseCSNotFoundException
- if one of the specified objects cannot be found on the databaseCSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
Use setObjectList
followed by delete
to remove all objects whose
IDs are listed, from the database.
Use setLabelList
and setType
followed by
delete
to remove all objects of that type whose labels are listed.
Use setType
followed by delete
to remove all objects of that type (e.g.
'UserProfile') from the database.
If none of setObjectList
, setLabelList
or setType
are specified,
ALL objects will be removed.
delete
in class CSItemMultiple
CSParameterException
- if an invalid combination of key information has been suppliedCSDatabaseException
- if there are problems accessing the databaseCSNotFoundException
- if one of the specified objects cannot be found on the databaseCSException
- the base class for exceptions thrown by this method.public java.lang.String generateXMLDocAsString(java.lang.String exportType) throws CSException
exportType
- The type of object to export.CSException
- CSExceptionpublic java.util.Map<java.lang.String,java.lang.Float> getResultScores()
public java.lang.String toString()
CSObjectMultiple
object to a String
object in a
user-friendly format.
toString
in class CSItemMultiple
String
containing the user-friendly outputCopyright © 2022 Goss Interactive Ltd. All Rights Reserved.