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 thepropnamerequest 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 booleanaction(XWikiContext context)Tries to change the specified property, and redirect back to the class editor (or the specifiedxredirectlocation).abstract voidchangePropertyDefinition(BaseClass xclass, String propertyName, XWikiContext context)The method which does the actual modification of the property definition.protected Class<? extends XWikiForm>getFormClass()Stringrender(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, localizeOrReturnKey, localizePlainOrKey, localizePlainOrReturnKey, readFromTemplate, resolveTemplate, sendGlobalRedirect, sendRedirect, setContentLength, supportRedirections, writeAjaxErrorResponse
-
-
-
-
Method Detail
-
getFormClass
protected Class<? extends XWikiForm> getFormClass()
- Overrides:
getFormClassin 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 specifiedxredirectlocation). If the property does not exist, forward to the exception page.- Overrides:
actionin classXWikiAction- Parameters:
context- the current request context- Returns:
falseif the operation succeeded and the response is finished,trueif the response must be rendered byrender(XWikiContext)- Throws:
XWikiException- if saving the document fails
-
render
public String render(XWikiContext context) throws XWikiException
- Overrides:
renderin 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
-
-