public class CSMetaDataProperty extends CSItem
A metadata property is a container for one or more metadata values. For example, metadata values of 'Red', 'Green', and 'Blue' could be defined for a metadata property of 'Colour'. Meta data values can be associated with articles to facilitate searching and personalisation.
The CSMetaDataProperty
class includes methods for the retrieval, update, and removal of a particular
metadata property. It also provides a method that checks for the existence of a metadata property. All such methods
require that certain database and key information (metadata property ID, for example) be specified via the
set
methods provided, prior to their invocation.
Typically, metadata values are specified via the META DATA section of iCM.
All database access/connectivity is handled internally by the CSMetaDataProperty
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 |
---|
CSMetaDataProperty()
Creates an empty
CSMetaDataProperty object. |
CSMetaDataProperty(java.lang.String strPropertyFile)
Creates an empty
CSMetaDataProperty object, specifying a property file that contains all of the
database connection details. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Removes a metadata property from the database.
|
boolean |
exist()
Checks to see whether the metadata property exists on the database.
|
void |
get()
Retrieves the details of a metadata property from the database.
|
java.lang.String |
getDescription()
Gets the description of the metadata property.
|
int |
getGroupID()
Gets the ID of the group that the metadata property belongs to.
|
java.lang.String |
getGroupName()
Gets the metadata group name
|
java.lang.String |
getGroupSearchField()
Gets the metadata group search field
|
java.lang.String |
getName()
Gets the name of the metadata property.
|
int |
getPropertyID()
Gets the ID of the metadata property.
|
java.lang.String |
getPropertySearchField()
Gets the metadata property search field.
|
void |
setDescription(java.lang.String strDescription)
Sets the description of the metadata property.
|
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setGroupID(int nGroupID)
Sets the ID of the group that the metadata property belongs to.
|
void |
setGroupName(java.lang.String strGroupName)
Sets the metadata group name.
|
void |
setGroupSearchField(java.lang.String strGroupName)
Sets the metadata group search field.
|
void |
setName(java.lang.String strName)
Sets the name of the metadata property.
|
void |
setPropertyID(int nPropertyID)
Sets the ID of the metadata property.
|
void |
setPropertySearchField(java.lang.String strSearchField)
Sets the metadata property search field.
|
void |
update()
Updates a metadata property on the database.
|
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 CSMetaDataProperty()
CSMetaDataProperty
object.
Use the various set methods provided to initialise the CSMetaDataProperty
object prior to invoking
any of its query methods.
public CSMetaDataProperty(java.lang.String strPropertyFile)
CSMetaDataProperty
object, specifying a property file that contains all of the
database connection details.
Use the various set methods provided to initialise the CSMetaDataProperty
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 read.public void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method.
Valid detail levels for a metadata property are :
LEVEL_ALL
setDetailLevel
in class CSDatabaseItem
nDetailLevel
- the detail level to be used.CSParameterException
- if an invalid detail level is specified.public void setPropertyID(int nPropertyID)
setPropertyID
followed by a call to exist
will determine whether a metadata
property with that ID exists on the database.
setPropertyID
followed by a call to get
will populate this
CSMetaDataProperty
object with that metadata property's details.
If a metadata property ID is specified, the update
method will update, using the contents of
this CSMetaDataProperty
object, the metadata property on the database whose ID matches.
setPropertyID
followed by a call to delete
will remove the metadata property
with that ID from the database.
nPropertyID
- the numeric identifier of the metadata property.public int getPropertyID()
public void setName(java.lang.String strName)
setName
followed by a call to exist
will determine whether a metadata property
with that name exists on the database. If the metadata property ID is known, it will be used in preference to the
name.
setName
followed by a call to get
will populate this
CSMetaDataProperty
object with details of the metadata property with the specified name. If the
metadata property ID is known, it will be used in preference to the name.
If no metadata property ID is specified, the update
method will use the name to update, using
the contents of this CSMetaDataProperty
object, the metadata property on the database whose name
matches. If none exists, a new one will be created.
setName
followed by a call to delete
will remove the metadata property with that
name from the database. If the metadata property ID is known, it will be used in preference to the name.
strName
- the metadata property's name.public java.lang.String getName()
public void setDescription(java.lang.String strDescription)
strDescription
- the metadata property's description.public java.lang.String getDescription()
public void setPropertySearchField(java.lang.String strSearchField)
strSearchField
- the metadata's property search field.public java.lang.String getPropertySearchField()
public void setGroupID(int nGroupID)
nGroupID
- The numeric identifier of the metadata group.public int getGroupID()
public void setGroupName(java.lang.String strGroupName)
This property should be regarded as read only; it does not provide a way to update the group name in the database
strGroupName
- the metadata's group name.public java.lang.String getGroupName()
public void setGroupSearchField(java.lang.String strGroupName)
This property should be regarded as read only; it does not provide a way to update the group search field in the database
strGroupName
- the metadata's group search field.public java.lang.String getGroupSearchField()
public boolean exist() throws CSException
Use setPropertyID
followed by exist
to determine whether a metadata
property with the specified ID exists on the database.
Use setName
followed by exist
to determine whether a metadata property
with the specified name exists on the database.
exist
in class CSItem
true
if the metadata property exists 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 setPropertyID
followed by get
to populate this
CSMetaDataProperty
object with the details of the metadata property identified by the specified
ID.
Use setName
followed by get
to populate this
CSMetaDataProperty
object with the details of the metadata property identified by the specified
name.
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 metadata property 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
Use update
to store the current contents of this CSMetaDataProperty
object to the
database. If a metadata property with the current ID/Name already exists, that metadata property's details will
be updated. Otherwise, a new metadata property will be created on the database.
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 the specified metadata property cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
Use setPropertyID
followed by delete
to remove the metadata property
with that ID from the database.
Use setName
followed by delete
to remove the metadata property with that
name from the database.
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 the specified metadata property cannot be found on the database.CSException
- the base class for exceptions thrown by this method.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.