fosiki is in Private Beta. Please email SvenDowideit@fosiki.com
Tags: +

TWiki

RestPlugin

Full implementation of REST - starting with FormFields

Usage

This plugin begins the task of creating a real REST URI engine for TWiki. It uses a TWiki:Codev.TopicObjectModel addressing scheme based on the IfStatements and QuerySearch syntax, and then enable both the retriving and setting / creation of topics and parts of topics.

Initially, it will be implemented using Dojotoolkit's Diji InlineEdit component, and apply just to formfields. This should give us a strong basis to extend the work to all topic fragments.

Examples

FORMFIELD

This allows you to change values in TWiki Forms without leaving the current topic - useful for reports and inline data-wiki applications. This syntax will be simplified in future.

This example alows you to view, and change the Summary Field in BugItem1? (from TWiki:Plugins.BugsContrib) - by just clicking on the text, changing it, and then hitting ENTER

Test this bug very carefully - it looks sneaky

%FORMFIELD{
    "Summary" 
    topic="Sandbox.BugItem1" 
    default="(not set)" 
    alttext="Summary field not found"
    format="<span id='Sandbox.BugItem1:FIELD.Summary' class="RestPluginEditable" dojoType='dijit.InlineEditBox' onChange='myHandler(this.id,arguments[0])'>$value</span>"
}%

Inline edit of forms in topic.

If you have installed this plugin, enabled it, and set SKIN=dojo,pattern then you can also goto BugItem1? , and edit each of the formfields directly.

Customisation

To make customisation possible, the javascript, and the formtables rendering is defined using the restpluginscript.tmpl and formtables.dojo.tmpl templates. To create your own implementations, create a new TWiki Contrib that contains your javascript (in pub) and templates to activate them. Then set your SKIN to include your templates.

Installation Instructions

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server where TWiki is running.

Like many other TWiki extensions, this module is shipped with a fully automatic installer script written using the BuildContrib.

  • If you have TWiki 4.2 or later, you can install from the configure interface (Go to Plugins->Find More Extensions)
  • If you have any problems, then you can still install manually from the command-line:
    1. Download one of the .zip or .tgz archives
    2. Unpack the archive in the root directory of your TWiki installation.
    3. Run the installer script ( perl <module>_installer )
    4. Run configure and enable the module, if it is a plugin.
    5. Repeat for any missing dependencies.
  • If you are still having problems, then instead of running the installer script:
    1. Make sure that the file permissions allow the webserver user to access all files.
    2. Check in any installed files that have existing ,v files in your existing install (take care not to lock the files when you check in)
    3. Manually edit LocalSite.cfg to set any configuration variables.

Plugin Info

Plugin Author(s): TWiki:Main.SvenDowideit - http://distributedINFORMATION.com a wikiringlogo20x20.png WikiRing founding partner
Copyright: © SvenDowideit@distributedINFORMATION.com
Gear Icon based on eXperience Crystal, by David Christian Berg
UniversalWikiEditButton? http://www.aboutus.org/UniversalWikiEditButton
License: GPL (Gnu General Public License)
Plugin Version: 64 (19 Mar 2008)
Change History:  
Dependencies:
NameVersionDescription
TWiki::Contrib::DojoToolkitContrib>=1.0DojoToolkit release 1.0
Plugin Home: http://twiki.org/cgi-bin/view/Plugins/RestPlugin
Feedback: http://twiki.org/cgi-bin/view/Plugins/RestPluginDev
Appraisal: http://twiki.org/cgi-bin/view/Plugins/RestPluginAppraisal

Related Topics: TWikiPlugins, DeveloperDocumentationCategory, AdminDocumentationCategory, TWikiPreferences

I Attachment Action Size Date Who Comment
pngpng Edit-chalk-10g.png manage 1.1 K 21 Mar 2008 - 09:57 TWikiAdminUser Saved by install script
pngpng Image:Edit-chalk-10bo.png manage 15.0 K 21 Mar 2008 - 09:57 TWikiAdminUser Saved by install script
pngpng Wiki-text-icon.png manage 0.8 K 21 Mar 2008 - 09:57 TWikiAdminUser Saved by install script
pngpng formfield_example.png manage 5.6 K 21 Mar 2008 - 09:57 TWikiAdminUser Saved by install script
pngpng restplugin-viewform.png manage 44.1 K 21 Mar 2008 - 09:57 TWikiAdminUser Saved by install script
pngpng wikiring-rest.png manage 33.1 K 21 Mar 2008 - 09:57 TWikiAdminUser Saved by install script
pngpng wikiringlogo20x20.png manage 1.3 K 21 Mar 2008 - 09:57 TWikiAdminUser Saved by install script