Class AbstractPropChangeAction

  • All Implemented Interfaces:
    com.xpn.xwiki.internal.web.LegacyAction
    Direct Known Subclasses:
    PropDeleteAction, PropDisableAction, PropEnableAction

    public abstract class AbstractPropChangeAction
    extends XWikiAction
    Base class for manipulating property definitions: disable, enable, delete. The property to alter is specified in the propname request parameter, and the class is the one defined in the requested document.
    Since:
    2.4M2
    Version:
    $Id: 2338e495423eaa2d9d331b2a3580c2ec495af385 $
    • Constructor Detail

      • AbstractPropChangeAction

        public AbstractPropChangeAction()
    • Method Detail

      • action

        public boolean action​(XWikiContext context)
                       throws XWikiException
        Tries to change the specified property, and redirect back to the class editor (or the specified xredirect location). If the property does not exist, forward to the exception page.
        Overrides:
        action in class XWikiAction
        Parameters:
        context - the current request context
        Returns:
        false if the operation succeeded and the response is finished, true if the response must be rendered by render(XWikiContext)
        Throws:
        XWikiException - if saving the document fails
      • changePropertyDefinition

        public abstract void changePropertyDefinition​(BaseClass xclass,
                                                      String propertyName,
                                                      XWikiContext context)
                                               throws XWikiException
        The method which does the actual modification of the property definition.
        Parameters:
        xclass - the affected class
        propertyName - the property to change
        context - the current request context
        Throws:
        XWikiException - if a storage error occurs