Difference: TWikiScripts (13 vs. 14)

Revision 142013-09-25 - TWikiContributor

Line: 1 to 1
 

TWiki CGI and Command Line Scripts

Line: 35 to 35
 
Parameter Description Default
topic If this is set to a URL, TWiki will immediately redirect to that URL. Otherwise it overrides the URL and is taken as the topic name (you can pass Web.TopicName)  
Changed:
<
<
user Command-line only; set the name of the user performing the action. Note: this usage is inherently insecure, as it bypasses webserver login constraints. For this reason only authorised users should be allowed to execute scripts from the command line.  
>
>
user Command-line only; set the name of the user performing the action. Note: this usage is inherently insecure, as it bypasses webserver login constraints. For this reason only authorized users should be allowed to execute scripts from the command line.  
 
skin Overrides the default skin path (see TWikiSkins)  
cover Specifies temporary skin path to prepend to the skin path for this script only (see TWikiSkins)  
Line: 174 to 174
  This script is mainly used for rendering pages containing error messages, though it is also used for some functional actions such as manage pages (move topic etc).
Changed:
<
<
oops templates are used with the oops script to generate system messages. This is done to make internationalisation or other local customisations simple.
>
>
oops templates are used with the oops script to generate system messages. This is done to make internationalization or other local customizations simple.
  The oops script supports the following parameters:
Line: 222 to 222
 
currentwebonly if defined, searches current web only for links to this topic  
nonwikiword if defined, a non-wikiword is acceptable for the new topic name  
redirectto If the rename process is successful, rename will redirect to this topic or URL. The parameter value can be a TopicName, a Web.TopicName, or a URL.
Note: Redirect to a URL only works if it is enabled in configure (Security setup > Miscellaneous {AllowRedirectUrl}).
 
Added:
>
>
disablefixlinks Bypass fixing WikiWord links in the rename destination topic if rename is done across webs. Fixing links in the renamed topic such as from SomeLink to Otherweb.SomeLink is usually desirable so that links in the copied topic still point to the same target off (links are fixed)
  Note: The rename script can only be called via http POST method, not GET. Make sure you specify method="post" if you call the rename script via a form action.
Added:
>
>

copy

Used for copying the current topic in its entirety including its history and attachments.

Parameter
<-- -->
Sorted ascending
Description Default
disablefixlinks Bypass fixing WikiWord links in the copy destination topic if copy is done across webs. Fixing links in the copied topic such as from SomeLink to Otherweb.SomeLink is usually desirable so that links in the copied topic still point to the same target off (links are fixed)
newtopic destination topic name current topic
newweb destination web name current web
nonwikiword if defined, a non-wikiword is acceptable for the destination topic name  
overwrite By default, copy does not happen if the destination topic already exists. If this parameter is 'on', the destination topic is deleted if exists before copying takes place off (no overwrite)
redirectto If the copy process is successful, copy will redirect to this topic or URL. The parameter value can be a TopicName, a Web.TopicName, or a URL.
Note: Redirect to a URL only works if it is enabled in configure (Security setup > Miscellaneous {AllowRedirectUrl}).
 

mdrepo

Used to retrieve and update data in MetadataRepository. Please read MetadataRepository#mdrepo_script_from_command_line and MetadataRepository#mdrepo_script_from_browser.

 

rest

This REST (Representational State Transfer) script can be invoked via http in the same way as the other TWiki scripts (see Invocation Examples, below) to execute a function that is associated to a "subject" and a "verb" (see below). These functions are usually registered by plugins using the TWiki::Func::registerRESTHandler method. The rest script will print the result directly to the browser unless the endPoint parameter is specified, in which case it will output a redirect to the given topic.

Line: 325 to 343
 
excludetopic="Web*"
excludetopic="WebHome, WebChanges"
Exclude topics from search: A topic, a topic with asterisk wildcards, or a list of topics separated by comma. None
type="keyword"
type="literal"
type="regex"
Do a keyword search like soap "web service" -shampoo; a literal search like web service; or RegularExpression search like soap;web service;!shampoo %SEARCHVAR- DEFAULTTYPE% preferences setting (literal)
scope="topic"
scope="text"
scope="all"
Search topic name (title); the text (body) of topic; or all (both) "text"
Changed:
<
<
order="topic"
order="created"
order="modified"
order="editby"
order=
 "formfield(name)"
Sort the results of search by the topic names, topic creation time, last modified time, last editor, or named field of TWikiForms. The sorting is done web by web; in case you want to sort across webs, create a formatted table and sort it with TablePlugin's initsort Sort by topic name
limit="all"
limit="16"
Limit the number of results returned. This is done after sorting if order is specified All results
>
>
sort="topic"
sort="created"
sort="modified"
sort="editby"
sort="parent"
sort=
 "formfield(name)"
Sort the results of search by the topic names, topic creation time, last modified time, last editor, parent topic name, or named field of TWikiForms. The sorting is done web by web; in case you want to sort across webs, create a formatted table and sort it with TablePlugin's initsort Sort by topic name
limit="all"
limit="16"
Limit the number of results returned. This is done after sorting if sort is specified All results
 
date="..." limits the results to those pages with latest edit time in the given time interval. All results
reverse="on" Reverse the direction of the search Ascending search
casesensitive="on" Case sensitive search Ignore case
Line: 387 to 405
 
raw=on Shows the text of the topic in a scrollable textarea  
raw=debug As raw=on, but also shows the metadata (forms etc) associated with the topic.  
raw=text Shows only the source of the topic, as plain text (Content-type: text/plain). Only shows the body text, not the form or other meta-data.
Added:
>
>
raw=expandvariables Similar to raw=text but TWiki variables are expanded.  
 
raw=all Shows only the source of the topic, as plain text (Content-type: text/plain), with embedded meta-data. This may be useful if you want to extract the source of a topic to a local file on disc.  
section Allows to view only a part of the topic delimited by a named section (see VarSTARTSECTION). If the given section is not present, no topic content is displayed.  
contenttype Allows you to specify a different Content-Type: (e.g. contenttype=text/plain)  
rev Revision to view (e.g. rev=45)  
Changed:
<
<
template Allows you to specify a different skin template, overriding the 'view' template the view script would normally use. The default template is view. For example, you could specify /ZIVwiki/bin/view/TWiki/TWikiScripts?template=edit. This is mainly useful when you have specialised templates for a TWiki Application.  
>
>
template Allows you to specify a different skin template, overriding the 'view' template the view script would normally use. The default template is view. For example, you could specify /ZIVwiki/bin/view/TWiki/TWikiScripts?template=edit. This is mainly useful when you have specialized templates for a TWiki Application.  
 
topic redirects to show the specified Web.Topic, or, redirects to a URL, if allowed by {AllowRedirectUrl} and {PermittedRedirectHostUrls} configure settings  
createifnotexist If createifnotexist is set to 1 and in case the topic does not exist, it is created automatically on view. Useful to create topics automatically based on a specific template (see example below). Behind the scene, the view script redirects first to the save script, passing along all URL parameters. Thus all URL parameters of the save script can be used, such as templatetopic, topicparent and redirectto. Next, the save script creates the topic and redirects back to the view script (or displays an error in case there were any issues creating the topic).  
extralog Add additional text to TWiki log, next to the user agent string. Useful to log actions by cache scripts and crawlers.  
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 1999-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding ZIVwiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.TWikiScripts.