tclhttpd

Check-in [701281756f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Moved DirectOO to its own module. Adding markdown files in the source to make maintaining the code simpler
Timelines: family | ancestors | descendants | both | 4_0
Files: files | file ages | folders
SHA1:701281756fd966af7ea67a2be00c41b3fda19350
User & Date: hypnotoad 2015-04-02 09:19:06
Context
2015-04-02
09:39
Adding a distribution of the Tao core Moved taourl out to a seperate file Adding a stub page to document qwiki check-in: 52ee0a713b user: hypnotoad tags: 4_0
09:19
Moved DirectOO to its own module. Adding markdown files in the source to make maintaining the code simpler check-in: 701281756f user: hypnotoad tags: 4_0
00:03
Fixed the library path in the httpd.tcl script Adding a new unified session/login/contact/access control manager calleed "community" (half baked) Adding a quick and dirty wiki (qwiki). This code is being ported from the generators that run etoyoc.com, and I'm only part of the way there so far, but the functions that are working can be exercised in bin/test/ (The test build an in-memory database) check-in: d1004ea2ce user: hypnotoad tags: 4_0
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added modules/community/community.md.







































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
*httpd.community* is a decendent of [httpd.taourl](wiki?taourl). It adds an sqlite based user, group, and access control system. It is implemented in [community.tcl](finfo?name=modules/community/community.tcl).

## Required Packages

Community relies on the following external packages:

* tao-sqlite from [taolib](http://fossil.etoyoc.com/fossil/taolib)
* sha1 from [tcllib](http://core.tcl.tk/tcllib)
* sqlite3 from [sqlite](http://www.sqlite.org)


## Options

* dbfile - Path to a file which stores the sqlite database for the community (default in-memory)
* virtual - Root Url of this object.

## Attached Objects

Community objects (and their derived classes) contain an embedded sqlite database. This database can be accessed via that \<db\> method.

Added modules/directoo/directoo.md.



































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# The httpd.url class

[Implementation](finfo?name=modules/httpd/directoo.tcl)

*httpd.url* is a TclOO class. The first argument (after the name of the new object) is the virtual root for this object. For more complex classes, the second argument is a key/value list of configuration options. Any arguments after that are passed to *Url_PrefixInstall*

## Variables

### env

An array which contains CGI data. It is populated every page view *Cgi_SetEnv* in Tclhttpd.

### result

An array which contains the meta information and content about the page view in progress. Important fields:

* code - HTTP code to return (default 400)
* body - The block of data to be sent via *Httpd_ReturnData* or *Httpd_ReturnCacheableData* at the conclusion of the operation.
* content-type - The type of content in *block* (default text/html)

## Methods

### configurelist *keyvaluelist*

Pass configuration items as a key/value list.

### cget *field*

Retrieve the value of a configuration item

### /html

A method which implements the default root page of the object.

### initialize

A method which is called in the constructor, after the configuration items have been applied and the domain registered with Tclhttpd.

### httpdDirect *sock* *suffix*

This method is the first called when resolving a dynamic page. It calles *httpdSessionLoad* to load the session, *httpdMarshalArguments* do compute the method to call. On error, this method returns an error message. On success it calls *httpdSessionSave*, before sending the resulting data out to TclHttpd via the *Httpd_ReturnData* or *Httpd_ReturnCacheableData* procs.

### httpdMarshalArguments *sock* *suffix*

Calculate the command which will implement the current page view.

### httpdSessionLoad *sock *prefix* *suffix*

Initializes the *result* variable, and load session data from either cookies or the incoming GET/POST query. This method also calls the *Cgi_SetEnv* and *Url_QuerySetup* procs from Tclhttpd. Rather than populate the global *env* variable, Cgi_SetEnv populates the private *env* variable for this object.

### httpdSessionSave *sock*

Updates the current session, and writes cookies back to the browser.

### reset

Reset the current value of result(body)

### puts

Append to the value of result(body). Accepts multiple arguments. An implied \n is appended at the tail end.

### unknown *args*

Handler for unknown, incomplete, or invalid queries.

Name change from modules/httpd/directoo.tcl to modules/directoo/directoo.tcl.