Package com.microstrategy.web.transform
Class StyleCatalogImpl
- java.lang.Object
 - 
- com.microstrategy.utils.config.AbstractConfigurationElement
 - 
- com.microstrategy.web.transform.AbstractStyleCatalogElement
 - 
- com.microstrategy.web.transform.StyleCatalogImpl
 
 
 
 
- 
- All Implemented Interfaces:
 ConfigurationElement,ConfigurationFile,StyleCatalog,java.lang.Cloneable
public class StyleCatalogImpl extends AbstractStyleCatalogElement implements StyleCatalog
- Since:
 - MicroStrategy Web 7.3.1 or earlier
 
 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
AbstractConfigurationElement.FilteredList 
 - 
 
- 
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringATT_DESCRIPTIONprotected static java.lang.StringATT_NAMEprotected static java.lang.StringATT_VERSIONstatic java.lang.StringDTD_FILEprotected static java.lang.StringNODE_STYLE_CATALOG- 
Fields inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
ATT_CONFIG_SRC, ATT_DELETED, ATT_POSITION, ATT_PROTOTYPE, ATT_USE_DEFAULT 
 - 
 
- 
Constructor Summary
Constructors Constructor Description StyleCatalogImpl() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteTransformDefnFromStyles(TransformDefn trDef, boolean removeStyles)Cleans all the possible associatios made to the TransformDefn object specified.BeanDefngetBeanDefn(TransformDefn tDefn)Returns the BeanDefn for a bean supported by this transform.BeanDefnsgetBeanDefns()Returns the BeanDefns collection.java.lang.StringgetDescription()Returns the textual description of the style catalog.protected java.lang.StringgetDTDFileName()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;nullby default.java.lang.StringgetFileName()Returns the file name used by the style catalog.protected java.lang.StringgetKeyAttribute()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 thegetKeyandsetKeymethods.LayoutParserDefnsgetLayoutParserDefns()Gets the collection of layout parser definition objects.LayoutSourceDefnsgetLayoutSourceDefns()Gets the collection of layout source definition objects.MapperDefnsgetMapperDefns()Returns the collection fo mapper definitions.java.lang.StringgetName()Returns the name of the style catalog.SourceLookupgetSourceLookup(java.lang.String source)Returns the registered SourceLookup object with the specified name.StyleMapsgetStyleMaps()Returns the collection of style maps.StylesgetStyles()Returns the Styles collection.TransformgetTransformByStyle(java.lang.String styleName)Returns the transform object associated with the specified style.TransformgetTransformByStyle(java.lang.String styleName, StyleRequestContext context)Returns the transform object associated with the specified style.TransformDefnsgetTransformDefns()Returns the TransformDefns collection.java.lang.StringgetVersion()Returns the current version of the styleCatalogbooleanhasChanged()Equivalent toAbstractConfigurationElement.isDirty().protected voidinitDefaultAttributes()This method can be overridden to set default values for attributes.StyleslistStyles(TransformDefn trDef, int sortBy)Lists all styles for a specified transform.StyleslistStylesForBean(java.lang.String beanName, int sortBy)Lists styles filtered by the bean type and/or sorted by bean type.TransformDefnslistTransformDefns(java.lang.String beanName, int sortBy)Lists transform definitions filtered by the bean type and/or sorted by bean type.voidloadFromDocument(org.w3c.dom.Document styleCatalog)voidreset()Reloads the previous style catalog file - undoing any in-memory changes reverting back to the file definition.voidsave()Saves thisConfigurationElementback into the files where it was loaded from.StyleCatalogsaveAs(java.lang.String fileName, boolean overwrite)Saves the contents of the style catalog in a new instance and to disk.voidsetDescription(java.lang.String value)Sets the textual description of the style catalog.voidsetFileName(java.lang.String fileName)Sets the name of the file used by the style catalog.voidsetName(java.lang.String value)Sets the name of the style catalog.voidsetSourceLookup(java.lang.String source, SourceLookup sourceLookup)Registers a SourceLookup object with the specified key.voidsetVersion(java.lang.String value)Sets the version of the style catalog.- 
Methods inherited from class com.microstrategy.web.transform.AbstractStyleCatalogElement
clearCaches, copyContents, getStyleCatalog, reload, resetChanged, setStrAttribute 
- 
Methods inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
addFileSource, applyCustomization, applyCustomizations, cleanUpDeletedElements, clone, delete, deltas, deltas, equalAtts, equalElements, equalNodeValues, equals, equalsIncludingDeletedElements, exportAttributesToXML, exportElementsToXML, exportNodeValueToXML, getAttribute, getAttributes, getBoolAttribute, getChildKey, getConfigSrc, getElement, getElement, getElements, getFileLoader, getIntAttribute, getIntAttribute, getKey, getLineNumber, getList, getNextKey, getNodeName, getNodeValue, getNodeValue, getOrCreateElement, getParent, getPosition, getPrototype, getRegisteredClass, getSelfInitPath, getSource, getStrAttribute, getUseDefault, getXMLParserParameters, getXMLSerializerParameters, hashCode, hashCodeAtts, hashCodeElements, hashCodeNodeValues, hasRegisteredClass, initAttributesFromXML, initElementFromXML, initElementsFromXML, initFromFile, initFromResource, initFromXML, initFromXML, initNodeValueFromXML, initPrototype, isActive, isCustomized, isDeleted, isDirty, isInSource, isKeyAttribute, load, mergeChanges, newChildInstance, newSource, original, populate, printAttributes, printElements, printNodeValue, refreshLists, registerClass, registerElement, registerElement, registerElementList, reloadPrototype, removeAttribute, removeDefaults, replaceList, restore, save, saveChangesAs, saveConfig, saveFlatXML, saveNode, saveSource, setAttribute, setBoolAttribute, setChildOriginals, setConfigSrc, setCustomized, setElement, setFileLoader, setIntAttribute, setKey, setLineNumber, setNodeName, setNodeValue, setPosition, setPrototype, setSelfInitPath, setUseDefault, setUseValidation, throwConfigParseException, toString, toXML, toXML, toXML, toXML, useNodeValue, useValidation 
- 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait 
- 
Methods inherited from interface com.microstrategy.utils.config.ConfigurationElement
getAttribute, getAttributes, getElement, getElements, getKey, getNodeName, getStrAttribute, initFromXML, reload, toXML 
- 
Methods inherited from interface com.microstrategy.utils.config.ConfigurationFile
applyCustomization, applyCustomizations, load, reload, save, setUseValidation, useValidation 
 - 
 
 - 
 
- 
- 
Field Detail
- 
ATT_NAME
protected static final java.lang.String ATT_NAME
- Since:
 - MicroStrategy Web 9.0.0
 - See Also:
 - Constant Field Values
 
 
- 
ATT_DESCRIPTION
protected static final java.lang.String ATT_DESCRIPTION
- Since:
 - MicroStrategy Web 9.0.0
 - See Also:
 - Constant Field Values
 
 
- 
ATT_VERSION
protected static final java.lang.String ATT_VERSION
- Since:
 - MicroStrategy Web 9.0.0
 - See Also:
 - Constant Field Values
 
 
- 
NODE_STYLE_CATALOG
protected static final java.lang.String NODE_STYLE_CATALOG
- Since:
 - MicroStrategy Web 9.0.0
 - See Also:
 - Constant Field Values
 
 
- 
DTD_FILE
public static final java.lang.String DTD_FILE
- Since:
 - MicroStrategy Web 9.0.0
 - See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
getDTDFileName
protected java.lang.String getDTDFileName()
Description copied from class:AbstractConfigurationElementReturns 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;nullby default. This method should be extended if the concrete instance of an element has a predefined DTD file associated.- Overrides:
 getDTDFileNamein classAbstractConfigurationElement- Since:
 - MicroStrategy Web 9.0.0
 
 
- 
initDefaultAttributes
protected void initDefaultAttributes()
Description copied from class:AbstractConfigurationElementThis method can be overridden to set default values for attributes. Simply extend this method and callAbstractConfigurationElement.setAttribute(java.lang.String, java.lang.Object)- Overrides:
 initDefaultAttributesin classAbstractConfigurationElement- Since:
 - MicroStrategy Web 9.0.0
 
 
- 
getFileName
public java.lang.String getFileName()
Description copied from interface:StyleCatalogReturns the file name used by the style catalog.- Specified by:
 getFileNamein interfaceStyleCatalog- Returns:
 - the file name used by the style catalog.
 
 
- 
setFileName
public void setFileName(java.lang.String fileName)
Description copied from interface:StyleCatalogSets the name of the file used by the style catalog.- Specified by:
 setFileNamein interfaceStyleCatalog- Parameters:
 fileName- the file name used by the style catalog.
 
- 
getName
public java.lang.String getName()
Description copied from interface:StyleCatalogReturns the name of the style catalog.- Specified by:
 getNamein interfaceStyleCatalog- Returns:
 - the name of the style catalog.
 
 
- 
setName
public void setName(java.lang.String value)
Description copied from interface:StyleCatalogSets the name of the style catalog.- Specified by:
 setNamein interfaceStyleCatalog- Parameters:
 value- the name of the style catalog.
 
- 
getDescription
public java.lang.String getDescription()
Description copied from interface:StyleCatalogReturns the textual description of the style catalog.- Specified by:
 getDescriptionin interfaceStyleCatalog- Returns:
 - the description of the style catalog.
 
 
- 
setDescription
public void setDescription(java.lang.String value)
Description copied from interface:StyleCatalogSets the textual description of the style catalog.- Specified by:
 setDescriptionin interfaceStyleCatalog- Parameters:
 value- the description of the style catalog.
 
- 
getStyles
public Styles getStyles()
Description copied from interface:StyleCatalogReturns the Styles collection.- Specified by:
 getStylesin interfaceStyleCatalog- Returns:
 - the 
Stylesobject. 
 
- 
getTransformDefns
public TransformDefns getTransformDefns()
Description copied from interface:StyleCatalogReturns the TransformDefns collection.- Specified by:
 getTransformDefnsin interfaceStyleCatalog- Returns:
 - the 
TransformDefnsobject. 
 
- 
getBeanDefn
public BeanDefn getBeanDefn(TransformDefn tDefn)
Description copied from interface:StyleCatalogReturns the BeanDefn for a bean supported by this transform.- Specified by:
 getBeanDefnin interfaceStyleCatalog- Returns:
 - the 
BeanDefnfor a bean supported by this transform. 
 
- 
getBeanDefns
public BeanDefns getBeanDefns()
Description copied from interface:StyleCatalogReturns the BeanDefns collection.- Specified by:
 getBeanDefnsin interfaceStyleCatalog- Returns:
 - the 
BeanDefnsobject. 
 
- 
hasChanged
public boolean hasChanged()
Description copied from class:AbstractStyleCatalogElementEquivalent toAbstractConfigurationElement.isDirty(). Maintained for binary compatibility.- Specified by:
 hasChangedin interfaceStyleCatalog- Overrides:
 hasChangedin classAbstractStyleCatalogElement- Returns:
 - whether the style catalog changed.
 
 
- 
save
public void save() throws WebTransformExceptionDescription copied from class:AbstractConfigurationElementSaves thisConfigurationElementback into the files where it was loaded from. All in-memory changes are automatically applied into the lastElementSourceused to load this element.- Specified by:
 savein interfaceConfigurationFile- Specified by:
 savein interfaceStyleCatalog- Overrides:
 savein classAbstractConfigurationElement- Throws:
 WebTransformException- thrown if an error saving to the file occurs.
 
- 
saveAs
public StyleCatalog saveAs(java.lang.String fileName, boolean overwrite) throws WebTransformException, java.lang.IllegalArgumentException
Description copied from interface:StyleCatalogSaves the contents of the style catalog in a new instance and to disk.- Specified by:
 saveAsin interfaceStyleCatalog- 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:
 WebTransformException- thrown if an error saving to the file occurs.java.lang.IllegalArgumentException- thrown if the file name exists and it can't overwrite it.
 
- 
loadFromDocument
public void loadFromDocument(org.w3c.dom.Document styleCatalog) throws WebTransformException- Throws:
 WebTransformException
 
- 
getStyleMaps
public StyleMaps getStyleMaps()
Description copied from interface:StyleCatalogReturns the collection of style maps.- Specified by:
 getStyleMapsin interfaceStyleCatalog- Returns:
 StyleMapsa collection ofStyleMap.- Since:
 - MicroStrategy Web 9.0.0
 
 
- 
getMapperDefns
public MapperDefns getMapperDefns()
Description copied from interface:StyleCatalogReturns the collection fo mapper definitions.- Specified by:
 getMapperDefnsin interfaceStyleCatalog- Returns:
 MapperDefnsa collection ofMapperDefn.- Since:
 - MicroStrategy Web 9.0.0
 
 
- 
listTransformDefns
public TransformDefns listTransformDefns(java.lang.String beanName, int sortBy) throws java.lang.IllegalArgumentException
Description copied from interface:StyleCatalogLists transform definitions filtered by the bean type and/or sorted by bean type.- Specified by:
 listTransformDefnsin interfaceStyleCatalog- 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. FromEnumSortBy- 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:
 java.lang.IllegalArgumentException- thrown if the sortBy parameter is invalid.
 
- 
listStylesForBean
public Styles listStylesForBean(java.lang.String beanName, int sortBy) throws java.lang.IllegalArgumentException
Description copied from interface:StyleCatalogLists styles filtered by the bean type and/or sorted by bean type.- Specified by:
 listStylesForBeanin interfaceStyleCatalog- 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. FromEnumSortBy- 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:
 java.lang.IllegalArgumentException- thrown if the sortBy parameter is invalid.
 
- 
listStyles
public Styles listStyles(TransformDefn trDef, int sortBy) throws java.lang.IllegalArgumentException
Description copied from interface:StyleCatalogLists all styles for a specified transform. Styles will be sorted according to the sortBy value.- Specified by:
 listStylesin interfaceStyleCatalog- Parameters:
 trDef- theTransformDefnobject used to filter the list of styles.sortBy- Defines sorting order. FromEnumSortBy- 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:
 java.lang.IllegalArgumentException- thrown if the sortBy parameter is invalid or the TransformDefn object is null.
 
- 
deleteTransformDefnFromStyles
public void deleteTransformDefnFromStyles(TransformDefn trDef, boolean removeStyles) throws java.lang.IllegalArgumentException
Description copied from interface:StyleCatalogCleans 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.- Specified by:
 deleteTransformDefnFromStylesin interfaceStyleCatalog- Parameters:
 trDef- theTransformDefnobject you want to remove.removeStyles- inicates whether you want to remove the styles associated with this TransformDefn object or not.- Throws:
 java.lang.IllegalArgumentException- thrown if the TransformDefn object is null.
 
- 
getTransformByStyle
public Transform getTransformByStyle(java.lang.String styleName) throws WebTransformException, java.lang.IllegalArgumentException
Returns the transform object associated with the specified style.- Specified by:
 getTransformByStylein interfaceStyleCatalog- Parameters:
 styleName- the name of the style.- Returns:
 - an instance of the 
Transformobject. - 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.java.lang.IllegalArgumentException- thrown if the style name was not found in the system style catalog.
 
- 
getLayoutParserDefns
public LayoutParserDefns getLayoutParserDefns()
Description copied from interface:StyleCatalogGets the collection of layout parser definition objects.- Specified by:
 getLayoutParserDefnsin interfaceStyleCatalog- Returns:
 - The collection of layout parser definition objects.
 - Since:
 - MicroStrategy Web 8.0.0
 
 
- 
getLayoutSourceDefns
public LayoutSourceDefns getLayoutSourceDefns()
Description copied from interface:StyleCatalogGets the collection of layout source definition objects.- Specified by:
 getLayoutSourceDefnsin interfaceStyleCatalog- Returns:
 - The collection of layout source definition objects.
 - Since:
 - MicroStrategy Web 8.0.0
 
 
- 
reset
public void reset() throws WebTransformExceptionDescription copied from interface:StyleCatalogReloads 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.
- Specified by:
 resetin interfaceStyleCatalog- Throws:
 WebTransformException- Since:
 - MicroStrategy Web 8.0.0
 
 
- 
getVersion
public java.lang.String getVersion()
Description copied from interface:StyleCatalogReturns the current version of the styleCatalog- Specified by:
 getVersionin interfaceStyleCatalog- Returns:
 - the version of the styleCatalog
 - Since:
 - MicroStrategy Web 8.0.0
 
 
- 
setVersion
public void setVersion(java.lang.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.- Since:
 - MicroStrategy Web 8.1.0
 
 
- 
getSourceLookup
public SourceLookup getSourceLookup(java.lang.String source)
Description copied from interface:StyleCatalogReturns the registered SourceLookup object with the specified name.- Specified by:
 getSourceLookupin interfaceStyleCatalog- Parameters:
 source- the name used to look up the SourceLookup object.- Returns:
 - the SourceLookup object with the specified name.
 - Since:
 - MicroStrategy Web 8.0.0
 
 
- 
setSourceLookup
public void setSourceLookup(java.lang.String source, SourceLookup sourceLookup)Description copied from interface:StyleCatalogRegisters a SourceLookup object with the specified key.- Specified by:
 setSourceLookupin interfaceStyleCatalog- Parameters:
 source- the key mapped to the SourceLookup objectsourceLookup- theSourceLookupobject to register- Since:
 - MicroStrategy Web 8.0.0
 
 
- 
getTransformByStyle
public Transform getTransformByStyle(java.lang.String styleName, StyleRequestContext context) throws WebTransformException, java.lang.IllegalArgumentException
Description copied from interface:StyleCatalogReturns the transform object associated with the specified style.- Specified by:
 getTransformByStylein interfaceStyleCatalog- Parameters:
 styleName- the name of the style.context- the StyleRequestContext object used to resolve dynamic actual parameter values.- Returns:
 - an instance of the 
Transformobject. - Throws:
 WebTransformException- thrown if there is an error getting a new instance of the transformjava.lang.IllegalArgumentException- thrown if the style name was not found in this style catalog.- Since:
 - MicroStrategy Web 8.0.0
 
 
- 
getKeyAttribute
protected java.lang.String getKeyAttribute()
Description copied from class:AbstractConfigurationElementThis method must return the attribute that uniquely identifies this element among its siblings; if no single attribute can be used, return null and override thegetKeyandsetKeymethods.- Specified by:
 getKeyAttributein classAbstractConfigurationElement- Since:
 - MicroStrategy Web 9.0.0
 
 
 - 
 
 -