JsonData

From Jsonwidget
Jump to: navigation, search

This is an extension which allows for form-based editing of arbitrary JSON data in MediaWiki. As of this writing, it supports a subset of the JSON schema Internet draft-03 submitted to the IETF by Kris Zyp.

Contents

[edit] Getting JsonData

Available here:

[edit] Installing JsonData

Perform the following steps to install JsonData on your existing MediaWiki install:

  1. Copy the extension as "JsonData" into the extensions directory
  2. Configure the extension in LocalSettings.php. An example configuration can be found in example/LocalSettings_example.php

[edit] Testing

This should be enough to get up and running. A few tests to try with the example configuration:

  1. Create a page "Address:Test". This is an example of a basic address book.
  2. Create a page "Data:Test". This is an example of free-form JSON editing sans schema.
  3. Copy an example schema to the wiki. Create "Schema:SimpleAddr", and copy in the contents of simpleaddr-schema.json. Surround the contents with a <jsonschema> tag.
  4. Move your config on-wiki and make a modification:
    • Copy the contents of example/configexample.json to a new article called "JsonConfig:Test". Be sure to leave either <json> or <jsonconfig> tags around the JSON data.
    • Set $wgJsonDataConfigArticle = "JsonConfig:Test" in LocalSettings.php
    • Edit JsonConfig:Test, changing the following values:
      ['tags']['address']['schema']['srctype'] from "predefined" to "article"
      ['tags']['address']['schema']['src'] to "Schema:SimpleAddr"
    • Edit "Schema:SimpleAddr", adding or removing a field
    • Create a page "Address:Test2", and note your change to the schema.

[edit] Sandbox

Please feel free to edit and save changes any of the following pages, and/or add new pages to this list:

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox