none
[openafs-wiki.git] / TWiki / TWikiSiteTools.mdwn
1 <div>
2   <ul>
3     <li><a href="#TWikiSiteTools"> TWikiSiteTools</a><ul>
4         <li><a href="#Overview"> Overview</a></li>
5         <li><a href="#WebNotify Recent Changes Alert"> WebNotify Recent Changes Alert</a><ul>
6             <li><a href="#Configuring Outgoing Mail"> Configuring Outgoing Mail</a></li>
7             <li><a href="#Setting the Automatic Email Sche"> Setting the Automatic Email Schedule</a></li>
8           </ul>
9         </li>
10         <li><a href="#WebStatistics Site Usage Log"> WebStatistics Site Usage Log</a><ul>
11             <li><a href="#Configuring for Automatic Operat"> Configuring for Automatic Operation</a></li>
12             <li><a href="#Generating Statistics Manually b"> Generating Statistics Manually by URL</a></li>
13           </ul>
14         </li>
15         <li><a href="#WebSearch"> WebSearch</a><ul>
16             <li><a href="#WebChanges"> WebChanges</a></li>
17             <li><a href="#WebIndex"> WebIndex</a></li>
18           </ul>
19         </li>
20       </ul>
21     </li>
22   </ul>
23 </div>
24
25 # <a name="TWikiSiteTools"></a><a name="_TWikiSiteTools"></a> TWikiSiteTools
26
27 _Utilities for searching, navigation, and monitoring site activity_
28
29 ## <a name="Overview"></a> Overview
30
31 [[TWikiSiteTools]] include utilities for navigating, searching and keeping up with site activity. Preferences can be configured by web or site-wide. You are currently in the **TWiki** web. In particular, TWiki provides two highly configurable, automated site monitoring tools, **WebNotify**, to email alerts when topics are edited, and **WebStats**, to generate detailed activity reports.
32
33 ## <a name="WebNotify Recent Changes Alert"></a><a name="_WebNotify Recent Changes Alert"></a> WebNotify Recent Changes Alert
34
35 Each TWiki web has an automatic email alert service that sends a list of recent changes on a preset schedule, like once a day. Users can subscribe and unsubscribe using [[WebNotify]] in each web. The Perl script `mailnotify` is called by a deamon in regular intervals. The script sends an automated email to subscribed users if topics were changed in a web within last interval.
36
37 - You can create a [[WebNotify]] using [[TWikiVariables]] with <code>**%NOTIFYTOPIC%**</code>
38
39 ### <a name="Configuring Outgoing Mail"></a> Configuring Outgoing Mail
40
41 %WIKITOOLNAME% will use the <code>**Net::SMTP**</code> module if it is installed on your system. Set this with the <code>**SMTPMAILHOST**</code> variable in [[TWikiPreferences]].
42
43 You can use an external mail program, like <code>**sendmail**</code>, if the `Net::SMTP` module is not installed. Set the program path in <code>**$mailProgram**</code> in <code>**TWiki.cfg**</code>.
44
45 - %H% Net::SMTP can be easily disabled (ex: if there is an installation error) by setting <code>**SMTPMAILHOST**</code> in [[TWikiPreferences]] to an empty value.
46
47 - %T% You can set a separate <code>**SMTPSENDERHOST**</code> variable to define the mail sender host (some SMTP installations require this).
48
49 ### <a name="Setting the Automatic Email Sche"></a> Setting the Automatic Email Schedule
50
51 **For Unix platforms:** Edit the `cron` table so that `mailnotify` is called in an interval of your choice. Please consult `man crontab` of how to modify the table that schedules program execution at certain intervals. Example:
52
53     % crontab -e
54     15,45 * * * * (cd ~twiki/public_html/bin; ./mailnotify -q)
55
56 The above line will call mailnotify at 15 minutes and 45 minutes past every hour. The `-q` switch suppresses all normal output.
57
58 **For ISP installations:** Many ISPs don't allow hosted accounts direct cron access, as it's often used for things that can heavily load the server. Workaround scripts are available.
59
60 **On Windows NT/2000:** You can use a scheduled task if you have administrative privileges. **_Note:_** AT on an NT machine is pretty limited. Microsoft lists several third-party [replacements](http://www.microsoft.com/ntserver/partners/findoffering/serversolutions/Maintnce.asp#cron) (as of 2001-11-20, none of them free).
61
62 ## <a name="WebStatistics Site Usage Log"></a><a name="_WebStatistics Site Usage Log"></a> WebStatistics Site Usage Log
63
64 You can generate a listing manually, or on an automated schedule, of visits to individual pages, on a per web basis. Compiled as a running total on a monthly basis. Includes totals for Topic Views, Topic Saves, Attachment Uploads, Most Popular Topics with number of views, and Top Contributors showing total of saves and attachment uploads. Previous months are saved.
65
66 - You can create a [[WebStatistics]] link using [[TWikiVariables]] with <code>**%STATISTICSTOPIC%**</code>
67
68 ### <a name="Configuring for Automatic Operat"></a> Configuring for Automatic Operation
69
70 - You can automatically generate usage statistics for all webs. To enable this:
71   - Make sure variable `$doLogTopicView, $doLogTopicSave and $doLogTopicUpload` in `TWiki.cfg` are set. This will generate log entries in file `twiki/data/log<date>.txt` .
72   - The [[WebStatistics]] topic must be present in all webs where you want to have statistics. You can use the topic in the Main web as a template.
73   - Call the `twiki/bin/statistics` script from a cron job, once a day is recommended. This will update the [[WebStatistics]] topics in all webs.
74   - **_Attention:_** The script must run as the same user as the CGI scripts are running, which is user `nobody` on most systems. Example crontab entry: <br />`0 0 * * * (cd /path/to/TWiki/bin; ./statistics >/dev/null 2>&1)`
75   - There is a workaround in case you can't run the script as user `nobody` : Run the utility `twiki/bin/geturl` in your cron job and specify the URL of the `twiki/bin/statistics` script as a parameter. Example: <br />`0 0 * * * (cd /path/to/TWiki/bin; ./geturl mydomain.com /urlpath/to/TWiki/bin/statistics >/dev/null 2>&1)`
76
77 ### <a name="Generating Statistics Manually b"></a> Generating Statistics Manually by URL
78
79 - The `twiki/bin/statistics` script can also be executed as a CGI script, just enter the URL in your browser. Examples:
80   - Update current month for all webs: <br />`http://mydomain.com/twiki/bin/statistics`
81   - Update current month for Main web only: <br />`http://mydomain.com/twiki/bin/statistics/Main`
82   - Update January 2000 for Main web: <br />`http://mydomain.com/twiki/bin/statistics/Main?logdate=200001`
83
84 ## <a name="WebSearch"></a><a name="_WebSearch"></a> WebSearch
85
86 [[WebSearch]] is an extremely fast and flexible search facility, part of the core TWiki feature set. Options include:
87
88 - topic title or full-text search
89 - regular expressions
90 - search within web or site-wide
91 - index-style A-Z alphabetical listing sorted topic title
92 - many more
93
94 See also: [[TWikiVariables]] for including hard-coded searches in text.
95
96 ### <a name="WebChanges"></a><a name="_WebChanges"></a> WebChanges
97
98 To check for the most recently edited topics while on-site, use the [[WebChanges]] link, usually located on the upper toolbar. It lists the most recently modified topics, newest first, along with the first couple of lines of the page content.
99
100 This is simply a preset `SEARCH`. The number of topics listed by the `limit` parameter.:
101
102 > <pre>
103 > %SEARCH{".*" web="%INCLUDINGWEB%" regex="on" nosearch="on" order="modified" <br />reverse="on" limit="50"}%
104 > </pre>
105
106 ### <a name="WebIndex"></a><a name="_WebIndex"></a> WebIndex
107
108 [[WebIndex]] lists all web topics in alphabetical order, with the first couple of lines of text. This is simply a preset `SEARCH`:
109
110 > %SEARCH{"\.*" scope="topic" regex="on" nosearch="on"}%
111
112 -- [[MikeMannix]] - 01 Dec 2001