Package com.xpn.xwiki.web
Class DeleteAction
- java.lang.Object
-
- com.xpn.xwiki.web.XWikiAction
-
- com.xpn.xwiki.web.DeleteAction
-
- All Implemented Interfaces:
com.xpn.xwiki.internal.web.LegacyAction
- Direct Known Subclasses:
DeleteSpaceAction
@Component @Named("delete") @Singleton public class DeleteAction extends XWikiAction
Action for delete document to recycle bin and for delete documents from recycle bin.- Version:
- $Id: bc1cb2173d945d0f803eb5c81a1dc42576e4e031 $
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
ACTION_NAME
protected static String
ASYNC_PARAM
protected static String
CONFIRM_PARAM
confirm parameter name.protected static String
EMPTY_RECYCLE_BIN
protected static String
RECYCLED_DOCUMENT_ID_PARAM
-
Fields inherited from class com.xpn.xwiki.web.XWikiAction
ACTION_PROGRESS, componentDescriptor, container, execution, observation, waitForXWikiInitialization
-
-
Constructor Summary
Constructors Constructor Description DeleteAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
action(XWikiContext context)
protected boolean
delete(XWikiContext context)
protected boolean
deleteDocument(EntityReference entityReference, XWikiContext context, boolean shouldSkipRecycleBin, DocumentReference newBacklinkTarget, boolean updateLinks, boolean autoRedirect)
Create a job to delete an entity.String
render(XWikiContext context)
-
Methods inherited from class com.xpn.xwiki.web.XWikiAction
answerJSON, cleanupComponents, csrfTokenCheck, csrfTokenCheck, execute, execute, getContextualAuthorizationManager, getCurrentMixedDocumentReferenceResolver, getCurrentScriptContext, getEntityNameValidationConfiguration, getEntityNameValidationManager, getFormClass, getLocalization, getLocalSerializer, getName, getProgress, getRealPath, getTranslatedDocument, handleRevision, initializeContainerComponent, initializeXWikiContext, initializeXWikiContext, isEntityReferenceNameValid, localizePlainOrKey, readFromTemplate, resolveTemplate, sendGlobalRedirect, sendRedirect, setContentLength, supportRedirections, writeAjaxErrorResponse
-
-
-
-
Field Detail
-
CONFIRM_PARAM
protected static final String CONFIRM_PARAM
confirm parameter name.- See Also:
- Constant Field Values
-
ACTION_NAME
protected static final String ACTION_NAME
- See Also:
- Constant Field Values
-
ASYNC_PARAM
protected static final String ASYNC_PARAM
- See Also:
- Constant Field Values
-
RECYCLED_DOCUMENT_ID_PARAM
protected static final String RECYCLED_DOCUMENT_ID_PARAM
- See Also:
- Constant Field Values
-
EMPTY_RECYCLE_BIN
protected static final String EMPTY_RECYCLE_BIN
- See Also:
- Constant Field Values
-
-
Method Detail
-
action
public boolean action(XWikiContext context) throws XWikiException
- Overrides:
action
in classXWikiAction
- Throws:
XWikiException
-
render
public String render(XWikiContext context) throws XWikiException
- Overrides:
render
in classXWikiAction
- Throws:
XWikiException
-
delete
protected boolean delete(XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
deleteDocument
protected boolean deleteDocument(EntityReference entityReference, XWikiContext context, boolean shouldSkipRecycleBin, DocumentReference newBacklinkTarget, boolean updateLinks, boolean autoRedirect) throws XWikiException
Create a job to delete an entity. An entity can either be deleted permanently or moved to the recycle bin. The preference of the user deleting the entity is stored in theshouldSkipRecycleBin
parameter. WhenshouldSkipRecycleBin
istrue
the entity is preferably permanently deleted. Otherwise, the entity is preferably moved to the recycle bin. Note that it only express a choice made by the user. If the user does not have the right to remove an entity permanently, the entity might still be saved in the recycle bin. If the wiki does not have access to a recycle bin, the entity might be permanently removed, regardless of the user's preferences.- Parameters:
entityReference
- the entity to deletecontext
- the current context, used to access the user's requestshouldSkipRecycleBin
- iffalse
the entity is preferably sent to the recycle bin, iftrue
, the entity is preferably deleted permanentlynewBacklinkTarget
- reference of an existing document to be used as new backlink targetupdateLinks
-true
if the links that target the deleted document should be updated to target the new reference,false
to preserve the old linkautoRedirect
- iftrue
, a redirection will be set from the deleted document location to the new target- Returns:
true
if the user is redirected,false
otherwise- Throws:
XWikiException
- if anything goes wrong during the document deletion- Since:
- 12.8RC1
-
-