Interface MacroCategoryManager


  • @Role
    public interface MacroCategoryManager
    Component interface for managing macro category information. Each rendering macro defines a default category under which it falls, but this category may be overwritten by xwiki configuration mechanism. This component will handle such overwriting operations and make sure latest macro category information is presented to client code.
    Since:
    2.0M3
    Version:
    $Id: 2286ab472ceeb1361abd18ab57ec93ac0560041f $
    • Method Detail

      • getMacroCategories

        Set<String> getMacroCategories()
                                throws MacroLookupException
        Returns all the macro categories currently available in the system. Macros that don't have default or overridden categories are not included and thus clients should be aware that there can be macros in the system which do not belong to any category.
        Returns:
        the macro categories available in the system.
        Throws:
        MacroLookupException - error when looking up macros
      • getMacroCategories

        Set<String> getMacroCategories​(Syntax syntax)
                                throws MacroLookupException
        Returns all the macro categories currently available in the system for macros registered for a given syntax and for all syntaxes. Macros that don't have default or overridden categories are not included and thus clients should be aware that there can be macros in the system which do not belong to any category.
        Parameters:
        syntax - the syntax to filter the macros by syntax.
        Returns:
        the macro categories available for the given syntax
        Throws:
        MacroLookupException - error when looking up macros
      • getMacroIds

        Set<MacroId> getMacroIds​(String category)
                          throws MacroLookupException
        Parameters:
        category - name of the category or null.
        Returns:
        ids of all the macros belonging to the given category or if the category parameter is null, ids of all the macros which do not belong to any category.
        Throws:
        MacroLookupException - error when lookup macros
      • getMacroIds

        Set<MacroId> getMacroIds​(String category,
                                 Syntax syntax)
                          throws MacroLookupException
        Parameters:
        category - name of the category or null.
        syntax - the syntax to filter the macros by syntax.
        Returns:
        ids of all the macros belonging to the given category (and registered for the given syntax) or if the category parameter is null, ids of all the macros which do not belong to any category (and registered for the given syntax).
        Throws:
        MacroLookupException - error when lookup macros
      • getMacroCategories

        @Unstable
        default Set<String> getMacroCategories​(MacroId macroId)
        Return the set of categories of a given macro.
        Parameters:
        macroId - the id of the macro to get the categories for
        Returns:
        the list of categories of the macro
        Since:
        14.6RC1
      • getHiddenCategories

        @Unstable
        default Set<String> getHiddenCategories()
        Returns:
        the set of hidden categories (e.g., "Deprecated, Internal")
        Since:
        14.8RC1