com.xpn.xwiki.web
Class AbstractPropChangeAction

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by com.xpn.xwiki.web.XWikiAction
          extended by com.xpn.xwiki.web.AbstractPropChangeAction
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: 9ec187d1a609db3909df5dfedf710bdfc1ef7853 $

Field Summary
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
AbstractPropChangeAction()
           
 
Method Summary
 boolean action(XWikiContext context)
          Tries to change the specified property, and redirect back to the class editor (or the specified xredirect location).
abstract  void changePropertyDefinition(BaseClass xclass, String propertyName, XWikiContext context)
          The method which does the actual modification of the property definition.
 String render(XWikiContext context)
          
 
Methods inherited from class com.xpn.xwiki.web.XWikiAction
cleanupComponents, csrfTokenCheck, execute, execute, getRealPath, getTranslatedDocument, handleRevision, initializeContainerComponent, initializeXWikiContext, sendGlobalRedirect, sendRedirect
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

render

public String render(XWikiContext context)
              throws XWikiException

Overrides:
render in class XWikiAction
Throws:
XWikiException

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


Copyright © 2004-2013 XWiki. All Rights Reserved.