Changeset 7552
- Timestamp:
- 05/26/10 01:25:23 (2 years ago)
- Location:
- trunk/AttachContentPlugin
- Files:
-
- 2 edited
-
data/System/AttachContentPlugin.txt (modified) (6 diffs)
-
lib/Foswiki/Plugins/AttachContentPlugin.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/AttachContentPlugin/data/System/AttachContentPlugin.txt
r5001 r7552 1 %META:TOPICINFO{author="ProjectContributor" date="11 76591878" 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"}% 2 2 ---+!! Attach Content Plugin 3 3 4 %$SHORTDESCRIPTION% 4 5 … … 13 14 The 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. 14 15 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. 16 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% 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. 17 17 18 18 ---++ Syntax Rules … … 30 30 ---+++ Parameters 31 31 | *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 =<p />= tags, =<nop>= 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 =<p />= tags, =<nop>= tags, and square bracket type links | the default ={KeepPars}= text in [[%SCRIPTURL{configure}%/#AttachContentPlugin$Extensions][configure]] | =keeppars="on"= | 37 37 | =hidecontent= | Hide content from view. | - (the "content-to-be-saved" is visible) | =hidecontent="on"= | 38 39 ---++ Examples 38 40 39 ---++ Examples 41 ---+++ Adding a Save button to the topic. 42 43 These 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> 40 51 41 52 ---+++ Creating a color scheme … … 46 57 ---+++ User data XML 47 58 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.'}% 49 60 50 61 <verbatim> … … 57 68 </verbatim> 58 69 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 <?xml version="1.0" encoding="ISO-8859-1"?> 75 <users> 76 %S<nop>EARCH{ "[F]irstName.*value=.*()" web="%M<nop>AINWEB%" type="regex" nonoise="on" 77 excludetopic="UserForm,ProjectContributor,WikiGuest,UnknownUser" 78 format="<user><firstname><![CDATA[$formfield(FirstName)]]></firstname> 79 <lastname><![CDATA[$formfield(LastName)]]></lastname> 80 <url><![CDATA[%SC<nop>RIPTURL{view}%/%W<nop>EB%/$topic]]></url> 81 </user>" 82 }% 83 </users> 84 %END<nop>ATTACH% 85 </pre> 86 87 59 88 #PluginSettings 60 89 ---++ Plugin Settings 90 61 91 After installation, configure this plugin by changing settings in [[%SCRIPTURL{configure}%/#AttachContentPlugin$Extensions][configure]]. 62 92 63 93 ---++ Plugin Installation Instructions 94 64 95 %$INSTALL_INSTRUCTIONS% 65 66 96 67 97 ---++ Plugin Info … … 71 101 | Release: | %$RELEASE% | 72 102 | Change History: | <!-- versions below in reverse order --> | 103 | 25 May 2010 (2.3.2) | Foswikitask:Item8579 - Fix example to resolve save errors | 73 104 | 31 Aug 2009 (2.3) | Arthur Clemens: Added param =hidecontent=. Moved plugin settings to configure. | 74 105 | 23 Nov 2008 (2.2.1) | Foswiki compatible. | -
trunk/AttachContentPlugin/lib/Foswiki/Plugins/AttachContentPlugin.pm
r5001 r7552 30 30 # you should leave it alone. 31 31 our $VERSION = '$Rev: 11069$'; 32 our $RELEASE = '2.3. 1';32 our $RELEASE = '2.3.2'; 33 33 34 34 # Short description of this plugin
Note: See TracChangeset
for help on using the changeset viewer.
