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
Summary field not found
%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.
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:
- Download one of the
.zip
or .tgz
archives
- Unpack the archive in the root directory of your TWiki installation.
- Run the installer script (
perl <module>_installer
)
- Run
configure
and enable the module, if it is a plugin.
- Repeat for any missing dependencies.
- If you are still having problems, then instead of running the installer script:
- Make sure that the file permissions allow the webserver user to access all files.
- 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)
- Manually edit LocalSite.cfg to set any configuration variables.
Plugin Info
Related Topics: TWikiPlugins,
DeveloperDocumentationCategory,
AdminDocumentationCategory,
TWikiPreferences