Changeset 7552


Ignore:
Timestamp:
05/26/10 01:25:23 (2 years ago)
Author:
GeorgeClark
Message:

Item8579: Correct example to use post instead of simple link to save script. Bump rev for release.

Location:
trunk/AttachContentPlugin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/AttachContentPlugin/data/System/AttachContentPlugin.txt

    r5001 r7552  
    1 %META:TOPICINFO{author="ProjectContributor" date="1176591878" format="1.1" reprev="1.1" version="1.1"}% 
     1%META:TOPICINFO{author="ProjectContributor" date="1127466547" format="1.1" reprev="1.1" version="1.1"}% 
    22---+!! Attach Content Plugin 
     3 
    34%$SHORTDESCRIPTION% 
    45 
     
    1314The current version only refreshes the attachment when the topic is saved. Obviously this means that the attachment can get out of synch if, for example, it explicitly or implicitly refers to other topics. 
    1415 
    15 This plugin is written specifically to be able to put css into topic(s) and still be able to have efficient stylesheets: i.e., without the overhead of Foswiki processing. The feature can be used for many other things where you want Foswiki to generate a plain text file a smart way. %BR% 
    16 For example: write a =SEARCH= in a topic and save the search results to an XML file. The XML data can be used for efficient look-up. 
     16This plugin is written specifically to be able to put css into topic(s) and still be able to have efficient stylesheets: i.e., without the overhead of Foswiki processing. The feature can be used for many other things where you want Foswiki to generate a plain text file a smart way. %BR% For example: write a =SEARCH= in a topic and save the search results to an XML file. The XML data can be used for efficient look-up. 
    1717 
    1818---++ Syntax Rules 
     
    3030---+++ Parameters 
    3131| *Parameter* | *Description* | *Default* | *Example* | 
    32 | =topic=       | Topic to save the attachment to.  | - (the current topic is used) | =topic="WebHome"= | 
    33 | =web=         | Web where the save topic is located.  | - (the current Web is used) | =web="Main"= | 
    34 | =comment=     | Attachment comment text.  | the default ={AttachmentComment}= text in [[%SCRIPTURL{configure}%/#AttachContentPlugin$Extensions][configure]]  | =comment="User data as of %<nop>DATE%"= | 
    35 | =hide=        | Use =hide="on"= to hide the attachment in normal topic view.  | =off= | =hide="on"= | 
    36 | =keeppars=    | Keep paragraph =&lt;p /&gt;= tags, =&lt;nop&gt;= tags, and square bracket type links | the default ={KeepPars}= text in [[%SCRIPTURL{configure}%/#AttachContentPlugin$Extensions][configure]] | =keeppars="on"= | 
     32| =topic=  | Topic to save the attachment to.  | - (the current topic is used) | =topic="WebHome"= | 
     33| =web=  | Web where the save topic is located.  | - (the current Web is used) | =web="Main"= | 
     34| =comment=  | Attachment comment text.  | the default ={AttachmentComment}= text in [[%SCRIPTURL{configure}%/#AttachContentPlugin$Extensions][configure]]  | =comment="User data as of %<nop>DATE%"= | 
     35| =hide=  | Use =hide="on"= to hide the attachment in normal topic view.  | =off= | =hide="on"= | 
     36| =keeppars=  | Keep paragraph =&lt;p /&gt;= tags, =&lt;nop&gt;= tags, and square bracket type links | the default ={KeepPars}= text in [[%SCRIPTURL{configure}%/#AttachContentPlugin$Extensions][configure]] | =keeppars="on"= | 
    3737| =hidecontent= | Hide content from view. | - (the "content-to-be-saved" is visible) | =hidecontent="on"= | 
     38  
     39---++ Examples 
    3840 
    39 ---++ Examples 
     41---+++ Adding a Save button to the topic. 
     42 
     43These examples add a "Save" button to force a save of the topic and update the attachment.  Note that with versions of Foswiki since 1.0.4, it is not possible to initiate a save from a simple HTML link - which causes a "GET".  Save can only be initiated from a POST operation done using a HTML form.  The following sample form is used to create the button: 
     44 
     45<verbatim> 
     46<form action="%SCRIPTURL{save}%/%WEB%/%TOPIC%" method="post"> 
     47    <input type="hidden" name="action" value="action_save=1" /> 
     48    <input type="submit" class="foswikiButton" value="Save the topic" /> 
     49</form> 
     50</verbatim> 
    4051 
    4152---+++ Creating a color scheme 
     
    4657---+++ User data XML 
    4758 
    48 <a href="%SCRIPTURL{save}%/%WEB%/%TOPIC%?action_save=1">Update user data XML</a> 
     59%IF{"context AttachContentPluginEnabled" then='<form action="%SCRIPTURL{save}%/%WEB%/%TOPIC%" method="post"><input type="hidden" name="action" value="action_save=1" /><input type="submit" class="foswikiButton" value="Save the topic" /></form> This will generate an [[%PUBURLPATH%/%WEB%/%TOPIC%/userdata.xml][attachment]] to this topic. Content will be a xml file of users registered to this installation.' else='Install !AttachContentPlugin to be able to save this topic. On saving, an attachment will be created to this topic.'}% 
    4960 
    5061<verbatim> 
     
    5768</verbatim> 
    5869 
     70%X% Note that the STARTATTACH and ENDATTACH macros are not shown, so the actual content of the above "live" Attach Content block (spaced out for easier readability) is: 
     71 
     72<pre> 
     73%START<nop>ATTACH{"userdata.xml" comment="User data as of %D<nop>ATE%"}% 
     74&lt;?xml version="1.0" encoding="ISO-8859-1"?> 
     75&lt;users> 
     76%S<nop>EARCH{ "[F]irstName.*value=.*()" web="%M<nop>AINWEB%" type="regex" nonoise="on"  
     77   excludetopic="UserForm,ProjectContributor,WikiGuest,UnknownUser"  
     78   format="&lt;user>&lt;firstname>&lt;![CDATA[$formfield(FirstName)]]>&lt/firstname> 
     79               &lt;lastname>&lt;![CDATA[$formfield(LastName)]]>&lt;/lastname> 
     80               &lt;url>&lt;![CDATA[%SC<nop>RIPTURL{view}%/%W<nop>EB%/$topic]]>&lt;/url> 
     81           &lt;/user>" 
     82 }% 
     83&lt;/users> 
     84%END<nop>ATTACH% 
     85</pre> 
     86 
     87 
    5988#PluginSettings 
    6089---++ Plugin Settings 
     90 
    6191After installation, configure this plugin by changing settings in [[%SCRIPTURL{configure}%/#AttachContentPlugin$Extensions][configure]]. 
    6292 
    6393---++ Plugin Installation Instructions 
     94 
    6495%$INSTALL_INSTRUCTIONS% 
    65  
    6696 
    6797---++ Plugin Info 
     
    71101|  Release: | %$RELEASE% | 
    72102|  Change History: | <!-- versions below in reverse order -->&nbsp; | 
     103|  25 May 2010 (2.3.2) | Foswikitask:Item8579 - Fix example to resolve save errors |  
    73104|  31 Aug 2009 (2.3) | Arthur Clemens: Added param =hidecontent=. Moved plugin settings to configure.  | 
    74105|  23 Nov 2008 (2.2.1) | Foswiki compatible. | 
  • trunk/AttachContentPlugin/lib/Foswiki/Plugins/AttachContentPlugin.pm

    r5001 r7552  
    3030# you should leave it alone. 
    3131our $VERSION = '$Rev: 11069$'; 
    32 our $RELEASE = '2.3.1'; 
     32our $RELEASE = '2.3.2'; 
    3333 
    3434# Short description of this plugin 
Note: See TracChangeset for help on using the changeset viewer.