Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-24733

Allow resetting all the pages of an installed XAR extension at once

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 17.10.0
    • Extension
    • None
    • Unknown

    Description

      Problem

      Restoring the pages of an installed XAR extension to their packaged state is possible today, but only one page at a time.

      The flow is: click "Compute changes" on the extension, which runs DiffXarJob and parses every entry of the XAR, then click the "Reset" button on each changed page in the resulting diff view. That button calls XarExtensionScriptService#reset(), which delegates to Packager#reset(): it applies the packaged document over the database one and saves it. Because XWiki#getDocument() returns a fresh empty document when the page is absent, this also recreates a page that was deleted.

      There is no way to do it for the whole extension in one go. For an extension whose pages have been broadly modified, or partly deleted, the user has to run the diff job first and then click "Reset" once per page.

      Proposal

      Add a way to reset all the pages of an installed XAR extension to their packaged state in a single operation, alongside the existing per-page "Reset" button of the changes view.

      Points to settle:

      • it should be a job rather than a synchronous action, so that a large XAR is handled asynchronously and reports progress, reusing Packager#reset() for each entry;
      • whether it resets every entry of the XAR, or only the entries the diff reported as changed – restricting it to the changed ones avoids rewriting and adding a version to untouched pages;
      • whether it needs a confirmation step listing what is about to be overwritten, since a reset discards customisations by design, unlike the install and upgrade path which merges.

      Notes

      • This is deliberately narrower than XWIKI-10330, which is about re-running the extension handlers for an already-installed version, and which would apply the normal merge semantics rather than overwriting. A bulk reset is a much smaller change and may already cover a good part of the same practical need.
      • XWIKI-19418 is an existing bug of the per-page reset, where the edit right is checked against the script author rather than the current user. It would apply to a bulk reset too.
      • XWIKI-19663 asks for a tab listing all the pages of a XAR extension, which is a natural place for such a bulk action.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: