Class UserMacroAction

    • Constructor Detail

      • UserMacroAction

        public UserMacroAction()
    • Method Detail

      • setUserMacroLibrary

        public void setUserMacroLibrary​(UserMacroLibrary userMacroLibrary)
      • setMacroManager

        public void setMacroManager​(com.atlassian.renderer.v2.macro.MacroManager macroManager)
      • setMacroMetadataManager

        public void setMacroMetadataManager​(MacroMetadataManager macroMetadataManager)
      • setMacro

        public void setMacro​(String macro)
      • addUpdateMacro

        protected void addUpdateMacro​(UserMacroConfig userMacro)
        Add the updated macro to the user macro library. HasBody isn't displayed in the UI and it isn't worth updating with JS and killing the acceptance tests, so we set it here based on the body type. We also set hidden at this point.
      • isWikiTemplate

        public boolean isWikiTemplate​(String macroName)
        Parameters:
        macroName - the name of the macro to check
        Returns:
        true if the macro has a wiki formatted template.
      • isMissingMetadata

        public boolean isMissingMetadata​(String macroName)
      • countUserMacrosWithWikiTemplates

        public int countUserMacrosWithWikiTemplates()
      • countUserMacrosWithoutMetadata

        public int countUserMacrosWithoutMetadata()
      • getBodyTypes

        public List<String> getBodyTypes()
        Populates the body type select box Only used by AddUserMacroAction and UpdateUserMacroAction If this class gets any more complex consider using delegation
        Returns:
        list of body types
      • getCategories

        public List<HTMLPairType> getCategories()
        Populates the category multiple-select box Only used by AddUserMacroAction and UpdateUserMacroAction If this class gets _any_ more complex consider using delegation
        Returns:
        list of categories
      • getShowInMacroBrowser

        public boolean getShowInMacroBrowser()
      • setShowInMacroBrowser

        public void setShowInMacroBrowser​(boolean showInMacroBrowser)
      • getTemplateHtml

        public String getTemplateHtml()
      • validateNewMacroName

        protected void validateNewMacroName​(String name)
      • validateMacroForm

        protected void validateMacroForm()