Class 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 $
    • Constructor Detail

      • DeleteAction

        public DeleteAction()
    • Method Detail

      • 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 the shouldSkipRecycleBin parameter. When shouldSkipRecycleBin is true 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 delete
        context - the current context, used to access the user's request
        shouldSkipRecycleBin - if false the entity is preferably sent to the recycle bin, if true, the entity is preferably deleted permanently
        newBacklinkTarget - reference of an existing document to be used as new backlink target
        updateLinks - true if the links that target the deleted document should be updated to target the new reference, false to preserve the old link
        autoRedirect - if true, 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