Extension:GWToolset/Technical Implementation/Application entry

GWToolset is a Special Page extension. Its entry point is the same as any other Special Page, an initial set-up file,, and a special page file,  , extending SpecialPage and overriding the execute method.

GWToolset.php
Similar to other set-up pages with the difference being in the use of  and the   file to set-up various configuration settings. This convention was chosen in order to maintain a “cleaner” set-up file and isolate the extension’s configuration values within the  namespace.

wikiChecks
A series of checks to make sure the wiki environment is properly setup for the extension and that the user has permission to use it.

setModuleAndHandler
The extension uses the SpecialGWToolset->module_key to represent a step within the upload process. Each module_key has a corresponding handler, form and allow-get request value; the form value is not required and some module_keys share the same handler.

When the module_key is null or the module_key’s allow-get value is set to false, the introduction copy for the upload process is shown.

The current module_keys are:


 * 1) metadata-detect
 * 2) metadata-mapping
 * 3) metadata-mapping-save
 * 4) metadata-preview

processRequest
Sends the code to the proper handler depending on the  and whether or not the page request was a   or a. Below is a list of scenarios currently handled.


 * 1) when   has not been set, is invalid, or does not allow   access, the introduction message to the extension is displayed.
 * 2) when   is valid and allows   access, the handler’s   method is called.
 * 3) * at present, the only  that allows for this scenario is ‘metadata-detect’.
 * 4) * if an exception is thrown a user message is displayed.


 * 1) when   is valid and the request is not a , the handler’s   method is called.
 * 2) * if an exception is thrown a user message is displayed.
 * 3) when   is invalid, an exception is thrown and a user message is displayed.