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 could then is used to generate all the necessary additional pages needed to put the schema into effect, such as template pages and, if Semantic MediaWiki is installed, property pages. The XML could then also be edited via editing interface, 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. To start with,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 thatlet the administrator create the template(s), semantic properties, form, filter(s), 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 in the category pages for these special pages to help admins better manage the Schema.

Possible XML structure
Here is some possible XML to be contained within a page called "Category:Cities", used to define the "City" data type. This section defines the name of the category, 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 written by Ankit Garg as part of Google Summer of Code, 2011 and was mentored by Yaron Koren

Version
Page Schemas is currently at version 0.0.1.