Extension:Page Schemas

Description
Page Schemas is a MediaWiki extension that allows for defining all the schema information about a "class", or data type - for naming, display, data input, and browsing - within a single piece of XML contained within a category page. This XML then is used to generate all the necessary additional pages needed to put the schema into effect, such as template pages and, for instance, if Semantic Forms is installed, form pages. The XML can be created and edited via a helper form, preventing users from having to generate or modify it manually.

Page Schemas allows other extensions to define their own fields to add to the XML, using hooks. Currently, the extensions Semantic MediaWiki, Semantic Forms and Semantic Drilldown are hooked into the Page Schemas code to add their own fields.

Page Schemas defines two special pages: 'Special:EditSchema' and 'Special:GeneratePages'. 'Special:EditSchema' allows for creating or editing the XML via the helper form, while 'Special:GeneratePages' essentially provides a button that lets the administrator create the template(s), semantic properties, form etc. automatically from the XML definition. 'Special:GeneratePages' also include checkboxes for each of the pages to be generated, to let administrators choose not to override certain wiki pages that already exist.

Page Schemas also defines two tabs, that show up on category pages, to provide this functionality: "edit schema" and "generate pages"

Sample XML structure
Here is some sample XML, to be contained within a page called "Category:Cities", used to define the schema for pages within that category. This section defines the name of the form, and information for a single field of that class, "Population".

Code and download
You can download the code via SVN from the MediaWiki source code repository, at http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/PageSchemas/. From a command line, you can call the following:

To view the code online, including version history for each file, you can go here.

Installation
After you've obtained a 'PageSchemas' directory, place this directory within the main MediaWiki 'extensions' directory. Then, in the file 'LocalSettings.php' in the main MediaWiki directory, add the following line:

Author
Page Schemas was created by Ankit Garg as part of the 2011 Google Summer of Code, and was mentored by Yaron Koren. It is currently maintained by Yaron Koren. Parts of it are based on the TemplateInfo extension, by Yaron Koren and Roan Kattouw.

Version
Page Schemas is currently at version 0.2.

The version history for Page Schemas is:
 * 0.1 - August 23, 2011 - initial version
 * 0.2 - October 13, 2011 - overhaul; many changes to display and code structure