SetTopicValuesPlugin
Set addressible sub-elements of topics
Usage
This Plugin adds the ability to use some of the Topic Object model addressing introduced in
QuerySearch to modify values.
(only supports PREFERENCES and FIELDS - the others will come with the
Foswiki:Development.AddMetaSetActionToEditAndSave Foswiki 1.1 feature.
In essence, this plugin adds
Set+
and
Unset+
urlparams to the
=save= Script.
save
The
save
script performs a range of save-related functions, as selected by the
action
parameter.
Parameter |
Description |
Default |
set+SomeTOM=someValue |
Set a META PREFERENCE or FormFIELD to a value |
|
unset+SomeTOM |
unset (ie remove) a META PREFERENCE or FormFIELD |
|
Be aware that while you
can set a
FormFIELD that is not specified in the topics FORM, the next save will remove it.
For security reasons, the rvalues are entityEncoded before being saved.
This means you cannot set a a preference or formfield to another TML MACRO - just constant strings.
Examples
-
http://somewhere.com/save/Sandbox/TestTopic5?set+VIEW_TEMPLATE=SomeValue
-
http://somewhere.com/save?set+Sandbox.TestTopic5/preferences[VIEW_TEMPLATE]=SomeValue
- adds a META PREFERENCE (or potentially edits an existing in-text Setting?)
-
http://somewhere.com/save?unset+Sandbox.TestTopic5/preferences[VIEW_TEMPLATE]
Technical details
So that URL settings can be used to set the values on a topic that is being created, it uses the
afterSaveHandler
.
To simplify the implementation, PREFERENCES are all stored in the META::PREFERENCES, not inline in the topic.
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.
Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".
If you have any problems, or if the extension isn't available in
configure
, then you can still install manually from the command-line. See
http://foswiki.org/Support/ManuallyInstallingExtensions for more help.