Changeset 711


Ignore:
Timestamp:
11/15/08 15:20:31 (4 years ago)
Author:
CrawfordCurrie
Message:

Item109: renamed TWikiScripts

Location:
trunk/core/data/TWiki
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/core/data/TWiki/CommandAndCGIScripts.txt

    r700 r711  
    11%META:TOPICINFO{author="ProjectContributor" date="1168672578" format="1.1" version="$Rev$"}% 
    22%STARTINCLUDE% 
    3 ---+ TWiki CGI and Command Line Scripts 
    4  
    5 _Programs on the TWiki server performing actions such as rendering, saving and renaming topics._ 
    6  
    7 The TWiki scripts are located in the =twiki/bin= and =twiki/tools= directories. This topic describes the interfaces to some of those scripts. All scripts in the =twiki/bin= directory can be called from the CGI ([[http://en.wikipedia.org/wiki/Common_Gateway_Interface][Common Gateway Interface]]) environment or from the command line. The scripts in the =twiki/tools= directory can only be called from the command line. 
     3---+ CGI and Command Line Scripts 
     4 
     5_Programs on the server performing actions such as rendering, saving and renaming topics._ 
     6 
     7These scripts are located in the =bin= and =tools= directories. This topic describes the interfaces to some of those scripts. All scripts in the =twiki/bin= directory can be called from the CGI ([[http://en.wikipedia.org/wiki/Common_Gateway_Interface][Common Gateway Interface]]) environment or from the command line. The scripts in the =twiki/tools= directory can only be called from the command line. 
    88 
    99%TOC% 
     
    1414---+++ General Information 
    1515---++++ CGI environment 
    16 In the CGI environment parameters are passed to the scripts via the URL and URL parameters. Environment variables are also used to determine the user performing the action. If the environment is not set up, the default TWiki user is used (usually =guest=). 
     16In the CGI environment parameters are passed to the scripts via the URL and URL parameters. Environment variables are also used to determine the user performing the action. If the environment is not set up, the default user is used (usually =guest=). 
    1717---++++ Command-line 
    1818You *must* be have the =twiki/bin= directory on the perl path to run the scripts from the command line. To avoid issues with file permissions, run the scripts as the web server user such as =nobody= or =www=. 
     
    2929 
    3030| *Parameter* | *Description* | *Default* | 
    31 | =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.<nop>TopicName) | | 
     31| =topic= | If this is set to a URL, %WIKITOOLNAME% will immediately redirect to that URL. Otherwise it overrides the URL and is taken as the topic name (you can pass Web.<nop>TopicName) | | 
    3232| =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. | | 
    3333| =skin= | Overrides the default skin path (see [[Skins]]) | | 
     
    5454 
    5555---+++ =configure= 
    56 =configure= is the browser script used for inspection and configuration of the TWiki configuration. None of the parameters to this script are useable for any purpose except =configure=. See [[%SCRIPTURLPATH{"configure"}%][configure]]. 
     56=configure= is the browser script used for inspection of, and cahnges to, the site configuration. None of the parameters to this script are useable for any purpose except =configure=. See [[%SCRIPTURLPATH{"configure"}%][configure]]. 
    5757 
    5858---+++ =edit= 
     
    7878 
    7979---+++ =login= 
    80 Used for logging in when TWiki login is being used (e.g !TemplateLoginManager). 
     80Used for logging in with !TemplateLoginManager. 
    8181| *Parameter* | *Description* | *Default* | 
    8282| =origurl= | URL that was being accessed when an access violation occurred. the login process will redirect to this URL if it is successful | none | 
     
    159159 
    160160---+++ =rdiff= 
    161 Renders the differences between version of a TWiki topic 
     161Renders the differences between version of a topic 
    162162 
    163163| *Parameter* | *Description* | *Default* | 
     
    190190 
    191191---+++ =rest= 
    192 This REST ([[http://en.wikipedia.org/wiki/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. 
     192This REST ([[http://en.wikipedia.org/wiki/REST][Representational State Transfer]]) script can be invoked via http in the same way as the other 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. 
    193193 
    194194The =rest= script supports the following parameters: 
     
    200200The function is free to use any other query parameters for its own purposes. 
    201201 
    202 %X% The =rest= script should *always* require authentication in any TWiki that has logins. Otherwise there is a risk of opening up major security holes. So make sure you add it to the list of authenticated scripts if you are using =ApacheLogin=. 
     202%X% The =rest= script should *always* require authentication in any site that has logins. Otherwise there is a risk of opening up major security holes. So make sure you add it to the list of authenticated scripts if you are using =ApacheLogin=. 
    203203 
    204204---++++ Invocation Examples 
     
    236236| =templatetopic= | Name of a topic to use as a template for the text and form (new topic _only_) | | 
    237237| =text= | New text of the topic | | 
    238 | =forcenewrevision= | if set, forces a revision even if TWiki thinks one isn't needed | | 
     238| =forcenewrevision= | if set, forces a revision even if %WIKITOOLNAME% thinks one isn't needed | | 
    239239| =topicparent= | If 'none' remove any current topic parent. If the name of a topic, set the topic parent to this. | | 
    240240| =formtemplate= | if defined, use the named template for the form (will remove the form is set to 'none') | | 
     
    305305for example: 
    306306   1 from browser %SCRIPTURL{"statistics"}% updates _all user webs_ 
    307    2 from browser %SCRIPTURL{"statistics"}%?webs=TWiki,Main,Sandbox updates _TWiki,Main,Sandbox_ 
     307   2 from browser %SCRIPTURL{"statistics"}%?webs=Userweb,Sandbox updates _Userweb,Sandbox_ 
    308308   3 from browser %SCRIPTURL{"statistics"}%/%WEB% updates %WEB% 
    309309   4 from command line twiki/bin/statistics updates _all user webs_ 
    310    5 from command line twiki/bin/statistics -webs=TWiki,Main,Sandbox updates _TWiki,Main,Sandbox_ 
     310   5 from command line twiki/bin/statistics -webs=Userweb,Sandbox updates _Userweb,Sandbox_ 
    311311   6 from command line twiki/bin/statistics %WEB%.<nop>WebHome updates %WEB% 
    312312 
    313 see TWikiSiteTools#WebStatistics_site_statistics for updating statistics using cron. 
     313see SiteTools#WebStatistics_site_statistics for updating statistics using cron. 
    314314 
    315315---+++ =upload= 
     
    336336| =contenttype= | Allows you to specify a different *Content-Type:* (e.g. =contenttype=text/plain=) | | 
    337337| =rev= | Revision to view (e.g. =rev=45=) | | 
    338 | =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 [[%SCRIPTURLPATH{"view"}%/%WEB%/%TOPIC%?template=edit][%SCRIPTURLPATH{"view"}%/%WEB%/%TOPIC%?template=edit]]. This is mainly useful when you have specialised templates for a TWiki Application. | | 
     338| =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 [[%SCRIPTURLPATH{"view"}%/%WEB%/%TOPIC%?template=edit][%SCRIPTURLPATH{"view"}%/%WEB%/%TOPIC%?template=edit]]. This is mainly useful when you have specialised templates for a Wiki Application. | | 
    339339| =topic= | redirects (at the beging of the cgi script running) to show the spcified Web.Topic, or, redirects to a URL, if allowed by {AllowRedirectUrl} and {PermittedRedirectHostUrls} | | 
    340340 
    341 %X% For historical reasons, the view script has a special interpretation of the =text= skin. In earlier TWiki versions the =skin=text= parameter was used like this: 
     341%X% For historical reasons, the view script has a special interpretation of the =text= skin. In TWiki < 4.0 the =skin=text= parameter was used like this: 
    342342=http<nop>://.../view/MyWeb/MyTopic?skin=text&contenttype=text/plain&raw=on= 
    343343which shows the topic as plain text; useful for those who want to download plain text for the topic. 
     
    358358 
    359359---+++ =geturl.pl= 
    360 This is a very simple script to get the content of a web site. It is marked as _deprecated_ and might be removed (or enhanced) in a future TWiki release. Its functions are covered by the standard =wget= and =curl= commands. 
     360This is a very simple script to get the content of a web site. It is marked as _deprecated_ and might be removed (or enhanced) in a future release. Its functions are covered by the standard =wget= and =curl= commands. 
    361361   * Usage:    =geturl.pl &lt;host&gt; &lt;path&gt; [&lt;port&gt; [&lt;header&gt;]]= 
    362362   * Example:  =geturl.pl some.domain /some/dir/file.html 80= 
     
    364364 
    365365---+++ =rewriteshebang.pl= 
    366 Simple script to rewrite the =#!/usr/bin/perl= shebang lines specific to your local Perl installation. It will rewrite the first line of all your TWiki cgi scripts so they use a different shebang line. Use it if your perl is in a non-standard location, or you want to use a different interpreter (such as 'speedy'). 
     366Simple script to rewrite the =#!/usr/bin/perl= shebang lines specific to your local Perl installation. It will rewrite the first line of all your cgi scripts so they use a different shebang line. Use it if your perl is in a non-standard location, or you want to use a different interpreter (such as 'speedy'). 
    367367 
    368368---+++ =tick_twiki.pl= 
    369 This script executes a number of non-essential regular administration tasks that will help keep your TWiki healthy and happy, such as removing expired sessions and lease files. 
     369This script executes a number of non-essential regular administration tasks that will help keep your site healthy and happy, such as removing expired sessions and lease files. 
    370370 
    371371It is intended to be run as a cron job or a scheduled task once a week. Example crontab entry:%BR% 
     
    374374__Note:__ The script has to be run by a user who can write files created by the webserver user. 
    375375 
    376  
    377  
    378376__Related Topics:__ AdminDocumentationCategory, DeveloperDocumentationCategory 
  • trunk/core/data/TWiki/CompleteDocumentation.txt

    r709 r711  
    11%META:TOPICINFO{author="ProjectContributor" date="1168078214" format="1.1" version="$Rev: 14760 $"}% 
    2 ---+!! TWiki Reference Manual (%WIKIVERSION%) 
     2---+!! Reference Manual (%WIKIVERSION%) 
    33 
    44This page contains all documentation topics as one long, complete reference sheet. 
     
    9898 
    9999------ 
    100 %INCLUDE{"TWikiScripts"}% 
     100%INCLUDE{"CommandAndCGIScripts"}% 
    101101 
    102102[[#PageTop][Back to top]] 
Note: See TracChangeset for help on using the changeset viewer.