Hi, I would like to introduce a MacroCategoriesManager component for managing macro categories. We already have a MacroManager component in place but I think seperating out the concern of macro categories management into a seperate component creates a more extensible design. Following is a basic outline for implementing MacroCategoriesManager component:
* Introduce MacroDescriptor::getDefaultCategory() method which returns a String. The purpose of this method is to allow macro author to supply a default category under which his macro should be listed. This method can virtually return any string. Following three steps I'm not very confident about: * Duplicate each existing constructor in AbstractMacro and add a 'category' parameter. * Make AbstractMacroDescriptor constructor accept a 'category' parameter. * Duplicate each existing constructor in DefaultMacroDescriptor and add a 'category' parameter. If a macro author does not specify a default category, the "Other" category will be used. * Introduce the MacroCategoriesManager component with following methods: List<String> getMacroCategories() List<String> getMacroNames(String category) List<String> getMacroNames(String category, Syntax syntax) Each of these methods will give priority to admin configured macro categories. That is they will discard MacroDescriptor::getDefaultCategory() return value if the wiki admin has configured a different category for a given macro. * A macro category can be overwritten by specifying the configuration parameter "org.xwiki.rendering.macro.<macro_name>.category" using xwiki's configuration mechanism (Ex. xwiki.properties). This is my initial design idea, please let me know what you think. Thanks. - Asiri _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs

