Class StyleCatalogImpl

    • 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
    • Constructor Detail

      • StyleCatalogImpl

        public StyleCatalogImpl()
    • Method Detail

      • getDTDFileName

        protected java.lang.String getDTDFileName()
        Description copied from class: AbstractConfigurationElement
        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.
        Overrides:
        getDTDFileName in class AbstractConfigurationElement
        Since:
        MicroStrategy Web 9.0.0
      • getFileName

        public java.lang.String getFileName()
        Description copied from interface: StyleCatalog
        Returns the file name used by the style catalog.
        Specified by:
        getFileName in interface StyleCatalog
        Returns:
        the file name used by the style catalog.
      • setFileName

        public void setFileName​(java.lang.String fileName)
        Description copied from interface: StyleCatalog
        Sets the name of the file used by the style catalog.
        Specified by:
        setFileName in interface StyleCatalog
        Parameters:
        fileName - the file name used by the style catalog.
      • getName

        public java.lang.String getName()
        Description copied from interface: StyleCatalog
        Returns the name of the style catalog.
        Specified by:
        getName in interface StyleCatalog
        Returns:
        the name of the style catalog.
      • setName

        public void setName​(java.lang.String value)
        Description copied from interface: StyleCatalog
        Sets the name of the style catalog.
        Specified by:
        setName in interface StyleCatalog
        Parameters:
        value - the name of the style catalog.
      • getDescription

        public java.lang.String getDescription()
        Description copied from interface: StyleCatalog
        Returns the textual description of the style catalog.
        Specified by:
        getDescription in interface StyleCatalog
        Returns:
        the description of the style catalog.
      • setDescription

        public void setDescription​(java.lang.String value)
        Description copied from interface: StyleCatalog
        Sets the textual description of the style catalog.
        Specified by:
        setDescription in interface StyleCatalog
        Parameters:
        value - the description of the style catalog.
      • saveAs

        public StyleCatalog saveAs​(java.lang.String fileName,
                                   boolean overwrite)
                            throws WebTransformException,
                                   java.lang.IllegalArgumentException
        Description copied from interface: StyleCatalog
        Saves the contents of the style catalog in a new instance and to disk.
        Specified by:
        saveAs in interface StyleCatalog
        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.
      • listTransformDefns

        public TransformDefns listTransformDefns​(java.lang.String beanName,
                                                 int sortBy)
                                          throws java.lang.IllegalArgumentException
        Description copied from interface: StyleCatalog
        Lists transform definitions filtered by the bean type and/or sorted by bean type.
        Specified by:
        listTransformDefns in interface StyleCatalog
        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:
        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: StyleCatalog
        Lists styles filtered by the bean type and/or sorted by bean type.
        Specified by:
        listStylesForBean in interface StyleCatalog
        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:
        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: StyleCatalog
        Lists all styles for a specified transform. Styles will be sorted according to the sortBy value.
        Specified by:
        listStyles in interface StyleCatalog
        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:
        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: StyleCatalog
        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.
        Specified by:
        deleteTransformDefnFromStyles in interface StyleCatalog
        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:
        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:
        getTransformByStyle in interface StyleCatalog
        Parameters:
        styleName - the name of the style.
        Returns:
        an instance of the Transform object.
        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: StyleCatalog
        Gets the collection of layout parser definition objects.
        Specified by:
        getLayoutParserDefns in interface StyleCatalog
        Returns:
        The collection of layout parser definition objects.
        Since:
        MicroStrategy Web 8.0.0
      • getLayoutSourceDefns

        public LayoutSourceDefns getLayoutSourceDefns()
        Description copied from interface: StyleCatalog
        Gets the collection of layout source definition objects.
        Specified by:
        getLayoutSourceDefns in interface StyleCatalog
        Returns:
        The collection of layout source definition objects.
        Since:
        MicroStrategy Web 8.0.0
      • reset

        public void reset()
                   throws WebTransformException
        Description copied from interface: StyleCatalog

        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.

        Specified by:
        reset in interface StyleCatalog
        Throws:
        WebTransformException
        Since:
        MicroStrategy Web 8.0.0
      • getVersion

        public java.lang.String getVersion()
        Description copied from interface: StyleCatalog
        Returns the current version of the styleCatalog
        Specified by:
        getVersion in interface StyleCatalog
        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: StyleCatalog
        Returns the registered SourceLookup object with the specified name.
        Specified by:
        getSourceLookup in interface StyleCatalog
        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: StyleCatalog
        Registers a SourceLookup object with the specified key.
        Specified by:
        setSourceLookup in interface StyleCatalog
        Parameters:
        source - the key mapped to the SourceLookup object
        sourceLookup - the SourceLookup object 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: StyleCatalog
        Returns the transform object associated with the specified style.
        Specified by:
        getTransformByStyle in interface StyleCatalog
        Parameters:
        styleName - the name of the style.
        context - the StyleRequestContext object used to resolve dynamic actual parameter values.
        Returns:
        an instance of the Transform object.
        Throws:
        WebTransformException - thrown if there is an error getting a new instance of the transform
        java.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: AbstractConfigurationElement
        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.
        Specified by:
        getKeyAttribute in class AbstractConfigurationElement
        Since:
        MicroStrategy Web 9.0.0