From 482886be6090f60d0ee18126594c1867b0113a11 Mon Sep 17 00:00:00 2001 From: MichaelDaum Date: Wed, 7 Jan 2009 13:42:17 +0000 Subject: [PATCH] Item8016:Item8015:Item5685:Item6015:Item5675:Item5653: * hybrid twiki/foswiki extension, only one foswiki uploaded * fixed group mapping * fixed group mapping under MapGroup=off * fixed getting email info git-svn-id: http://svn.foswiki.org/trunk@1793 0b4bb1d4-4e5a-0410-9cc4-b2b747904278 --- core/bin/rest | 1 + core/data/Main/SitePreferences.txt | 238 ++++++++++++++++++++-- core/data/Main/WebHome.txt | 95 +++++++-- core/data/Main/WebPreferences.txt | 15 +- core/data/Main/WebStatistics.txt | 12 +- core/data/Main/WikiGroups.txt | 26 +-- core/data/Sandbox/WebHome.txt | 54 ++--- core/data/Sandbox/WebNotify.txt | 6 +- core/data/Sandbox/WebPreferences.txt | 59 ++++-- core/data/Sandbox/WebStatistics.txt | 6 +- core/data/System/ManagingWebs.txt | 24 +-- core/data/System/SystemRequirements.txt | 1 - core/data/System/WebPreferences.txt | 4 +- core/data/System/WebTopicEditTemplate.txt | 6 - core/data/Trash/TrashAttachment.txt | 6 +- core/lib/Foswiki.pm | 179 ++++++++++++++-- core/lib/Foswiki/Engine/CGI.pm | 2 + core/lib/Foswiki/Form.pm | 2 +- core/lib/Foswiki/Render.pm | 11 + core/lib/Foswiki/Search.pm | 5 + core/lib/Foswiki/Store.pm | 12 ++ core/lib/Foswiki/Templates.pm | 2 +- core/lib/Foswiki/UI/Manage.pm | 44 ++-- core/lib/Foswiki/UI/View.pm | 24 +++ 24 files changed, 640 insertions(+), 194 deletions(-) diff --git a/core/bin/rest b/core/bin/rest index c7e1b35446..998e4fe830 100755 --- a/core/bin/rest +++ b/core/bin/rest @@ -1,4 +1,5 @@ #!/usr/bin/perl -wT +#!/usr/bin/speedy -wT -- -t600 -M5 -r20 -gTWikiTrunk # # Foswiki - The Free and Open Source Wiki, http://foswiki.org/ # diff --git a/core/data/Main/SitePreferences.txt b/core/data/Main/SitePreferences.txt index c7e6746eaf..bb5ba285e5 100644 --- a/core/data/Main/SitePreferences.txt +++ b/core/data/Main/SitePreferences.txt @@ -1,17 +1,231 @@ -%META:TOPICINFO{author="ProjectContributor" date="1228723330" format="1.1" version="1.1"}% ----+!! %MAKETEXT{"Local customisations of site-wide preferences"}% +%META:TOPICINFO{author="micha" date="1230732417" format="1.1" version="1.35"}% +---+!! %TOPIC% -
%ICON{"info"}% %MAKETEXT{"Site-level preferences are located in [_1], however this [_2] prefs topic has override priority and should be used for local customisations. This allows for easier upgrades as you don't need to worry about the shipped preferences clobbering yours. It's easier to keep a handle on if you only copy over the settings you actually change." args="[[%SYSTEMWEB%.DefaultPreferences]], [[%USERSWEB%.%TOPIC%]]"}%
+%TOC% -%EDITPREFERENCES{"%SYSTEMWEB%/DefaultPreferencesForm"}% -%IF{"$ SCRIPTNAME != 'viewauth%SCRIPTSUFFIX%'" then="%MAKETEXT{"Quick edit of existing preferences (edit the topic text to set new preferences)"}%" }% +---++ Broadcast messages + + * #Set BROADCASTMESSAGE = Foo bar + * Set MESSAGEWEB = Messages + * #Set BROADCASTMESSAGE = %DBCALL{"Applications.MessageApp.RenderBroadcast"}% + See Applications.MessageApp.RenderBroadcast - +---++ Site settings + * Set WIKITOOLNAME = MDC Wiki + * Set TWIKIREGISTRATION = %MAINWEB%.TWikiRegistration + * Set WEBCOPYRIGHT = Copyright © 1999-%GMTIME{"$year"}% by the contributing authors. All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems regarding %WIKITOOLNAME%? Send feedback. + * Set WEBRSSCOPYRIGHT = Copyright © %GMTIME{"$year"}% by contributing authors - * =FINALPREFERENCES= locks site-level preferences that are *not* allowed to be overridden by [[%WEBPREFSTOPIC%]] or user preferences: - * Set FINALPREFERENCES = ATTACHFILESIZELIMIT, PREVIEWBGIMAGE, WIKITOOLNAME, WIKIHOMEURL, ALLOWROOTCHANGE, DENYROOTCHANGE, FOSWIKI_LAYOUT_URL, FOSWIKI_STYLE_URL, FOSWIKI_COLORS_URL, USERSWEB, SYSTEMWEB, DOCWEB - - + +---+++ Trivadis setup + Module settings: + * Set TVDEMPSUMMARY = Applications.EmployeePortalApp.RenderTvdSummary + * Set TVDEMPMODULES = + | *Id* | *Label* | *View* | *Icon* | *Edit* | *Data* | + | business | Business details | Applications.EmployeePortalApp.RenderTvdBusinessDetails | %PUBURL%/Applications/EmployeePortalApp/icn_business.gif | Applications.EmployeePortalApp.TvdBusinessDetailsEdit | %BASEWEB%.%BASETOPIC% | + | contact | Contact details | Applications.EmployeePortalApp.RenderTvdContactDetails | %PUBURL%/Applications/EmployeePortalApp/icn_location.gif | Applications.EmployeePortalApp.TvdContactDetailsEdit | %BASEWEB%.%BASETOPIC% | + | skills | Skills | Applications.EmployeePortalApp.RenderSkills | %PUBURL%/Applications/EmployeePortalApp/icn_self.gif | Applications.EmployeePortalApp.SkillsEdit | %BASEWEB%.%BASETOPIC% | + | cv | Curriculum Vitae | Applications.EmployeePortalApp.RenderTvdCurriculumVitae | %PUBURL%/Applications/EmployeePortalApp/icn_self.gif | Applications.EmployeePortalApp.TvdCurriculumVitaeEdit | %BASEWEB%.%BASETOPIC% | + | notes | Notes | Applications.EmployeePortalApp.RenderPersonalNotes | %PUBURL%/Applications/EmployeePortalApp/icn_web.gif | | %BASEWEB%.%BASETOPIC% | + +%SYSTEMWEB%.RtfContrib settings: + * Set RTFCVTEMPLATEDE = Applications.EmployeePortalApp.cv-template-de.rtf + * Set RTFCVTEMPLATEEN = Applications.EmployeePortalApp.cv-template-en.rtf + * Set RTFCVTEMPLATEFR = Applications.EmployeePortalApp.cv-template-fr.rtf + +---++ Plucene configutation + * #Set PLUCENE_SEARCHALL = on + +---++ Accesss rights + * Set DENYWEBCHANGE = + * Set ALLOWTOPICCHANGE = TWikiAdminGroup + * Set ALLOWTOPICVIEW = TWikiAdminGroup + +---++ Finalization + * Set FINALPREFERENCES = ATTACHFILESIZELIMIT, PREVIEWBGIMAGE, WIKITOOLNAME, WIKIHOMEURL, ALLOWROOTCHANGE, DENYROOTCHANGE, TWIKILAYOUTURL, TWIKISTYLEURL, TWIKICOLORSURL, USERSWEB, SYSTEMWEB, DOCWEB + +%META:FILEATTACHMENT{name="butterfly-orange-128x128.png" attr="" autoattached="1" comment="" date="1185183896" path="butterfly-orange-128x128.png" size="16872" user="micha" version="1"}% +%META:FILEATTACHMENT{name="fff_tujs.png" attachment="fff_tujs.png" attr="" comment="" date="1223563028" path="fff_tujs.png" size="4186" stream="IO::File=GLOB(0x8e92de8)" tmpFilename="/var/tmp/CGItemp44214" user="micha" version="4"}% +%META:FILEATTACHMENT{name="trajanusbricks.png" attachment="trajanusbricks.png" attr="" comment="" date="1223562969" path="trajanusbricks.png" size="2543" stream="IO::File=GLOB(0x8e97594)" tmpFilename="/var/tmp/CGItemp44284" user="micha" version="1"}% diff --git a/core/data/Main/WebHome.txt b/core/data/Main/WebHome.txt index 7d789b51b6..f13a19c5ee 100644 --- a/core/data/Main/WebHome.txt +++ b/core/data/Main/WebHome.txt @@ -1,26 +1,77 @@ -%META:TOPICINFO{author="ProjectContributor" date="1228500812" format="1.1" version="1.1"}% ----+!! Welcome to the %USERSWEB% web -Congratulations, you have finished installing Foswiki. +%META:TOPICINFO{author="micha" date="1227726813" format="1.1" version="1.5"}% +---+ [[%WEB%.%TOPIC%][Professional Wikis]] + -This site is running Foswiki version *%WIKIVERSION%*, Plugin API version *%PLUGINVERSION{}%* +*You want* to coordinate distant parts of your company, ease project coordination with your partners, +or offer wiki access for your clients. You want to +leverage collaboration and knowledge sharing among your employees. +You are looking for a wiki for your company's intranet. +And integrate it seamlessly in terms of infrastructure as well as look&feel. +You want your wiki to be a great success in your company's intranet, +an easy to use system, yet scaling with your needs. +And you want your fun back while managing knowledge. -To learn more about Foswiki, visit the [[%SYSTEMWEB%.WebHome][%SYSTEMWEB% web]]. Please ensure that the read/write -permissions for each web on your site match your access control policies (see [[%SYSTEMWEB%.DefaultPreferences]] -and [[%USERSWEB%.SitePreferences]]). Replace this text with a description of your new -%IF{"defined WIKITOOLNAME" then="%WIKITOOLNAME%" else="Foswiki"}% site. +---+ Our Services + +*You get* an open ear to listen to all of your needs! +Not only do we accompany you with every step to get the most decent wiki. +We enable it hands on, on-site or via remote access. +We offer first class out-of-the-box wikis in the market. +We evaluate, rewrite and customize Open Source software according to your needs, +thus supporting the originating authors. We conduct Open Source projects that you initiate. +We design your wiki, either from scratch or according to your own corporate identity. +We went down to every usability aspect and reinvented online interaction in knowledge management. +We support your team long-term. We train them. We administrate your wiki systems remotely, if you want. ----++ %WEB% Web Utilities -
- * [[%SYSTEMWEB%.WelcomeGuest][WelcomeGuest]] - for first time visitors - * [[%SYSTEMWEB%.UserRegistration][Registration]] - become a %WIKITOOLNAME% user - * [[%WIKIUSERSTOPIC%]] - list of users of this %WIKITOOLNAME% site - * [[WikiGroups]] - list of groups used for access control - *   - [[WebSearchAdvanced][advanced search]] - * [[WebTopicList]] - all topics in alphabetical order - * [[WebChanges]] - recent topic changes in this web - * [[WebNotify]] - subscribe to an e-mail alert sent when topics change - * [[WebRss]], [[WebAtom]] - RSS and ATOM news feeds of topic changes - * [[WebStatistics]] - listing popular topics and top contributors - * [[WebPreferences]] - preferences of this web - + + + + + +
+---+ Contact +You want all this, and even more. And you need it fast. +Then contact +%INCLUDE{"Contact"}% +---+ Buzzer +%~~ TAGCLOUD{" +~~~ Wikis:10, +~~~ Collaboration:10, +~~~ Knowledge Management:8, +~~~ Information Extraction:2, +~~~ Language Processing:2, +~~~ Consulting:9, +~~~ Coatching:8, +~~~ TWikiApplications:7, +~~~ TWiki:10, +~~~ LDAP:5, +~~~ Web Design:5, +~~~ Fulltext Retrieval:3, +~~~ Skills management:6, +~~~ Information Portals:8, +~~~ Blogs:7, +~~~ Forums:4, +~~~ Tagging:8, +~~~ Categorization:4, +~~~ Ontologies, +~~~ " +~~~ split="," +~~~ offset="8" +~~~ format=" +~~~ $term" +~~~ }% +
+ + + + +%META:FILEATTACHMENT{name="gummiebaerchen.jpeg" attachment="gummiebaerchen.jpeg" attr="h" comment="gummie" date="1192126924" moveby="micha" movedto="Main.WebHome.gummiebaerchen.jpeg" movedwhen="1192134208" movefrom="Main.ProfessionalWikis.gummiebaerchen.jpeg" path="gummiebaerchen.jpeg" size="21285" stream="gummiebaerchen.jpeg" tmpFilename="/var/tmp/CGItemp27229" user="micha" version="1"}% +%META:PREFERENCE{name="TOPICTITLE" title="TOPICTITLE" type="Set" value="WebHome"}% diff --git a/core/data/Main/WebPreferences.txt b/core/data/Main/WebPreferences.txt index 59d0fb9b46..9a2dd8da1a 100644 --- a/core/data/Main/WebPreferences.txt +++ b/core/data/Main/WebPreferences.txt @@ -11,25 +11,26 @@ The following settings are *web preferences* of the [[%WEB%.%HOMETOPIC%][%WEB%]] These settings override the defaults for this web only. See [[%SYSTEMWEB%.DefaultPreferences#DefaultWebPreferences][full list of defaults with explanation]]. * Web settings: - * Set WEBTOPICLIST = [[%WIKIUSERSTOPIC%][Users]] %SEP% [[WikiGroups][Groups]] %SEP% [[WebChanges][Changes]] %SEP% [[WebIndex][Index]] %SEP% [[WebSearch][Search]] %SEP% Go * Set WEBBGCOLOR = #FFEFA6 - * Set SITEMAPWHAT = Welcome to %WIKITOOLNAME%... [[%WEB%.%WIKIUSERSTOPIC%][Users]], [[%WEB%.WikiGroups][Groups]] - * Set SITEMAPUSETO = ...see who is registered on this site + * Set SITEMAPWHAT = Welcome to the %WIKITOOLNAME% + * Set SITEMAPUSETO = ...about the %WIKITOOLNAME% and its users. * Set SITEMAPLIST = on + * Set USERSTYLEURL = %PUBURLPATH%/Applications/YellowPageApp/styles.css + * Default template for *new topics* for this web: * WebTopicEditTemplate: Default template for new topics in this web. (Site-level is used if topic does not exist) * [[%SYSTEMWEB%.WebTopicEditTemplate]]: Site-level default topic template * Comma separated list of *forms* that can be attached to topics in this web. See [[%SYSTEMWEB%.DataForms][DataForms]] for more information. - * Set WEBFORMS = %SYSTEMWEB%.UserForm + * Set WEBFORMS = %SYSTEMWEB%.UserForm, Applications.EmployeePortalApp.EmployeePortal * Users or groups who *are not* / *are* allowed to *view* / *change* / *rename* topics in the %WEB% web: (See [[%SYSTEMWEB%.AccessControl][AccessControl]]). Remove the # to enable any of these settings. Remember that an empty setting is a valid setting; setting DENYWEBVIEW to nothing means that anyone can view the web. * Set DENYWEBVIEW = * Set ALLOWWEBVIEW = - * Set DENYWEBCHANGE = + * Set DENYWEBCHANGE = %MAINWEB%.TWikiGuest * Set ALLOWWEBCHANGE = - * Set DENYWEBRENAME = + * Set DENYWEBRENAME = %MAINWEB%.TWikiGuest * Set ALLOWWEBRENAME = * Users or groups allowed to change or rename this %TOPIC% topic: (e.g., [[%USERSWEB%.AdminGroup][AdminGroup]]) @@ -38,5 +39,3 @@ These settings override the defaults for this web only. See [[%SYSTEMWEB%.Defaul * Web preferences that are *not* allowed to be overridden by sub-web, user or topic preferences: * Set FINALPREFERENCES = NOSEARCHALL, ATTACHFILESIZELIMIT, WIKIWEBMASTER, WEBCOPYRIGHT, WEBTOPICLIST, DENYWEBVIEW, ALLOWWEBVIEW, DENYWEBCHANGE, ALLOWWEBCHANGE, DENYWEBRENAME, ALLOWWEBRENAME - -%INCLUDE{%SYSTEMWEB%.WebPreferencesHelp}% diff --git a/core/data/Main/WebStatistics.txt b/core/data/Main/WebStatistics.txt index 9a70cda068..c141c146e4 100644 --- a/core/data/Main/WebStatistics.txt +++ b/core/data/Main/WebStatistics.txt @@ -4,9 +4,9 @@ | *Month:* | *Topic
views:* | *Topic
saves:* | *File
uploads:* | *Most popular
topic views:* | *Top contributors for
topic save and uploads:* | | | | | | | | - -*Notes:* - * Do not edit this topic, it is updated automatically. (You can also [[%SCRIPTURL{"statistics"}%/%WEB%][force]] an update) - * [[%SYSTEMWEB%.SiteTools#WebStatistics_site_statistics][Site tools]] tells you how to enable the automatic updates of the statistics. - * Suggestion: You could archive this topic once a year and delete the previous year's statistics from the table. - +| Sep 2008 | 383 | 40 | 0 | 174 [[WebHome]]
 91 [[MichaelDaum]]
 77 [[Category]]
 16 [[SkillsCloud]]
 11 [[TWikiUsers]]
  5 [[TWikiPreferences]]
  4 [[TWikiGroups]]
  1 [[TWikiRegistration]]
  1 [[TestUser]]
  1 [[SkillsCategory]]
  1 [[WebPreferences]] |  38 Main.MichaelDaum
  1 Main.TWikiRegistrationAgent
  1 Main.admin | +| Nov 2007 | 212 | 6 | 0 | 157 [[WebHome]]
 33 [[TWikiWebMoreActions]]
 16 [[TWikiPreferences]]
  1 [[MichaelDaum]]
  1 [[WebNotify]]
  1 [[TWikiGroups]] |   6 Main.MichaelDaum | +| Oct 2007 | 577 | 15 | 0 | 515 [[WebHome]]
 54 [[TWikiPreferences]]
  6 [[WikiRingThemeContrib]]
  1 [[MichaelDaum]] |  15 Main.MichaelDaum | +| Sep 2007 | 2107 | 47 | 1 | 638 [[WebHome]]
371 [[SolutionsContrib]]
283 [[DpaContrib]]
109 [[WebTopicList]]
 61 [[TWikiPreferences]]
 56 [[BlogAdminGroup]]
 53 [[WikiRingThemeContrib]]
 50 [[MichaelDaum]]
 21 [[MichaelDaumSideBar]]
 19 [[BlogAuthorGroup]]
 17 [[WebSearchAdvanced]] |  48 Main.MichaelDaum | +| Aug 2007 | 854 | 25 | 0 | 505 [[SolutionsContrib]]
232 [[WebHome]]
 78 [[TWikiPreferences]]
 12 [[TWikiUsers]]
  9 [[TWikiGroups]]
  5 [[MichaelDaum]]
  5 [[RsapContrib]]
  3 [[TWikiWebHtmlHead]]
  1 [[TWikiWebJavaScript]]
  1 [[TWikiGuest]]
  1 [[TWikiAdminGroup]] |  25 Main.MichaelDaum | +| Jul 2007 | 557 | 62 | 1 | 391 [[WebHome]]
 64 [[TWikiPreferences]]
 35 [[TWikiWebHtmlHead]]
 19 [[MichaelDaum]]
 18 [[TWikiWebJavaScript]]
 15 [[RsapContrib]]
  3 [[WebTopicList]]
  3 [[TWikiUsers]]
  2 [[MichaelDaumSideBar]]
  1 [[UnknownUser]]
  1 [[WebStatistics]] |  63 Main.MichaelDaum | diff --git a/core/data/Main/WikiGroups.txt b/core/data/Main/WikiGroups.txt index b20af785cc..45553961d1 100644 --- a/core/data/Main/WikiGroups.txt +++ b/core/data/Main/WikiGroups.txt @@ -1,30 +1,30 @@ -%META:TOPICINFO{author="ProjectContributor" date="1111931141" format="1.0" version="$Rev: 15171 $"}% +%META:TOPICINFO{author="micha" date="1229345065" format="1.1" version="1.3"}% ---+ Wiki Groups - These groups can be used to define fine grained [[%SYSTEMWEB%.AccessControl][AccessControl]] in %WIKITOOLNAME%: -%GROUPS% +%TWISTY{link="%BUTTON{"%MAKETEXT{"New group"}%" icon="add"}%%CLEAR%"}%
-
-
-%TABLE{databg="" cellborder="0" tableborder="0"}% -| New Group: |  | -| |%ICON{"warning"}% *Note:* A group topic name must be a [[%SYSTEMWEB%.WikiWord][WikiWord]] and *must* end in =...Group=. New topics are based on [[GroupTemplate]] | - +
+---+++ Name: + +
+A group topic name must be a [[%SYSTEMWEB%.WikiWord][WikiWord]] and __must__ end in =...Group=. New topics are based on [[GroupTemplate]] +
+
+
+%BUTTON{"%MAKETEXT{"Submit"}%" type="submit" icon="tick"}%%CLEAR%
+%ENDTWISTY% -*IMPORTANT NOTE:* Think twice before restricting write access to a web or a topic, because an open system where everybody can contribute is the essence of [[%SYSTEMWEB%.WikiCulture][WikiCulture]]. Experience shows that unrestricted write access works very well because: - * There is enough peer pressure to post only appropriate content. - * Content does not get lost because topics are under revision control. - * A topic revision can be undone by a member of the [[%USERSWEB%.AdminGroup][AdminGroup]] if necesssary. +%GROUPS% --- *Related topics:* [[%SYSTEMWEB%.AccessControl][AccessControl]], [[%WEBPREFSTOPIC%]], [[%WIKIUSERSTOPIC%]], [[%SYSTEMWEB%.WikiCulture][WikiCulture]] diff --git a/core/data/Sandbox/WebHome.txt b/core/data/Sandbox/WebHome.txt index f04d721c40..f344e707e1 100644 --- a/core/data/Sandbox/WebHome.txt +++ b/core/data/Sandbox/WebHome.txt @@ -1,22 +1,32 @@ -%META:TOPICINFO{author="ProjectContributor" date="1181951854" format="1.1" version="1.1"}% +%META:TOPICINFO{author="micha" date="1227288137" format="1.1" reprev="1.9" version="1.9"}% ---+!! %MAKETEXT{"Welcome to the [_1] web" args="%WEB%"}% - + %MAKETEXT{"The [_1] web is the sandbox you can use for testing. Everybody is welcome to add or delete some stuff. It is recommended to walk through the [_2] to get a jumpstart on the [_3] tool. A good rule of thumb is to add at the end of the page and sign and date it with your [_4]." args="%WEB%,%SYSTEMWEB%.TwentyMinuteTutorial,%WIKITOOLNAME%,%SYSTEMWEB%.WikiName"}% ----++ %MAKETEXT{"Test Topics"}% - -
-%ICON{"newtopic"}% %MAKETEXT{"Create a new document by name:"}% %MAKETEXT{"(Use a topic name in System.WikiNotation)"}%
-  - - -
- -
-%ICON{"newtopic"}% %MAKETEXT{"Create a new auto-numbered test topic:"}% - - +%TWISTY{link="%BUTTON{"Create a new topic" icon="add"}%%CLEAR%"}% + + + + +
+
+

%MAKETEXT{"Name:"}%

+
+
+   + + %BUTTON{"%MAKETEXT{"Submit"}%" icon="tick" type="submit""}% + %BUTTON{"%MAKETEXT{"Clear"}%" icon="application_form" type="clear"}% +
+ %CLEAR% +
+
%MAKETEXT{"Use a topic name in %SYSTEMWEB%.WikiNotation"}%
+
+
+%ENDTWISTY% ---++ %MAKETEXT{"Recently changed topics"}%
@@ -24,16 +34,6 @@
%MAKETEXT{"A more extensive changes list is available via ~[~[[_1]~]~[Recent Changes~]~]." args="WebChanges"}% ----++ %WEB% Web Utilities -
- *   - [[WebSearchAdvanced][advanced search]] - * WebTopicList - all topics in alphabetical order - * WebChanges - recent topic changes in this web - * WebNotify - subscribe to an e-mail alert sent when topics change - * WebRss, WebAtom - RSS and ATOM news feeds of topic changes - * WebStatistics - listing popular topics and top contributors - * WebPreferences - preferences of this web -
- - + diff --git a/core/data/Sandbox/WebNotify.txt b/core/data/Sandbox/WebNotify.txt index 82351ed2e2..172c53c1da 100644 --- a/core/data/Sandbox/WebNotify.txt +++ b/core/data/Sandbox/WebNotify.txt @@ -1,8 +1,4 @@ %META:TOPICINFO{author="ProjectContributor" date="1111938186" format="1.0" version="$Rev$"}% -%MAKETEXT{"This is a subscription service to be automatically notified by e-mail when topics change in this [_1] web. This is a convenient service, so you do not have to come back and check all the time if something has changed. To subscribe, please add a bullet with your [_2] in alphabetical order to this list:" args="*%WEB%*,[[%SYSTEMWEB%.WikiName][WikiName]]"}% - - * %USERSWEB%.WikiGuest - * %USERSWEB%.WikiGuest - example@your.company - +---+!! %TOPIC% %INCLUDE{"%SYSTEMWEB%.WebChangesAlert"}% diff --git a/core/data/Sandbox/WebPreferences.txt b/core/data/Sandbox/WebPreferences.txt index 56c01d4f23..183295ad33 100644 --- a/core/data/Sandbox/WebPreferences.txt +++ b/core/data/Sandbox/WebPreferences.txt @@ -1,4 +1,4 @@ -%META:TOPICINFO{author="BaseUserMapping_333" date="1228679419" format="1.1" version="1.2"}% +%META:TOPICINFO{author="micha" date="1231278475" format="1.1" version="1.4"}% ---+!! %WEB% Web Preferences The following settings are *web preferences* of the [[%WEB%.%HOMETOPIC%][%WEB%]] web. These preferences overwrite the *site-level preferences* in [[%SYSTEMWEB%.%WIKIPREFSTOPIC%]] and [[%LOCALSITEPREFS%]], and can be overwritten by *user preferences* (your personal topic, eg: [[%USERSWEB%.%WIKINAME%][%WIKINAME%]] in the [[%USERSWEB%.%HOMETOPIC%][%USERSWEB%]] web). @@ -9,26 +9,57 @@ The following settings are *web preferences* of the [[%WEB%.%HOMETOPIC%][%WEB%]] These settings override the defaults for this web only. See [[%SYSTEMWEB%.DefaultPreferences#DefaultWebPreferences][full list of defaults with explanation]]. - * Web Settings: +---++ Applications.EmployeePortalApp stuff + + * Set WEBDEPENDENCIES = Sandbox.WebHome + * Set EMPSUMMARY = %TVDEMPSUMMARY% + * Set EMPDEFAULTMODULE = business + * Set EMPMODULES = %TVDEMPMODULES% + +---+++ Module settings: + * Set TVDEMPSUMMARY = RenderTvdSummary + * Set TVDEMPMODULES = + | *Id* | *Label* | *View* | *Icon* | *Edit* | *Data* | + | business | Business details | Applications.EmployeePortalApp.RenderTvdBusinessDetails | %PUBURL%/Applications/EmployeePortalApp/icn_business.gif | Applications.EmployeePortalApp.TvdBusinessDetailsEdit | %BASEWEB%.%BASETOPIC% | + | contact | Contact details | Applications.EmployeePortalApp.RenderTvdContactDetails | %PUBURL%/Applications/EmployeePortalApp/icn_location.gif | Applications.EmployeePortalApp.TvdContactDetailsEdit | %BASEWEB%.%BASETOPIC% | + | projects | Projects | Applications.EmployeePortalApp.RenderTvdProjects | | | | + | skills | Skills | Applications.EmployeePortalApp.RenderTvdSkills | %PUBURL%/Applications/EmployeePortalApp/icn_self.gif | Applications.EmployeePortalApp.TvdSkillsEdit | %BASEWEB%.%BASETOPIC% | + | cv | Curriculum Vitae | Applications.EmployeePortalApp.RenderTvdCurriculumVitae | %PUBURL%/Applications/EmployeePortalApp/icn_self.gif | Applications.EmployeePortalApp.TvdCurriculumVitaeEdit | %BASEWEB%.%BASETOPIC% | + | notes | Notes | Applications.EmployeePortalApp.RenderPersonalNotes | %PUBURL%/Applications/EmployeePortalApp/icn_web.gif | | %BASEWEB%.%BASETOPIC% | + + + +TWiki.RtfContrib settings: + * Set RTFCVTEMPLATEDE = Applications.EmployeePortalApp.cv-template-de.rtf + * Set RTFCVTEMPLATEEN = Applications.EmployeePortalApp.cv-template-en.rtf + + +Misc: + * Set TVDPHOTOURL = https://intranet.trivadis.com/tvd_all/70_INTRANET/10_WEBPAGES/MAFotos + +---++ Default stuff + + * #Set DISPLAYFORM = on + + * Web Settings: * Set WEBBGCOLOR = #B9DAFF * Set SITEMAPWHAT = Sandbox test area with all features enabled. * Set SITEMAPUSETO = ...experiment in an unrestricted hands-on web. * Set SITEMAPLIST = on - * Default template for *new topics* for this web: - * WebTopicEditTemplate: Default template for new topics in this web. (Site-level is used if topic does not exist) - * [[%SYSTEMWEB%.WebTopicEditTemplate]]: Site-level default topic template - - * Comma separated list of *forms* that can be attached to topics in this web. See [[%SYSTEMWEB%.DataForms][DataForms]] for more information. - * Set WEBFORMS = TestForm + * Comma separated list of *forms* that can be attached to topics in this web. See [[%SYSTEMWEB%.DataForms][DataForms]] for more information. + * Set WEBFORMS = Applications.TopicType, TestForm, PartnerForm * Users or groups who *are not* / *are* allowed to *view* / *change* / *rename* topics in the %WEB% web: (See [[%SYSTEMWEB%.AccessControl][AccessControl]]). Remove the # to enable any of these settings. Remember that an empty setting is a valid setting; setting DENYWEBVIEW to nothing means that anyone can view the web. - * Set DENYWEBVIEW = - * Set ALLOWWEBVIEW = - * Set DENYWEBCHANGE = - * Set ALLOWWEBCHANGE = - * Set DENYWEBRENAME = - * Set ALLOWWEBRENAME = + * #Set DENYWEBVIEW = %MAINWEB%.TWikiGuest + * #Set ALLOWWEBVIEW = + * #Set DENYWEBCHANGE = %MAINWEB%.TWikiGuest + * #Set ALLOWWEBCHANGE = + * #Set DENYWEBRENAME = %MAINWEB%.TWikiGuest + * #Set ALLOWWEBRENAME = * Users or groups allowed to change or rename this %TOPIC% topic: (e.g., [[%USERSWEB%.AdminGroup][AdminGroup]]) * Set ALLOWTOPICCHANGE = %USERSWEB%.AdminGroup diff --git a/core/data/Sandbox/WebStatistics.txt b/core/data/Sandbox/WebStatistics.txt index 9a70cda068..7c83f782f4 100644 --- a/core/data/Sandbox/WebStatistics.txt +++ b/core/data/Sandbox/WebStatistics.txt @@ -4,9 +4,9 @@ | *Month:* | *Topic
views:* | *Topic
saves:* | *File
uploads:* | *Most popular
topic views:* | *Top contributors for
topic save and uploads:* | | | | | | | | +| Sep 2008 | 140 | 86 | 4 |  20 [[FormatListTest]]
 19 [[CalcTest]]
 18 [[ImageTest]]
 17 [[WebHome]]
 16 [[IfDefinedPluginTest]]
 10 [[TestTopic8]]
 10 [[TestTopic9]]
  8 [[TablePluginTest]]
  7 [[CommentTest]]
  4 [[JQueryPluginExamples]]
  3 [[ImageTest2]] |  88 Main.MichaelDaum
  2 Main.CrawfordCurrie | *Notes:* - * Do not edit this topic, it is updated automatically. (You can also [[%SCRIPTURL{"statistics"}%/%WEB%][force]] an update) + * Do not edit this topic, it is updated automatically. (You can also [[%SCRIPTURL{"statistics"}%/%WEB%/%TOPIC%][force]] an update) * [[%SYSTEMWEB%.SiteTools#WebStatistics_site_statistics][Site tools]] tells you how to enable the automatic updates of the statistics. - * Suggestion: You could archive this topic once a year and delete the previous year's statistics from the table. - + * Suggestion: You could archive this topic once a year and delete the previous year's statistics from the table. diff --git a/core/data/System/ManagingWebs.txt b/core/data/System/ManagingWebs.txt index 54b0b99278..eb12262b79 100644 --- a/core/data/System/ManagingWebs.txt +++ b/core/data/System/ManagingWebs.txt @@ -1,4 +1,4 @@ -%META:TOPICINFO{author="ProjectContributor" date="1153528583" format="1.1" version="$Rev: 15450 $"}% +%META:TOPICINFO{author="micha" date="1228130313" format="1.1" reprev="1.2" version="1.2"}% %STARTINCLUDE% ---+ Managing Webs @@ -21,25 +21,9 @@ In either case you will want to be sure to verify that your new web has all the #CreateNewWeb ---++ Adding a New Web - -
-Create a new web by filling out this form.%BR% -*%X% Note:* *Keep the number of webs to a minimum!* Don't create a new web for each little project. Cross-linking topics is easier, and searches are faster, if there are only a few larger webs. -| *Name of new web:* | | The name must start with an upper case letter, followed by upper or lower case letters or numbers. Specify a short name to avoid long URLs. | -| *Based on web:* | | Select a TemplateWeb | -| *Web color:* | | Enter a StandardColors code for the web | -| *Site Map:* | Yes   No | Include this web in the site map | -| *Description:
 
 * |
Enter a short description of the web. Write =Web.TopicName= instead of just =TopicName= if you include links. This description will be used in the %SYSTEMWEB%.SiteMap || -| *Use to...
 * |
Continue the sentence describing the intended use. This is also for the %SYSTEMWEB%.SiteMap || -| *Hidden:* | Yes   No | Specify if you want to exclude the web from a "search all webs" search. *This will not prevent users accessing the web*. It will simply hide it from searches. | -| * * | || - - -
- -*Notes:* - * You must have =ROOTCHANGE= access to create a top-level web (one with no parent) - * Only the person who created it has permission to change the %WEBPREFSTOPIC% in the new web +New webs can be created using the WebCreateNewWeb [[AdminToolsCategory][AdminTool]]. +You must have =ROOTCHANGE= access to create a top-level web (one with no parent) +Only the person who created it has permission to change the %WEBPREFSTOPIC% in the new web. ---++ Hierarchical Webs diff --git a/core/data/System/SystemRequirements.txt b/core/data/System/SystemRequirements.txt index 2ea3fef28e..0af96cb394 100644 --- a/core/data/System/SystemRequirements.txt +++ b/core/data/System/SystemRequirements.txt @@ -9,7 +9,6 @@ Low client and server base requirements are core features that keep Foswiki wide %TOC% ---++ Server Requirements - The code is written in Perl 5, and uses a number of shell commands from perl. The default package requires [[http://www.gnu.org/software/rcs/rcs.html][RCS (Revision Control System)]], a GNU Free Software package. Foswiki is developed in a basic Linux/Apache environment. It also works with Microsoft Windows, and should have no problem on any other platform that meets the requirements. diff --git a/core/data/System/WebPreferences.txt b/core/data/System/WebPreferences.txt index 08c6a955e9..95d98ffb37 100644 --- a/core/data/System/WebPreferences.txt +++ b/core/data/System/WebPreferences.txt @@ -30,8 +30,8 @@ These [[%SYSTEMWEB%.PreferenceSettings][preference settings]] override the defau * Comma separated list of *forms* that can be attached to topics in this web. See [[%SYSTEMWEB%.DataForms][DataForms]] for more information. * Set WEBFORMS = DefaultPreferencesForm - * Copyright notice for the web. - * Set WEBCOPYRIGHT = This site is powered by Foswiki%MAKETEXT{"Copyright &© by the contributing authors. All material on this site is the property of the contributing authors." args="1999-%GMTIME{$year}%"}%
%MAKETEXT{"Ideas, requests, problems regarding [_1]? Send feedback" args="%WIKITOOLNAME%,mailto:%WIKIWEBMASTER%?subject=%WIKITOOLNAME%%20Feedback%20on%20%BASEWEB%.%BASETOPIC%"}% %IF{"$ WEB= $ SYSTEMWEB" then=""}% + * Copyright notice for the TWiki web. + * Set WEBCOPYRIGHT = %MAKETEXT{"Copyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors." args="1999-%GMTIME{$year}%"}%
%MAKETEXT{"Ideas, requests, problems regarding [_1]? Send feedback" args="%WIKITOOLNAME%,mailto:%WIKIWEBMASTER%?subject=%WIKITOOLNAME%%20Feedback%20on%20%BASEWEB%.%BASETOPIC%"}% %IF{"$ WEB= $ SYSTEMWEB" then="
__Note:__ Please contribute updates to this topic on TWiki.org at TWiki:TWiki.%BASETOPIC%"}% * Users or groups who *are not* / *are* allowed to *view* / *change* / *rename* topics in the %WEB% web: (See %SYSTEMWEB%.AccessControl). * Set ALLOWWEBCHANGE = %USERSWEB%.AdminGroup diff --git a/core/data/System/WebTopicEditTemplate.txt b/core/data/System/WebTopicEditTemplate.txt index 85064bd47b..37651112b1 100644 --- a/core/data/System/WebTopicEditTemplate.txt +++ b/core/data/System/WebTopicEditTemplate.txt @@ -1,7 +1 @@ %META:TOPICINFO{author="ProjectContributor" date="1111929255" format="1.0" version="$Rev$"}% - - - - - --- %WIKIUSERNAME% - %DATE% diff --git a/core/data/Trash/TrashAttachment.txt b/core/data/Trash/TrashAttachment.txt index 29eb3f3fc0..165248ddcc 100644 --- a/core/data/Trash/TrashAttachment.txt +++ b/core/data/Trash/TrashAttachment.txt @@ -1,5 +1,9 @@ -%META:TOPICINFO{author="ProjectContributor" date="1092762941" format="1.0" version="$Rev$"}% +%META:TOPICINFO{author="micha" date="1231235369" format="1.1" version="1.4"}% %META:TOPICPARENT{name="WebHome"}% ---+ %MAKETEXT{"Placeholder for trashed attachments"}% +%META:FILEATTACHMENT{name="2078280247_dcd1261627_o.jpg" attachment="2078280247_dcd1261627_o.jpg" attr="" comment="" date="1226074978" moveby="micha" movedto="Trash.TrashAttachment.2078280247_dcd1261627_o.jpg" movedwhen="1226077758" movefrom="Sandbox.CopyContribTest.2078280247_dcd1261627_o.jpg" path="2078280247_dcd1261627_o.jpg" size="84581" stream="IO::File=GLOB(0x8f3d614)" tmpFilename="/var/tmp/CGItemp28948" user="micha" version="1"}% +%META:FILEATTACHMENT{name="aww.gif" attachment="aww.gif" attr="" comment="" date="1226080828" moveby="micha" movedto="Trash.TrashAttachment.aww.gif" movedwhen="1226081105" movefrom="Sandbox.CopyContribTest1.aww.gif" path="aww.gif" size="18542" stream="IO::File=GLOB(0x8f3dd2c)" tmpFilename="/var/tmp/CGItemp51073" user="micha" version="1"}% +%META:FILEATTACHMENT{name="handlotion.gif" attachment="handlotion.gif" attr="h" comment="" date="1229078225" moveby="micha" movedto="Trash.TrashAttachment.handlotion.gif" movedwhen="1229078250" movefrom="Sandbox.AhaEDVFaehland.handlotion.gif" path="handlotion.gif" size="18474" stream="IO::File=GLOB(0x8f99c34)" tmpFilename="/var/tmp/CGItemp34669" user="micha" version="1"}% +%META:FILEATTACHMENT{name="jquery.tablesorter.pack.js" attr="" autoattached="1" comment="2.0-beta" date="1185819841" moveby="micha" movedto="Trash.TrashAttachment.jquery.tablesorter.pack.js" movedwhen="1231235369" movefrom="Morgue.JQueryTableSorterPlugin.jquery.tablesorter.pack.js" path="jquery.tablesorter.pack.js" size="5298" user="micha" version="1"}% diff --git a/core/lib/Foswiki.pm b/core/lib/Foswiki.pm index c6b606ef24..6d051f0d55 100644 --- a/core/lib/Foswiki.pm +++ b/core/lib/Foswiki.pm @@ -624,42 +624,56 @@ sub writeCompletePage { my ( $this, $text, $pageType, $contentType ) = @_; $contentType ||= 'text/html'; - if ( $contentType ne 'text/plain' ) { + my $status = $this->{response}->status || 200; + $status =~ s/[^\d]//go; - # Remove and tags - $text =~ s/([\t ]?)[ \t]*<\/?(nop|noautolink)\/?>/$1/gis; - $text .= "\n" unless $text =~ /\n$/s; + if ($status != 302) { # don't do nothing if we are in the middle of a redirect - my $htmlHeader = join( "\n", - map { '' . $this->{_HTMLHEADERS}{$_} } - keys %{ $this->{_HTMLHEADERS} } ); - $text =~ s!()!$htmlHeader$1!i if $htmlHeader; - chomp($text); - } + if ( $contentType ne 'text/plain' ) { + + # Remove and tags + $text =~ s/([\t ]?)[ \t]*<\/?(nop|noautolink)\/?>/$1/gis; + $text .= "\n" unless $text =~ /\n$/s; + + my $htmlHeader = join( "\n", + map { '' . $this->{_HTMLHEADERS}{$_} } + keys %{ $this->{_HTMLHEADERS} } ); + $text =~ s!()!$htmlHeader$1!i if $htmlHeader; + chomp($text); + } + + # Call final handler + $this->{plugins}->dispatch('completePageHandler', $text); - $this->generateHTTPHeaders( undef, $pageType, $contentType ); - my $hdr = $this->{response}->printHeaders; + # cache final page, but only view + my $cachedPage; + if ($this->inContext('view') && $TWiki::cfg{Cache}{Enabled}) { + $cachedPage = $this->{cache}->cachePage($contentType, $text); + $this->{cache}->renderDirtyAreas(\$text) if $cachedPage->{isDirty}; + } - # Call final handler - $this->{plugins}->dispatch( 'completePageHandler', $text, $hdr ); + $this->generateHTTPHeaders( undef, $pageType, $contentType, $text, $cachedPage ); + } $this->{response}->print($text); } =begin TML ----++ ObjectMethod generateHTTPHeaders( $query, $pageType, $contentType ) -> $header +---++ ObjectMethod generateHTTPHeaders( $query, $pageType, $contentType, $text, $cachedPage ) -> $header All parameters are optional. - * =$query= CGI query object | Session CGI query (there is no good reason to set this) + * =$query= - CGI query object | Session CGI query (there is no good reason to set this) * =$pageType= - May be "edit", which will cause headers to be generated that force caching for 24 hours, to prevent Codev.BackFromPreviewLosesText bug, which caused data loss with IE5 and IE6. * =$contentType= - page content type | text/html + * =$text= - page content + * =$cachedPage= - a pointer to the page container as fetched from the TWikiCache =cut sub generateHTTPHeaders { - my ( $this, $query, $pageType, $contentType ) = @_; + my( $this, $query, $pageType, $contentType, $text, $cachedPage ) = @_; $query = $this->{request} unless $query; @@ -719,6 +733,77 @@ sub generateHTTPHeaders { # add cookie(s) $this->{users}->{loginManager}->modifyHeader($hopts); + # add etag and compression + if( !$this->inContext('command_line') && $text) { + + my $contentEncodingHdr = ''; + if ($TWiki::cfg{Cache}{Compress}) { + # compress + my $acceptEncoding = lc($ENV{'HTTP_ACCEPT_ENCODING'}) || ''; + if ($acceptEncoding =~ /(x-gzip|gzip)/i) { + my $encoding = $1; + + # check if we take the compressed version from the cache + if ($cachedPage && !$cachedPage->{isDirty}) { + $text = $cachedPage->{text}; + } else { + + # well, then compress it now + if (!$cachedPage || $cachedPage->{isDirty}) { + require Compress::Zlib; + $text = Compress::Zlib::memGzip($text); + #print STDERR "compressing\n"; + } + } + + $hopts->{'Content-Encoding'} = $encoding; + $hopts->{'Vary'} = 'Accept-Encoding'; + + } else { + if ($cachedPage && !$cachedPage->{isDirty}) { + + # sorry, we need to uncompressed pages from cache again + require Compress::Zlib; + $text = Compress::Zlib::memGunzip($text); + #print STDERR "uncompressing\n"; + } + } + } else { + if ($cachedPage && !$cachedPage->{isDirty}) { + $text = $cachedPage->{text} + } + } + + # add etag + my $etag = ($cachedPage)?$cachedPage->{etag}:''; + unless ($etag) { + #print STDERR "computing etag\n"; + require Digest::MD5; + $etag = '"'.Digest::MD5::md5_hex($text).'"'; + } + + # check etag + if ($ENV{'HTTP_IF_NONE_MATCH'} && + $etag =~ m/$ENV{'HTTP_IF_NONE_MATCH'}/) { + delete $hopts->{'Content-Encoding'}; + delete $hopts->{'Vary'}; + $hopts->{'Status'} = '304 Not Modified'; + $text = ''; + #print STDERR "not modified\n"; + } else { + $hopts->{'ETag'} = $etag; + #print STDERR "modified\n"; + } + + # write back to text + $_[4] = $text; + + # FIXME: Defer next line until we have Codev.UnicodeSupport + # - too 5.8 dependent + # my $len = do { use bytes; length( $text ); }; + my $len = length($text); + $hopts->{'Content-Length'} = $len; + } # The headers method resets all headers to what we pass # what we want is simply ensure our headers are there @@ -1328,6 +1413,10 @@ sub new { $this->{_HTMLHEADERS} = {}; $this->{context} = $initialContext; + + require Foswiki::PageCache; + $this->{cache} = new Foswiki::PageCache( $this ); + require Foswiki::Plugins; $this->{plugins} = new Foswiki::Plugins($this); require Foswiki::Store; @@ -1686,6 +1775,7 @@ sub finish { $this->{attach}->finish() if $this->{attach}; $this->{security}->finish() if $this->{security}; $this->{i18n}->finish() if $this->{i18n}; + $this->{cache}->finish() if $this->{cache}; undef $this->{_HTMLHEADERS}; undef $this->{request}; @@ -2654,7 +2744,13 @@ sub _processTags { } my $verbatim = {}; - $text = $this->renderer->takeOutBlocks( $text, 'verbatim', $verbatim ); + $text = $this->renderer->takeOutBlocks( $text, 'verbatim', + $verbatim); + + my $dirtyAreas = {}; + $text = $this->renderer->takeOutBlocks( $text, 'dirtyarea', $dirtyAreas) + if $TWiki::cfg{Cache}{Enabled} && $this->inContext('view'); + # See Item1442 #my $percent = ($TranslationToken x 3).'%'.($TranslationToken x 3); @@ -2768,6 +2864,8 @@ sub _processTags { #$stackTop =~ s/$percent/%/go; + $this->renderer->putBackBlocks( \$stackTop, $dirtyAreas, 'dirtyarea' ) + if $TWiki::cfg{Cache}{Enabled} && $this->inContext('view'); $this->renderer->putBackBlocks( \$stackTop, $verbatim, 'verbatim' ); #print STDERR "FINAL $stackTop\n"; @@ -2956,7 +3054,6 @@ sub handleCommonTags { ASSERT($theTopic) if DEBUG; return $text unless $text; - my $verbatim = {}; # Plugin Hook (for cache Plugins only) $this->{plugins} @@ -2964,7 +3061,15 @@ sub handleCommonTags { #use a "global var", so included topics can extract and putback #their verbatim blocks safetly. - $text = $this->renderer->takeOutBlocks( $text, 'verbatim', $verbatim ); + my $verbatim={}; + $text = $this->renderer->takeOutBlocks( $text, 'verbatim', + $verbatim); + + # take out dirty areas + my $dirtyAreas = {}; + $text = $this->renderer->takeOutBlocks( $text, 'dirtyarea', $dirtyAreas ) + if $TWiki::cfg{Cache}{Enabled} && $this->inContext('view'); + my $memW = $this->{SESSION_TAGS}{INCLUDINGWEB}; my $memT = $this->{SESSION_TAGS}{INCLUDINGTOPIC}; @@ -3003,6 +3108,11 @@ sub handleCommonTags { # table rows properly $text =~ s/^\r?\n//gm; + # restore dirty areas + $this->renderer->putBackBlocks( \$text, $dirtyAreas, 'dirtyarea' ) + if $TWiki::cfg{Cache}{Enabled} && $this->inContext('view'); + + $this->renderer->putBackBlocks( \$text, $verbatim, 'verbatim' ); # Foswiki Plugin Hook (for cache Plugins only) @@ -4352,6 +4462,35 @@ sub GROUPS { return '| *Group* | *Members* |' . "\n" . join( "\n", sort @table ); } +sub DISPLAYDEPENDENCIES { + my ( $this, $params ) = @_; + + my $web = $params->{web} || $this->{webName}; + my $topic = $params->{topic} || $this->{topicName}; + my $header = $params->{header} || ''; + my $footer = $params->{footer} || ''; + my $format = $params->{format} || ' 1 [[$web.$topic]]'; + my $separator = $params->{sep} || $params->{separator} || "\n"; + + ($web, $topic) = $this->normalizeWebTopicName($web, $topic); + + my $deps = $this->{cache}->getDependencies($web, $topic); + my @lines; + my $thisWeb; + my $thisTopic; + foreach my $dep (sort @$deps) { + $dep =~ /^(.*)[\.\/](.*?)$/; + $thisWeb = $1; + $thisTopic = $2; + my $text = $format; + $text =~ s/\$web/$thisWeb/g; + $text =~ s/\$topic/$thisTopic/g; + push @lines, $text; + } + return '' unless @lines; + return expandStandardEscapes($header.join($separator, @lines).$footer); +} + 1; __DATA__ # Foswiki - The Free and Open Source Wiki, http://foswiki.org/ diff --git a/core/lib/Foswiki/Engine/CGI.pm b/core/lib/Foswiki/Engine/CGI.pm index eea2615b26..e11213bae8 100644 --- a/core/lib/Foswiki/Engine/CGI.pm +++ b/core/lib/Foswiki/Engine/CGI.pm @@ -22,6 +22,8 @@ use Assert; sub run { my $this = shift; my $req = $this->prepare; + my $errorLog = $Foswiki::cfg{DataDir}."/error.log"; + open(STDERR, ">>$errorLog"); if ( UNIVERSAL::isa( $req, 'Foswiki::Request' ) ) { my $res = Foswiki::UI::handleRequest($req); $this->finalize( $res, $req ); diff --git a/core/lib/Foswiki/Form.pm b/core/lib/Foswiki/Form.pm index 36a8336ea5..143b1a9bba 100644 --- a/core/lib/Foswiki/Form.pm +++ b/core/lib/Foswiki/Form.pm @@ -178,7 +178,7 @@ sub _parseFormDefinition { # Only insist on first field being present FIXME - use oops page instead? if ( $inBlock && $line =~ s/^\s*\|\s*// ) { - $line =~ s/\\\|/\007/g; # protect \| from split + $line =~ s/\\\|/\\\007/g; # protect \| from split my ( $title, $type, $size, $vals, $tooltip, $attributes ) = map { s/\007/|/g; $_ } split( /\s*\|\s*/, $line ); diff --git a/core/lib/Foswiki/Render.pm b/core/lib/Foswiki/Render.pm index 6b4fc6a360..e91c689a37 100644 --- a/core/lib/Foswiki/Render.pm +++ b/core/lib/Foswiki/Render.pm @@ -654,6 +654,11 @@ sub _renderWikiWord { } if ($topicExists) { + # add a dependency so that the page gets invalidated as soon as the + # topic is deleted + $this->{session}->{cache}->addDependency($theWeb, $theTopic) + if $Foswiki::cfg{Cache}{Enabled}; + return _renderExistingWikiWord( $this, $theWeb, $theTopic, $theLinkText, $theAnchor ); } @@ -663,6 +668,12 @@ sub _renderWikiWord { # if ($singular && $singular ne $theTopic) { # #unshift( @topics, $singular); # } + + # add a dependency so that the page gets invalidated as soon as the + # WikiWord comes into existance + $this->{session}->{cache}->addDependency($theWeb, $theTopic) + if $Foswiki::cfg{Cache}{Enabled}; + return _renderNonExistingWikiWord( $this, $theWeb, $theTopic, $theLinkText ); } diff --git a/core/lib/Foswiki/Search.pm b/core/lib/Foswiki/Search.pm index 32868dd97b..3a55d8632d 100644 --- a/core/lib/Foswiki/Search.pm +++ b/core/lib/Foswiki/Search.pm @@ -766,6 +766,11 @@ sub searchWeb { } } + # add dependencies + foreach my $topic ( @topicList ) { + $session->{cache}->addDependency($web,$topic); + } + # output the list of topics in $web my $ntopics = 0; my $headerDone = $noHeader; diff --git a/core/lib/Foswiki/Store.pm b/core/lib/Foswiki/Store.pm index 654a3bad0b..6dd7f9bf37 100644 --- a/core/lib/Foswiki/Store.pm +++ b/core/lib/Foswiki/Store.pm @@ -270,6 +270,9 @@ sub readTopicRaw { # test if topic contains a webName to override $web ( $web, $topic ) = $this->{session}->normalizeWebTopicName( $web, $topic ); + # add dependency + $this->{session}->{cache}->addDependency( $web, $topic ) if $Foswiki::cfg{Cache}{Enabled}; + my $text; my $handler = _getHandler( $this, $web, $topic ); @@ -387,6 +390,8 @@ sub moveAttachment { ); } finally { + $this->{session}->{cache}->fireDependency($oldWeb, $oldTopic); + $this->{session}->{cache}->fireDependency($newWeb, $newTopic); $this->unlockTopic( $user, $oldWeb, $oldTopic ); $this->unlockTopic( $user, $newWeb, $newTopic ); }; @@ -537,6 +542,8 @@ sub moveTopic { $handler->moveTopic( $newWeb, $newTopic ); } finally { + $this->{session}->{cache}->fireDependency($newWeb, $newTopic); + $this->{session}->{cache}->fireDependency($oldWeb, $oldTopic); $this->unlockTopic( $user, $oldWeb, $oldTopic ); }; @@ -648,6 +655,9 @@ sub readAttachment { $this->{session}->security->getReason() ); } + # add dependency + $this->{session}->{cache}->addDependency( $web, $topic ) if $Foswiki::cfg{Cache}{Enabled}; + my $handler = _getHandler( $this, $web, $topic, $attachment ); return $handler->getRevision($theRev); } @@ -951,6 +961,7 @@ sub saveTopic { $plugins->dispatch( 'afterSaveHandler', $text, $topic, $web, $error ? $error->{-text} : '', $meta ); } + $this->{session}->{cache}->fireDependency($web, $topic); throw $error if $error; } @@ -1111,6 +1122,7 @@ sub saveAttachment { } finally { + $this->{session}->{cache}->fireDependency($web, $topic); $this->unlockTopic( $user, $web, $topic ); }; diff --git a/core/lib/Foswiki/Templates.pm b/core/lib/Foswiki/Templates.pm index 96d559a1e6..990dadffca 100644 --- a/core/lib/Foswiki/Templates.pm +++ b/core/lib/Foswiki/Templates.pm @@ -290,7 +290,7 @@ sub _readTemplateFile { # SMELL: not i18n-friendly (can't have accented characters in skin name) # zap anything suspicious - $name =~ s/[^A-Za-z0-9_,.]//go; + $name =~ s/[^A-Za-z0-9_,.\/]//go; $skins =~ s/[^A-Za-z0-9_,.]//go; # if the name ends in .tmpl, then this is an explicit include from diff --git a/core/lib/Foswiki/UI/Manage.pm b/core/lib/Foswiki/UI/Manage.pm index 87d0be2360..c0df1b0ada 100644 --- a/core/lib/Foswiki/UI/Manage.pm +++ b/core/lib/Foswiki/UI/Manage.pm @@ -1063,8 +1063,8 @@ sub _newTopicScreen { else { $refs = getReferringTopics( $session, $oldWeb, $oldTopic, 1 ); foreach my $entry ( sort keys %$refs ) { - $search .= CGI::Tr( - CGI::td( + $search .= + CGI::Div( { class => 'foswikiTopRow' }, CGI::input( { @@ -1076,12 +1076,7 @@ sub _newTopicScreen { } ) . " [[$entry]] " - ) - . CGI::td( - { class => 'foswikiSummary foswikiGrayText' }, - $refs->{$entry} - ) - ); + ); } unless ($search) { $search = ( $session->i18n->maketext('(none)') ); @@ -1096,8 +1091,8 @@ sub _newTopicScreen { $search = ''; foreach my $entry ( sort keys %$refs ) { - $search .= CGI::Tr( - CGI::td( + $search .= + CGI::Div( { class => 'foswikiTopRow' }, CGI::input( { @@ -1109,12 +1104,7 @@ sub _newTopicScreen { } ) . " [[$entry]] " - ) - . CGI::td( - { class => 'foswikiSummary foswikiGrayText' }, - $refs->{$entry} - ) - ); + ); } unless ($search) { $search = ( $session->i18n->maketext('(none)') ); @@ -1254,8 +1244,8 @@ sub _newWebScreen { $refs = ${$webTopicInfoRef}{referring}{refs1}; foreach my $entry ( sort keys %$refs ) { - $search .= CGI::Tr( - CGI::td( + $search .= + CGI::Div( { class => 'foswikiTopRow' }, CGI::input( { @@ -1267,12 +1257,7 @@ sub _newWebScreen { } ) . " [[$entry]] " - ) - . CGI::td( - { class => 'foswikiSummary foswikiGrayText' }, - $refs->{$entry} - ) - ); + ); } unless ($search) { $search = ( $session->i18n->maketext('(none)') ); @@ -1285,8 +1270,8 @@ sub _newWebScreen { $refs = $webTopicInfoRef->{referring}{refs0}; $search = ''; foreach my $entry ( sort keys %$refs ) { - $search .= CGI::Tr( - CGI::td( + $search .= + CGI::Div( { class => 'foswikiTopRow' }, CGI::input( { @@ -1298,12 +1283,7 @@ sub _newWebScreen { } ) . " [[$entry]] " - ) - . CGI::td( - { class => 'foswikiSummary foswikiGrayText' }, - $refs->{$entry} - ) - ); + ); } unless ($search) { $search = ( $session->i18n->maketext('(none)') ); diff --git a/core/lib/Foswiki/UI/View.pm b/core/lib/Foswiki/UI/View.pm index bdce355759..61b9ce1f16 100644 --- a/core/lib/Foswiki/UI/View.pm +++ b/core/lib/Foswiki/UI/View.pm @@ -46,6 +46,30 @@ sub view { my $webName = $session->{webName}; my $topicName = $session->{topicName}; + my $cachedPage; + $session->{cache} && $session->{cache}->getPage($webName, $topicName) if $session->{cache}; + if ($cachedPage) { + print STDERR "found $webName.$topicName in cache\n" if $Foswiki::cfg{Cache}{Debug}; + Monitor::MARK("found page in cache"); + + # render uncacheable areas + my $text = $cachedPage->{text}; + $session->{cache}->renderDirtyAreas(\$text) if $cachedPage->{isDirty}; + + # compute headers + my $contentType = $cachedPage->{contentType}; + $session->generateHTTPHeaders($query, 'view', $contentType, $text, $cachedPage); + $session->{response}->body($text); + + Monitor::MARK('Wrote HTML'); + if ($Foswiki::cfg{Log}{view}) { + $session->writeLog( 'view', $webName.'.'.$topicName, '(cached)' ); + } + return; + } + + print STDERR "computing page for $webName.$topicName\n" if $Foswiki::cfg{Cache}{Debug}; + my $raw = $query->param('raw') || ''; my $contentType = $query->param('contenttype');