Skip to content

Commit

Permalink
Item6977: %WEBLIST{...}% which would time out on a large site is to b…
Browse files Browse the repository at this point in the history
…e ammended

git-svn-id: http://develop.twiki.org/svn/twiki/trunk@24803 a00a5322-12db-0310-a70b-8735589c885e
  • Loading branch information
HideyoImazu authored and HideyoImazu committed Jan 23, 2013
1 parent 829a602 commit 6bc722e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions core/data/TWiki/AdminToolsCategory.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="TWikiContributor" date="1346910628" format="1.1" version="$Rev$"}%
%META:TOPICINFO{author="TWikiContributor" date="1358923897" format="1.1" version="$Rev$"}%
%META:TOPICPARENT{name="CategoryCategory"}%
---+ Admin Tools

Expand All @@ -12,11 +12,11 @@ _Manage whole <b>TWiki</b> site from one screen._
| *TWiki %MAKETEXT{web}%* | *Tools* |
%WEBLIST{
" | <span style=\"white-space:nowrap; font-weight:700\"><a href=\"%SCRIPTURLPATH{"view"}%/$name/%HOMETOPIC%\"><img src=\"%ICONURL{web-bg}%\" border=\"0\" alt=\"\" width=\"16\" height=\"16\" style=\"background-color:%$markerVAR{\"WEBBGCOLOR\" web=$qname}$marker%\" />&nbsp;<nop>$indentedname</a></span>: %$markerVAR{\"SITEMAPWHAT\" web=$qname}$marker% | <span style="white-space:nowrap">[[$name.%HOMETOPIC%][<img src=\"%PUBURLPATH%/%SYSTEMWEB%/TWikiDocGraphics/home.gif\" alt=\"Home\" title=\"Home of <nop>$name web\" width=\"16\" height=\"16\" border=\"0\">]]&nbsp;[[$name.WebSearch][<img src=\"%PUBURLPATH%/%SYSTEMWEB%/TWikiDocGraphics/searchtopic.gif\" alt=\"Search\" title=\"Search <nop>$name web\" width=\"16\" height=\"16\" border=\"0\">]]&nbsp;[[$name.WebChanges][<img src=\"%PUBURLPATH%/%SYSTEMWEB%/TWikiDocGraphics/recentchanges.gif\" alt=\"Changes\" title=\"Recent changes in the <nop>$name web\" width=\"16\" height=\"16\" border=\"0\">]]&nbsp;[[$name.%NOTIFYTOPIC%][<img src=\"%PUBURLPATH%/%SYSTEMWEB%/TWikiDocGraphics/notify.gif\" alt=\"Notification\" title=\"Get notified of changes to the <nop>$name web\" width=\"16\" height=\"16\" border=\"0\">]]&nbsp;[[$name.%WEBPREFSTOPIC%][<img src=\"%PUBURLPATH%/%SYSTEMWEB%/TWikiDocGraphics/wrench.gif\" alt=\"Preferences\" title=\"Preferences of <nop>$name web\" width=\"16\" height=\"16\" border=\"0\">]]&nbsp;[[$name.WebTopMenu][<img src=\"%PUBURLPATH%/%SYSTEMWEB%/TWikiDocGraphics/topmenu.gif\" alt=\"Top menu\" title=\"Top menu of <nop>$name web\" width=\"16\" height=\"16\" border=\"0\">]]&nbsp;[[$name.%STATISTICSTOPIC%][<img src=\"%PUBURLPATH%/%SYSTEMWEB%/TWikiDocGraphics/statistics.gif\" alt=\"Statistics\" title=\"Statistics of <nop>$name web\" width=\"16\" height=\"16\" border=\"0\">]]&nbsp;[[$name.WebTopicList][<img src=\"%PUBURLPATH%/%SYSTEMWEB%/TWikiDocGraphics/indexlist.gif\" alt=\"All topics\" title=\"Bullet list of all topics\" width=\"16\" height=\"16\" border=\"0\">]]&nbsp;[[$name.WebIndex][<img src=\"%PUBURLPATH%/%SYSTEMWEB%/TWikiDocGraphics/index.gif\" alt=\"Topic details\" title=\"Index of all topics\" width=\"16\" height=\"16\" border=\"0\">]]</span> |"
webs="public,webtemplate"
webs="%IF{"{NoInAllPublicWebs}" then="Main,TWiki" else=""public,webtemplate"}%"
}%
<table border="0" cellspacing="2" cellpadding="3">
<tr bgcolor="#ffffff">
<td colspan="6"> This table is updated automatically based on <nop>WebPreferences settings of the individual webs. </td>
<td colspan="6"> %IF{"{NoInAllPublicWebs}" then=" The rest of the web list is ommited to avoid time out." else="This table is updated automatically based on <nop>WebPreferences settings of the individual webs."}% </td>
</tr>
<tr bgcolor="#ffffff">
<td valign="top"> Legend: </td>
Expand Down
8 changes: 5 additions & 3 deletions core/data/TWiki/SearchPatternCookbook.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="TWikiContributor" date="1240609516" format="1.1" version="$Rev$"}%
%META:TOPICINFO{author="TWikiContributor" date="1358925784" format="1.1" version="$Rev$"}%
%META:TOPICPARENT{name="FormattedSearch"}%
---+!! Search Pattern Cookbook

Expand Down Expand Up @@ -255,27 +255,29 @@ _Thanks to TWiki:Main.PeterThoeny for these solutions._
</verbatim>

---+++ Test case
%IF{"{NoInAllPublicWebs}" then="<span style='color: red'>The above solution would time out on this site because there are too many webs. So the following test case does the job only with the %USERSWEB% and %SYSTEMWEB% webs.</span>" else="<nop>"}%

Public webs of TWiki.

<form>
<select name="topic">
<option value="%TOPIC%">Select...</option>
%SEARCH{ "%HOMETOPIC%" scope="topic" web="all" topic="%HOMETOPIC%" format="<option value=\"$web.$topic\">$web</option>" separator=" " }%
%SEARCH{ "%HOMETOPIC%" scope="topic" web="%IF{"{NoInAllPublicWebs}" then="%USERSWEB%,%SYSTEMWEB%" else="all"}%" topic="%HOMETOPIC%" format="<option value=\"$web.$topic\">$web</option>" separator=" " }%
</select>
<input type="submit" value="Go" />
</form>

%T% For private webs, or any other webs you wish to exclude from the display, use "on" for the =Exclude web from a web="all" search= setting in the relevant web's !WebPreferences topic.

---+++ Alternative solution
%IF{"{NoInAllPublicWebs}" then="<span style='color: red'>The following solution would time out on this site for the same reason as above. So the following test case does the job only with the %USERSWEB% and %SYSTEMWEB% webs.</span>" else="<nop>"}%

This result can also be accomplished with the %<nop>WEBLIST% variable.

<form>
<select name="topic">
<option value="%TOPIC%">Select...</option>
%WEBLIST{ format="<option value=\"$name.%HOMETOPIC%\">$name</option>" webs="public" separator=" " }%
%WEBLIST{ format="<option value=\"$name.%HOMETOPIC%\">$name</option>" webs="%IF{"{NoInAllPublicWebs}" then="%USERSWEB%,%SYSTEMWEB%" else="public"}%" separator=" " }%
</select>
<input type="submit" value="Go" />
</form>
Expand Down
6 changes: 3 additions & 3 deletions core/data/TWiki/TWikiPreferences.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="TWikiContributor" date="1357464328" format="1.1" version="$Rev$"}%
%META:TOPICINFO{author="TWikiContributor" date="1358926998" format="1.1" version="$Rev$"}%
---+!! <nop>%WIKITOOLNAME% Site-Level Preferences

This topic defines __site-level__ settings that apply to all users and webs on this TWikiSite.
Expand Down Expand Up @@ -139,8 +139,8 @@ Preference settings local to your site should be set in [[%LOCALSITEPREFS%]] (th

* List of <nop>%WIKITOOLNAME% webs - on the first line of the upper toolbar (to add a new web, see ManagingWebs and %SYSTEMWEB%.SiteMap):
* Set WIKIWEBLIST = [[%USERSWEB%.%HOMETOPIC%][%USERSWEB%]] %SEP% [[%SYSTEMWEB%.%HOMETOPIC%][%SYSTEMWEB%]] %SEP% [[Sandbox.%HOMETOPIC%][Sandbox]]
* %T% *NOTE:* To automatically list all non-hidden webs in alphabetical order, use the =%<nop>WEBLIST{}%= variable instead: <br />
%WEBLIST{"[[$name.%HOMETOPIC%][$name]]" separator=" | "}%
* %T% %IF{"{NoInAllPublicWebs}" else="*NOTE:* To automatically list all non-hidden webs in alphabetical order, use the =&#37;WEBLIST{}&#37;= variable instead: <br />" then="You cannot use =&#37;WEBLIST{}&#37;= to list all webs because it would time out."}%
%%IF{"{NoInAllPublicWebs}" then="HIDE{" else="WEBLIST{"}% "[[$name.%HOMETOPIC%][$name]]" separator=" | "}%

* Maximum size of %SYSTEMWEB%.FileAttachments in KB, 0 for no limit:
* Set ATTACHFILESIZELIMIT = 10000
Expand Down

0 comments on commit 6bc722e

Please sign in to comment.