Extension:AddPageService

Introduction
AddPageService is a web service that enables external programs to add or edit pages on the wiki just as a regular user.



Features

 * Can add or edit pages.
 * Impersonates a wiki user.
 * Requires user name and password.
 * Has the same behavior as a manual edit.
 * Silently replaces invalid characters in page titles.

Installation

 * 1) Install Snoopy. Download it and extract it into some directory.
 * 2) Install PEAR SOAP. For instance, execute this command in the php directory: pear install channel://pear.php.net/soap-0.10.1
 * 3) Download AddPageService.php and save it in the extensions directory of your wiki.

Configuration
Edit the "Customization required" section in AddPageService.php:
 * 1) $wiki_root_url: Must point to the base URL of your wiki.
 * 2) Snoopy: Specify the correct path for the include directive for the Snoopy class.
 * 3) $debug_file_name: Specify a full pathname for a temporary debug file or an empty string to disable this feature.
 * The debug file shows the wiki response to the request to open the edit form. Most problems can be diagnosed with the error messages in this file.
 * 1) $strict_title_rules: True to apply more strict rules about valid characters in page titles.
 * With this option on, some characters that are valid but may cause problems will be substituted for spaces. For more information see Wikipedia:Naming conventions (technical restrictions).

Test

 * 1) Download TestAddPage.php and save it in the extensions directory of your wiki.
 * 2) Edit the "Customization required" section in TestAddPage.php:
 * 3) * $endpoint: The full URL of the AddPage web service.
 * 4) * $user: A valid wiki user name.
 * 5) * $password: The password of the $user.
 * 6) * $title: The title of the test page to be created.
 * 7) * $text: The contents of the test page to be created.
 * 8) Using the full URL, open TestAddPage.php in your browser. For instance: http://server/wiki/extensions/TestAddPage.php
 * 9) The web service answer will be shown. It will be "OK" or an error message.
 * 10) Verify that the test page shows on the "Recent changes" page on the wiki.

Usage
Information about using the web service in external programs:
 * The web service URL will be similar to this: http://server/wiki/extensions/AddPageService.php
 * The WSDL can be obtained by adding "?wsdl" to the URL, like this: http://server/wiki/extensions/AddPageService.php?wsdl
 * The web service method to be called is named addPage.
 * It has these parameters:
 * title: page title (UTF-8 encoded).
 * text: page text (UTF-8 encoded).
 * user: wiki user name.
 * password: wiki user password.
 * Use a high timeout. For instance, 30 seconds. The web service opens several web forms and may take a few seconds to answer.
 * Verify that the method returns "OK". Otherwise, show the returned error message.

Credits
Partially based on Bulk Page Creator.

1.0.1
Release date: 2007-01-31
 * Removes restricted characters from page titles.
 * Outputs debug file.

1.0.0
Release date: 2007-01-31
 * Initial release.

Alternatives

 * API

Feedback
Use the discussion page for feedback, questions, feature requests and bug reports.