Class PreferenceDefinitionBase
- java.lang.Object
-
- com.microstrategy.web.preferences.PreferenceDefinitionBase
-
- All Implemented Interfaces:
PreferenceDefinition
- Direct Known Subclasses:
PreferenceDefinitionImpl
public abstract class PreferenceDefinitionBase extends java.lang.Object implements PreferenceDefinition
This class encapsulates the definition of a preference. It may be extended to provide handling of custom preferences with user-defined properties and validation. Subclasses are likely to overridevalidate(java.lang.String, com.microstrategy.web.preferences.Preferences, java.lang.Object)
,setAttributes(Attributes, PreferenceLevels)
, andbuildXmlAttributes(XMLBuilder)
.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<PreferenceAllowableValue>
_allowableValues
protected boolean
_clusterPropagate
protected java.lang.String
_description
protected PreferenceLevels
_levels
protected java.lang.String
_name
protected PreferenceLevel
_scope
protected java.lang.String
_type
protected java.lang.String
_value
-
Fields inherited from interface com.microstrategy.web.preferences.PreferenceDefinition
TYPE_BOOLEAN, TYPE_DEFAULT
-
-
Constructor Summary
Constructors Constructor Description PreferenceDefinitionBase()
Constructor for creating PreferenceDefinition objects from XML parsing.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
buildXmlAttributes(XMLBuilder builder)
This is used to persist the state of the preference definition.boolean
clusterPropagate()
Whether changes to the preference will also propagate to other Intelligence Servers in the cluster.java.util.List<PreferenceAllowableValue>
getAllowableValues()
Retrieves a list ofPreferenceAllowableValue
objects which are supported by thie preference.java.lang.String
getDescription()
A description of the definition.protected PreferenceLevels
getEnumPreferenceLevels()
java.lang.String
getName()
The name/key of the definition.PreferenceLevel
getScope()
The scope refers to the PreferenceLevel which this definition applies.java.lang.String
getType()
java.lang.String
getValue()
The value of the definition.protected abstract void
setAttributes(org.xml.sax.Attributes attrs, PreferenceLevels group)
This restores the state of the preference definition from a set of XML attributes.protected abstract void
setAttributes(org.xml.sax.Attributes attrs, PreferenceLevels group, boolean update)
This restores the state of the preference definition from a set of XML attributes.void
setClusterPropagate(boolean propagate)
Configures whether changes to the preference will also propagate to other Intelligence Servers in the cluster.void
setDescription(java.lang.String value)
Update the description of a definition.protected void
setEnumPreferenceLevels(PreferenceLevels lvls)
protected void
setName(java.lang.String name)
void
setScope(PreferenceLevel lvl)
Updates the scope of the definition.void
setType(java.lang.String type)
Type is an application dependent declaration - typically used for validating the value property.void
setValue(java.lang.String value)
Update the value of the definition.java.lang.String
toString()
protected abstract void
validate(java.lang.String value, Preferences pref, java.lang.Object validationObject)
This method is triggered by callback when setting preference values.protected boolean
validateDataType(java.lang.String value)
-
-
-
Field Detail
-
_name
protected java.lang.String _name
-
_description
protected java.lang.String _description
-
_value
protected java.lang.String _value
-
_type
protected java.lang.String _type
-
_scope
protected PreferenceLevel _scope
-
_levels
protected PreferenceLevels _levels
-
_clusterPropagate
protected boolean _clusterPropagate
- Since:
- MicroStrategy Web 8.0.1
-
_allowableValues
protected java.util.List<PreferenceAllowableValue> _allowableValues
- Since:
- MicroStrategy Web 9.0.0
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:PreferenceDefinition
The name/key of the definition.- Specified by:
getName
in interfacePreferenceDefinition
-
getValue
public java.lang.String getValue()
Description copied from interface:PreferenceDefinition
The value of the definition.- Specified by:
getValue
in interfacePreferenceDefinition
- Returns:
- The definition value.
-
setValue
public void setValue(java.lang.String value)
Description copied from interface:PreferenceDefinition
Update the value of the definition.- Specified by:
setValue
in interfacePreferenceDefinition
- Parameters:
value
- the new definition value.
-
getDescription
public java.lang.String getDescription()
Description copied from interface:PreferenceDefinition
A description of the definition.- Specified by:
getDescription
in interfacePreferenceDefinition
- Returns:
- The definition description.
-
setDescription
public void setDescription(java.lang.String value)
Description copied from interface:PreferenceDefinition
Update the description of a definition.- Specified by:
setDescription
in interfacePreferenceDefinition
- Parameters:
value
- The new definition description.
-
getScope
public PreferenceLevel getScope()
Description copied from interface:PreferenceDefinition
The scope refers to the PreferenceLevel which this definition applies.- Specified by:
getScope
in interfacePreferenceDefinition
- Returns:
- The definition
PreferenceLevel
scope.
-
setScope
public void setScope(PreferenceLevel lvl) throws java.lang.IllegalArgumentException
Description copied from interface:PreferenceDefinition
Updates the scope of the definition.- Specified by:
setScope
in interfacePreferenceDefinition
- Parameters:
lvl
- The newPreferenceLevel
scope.- Throws:
java.lang.IllegalArgumentException
-
setType
public void setType(java.lang.String type)
Description copied from interface:PreferenceDefinition
Type is an application dependent declaration - typically used for validating the value property. See specific PreferenceDefinition implementations for further details.- Specified by:
setType
in interfacePreferenceDefinition
- Parameters:
type
- type of the definition.
-
getType
public java.lang.String getType()
- Specified by:
getType
in interfacePreferenceDefinition
- Returns:
- String type of the definition.
-
setClusterPropagate
public void setClusterPropagate(boolean propagate)
Description copied from interface:PreferenceDefinition
Configures whether changes to the preference will also propagate to other Intelligence Servers in the cluster.- Specified by:
setClusterPropagate
in interfacePreferenceDefinition
- Parameters:
propagate
- whether to propagate preference value changes to other servers in the cluster.- Since:
- MicroStrategy Web 8.0.1
-
clusterPropagate
public boolean clusterPropagate()
Description copied from interface:PreferenceDefinition
Whether changes to the preference will also propagate to other Intelligence Servers in the cluster. Defaults to true.- Specified by:
clusterPropagate
in interfacePreferenceDefinition
- Returns:
- whether changes to the preference will also propagate to other Servers in the cluster.
- Since:
- MicroStrategy Web 8.0.1
-
getAllowableValues
public java.util.List<PreferenceAllowableValue> getAllowableValues()
Description copied from interface:PreferenceDefinition
Retrieves a list ofPreferenceAllowableValue
objects which are supported by thie preference.- Specified by:
getAllowableValues
in interfacePreferenceDefinition
- Returns:
- A list of allowable value objects supoprted by this preference.
- Since:
- MicroStrategy Web 9.0.0
- See Also:
PreferenceDefinition.getAllowableValues()
-
validate
protected abstract void validate(java.lang.String value, Preferences pref, java.lang.Object validationObject) throws PreferencesException
This method is triggered by callback when setting preference values.- Throws:
PreferencesException
-
buildXmlAttributes
protected abstract void buildXmlAttributes(XMLBuilder builder)
This is used to persist the state of the preference definition. Only attributes are set on the builder node. No new nodes should be created, nor existing ones closed.- Parameters:
builder
-
-
setAttributes
protected abstract void setAttributes(org.xml.sax.Attributes attrs, PreferenceLevels group) throws PreferencesException
This restores the state of the preference definition from a set of XML attributes.- Parameters:
attrs
-group
-- Throws:
PreferencesException
-
setAttributes
protected abstract void setAttributes(org.xml.sax.Attributes attrs, PreferenceLevels group, boolean update) throws PreferencesException
This restores the state of the preference definition from a set of XML attributes.- Parameters:
attrs
-group
-update
-- Throws:
PreferencesException
- Since:
- MicroStrategy Web 9.0.1
-
setEnumPreferenceLevels
protected void setEnumPreferenceLevels(PreferenceLevels lvls)
-
getEnumPreferenceLevels
protected PreferenceLevels getEnumPreferenceLevels()
- Since:
- MicroStrategy Web 8.0.0
-
setName
protected void setName(java.lang.String name)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
validateDataType
protected boolean validateDataType(java.lang.String value)
-
-