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>_allowableValuesprotected boolean_clusterPropagateprotected java.lang.String_descriptionprotected PreferenceLevels_levelsprotected java.lang.String_nameprotected PreferenceLevel_scopeprotected java.lang.String_typeprotected 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 voidbuildXmlAttributes(XMLBuilder builder)This is used to persist the state of the preference definition.booleanclusterPropagate()Whether changes to the preference will also propagate to other Intelligence Servers in the cluster.java.util.List<PreferenceAllowableValue>getAllowableValues()Retrieves a list ofPreferenceAllowableValueobjects which are supported by thie preference.java.lang.StringgetDescription()A description of the definition.protected PreferenceLevelsgetEnumPreferenceLevels()java.lang.StringgetName()The name/key of the definition.PreferenceLevelgetScope()The scope refers to the PreferenceLevel which this definition applies.java.lang.StringgetType()java.lang.StringgetValue()The value of the definition.protected abstract voidsetAttributes(org.xml.sax.Attributes attrs, PreferenceLevels group)This restores the state of the preference definition from a set of XML attributes.protected abstract voidsetAttributes(org.xml.sax.Attributes attrs, PreferenceLevels group, boolean update)This restores the state of the preference definition from a set of XML attributes.voidsetClusterPropagate(boolean propagate)Configures whether changes to the preference will also propagate to other Intelligence Servers in the cluster.voidsetDescription(java.lang.String value)Update the description of a definition.protected voidsetEnumPreferenceLevels(PreferenceLevels lvls)protected voidsetName(java.lang.String name)voidsetScope(PreferenceLevel lvl)Updates the scope of the definition.voidsetType(java.lang.String type)Type is an application dependent declaration - typically used for validating the value property.voidsetValue(java.lang.String value)Update the value of the definition.java.lang.StringtoString()protected abstract voidvalidate(java.lang.String value, Preferences pref, java.lang.Object validationObject)This method is triggered by callback when setting preference values.protected booleanvalidateDataType(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:PreferenceDefinitionThe name/key of the definition.- Specified by:
 getNamein interfacePreferenceDefinition
 
- 
getValue
public java.lang.String getValue()
Description copied from interface:PreferenceDefinitionThe value of the definition.- Specified by:
 getValuein interfacePreferenceDefinition- Returns:
 - The definition value.
 
 
- 
setValue
public void setValue(java.lang.String value)
Description copied from interface:PreferenceDefinitionUpdate the value of the definition.- Specified by:
 setValuein interfacePreferenceDefinition- Parameters:
 value- the new definition value.
 
- 
getDescription
public java.lang.String getDescription()
Description copied from interface:PreferenceDefinitionA description of the definition.- Specified by:
 getDescriptionin interfacePreferenceDefinition- Returns:
 - The definition description.
 
 
- 
setDescription
public void setDescription(java.lang.String value)
Description copied from interface:PreferenceDefinitionUpdate the description of a definition.- Specified by:
 setDescriptionin interfacePreferenceDefinition- Parameters:
 value- The new definition description.
 
- 
getScope
public PreferenceLevel getScope()
Description copied from interface:PreferenceDefinitionThe scope refers to the PreferenceLevel which this definition applies.- Specified by:
 getScopein interfacePreferenceDefinition- Returns:
 - The definition 
PreferenceLevelscope. 
 
- 
setScope
public void setScope(PreferenceLevel lvl) throws java.lang.IllegalArgumentException
Description copied from interface:PreferenceDefinitionUpdates the scope of the definition.- Specified by:
 setScopein interfacePreferenceDefinition- Parameters:
 lvl- The newPreferenceLevelscope.- Throws:
 java.lang.IllegalArgumentException
 
- 
setType
public void setType(java.lang.String type)
Description copied from interface:PreferenceDefinitionType is an application dependent declaration - typically used for validating the value property. See specific PreferenceDefinition implementations for further details.- Specified by:
 setTypein interfacePreferenceDefinition- Parameters:
 type- type of the definition.
 
- 
getType
public java.lang.String getType()
- Specified by:
 getTypein interfacePreferenceDefinition- Returns:
 - String type of the definition.
 
 
- 
setClusterPropagate
public void setClusterPropagate(boolean propagate)
Description copied from interface:PreferenceDefinitionConfigures whether changes to the preference will also propagate to other Intelligence Servers in the cluster.- Specified by:
 setClusterPropagatein 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:PreferenceDefinitionWhether changes to the preference will also propagate to other Intelligence Servers in the cluster. Defaults to true.- Specified by:
 clusterPropagatein 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:PreferenceDefinitionRetrieves a list ofPreferenceAllowableValueobjects which are supported by thie preference.- Specified by:
 getAllowableValuesin 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 PreferencesExceptionThis 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 PreferencesExceptionThis 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 PreferencesExceptionThis 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:
 toStringin classjava.lang.Object
 
- 
validateDataType
protected boolean validateDataType(java.lang.String value)
 
 - 
 
 -