source: project/wiki/formular @ 13344

Last change on this file since 13344 was 13344, checked in by Ivan Raikov, 11 years ago

Added an entry for version 1.9

File size: 4.9 KB
Line 
1[[tags: egg]]
2
3== Introduction
4
5[[http://www.scriptarchive.com/formmail.html|FormMail]] is an HTML
6form to email gateway that receives the results of an HTML form and
7sends them to the specified email recipients.
8
9The {{formular}} library contains a collection of routines for parsing
10emails generated by FormMail. The emails can be read either from an
11SRFI-40 stream, or from a text file in Unix mbox format.
12
13There are two programs included with the library, {{form2wiki}} and
14{{form2txt}}. These programs read messages generated by FormMail from
15a Unix mbox file, and generate a representation of the form data in
16wiki format or text format.
17
18This egg includes a copy of NMS FormMail Version 3.14c1 that has been
19modified to 1) include the submitted fields in the confirmation email;
202) use quotation marks to enclose field text that contains newline
21characters; 3) escape the submitted text in the notification email.
22
23== Requires
24
25; [[rfc822]]
26; [[stream-ext]]
27; [[stream-sections]]
28; [[rb-tree]]
29; [[ssax-core]]
30; [[fmt]]
31; [[uri]]
32; [[utf8]]
33; [[args]]
34
35
36== Library procedures
37
38=== {{read-form:: ENVELOPE * STRM -> FORM}}
39
40Given SRFI-40 streams that contain an RFC 822 envelope and message,
41this procedure parses the headers and fields that are found in the
42message stream, and returns an s-expression of the form:
43
44 (form (envelope <envelope-string>)
45       (headers <RFC 822 header alist>)
46       (fields <field alist>))
47
48=== {{mbox->form-stream:: FNAME -> FORM-STREAM}}
49
50Given the name of a Unix mbox file, this procedure reads the file and
51returns an SRFI-40 stream representation of its contents, where each
52element in the stream is a form s-expression in the format created by
53the {{read-form}} procedure.
54
55=== {{form-stream->tree:: STRM -> TREE}}
56
57Given an SRFI-40 stream created by the {{mbox->form-stream}}
58procedure, this procedure returns an ordered dictionary structure,
59where the key is the email address of the form sender, and the value
60is the list of all forms submitted by that sender. The API of the tree
61object follows that of the e.g. [[treap]] and [[rb-tree]] libraries.
62
63
64== Usage of form2wiki and form2txt
65
66
67 form2wiki [options...] 
68
69The following options are recognized:
70
71;  <nowiki>--exclude=FROM1:FROM2:...</nowiki>   : specify a colon-separated list of entries to exclude (default is none )
72;  <nowiki>--include=FROM1:FROM2:...</nowiki>   : specify a colon-separated list of entries to include (default is all )
73;  <nowiki>--flimits=FIELD1:LIMIT1,...</nowiki> : specify a comma-separated list of fields and character limits (default is none )
74;  <nowiki>--fields=FIELD1:FIELD2:...</nowiki>  : specify a colon-separated list of fields to process (default is all fields )
75;  <nowiki>--mbox-path=PATH</nowiki>            : specify path to input mbox (default: mbox)
76;  <nowiki>--order=N</nowiki>                   : specify order of form id (default: 3)
77;  <nowiki>--prefix=STRING</nowiki>             : specify prefix for wiki page title (default: Form Submission)
78;  <nowiki>-h, --help</nowiki>                  : Print help
79
80 form2txt [options...] operands
81
82The following options are recognized:
83
84;  <nowiki>--exclude=FROM1:FROM2</nowiki>  : specify a colon-separated list of entries to exclude (default is none )
85;  <nowiki>--fields=FIELD1:FIELD</nowiki>  : specify a colon-separated list of fields to process (default is all fields )
86;  <nowiki>--mbox-path=PATH</nowiki>       : specify path to input mbox (default: mbox)
87;  <nowiki>--order=N</nowiki>              : specify order of form id (default: 3)
88;  <nowiki>--prefix=STRING</nowiki>        : specify prefix for text page title (default: Form Submission)
89;  <nowiki>--write-alist=FILE</nowiki>     : write an alist representation to FILE
90;  <nowiki>--read-alist=FILE</nowiki>      : read an alist representation from FILE (mbox-path is ignored)
91;  <nowiki>-h, --help</nowiki>             : Print help
92
93
94== Authors
95
96Ivan Raikov
97
98== Version
99
100; 1.9 : Bug fix in form2wiki
101; 1.8 : Added handling of malformed fields
102; 1.7 : Bug fix in the setup script
103; 1.6 : Added support for reading from and writing to s-expression alists
104; 1.5 : Bug fixes due to changes in the results returned by rfc822-field->tokens
105; 1.4 : Added missing dependencies to meta file
106; 1.1 : Added the documentation file to the egg
107; 1.0 : Initial version
108
109== License
110
111Copyright 2008-2009 Ivan Raikov and the Okinawa Institute of Science
112and Technology.
113
114This program is free software: you can redistribute it and/or modify
115it under the terms of the GNU General Public License as published by
116the Free Software Foundation, either version 3 of the License, or (at
117your option) any later version.
118
119This program is distributed in the hope that it will be useful, but
120WITHOUT ANY WARRANTY; without even the implied warranty of
121MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
122General Public License for more details.
123
124A full copy of the GPL license can be found at
125<http://www.gnu.org/licenses/>.
Note: See TracBrowser for help on using the repository browser.