public class

StyleCatalogImpl

extends AbstractStyleCatalogElement
implements StyleCatalog
java.lang.Object
   ↳ com.microstrategy.utils.config.AbstractConfigurationElement
     ↳ com.microstrategy.web.transform.AbstractStyleCatalogElement
       ↳ com.microstrategy.web.transform.StyleCatalogImpl

Summary

Constants
String ATT_DESCRIPTION
String ATT_NAME
String ATT_VERSION
String DTD_FILE
String NODE_STYLE_CATALOG
[Expand]
Inherited Constants
From class com.microstrategy.utils.config.AbstractConfigurationElement
Public Constructors
StyleCatalogImpl()
Public Methods
void deleteTransformDefnFromStyles(TransformDefn trDef, boolean removeStyles)
Cleans all the possible associatios made to the TransformDefn object specified.
BeanDefn getBeanDefn(TransformDefn tDefn)
Returns the BeanDefn for a bean supported by this transform.
BeanDefns getBeanDefns()
Returns the BeanDefns collection.
String getDescription()
Returns the textual description of the style catalog.
String getFileName()
Returns the file name used by the style catalog.
LayoutParserDefns getLayoutParserDefns()
Gets the collection of layout parser definition objects.
LayoutSourceDefns getLayoutSourceDefns()
Gets the collection of layout source definition objects.
MapperDefns getMapperDefns()
Returns the collection fo mapper definitions.
String getName()
Returns the name of the style catalog.
SourceLookup getSourceLookup(String source)
Returns the registered SourceLookup object with the specified name.
StyleMaps getStyleMaps()
Returns the collection of style maps.
Styles getStyles()
Returns the Styles collection.
Transform getTransformByStyle(String styleName, StyleRequestContext context)
Returns the transform object associated with the specified style.
Transform getTransformByStyle(String styleName)
Returns the transform object associated with the specified style.
TransformDefns getTransformDefns()
Returns the TransformDefns collection.
String getVersion()
Returns the current version of the styleCatalog
boolean hasChanged()
This method is deprecated. Use isDirty()
Styles listStyles(TransformDefn trDef, int sortBy)
Lists all styles for a specified transform.
Styles listStylesForBean(String beanName, int sortBy)
Lists styles filtered by the bean type and/or sorted by bean type.
TransformDefns listTransformDefns(String beanName, int sortBy)
Lists transform definitions filtered by the bean type and/or sorted by bean type.
void loadFromDocument(Document styleCatalog)
void reset()

Reloads the previous style catalog file - undoing any in-memory changes reverting back to the file definition.

void save()
Saves this ConfigurationElement back into the files where it was loaded from.
StyleCatalog saveAs(String fileName, boolean overwrite)
Saves the contents of the style catalog in a new instance and to disk.
void setDescription(String value)
Sets the textual description of the style catalog.
void setFileName(String fileName)
Sets the name of the file used by the style catalog.
void setName(String value)
Sets the name of the style catalog.
void setSourceLookup(String source, SourceLookup sourceLookup)
Registers a SourceLookup object with the specified key.
void setVersion(String value)
Sets the version of the style catalog.
Protected Methods
String getDTDFileName()
Returns the name of a DTD file that will be added as SystemID to the XML resulting from serializing the contents of this ConfigurationElement into a file; null by default.
String getKeyAttribute()
This method must return the attribute that uniquely identifies this element among its siblings; if no single attribute can be used, return null and override the getKey and setKey methods.
void initDefaultAttributes()
This method can be overridden to set default values for attributes.
[Expand]
Inherited Methods
From class com.microstrategy.web.transform.AbstractStyleCatalogElement
From class com.microstrategy.utils.config.AbstractConfigurationElement
From class java.lang.Object
From interface com.microstrategy.utils.config.ConfigurationElement
From interface com.microstrategy.utils.config.ConfigurationFile
From interface com.microstrategy.web.transform.StyleCatalog

Constants

protected static final String ATT_DESCRIPTION

Constant Value: "description"

protected static final String ATT_NAME

Constant Value: "name"

protected static final String ATT_VERSION

Constant Value: "version"

public static final String DTD_FILE

Constant Value: "styleCatalog.dtd"

protected static final String NODE_STYLE_CATALOG

Constant Value: "StyleCatalog"

Public Constructors

public StyleCatalogImpl ()

Public Methods

public void deleteTransformDefnFromStyles (TransformDefn trDef, boolean removeStyles)

Cleans all the possible associatios made to the TransformDefn object specified. It will have the option to remove all the Style objects associated with this TransformDefn object.

Parameters
trDef the TransformDefn object you want to remove.
removeStyles inicates whether you want to remove the styles associated with this TransformDefn object or not.
Throws
IllegalArgumentException

public BeanDefn getBeanDefn (TransformDefn tDefn)

Returns the BeanDefn for a bean supported by this transform.

Returns
  • the BeanDefn for a bean supported by this transform.

public BeanDefns getBeanDefns ()

Returns the BeanDefns collection.

Returns

public String getDescription ()

Returns the textual description of the style catalog.

Returns
  • the description of the style catalog.

public String getFileName ()

Returns the file name used by the style catalog.

Returns
  • the file name used by the style catalog.

public LayoutParserDefns getLayoutParserDefns ()

Gets the collection of layout parser definition objects.

Returns
  • The collection of layout parser definition objects.

public LayoutSourceDefns getLayoutSourceDefns ()

Gets the collection of layout source definition objects.

Returns
  • The collection of layout source definition objects.

public MapperDefns getMapperDefns ()

Returns the collection fo mapper definitions.

Returns

public String getName ()

Returns the name of the style catalog.

Returns
  • the name of the style catalog.

public SourceLookup getSourceLookup (String source)

Returns the registered SourceLookup object with the specified name.

Parameters
source the name used to look up the SourceLookup object.
Returns
  • the SourceLookup object with the specified name.

public StyleMaps getStyleMaps ()

Returns the collection of style maps.

Returns

public Styles getStyles ()

Returns the Styles collection.

Returns

public Transform getTransformByStyle (String styleName, StyleRequestContext context)

Returns the transform object associated with the specified style.

Parameters
styleName the name of the style.
context the StyleRequestContext object used to resolve dynamic actual parameter values.
Returns
Throws
IllegalArgumentException
WebTransformException

public Transform getTransformByStyle (String styleName)

Returns the transform object associated with the specified style.

Parameters
styleName the name of the style.
Returns
Throws
WebTransformException thrown if there is an error getting a new instance of the transform or if the system style catalog has not been set.
IllegalArgumentException thrown if the style name was not found in the system style catalog.

public TransformDefns getTransformDefns ()

Returns the TransformDefns collection.

Returns

public String getVersion ()

Returns the current version of the styleCatalog

Returns
  • the version of the styleCatalog

public boolean hasChanged ()

This method is deprecated.
Use isDirty()

Equivalent to isDirty(). Maintained for binary compatibility.

public Styles listStyles (TransformDefn trDef, int sortBy)

Lists all styles for a specified transform. Styles will be sorted according to the sortBy value.

Parameters
trDef the TransformDefn object used to filter the list of styles.
sortBy Defines sorting order. From EnumSortBy
Returns
  • a subset of Style objects belonging to the specified TransformDefinition and sorted according to the sortBy parameter Returned subset is read-only, calling any update method on it will result in UnsupportedOperationException.
Throws
IllegalArgumentException

public Styles listStylesForBean (String beanName, int sortBy)

Lists styles filtered by the bean type and/or sorted by bean type.

Parameters
beanName the filer bean type. Must be a valid bean type or FILTER_NONE, in which case no filtering will be performed.
sortBy Defines sorting order. From EnumSortBy
Returns
  • a subset of Style objects filtered according to the beanName parameter and sorted according to the sortBy parameter. Returned subset is read-only, calling any update method on it will result in UnsupportedOperationException.
Throws
IllegalArgumentException

public TransformDefns listTransformDefns (String beanName, int sortBy)

Lists transform definitions filtered by the bean type and/or sorted by bean type.

Parameters
beanName the filer bean type. Must be a valid bean type or FILTER_NONE, in which case no filtering will be performed.
sortBy Defines sorting order. From EnumSortBy
Returns
  • a subset of TransformDefinition objects filtered according to the beanName parameter and sorted according to the sortBy parameter. Returned subset is read-only, calling any update method on it will result in UnsupportedOperationException.
Throws
IllegalArgumentException

public void loadFromDocument (Document styleCatalog)

public void reset ()

Reloads the previous style catalog file - undoing any in-memory changes reverting back to the file definition. Nothing happens if a style catalog was not previously loaded.

public void save ()

Saves this ConfigurationElement back into the files where it was loaded from. All in-memory changes are automatically applied into the last ElementSource used to load this element.

public StyleCatalog saveAs (String fileName, boolean overwrite)

Saves the contents of the style catalog in a new instance and to disk.

Parameters
fileName the name of the file for the new StyleCatalog object.
overwrite whether it overwrites the file if already exists.
Returns
  • a new instance of the StyleCatalog object with the copied contents.
Throws
IllegalArgumentException
WebTransformException

public void setDescription (String value)

Sets the textual description of the style catalog.

Parameters
value the description of the style catalog.

public void setFileName (String fileName)

Sets the name of the file used by the style catalog.

Parameters
fileName the file name used by the style catalog.

public void setName (String value)

Sets the name of the style catalog.

Parameters
value the name of the style catalog.

public void setSourceLookup (String source, SourceLookup sourceLookup)

Registers a SourceLookup object with the specified key.

Parameters
source the key mapped to the SourceLookup object
sourceLookup the SourceLookup object to register

public void setVersion (String value)

Sets the version of the style catalog. The version must be in the form of: "major.minor" where both major and minor must be valid numbers. If not in this form it throws an InvalidArgumentException.

Parameters
value Version number.

Protected Methods

protected String getDTDFileName ()

Returns the name of a DTD file that will be added as SystemID to the XML resulting from serializing the contents of this ConfigurationElement into a file; null by default. This method should be extended if the concrete instance of an element has a predefined DTD file associated.

protected String getKeyAttribute ()

This method must return the attribute that uniquely identifies this element among its siblings; if no single attribute can be used, return null and override the getKey and setKey methods.

protected void initDefaultAttributes ()

This method can be overridden to set default values for attributes. Simply extend this method and call setAttribute(String, Object)