DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:batchedit

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revision
plugin:batchedit [2018-05-28 20:38]
Klap-in [Download and Installation]
plugin:batchedit [2021-04-17 17:09]
dwp-forge New release
Line 4: Line 4:
 description: Edit wiki pages using regular expressions description: Edit wiki pages using regular expressions
 author     : Mykola Ostrovskyy author     : Mykola Ostrovskyy
-email      : spambox03@mail.ru+email      : dwpforge@gmail.com
 type       : admin type       : admin
-lastupdate : 2018-02-11 +lastupdate : 2021-04-17 
-compatible : 2012-10-13, "Adora Belle", Hrun, "Frusterick Manners"+compatible : Hrun, "Frusterick Manners", Greebo, Hogfather
 depends    :  depends    : 
 conflicts  conflicts 
Line 13: Line 13:
 tags       : search, replace, regexp, editing tags       : search, replace, regexp, editing
  
-downloadurl: https://github.com/dwp-forge/batchedit/archive/v.2018-02-11.zip+downloadurl: https://github.com/dwp-forge/batchedit/archive/v.2021-04-17.zip
 bugtracker : https://github.com/dwp-forge/batchedit/issues bugtracker : https://github.com/dwp-forge/batchedit/issues
 sourcerepo : https://github.com/dwp-forge/batchedit sourcerepo : https://github.com/dwp-forge/batchedit
  
-screenshot_img: http://img132.imageshack.us/img132/7844/31391754.png+screenshot_img: https://images2.imgbox.com/03/10/NeQ5FXhv_o.png
 ---- ----
  
Line 27: Line 27:
 Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually. Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
-  * [[https://github.com/dwp-forge/batchedit/archive/v.2018-02-11.zip|batchedit-2018-02-11]]+  * [[https://github.com/dwp-forge/batchedit/archive/v.2021-04-17.zip|batchedit-2021-04-17]]
  
  
 ===== User Interface ===== ===== User Interface =====
  
-{{ http://img132.imageshack.us/img132/7844/31391754.png?400|Screenshot}}+After installation BatchEdit shows up on the //Administration// pageWhen started, the plugin displays a form with four primary edit fields:
  
-After installation BatchEdit shows up on the //Administration// page.+{{ https://images2.imgbox.com/7d/08/aFH4zRaF_o.png?800 |Main UI}}
  
-When started, the plugin displays a form with four edit fields: +  * //Namespace// -- allows you to select a top level [[:namespaces|namespace]] that contains pages to search in. All the namespaces below the selected one will be included in the search as well. Standard name resolution of the namespaces applies here (e.g. "." stands for the current namespace, etc.). If the namespace is not provided, BatchEdit will search through the entire wiki. 
- +  * //Search for// -- depending on selected options this can be plain text string, regular expression, or fully qualified regular expression including delimiters and modifiers. BatchEdit uses Perl-compatible syntax of regular expression as defined by [[http://www.php.net/manual/en/book.pcre.php|PHP PCRE extension]]. 
-  * //Namespace// --- allows you to select a top level [[:namespaces|namespace]] that contains pages to search in. All the namespaces below the selected one will be included in the search as well. Standard name resolution of the namespaces applies here (e.g. "." stands for the current namespace, etc.). If the namespace is not provided, BatchEdit will search through the entire wiki. +  * //Replace with// -- the replacement text or pattern. For the syntax see [[http://php.net/manual/en/function.preg-replace.php|preg_replace]] documentation. 
-  * //Regular expression// --fully qualified regular expression including the modifiers. BatchEdit uses [[http://www.php.net/manual/en/book.pcre.php|PHP PCRE extension]] to do the matching+  * //Edit summary// -- summary of the replacement. This field has the same purpose as the //Edit summary// field of the DokuWiki text editor.
-  * //Replacement// --- the replacement pattern. For the syntax see [[http://php.net/manual/en/function.preg-replace.php|preg_replace]] documentation. +
-  * //Summary// --- summary of the replacement. This field has the same purpose as the //Summary// field of the DokuWiki text editor.+
  
 Below the edit fields there are two buttons: Below the edit fields there are two buttons:
Line 48: Line 46:
   * //Apply// -- replaces selected (see below) matches. If there are no selected matches it acts identical to the //Preview// button.   * //Apply// -- replaces selected (see below) matches. If there are no selected matches it acts identical to the //Preview// button.
  
-BatchEdit displays every match of the search results in separate boxOn top of the box the plugin shows a check box with the page name and a character offset where the match occurred. The check box is used to select matches for the replacement. In order to prevent unexpected results the check box is unchecked by default requiring the user to confirm every replacement. To the right from the page name there are two icons: the first one links to the page itself and the second one to the editor. The rest of the box is split in two parts: matched text with some context on the left side; and the same fragment with applied replacement on the right. Both the matched text and the replacement are highlighted.+{{ https://images2.imgbox.com/b8/59/8NixhxOL_o.png?800 |Match box}} 
 + 
 +BatchEdit displays search matches in separate boxes, which are grouped per pageNext to the page identifier and on every match box there is a check box, which is used to mark matches for replacement. In order to prevent unexpected results the check box is unchecked by default requiring the user to confirm every replacement. The match box is split in two parts: matched text with some context on the left side; and the same fragment with applied replacement on the right. Both the matched text and the replacement are highlighted.
  
 After the replacement, the matches show up with no check box in the caption and replaced text is highlighted with green. After the replacement, the matches show up with no check box in the caption and replaced text is highlighted with green.
 +
 +
 +==== Configuration ====
 +
 +BatchEdit uses two types of configuration options:
 +  * User-specific options -- all options available on BatchEdit page are individual for each user. These options are stored in a browser cookie, so strictly speaking they are browser-specific.
 +  * Global options -- can be modified on DokuWiki configuration page. They control aspects of BatchEdit operation, which are rarely (if ever) to be changed.
 +
  
 ===== Technical details ===== ===== Technical details =====
Line 56: Line 64:
 ==== Performance ==== ==== Performance ====
  
-BatchEdit does not rely on any caching to do the search, so every time //Preview// or //Apply// button is clicked the DokuWiki server reads all the pages from a hard drive. To reduce the server load and search time use //Namespace// field that limits the search scope.+BatchEdit performs caching of the search results to avoid repeating the search when replacement is applied. Yet on every preview attempt the DokuWiki server reads all the pages from a hard drive. To reduce the server load and search time use //Namespace// field that limits the search scope or limit the number of search results in //Advanced options//.
  
  
-==== Page locking ====+==== Concurrent page edits ====
  
-While BatchEdit locks pages during replacement, there is still small possibility for the data corruption. The replacement is performed in two stages: +Because of two-staged approach of Preview&Apply, there is a possibility that while one user verifies and marks matches for replacement some other user modifies one of the involved pages. To prevent any data corruption BatchEdit locks pages during replacement and verifies that matched text is still located at the match offset. If any of the marked matches cannot be found at expected offsets, replacement for that page is rejected.
-  - BatchEdit searches for the regular expression matches in all the pages. For every match the plugin records character offset in the page where the match occurs. +
-  - On the second stage BatchEdit compares matches found during the first pass with a list of matches selected for replacement. For the matches found in both lists BatchEdit locks the page and performs the replacement using the offset.+
  
-If the page is modified between these two stages, BatchEdit will apply the replacement to random data in the updated page. Though the chances of such corruption are rather small, the administrators should take care to minimize DokuWiki activity when Batchedit is used.+This verification still leaves a possibility that replacement will be applied to a different instance of the original text that happened to be at the exactly right offset after the edit, but likelihood of that is rather small. Anywayit's recommended that administrators take care to minimize DokuWiki activity when BatchEdit is used.
  
  
 ==== Page lookup ==== ==== Page lookup ====
  
-BatchEdit uses DokuWiki page index to get the list of existing pages instead of going through the data directories. If the index is incomplete the plugin will not see some pages. This also applies to the "special" pages, for example, namespace templates.+BatchEdit uses DokuWiki page index to get the list of existing pages instead of going through the data directories. Because of the missing or incomplete index BatchEdit may show less search results than expected. This is often the case for a freshly migrated wiki. You can use [[plugin:searchindex|Searchindex Manager]] plugin to get the index up to date. 
 + 
 +This limitation also applies to the "special" pages (e.g. namespace templates), which are not listed in the index and therefore cannot be edited by BatchEdit.
  
  
 ===== Version History ===== ===== Version History =====
 +
 +==== 2021-04-17 ====
 +
 + * Fixed PHP 8.0 compatibility issues
 + * Fixed admin UI layout in Safari browser
 + * Fixed support of DokuWiki hosted in proxied subfolder
 + * Updated French translation
 + * Updated Russian translation
 +
 +==== 2020-07-31 ====
 +
 +  * Fixed compatibility with DokuWiki Hogfather
 +  * Russian translation update
 +
 +==== 2019-06-02 ====
 +
 +  * Added Russian translation
 +  * German translation update
 +
 +==== 2018-11-25 ====
 +
 +  * French translation update
 +  * Minor fixes
 +
 +==== 2018-08-18 ====
 +
 +  * Major UI update
 +  * Added global and per page check boxes to mark multiple matches
 +  * Added various configuration options
 +  * Added progress bar for long operations
 +  * Performance optimizations for massive edits
 +  * Added Chinese(Simplified) translation
  
 ==== 2018-02-11 ==== ==== 2018-02-11 ====
plugin/batchedit.txt · Last modified: 2021-04-17 17:12 by dwp-forge