Package com.xpn.xwiki.web
Class AbstractPropChangeAction
- java.lang.Object
-
- com.xpn.xwiki.web.XWikiAction
-
- com.xpn.xwiki.web.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 thepropname
request parameter, and the class is the one defined in the requested document.- Since:
- 2.4M2
- Version:
- $Id: 2338e495423eaa2d9d331b2a3580c2ec495af385 $
-
-
Field Summary
-
Fields inherited from class com.xpn.xwiki.web.XWikiAction
ACTION_PROGRESS, componentDescriptor, container, execution, observation, waitForXWikiInitialization
-
-
Constructor Summary
Constructors Constructor Description AbstractPropChangeAction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
action(XWikiContext context)
Tries to change the specified property, and redirect back to the class editor (or the specifiedxredirect
location).abstract void
changePropertyDefinition(BaseClass xclass, String propertyName, XWikiContext context)
The method which does the actual modification of the property definition.protected Class<? extends XWikiForm>
getFormClass()
String
render(XWikiContext context)
-
Methods inherited from class com.xpn.xwiki.web.XWikiAction
answerJSON, cleanupComponents, csrfTokenCheck, csrfTokenCheck, execute, execute, getContextualAuthorizationManager, getCurrentMixedDocumentReferenceResolver, getCurrentScriptContext, getEntityNameValidationConfiguration, getEntityNameValidationManager, getLocalization, getLocalSerializer, getName, getProgress, getRealPath, getTranslatedDocument, handleRevision, initializeContainerComponent, initializeXWikiContext, initializeXWikiContext, isEntityReferenceNameValid, localizePlainOrKey, readFromTemplate, resolveTemplate, sendGlobalRedirect, sendRedirect, setContentLength, supportRedirections, writeAjaxErrorResponse
-
-
-
-
Method Detail
-
getFormClass
protected Class<? extends XWikiForm> getFormClass()
- Overrides:
getFormClass
in classXWikiAction
- Returns:
- the class of the XWikiForm in charge of parsing the request
-
action
public boolean action(XWikiContext context) throws XWikiException
Tries to change the specified property, and redirect back to the class editor (or the specifiedxredirect
location). If the property does not exist, forward to the exception page.- Overrides:
action
in classXWikiAction
- Parameters:
context
- the current request context- Returns:
false
if the operation succeeded and the response is finished,true
if the response must be rendered byrender(XWikiContext)
- Throws:
XWikiException
- if saving the document fails
-
render
public String render(XWikiContext context) throws XWikiException
- Overrides:
render
in classXWikiAction
- 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 classpropertyName
- the property to changecontext
- the current request context- Throws:
XWikiException
- if a storage error occurs
-
-