Difference between revisions of "User:Austin J. Che/Extensions/Recentchangesfilter"

From OpenWetWare
Jump to: navigation, search
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The standard [[Special:Recentchanges|recent changes]] list can be overwhelming with the number of changes. An extension to MediaWiki to allow filtering the changes list using complex patterns is running on OpenWetWare.
+
==Special:Recentchanges Filtering==
 +
The standard [[Special:Recentchanges|recent changes]] list can be overwhelming on a large site with the number of changes. This extension allows users to track a subset of changes that they are interested in and allows users to set preferences for the default filters to use when displaying the recent changes list.  
  
For a quick start and demo, see [[Reshma Shetty/Recent changes]] for an example of using this page.
+
===General Usage===
 +
The key to using this extension is to create desired filters. A filter is used in several possible ways. The filter can be passed as parameters at the end of the URL as extra path info, e.g. '''/wiki/Special:Recentchanges/parameters'''. They can also be passed with the real script path as in  '''/index.php?title=Special:Recentchanges&filter=parameters'''. A URL created in this manner can be either bookmarked in a browser, linked from a wiki page, or directly included within another wiki page (see below).  
  
==Usage==
+
Logged in users also have the ability to set their preferences (with help from the [[../PreferencesExtension/]]). When that extension is also installed, several additional options are added under the recent changs tab of a user's preferences. The enable filtering option turns on or off default filtering. With this option off, when the recent changes page is accessed without a filter in the URL, a normal recent changes page is returned (all results). If this option is enabled, then the other options determine the behavior of the [[Special:Recentchanges]] page when accessed without a filter. The filter list is of the form <tt>[name1]filter1...;[name2]filter2...;[name3]filter3</tt> for as many filters as one would like to define. The [name] part is optional but if not specified, the default name will be the filter number. The last preference allows specifying the default filter (by number, with the first filter numbered 0). When a user access the recent changes page, the default filter will be used if no other filter is given. In addition, the page will contain easy links to switch between all the filters listed on their filter list. An empty filter will always match everything and it is probably a good idea to always include this somewhere in one's list.
  
Currently, the only interface for using this extension is to create a URL by hand. The filtering criteria is passed in one of two ways. The short/easy way is to pass parameters at the end of the URL as extra path info as in <nowiki>http://openwetware.org/wiki/Special:Recentchanges/parameters</nowiki>. The second method is: <nowiki>http://openwetware.org/index.php?title=Special:Recentchanges&filter=parameters</nowiki>. Without any filter parameters, the page is identical to the normal changes list.
+
===Filter Specification===
  
Once a URL is created, the appropriate page can be either bookmarked in your browser, linked from a wiki page, or directly included within another wiki page. When a filter is provided, an extra link is provided at the top that allows toggling between filtering and not filtering the changes list.
+
The filter is specified as a boolean statement in disjunctive normal form (groups of expressions ANDed together that are then all ORed together).  
 
 
===Selection Specification===
 
 
 
The selection criteria is specified as a boolean statement in disjunctive normal form (groups of expressions ANDed together that are then all ORed together).  
 
  
 
====Expression====
 
====Expression====
Line 22: Line 20:
 
* '''e''': titles that end with the pattern
 
* '''e''': titles that end with the pattern
 
* '''c''': titles that contain the pattern
 
* '''c''': titles that contain the pattern
* '''m''': titles that match where the match expression can contain any number of the '%' character to represent a wildcard character that matches any number of charaters. This is a more general version of the b, e, and c types.
+
* '''m''': titles that match where the match expression can contain any number of the '%' character to represent a wildcard character that matches any number of charaters. This is a more general version of the b, e, and c types. Note that for URLs, you may need to encode the percent using '%25' in the URL.
* '''n''': The match pattern should be either a number corresponding to a namespace or the name of a namespace. This matches all pages that are in the given namespace. The main namespace has number 0 and doesn't have a name so you have to use the number. For other namespaces, you can use the name (e.g. 'User') or you can find the number by selecting the namespace in the dropdown list of the recent changes page, click go, and look at the URL to determine the namespace to number mapping.
+
* '''p''': matches the page of the given name (will always match at most one page). The page name should be given fully qualified with the namespace prefix as appropriate (e.g. as p=User:Austin). The criteria n=User^p=Austin will never match any pages because p=Austin is interpreted as being in the main namespace and no page can be in both the User and main namespaces.
 +
* '''n''': The match pattern should be either a number corresponding to a namespace or the name of a namespace. This matches all pages that are in the given namespace. The main namespace has number 0 and doesn't have a name so you have to use the number. For other namespaces, you can use the name (e.g. 'User talk') or you can find the number by selecting the namespace in the dropdown list of the recent changes page, click go, and look at the URL to determine the namespace to number mapping. There's also a namespace called 'Special' with number -1 that includes pages like the upload log.
 
* '''u''': match changes that were done by the given user
 
* '''u''': match changes that were done by the given user
 
* '''w''': match changes for pages on your (or whoever's currently logged in) watchlist. The match pattern is ignored so it can just be set to 1 or left off completely.
 
* '''w''': match changes for pages on your (or whoever's currently logged in) watchlist. The match pattern is ignored so it can just be set to 1 or left off completely.
Line 31: Line 30:
 
If no match type is specified (there is no equals sign), then the matching will be done with the default type of '''b'''.
 
If no match type is specified (there is no equals sign), then the matching will be done with the default type of '''b'''.
  
Note that for the purpose of selecting pages by titles, it is necessary to be clear which namespace a page is in. For example, the page User:Austin is not a page titled User:Austin but rather a page titled Austin in the namespace User. Thus, b=User won't match this page but either b=Austin or n=User would. Pages like Knight:Contact are in the main namespace so b=Contact wouldn't match this whereas b=Knight would.
+
''Note that for the purpose of selecting pages by title patterns, it is necessary to be clear which namespace a page is in.'' For example, the page User:Austin is not a page titled User:Austin but rather a page titled Austin in the namespace User. Thus, b=User won't match this page but either b=Austin or n=User would. Pages like Knight:Contact are in the main namespace so b=Contact wouldn't match this whereas b=Knight would.
  
 
====Joining Expressions====
 
====Joining Expressions====
Line 46: Line 45:
  
 
===Including within another page===
 
===Including within another page===
The special page can be included using the standard <nowiki>{{Special:Recentchanges/parameters)}}</nowiki> syntax. This allows including a select list of changes on a page.
+
The special page can be included using the standard <nowiki>{{Special:Recentchanges/parameters)}}</nowiki> syntax. This allows including a select list of changes on a page. For example, here's a live demo showing the last 5 changes of articles in the main namespace that do not have a ':' in their name (uncategorized/general pages):{{Special:Recentchanges/n=0^nc=:&limit=5}}
 +
 
 +
==Installation/MediaWiki compatibility==
 +
 
 +
More than most extensions, this one depends heavily on the internals of MediaWiki. Much of the code from wfSpecialRecentchanges is directly copied into this extension and updates to MediaWiki will require the corresponding update to this code. The current version of the code has been updated to work with the version of  MediaWiki running on this wiki (version {{CURRENTVERSION}}). Older versions are also available in the source directory.
  
==Source Download==
+
----
The extension was written by [[Austin Che]] and is available for download:
+
Send bugs and comments to [[Austin Che]]. Other extensions including  sources can be found at [[../]].
[http://austinche.name/mediawiki/SpecialRecentchangesfilter.php.txt SpecialRecentchangesfilter.php]
 
  
 +
__NOTOC__
  
Feel free to send comments or improvements.
+
[[category:Extensions]]

Latest revision as of 08:38, 17 November 2007

Special:Recentchanges Filtering

The standard recent changes list can be overwhelming on a large site with the number of changes. This extension allows users to track a subset of changes that they are interested in and allows users to set preferences for the default filters to use when displaying the recent changes list.

General Usage

The key to using this extension is to create desired filters. A filter is used in several possible ways. The filter can be passed as parameters at the end of the URL as extra path info, e.g. /wiki/Special:Recentchanges/parameters. They can also be passed with the real script path as in /index.php?title=Special:Recentchanges&filter=parameters. A URL created in this manner can be either bookmarked in a browser, linked from a wiki page, or directly included within another wiki page (see below).

Logged in users also have the ability to set their preferences (with help from the PreferencesExtension). When that extension is also installed, several additional options are added under the recent changs tab of a user's preferences. The enable filtering option turns on or off default filtering. With this option off, when the recent changes page is accessed without a filter in the URL, a normal recent changes page is returned (all results). If this option is enabled, then the other options determine the behavior of the Special:Recentchanges page when accessed without a filter. The filter list is of the form [name1]filter1...;[name2]filter2...;[name3]filter3 for as many filters as one would like to define. The [name] part is optional but if not specified, the default name will be the filter number. The last preference allows specifying the default filter (by number, with the first filter numbered 0). When a user access the recent changes page, the default filter will be used if no other filter is given. In addition, the page will contain easy links to switch between all the filters listed on their filter list. An empty filter will always match everything and it is probably a good idea to always include this somewhere in one's list.

Filter Specification

The filter is specified as a boolean statement in disjunctive normal form (groups of expressions ANDed together that are then all ORed together).

Expression

The general form for an expression is <match type>=<match pattern>.

Match types are 1 or 2 letter codes and specify how the match pattern should be used in selecting items to display in the recent changes list. The basic types and their meaning:

  • b: titles that begin with the pattern
  • e: titles that end with the pattern
  • c: titles that contain the pattern
  • m: titles that match where the match expression can contain any number of the '%' character to represent a wildcard character that matches any number of charaters. This is a more general version of the b, e, and c types. Note that for URLs, you may need to encode the percent using '%25' in the URL.
  • p: matches the page of the given name (will always match at most one page). The page name should be given fully qualified with the namespace prefix as appropriate (e.g. as p=User:Austin). The criteria n=User^p=Austin will never match any pages because p=Austin is interpreted as being in the main namespace and no page can be in both the User and main namespaces.
  • n: The match pattern should be either a number corresponding to a namespace or the name of a namespace. This matches all pages that are in the given namespace. The main namespace has number 0 and doesn't have a name so you have to use the number. For other namespaces, you can use the name (e.g. 'User talk') or you can find the number by selecting the namespace in the dropdown list of the recent changes page, click go, and look at the URL to determine the namespace to number mapping. There's also a namespace called 'Special' with number -1 that includes pages like the upload log.
  • u: match changes that were done by the given user
  • w: match changes for pages on your (or whoever's currently logged in) watchlist. The match pattern is ignored so it can just be set to 1 or left off completely.

All of the above types have a negated version with an extra n in front, i.e. nb, ne, nc, etc. For example, nb=foo will match all pages that don't begin with foo.

If no match type is specified (there is no equals sign), then the matching will be done with the default type of b.

Note that for the purpose of selecting pages by title patterns, it is necessary to be clear which namespace a page is in. For example, the page User:Austin is not a page titled User:Austin but rather a page titled Austin in the namespace User. Thus, b=User won't match this page but either b=Austin or n=User would. Pages like Knight:Contact are in the main namespace so b=Contact wouldn't match this whereas b=Knight would.

Joining Expressions

'^' is used to represent AND and ',' (comma) is used to represent OR. Expressions are assumed to be in disjunctive normal form so there's an intrinsic parenthesis order (and no way to change this order). This means that all the ANDs have higher precedence than the ORs.

Examples

Including within another page

The special page can be included using the standard {{Special:Recentchanges/parameters)}} syntax. This allows including a select list of changes on a page. For example, here's a live demo showing the last 5 changes of articles in the main namespace that do not have a ':' in their name (uncategorized/general pages):

20 October 2017

     09:23  Carrico‎ (diff | hist) . . (-305). . Yar (talk | contribs) (use mediawiki markup for images, not raw html)
     09:15 (User creation log) . . User account Msupestka (talk | contribs) was created by Yar (talk | contribs) and password was sent by email ‎

 m   08:27 

Beauchamp:DataSharing‎‎ (2 changes | history) . . (+228). . [John Magnotti‎ (2×)]

 m   

08:27

(cur | prev) . . (-2). . John Magnotti (talk | contribs)

 m   

08:27

(cur | prev) . . (+230). . John Magnotti (talk | contribs)

     08:02  Peyton: Lab Meeting Schedule Fall 2017‎ (diff | hist) . . (0). . Maria F. Gencoglu (talk | contribs)
     07:49  Min-Ho Kim Lab:Lab Members‎ (diff | hist) . . (-89). . Min-Ho Kim (talk | contribs)

19 October 2017

     21:07  BME100 f2017:Group7 W0800 L4‎ (diff | hist) . . (+977). . Miguel R. Almanza Lopez (talk | contribs) (SNP Information & Primer Design)

     18:43 

BME100 f2017:Group6 W1030 L4‎‎ (4 changes | history) . . (+1,447). . [Ray Gerard Regorgo‎ (4×)]

     

18:43

(cur | prev) . . (-196). . Ray Gerard Regorgo (talk | contribs) (OUR TEAM)

     

18:42

(cur | prev) . . (-3). . Ray Gerard Regorgo (talk | contribs) (OUR TEAM)

     

17:59

(cur | prev) . . (-3). . Ray Gerard Regorgo (talk | contribs) (Research and Development)

     

16:46

(cur | prev) . . (+1,649). . Ray Gerard Regorgo (talk | contribs) (Research and Development)

     15:43  User:Julie A. Fogarty‎ (diff | hist) . . (+46). . Julie A. Fogarty (talk | contribs) (Julie A. Fogarty)

     15:33 

Rich Lab:Funding‎‎ (2 changes | history) . . (-12). . [Isabel C. Morales‎ (2×)]

     

15:33

(cur | prev) . . (+12). . Isabel C. Morales (talk | contribs)

     

14:06

(cur | prev) . . (-24). . Isabel C. Morales (talk | contribs)

     14:58 

CONJ606:Materials‎‎ (2 changes | history) . . (+1,004). . [Weinjule‎; Peteral‎]

     

14:58

(cur | prev) . . (+685). . Peteral (talk | contribs) (Week 2: Me Myself and I-dentifiers, The Key To Immortality (Persistence))

     

12:15

(cur | prev) . . (+319). . Weinjule (talk | contribs) (Papers)

     14:52 

User:Peteral‎‎ (3 changes | history) . . (+1,264). . [Peteral‎ (3×)]

     

14:52

(cur | prev) . . (+185). . Peteral (talk | contribs) (Alec's Discussion Questions)

     

13:52

(cur | prev) . . (+351). . Peteral (talk | contribs) (Alec's Discussion Questions)

     

10:53

(cur | prev) . . (+728). . Peteral (talk | contribs) (Alec's Discussion Questions)

     14:13 

BME100 f2017:Group14 W0800 L4‎‎ (9 changes | history) . . (+9). . [Shae M. Diaz‎ (9×)]

     

14:13

(cur | prev) . . (+8). . Shae M. Diaz (talk | contribs) (Protocol)

     

14:12

(cur | prev) . . (-31). . Shae M. Diaz (talk | contribs) (TEAM MEMBERS)

     

14:10

(cur | prev) . . (+31). . Shae M. Diaz (talk | contribs) (TEAM MEMBERS)

     

14:09

(cur | prev) . . (+4). . Shae M. Diaz (talk | contribs) (TEAM MEMBERS)

     

14:05

(cur | prev) . . (-1). . Shae M. Diaz (talk | contribs) (TEAM MEMBERS)

     

14:05

(cur | prev) . . (+1). . Shae M. Diaz (talk | contribs) (TEAM MEMBERS)

     

14:04

(cur | prev) . . (-1). . Shae M. Diaz (talk | contribs) (TEAM MEMBERS)

     

13:55

(cur | prev) . . (+1). . Shae M. Diaz (talk | contribs) (TEAM MEMBERS)

     

13:55

(cur | prev) . . (-3). . Shae M. Diaz (talk | contribs) (TEAM MEMBERS)

 m   14:12  Swartz‎ (diff | hist) . . (+61). . Marcus Rohovie (talk | contribs)
     14:10 (Move log) . . Marcus Rohovie (talk | contribs) moved page Swartz to Swartz:Main

     14:08 

(Upload log). .

[Thorntca‎; Shae M. Diaz‎ (3×)]

     

14:08

. . Shae M. Diaz (talk | contribs) uploaded File:100profileshae.JPG

     

14:01

. . Shae M. Diaz (talk | contribs) uploaded File:Shaediaz100.JPG

     

13:51

. . Shae M. Diaz (talk | contribs) uploaded File:BME100ShaeD.JPG

     

13:17

. . Thorntca (talk | contribs) uploaded File:2Dgel.png.jpg

     13:52 

Klenow Assembly Method: Seamless cloning‎‎ (3 changes | history) . . (+101). . [David M.D. Bailey‎ (3×)]

     

13:52

(cur | prev) . . (-5). . David M.D. Bailey (talk | contribs) (The Klenow Assembly Method (KAM) for the seamless cloning of overlapping double stranded DNA fragments: Very cheap alternative to the Gibson Assembly)

     

13:51

(cur | prev) . . (+1). . David M.D. Bailey (talk | contribs) (The Klenow Assembly Method (KAM) for the seamless cloning of overlapping double stranded DNA fragments: Very cheap alternative to the Gibson Assembly)

     

13:50

(cur | prev) . . (+105). . David M.D. Bailey (talk | contribs) (The Klenow Assembly Method (KAM) for the seamless cloning of overlapping double stranded DNA fragments: Very cheap alternative to the Gibson Assembly)

     13:22 

User:Thorntca‎‎ (8 changes | history) . . (+529). . [Thorntca‎ (8×)]

     

13:22

(cur | prev) . . (+145). . Thorntca (talk | contribs)

     

13:19

(cur | prev) . . (+17). . Thorntca (talk | contribs)

     

13:19

(cur | prev) . . (+4). . Thorntca (talk | contribs)

     

13:18

(cur | prev) . . (+30). . Thorntca (talk | contribs)

     

13:16

(cur | prev) . . (+417). . Thorntca (talk | contribs)

     

12:52

(cur | prev) . . (+12). . Thorntca (talk | contribs)

     

12:51

(cur | prev) . . (-5). . Thorntca (talk | contribs)

     

12:51

(cur | prev) . . (-91). . Thorntca (talk | contribs)

     12:27 

User:Madeline.churchill‎‎ (2 changes | history) . . (+302). . [Madeline.churchill‎ (2×)]

     

12:27

(cur | prev) . . (0). . Madeline.churchill (talk | contribs) (TZAP protein controls telomere Trimming process)

     

12:27

(cur | prev) . . (+302). . Madeline.churchill (talk | contribs) (Madeline Churchill's Discussion Page)

     09:17  BioMicroCenter:BIG meeting‎ (diff | hist) . . (+19). . George W Bell (talk | contribs) (2017-2018 academic year)
     07:06 (User creation log) . . User account Newfish (talk | contribs) was created by Yar (talk | contribs) and password was sent by email ‎
     04:10  BioMicroCenter:BioinfoClasses‎ (diff | hist) . . (+9). . Charlie Whittaker (talk | contribs) (Teaching Schedule)

Installation/MediaWiki compatibility

More than most extensions, this one depends heavily on the internals of MediaWiki. Much of the code from wfSpecialRecentchanges is directly copied into this extension and updates to MediaWiki will require the corresponding update to this code. The current version of the code has been updated to work with the version of MediaWiki running on this wiki (version 1.29.1). Older versions are also available in the source directory.


Send bugs and comments to Austin Che. Other extensions including sources can be found at User:Austin J. Che/Extensions.