Overview
Comment: | 99.99% complete in porting to chicken 4.7 |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | move-to-ck4.7.x |
Files: | files | file ages | folders |
SHA1: |
06b806d3c60226e5928cbd4b961c1274 |
User & Date: | matt on 2011-10-04 05:33:19 |
Other Links: | branch diff | manifest | tags |
Context
2011-10-05
| ||
03:35 | few more fixes from porting Leaf check-in: 562f01e7e5 user: matt tags: move-to-ck4.7.x | |
2011-10-04
| ||
14:42 | Merged changes for chicken4.7 to trunk check-in: fda7f57df0 user: mrwellan tags: trunk | |
05:33 | 99.99% complete in porting to chicken 4.7 check-in: 06b806d3c6 user: matt tags: move-to-ck4.7.x | |
03:39 | Moved to units based compilation check-in: 31955e0a02 user: matt tags: move-to-ck4.7.x | |
Changes
Modified formdat.scm from [3d0d733457] to [05ad5e414c].
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 | 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 | + - + | ;; Copyright 2007-2011, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. (declare (unit formdat)) (use regex) (require-extension srfi-69) (define formdat:*debug* #f) ;; Old data format was something like this. BUT! ;; Forms do not have names so the hierarcy is ;; unnecessary (I think) ;; ;; hashtable ;; |-formname --> <formdat> 'form-name=formname ;; | 'form-data=hashtable ;; | | name => value ;; ;; New data format is only the <formdat> portion from above ;; (define-class <formdat> () ;; (form-data ;; )) |
︙ |
Modified html-filter.scm from [be2e4e1457] to [a71b1244d8].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | + | ;; Copyright 2007-2011, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. (declare (unit html-filter)) (require-extension regex) ;; (define (s:split-string strng delim) (if (eq? (string-length strng) 0) (list strng) (let loop ((head (make-string 1 (car (string->list strng)))) (tail (cdr (string->list strng))) (dest '()) |
︙ |
Modified modules/twiki/twiki-mod.scm from [705f97d8d5] to [1e45e35279].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | + | ;; Copyright 2007-2010, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. ;; twiki module (require-extension sqlite3 regex posix md5 base64) (import (prefix base64 base64:)) ;; TODO ;; ;; * Inline tiddlers [inline[TiddlerName]] ;; * Pics [pic X Y[picname.jpg]] ;; * Move twiki parsing/expanding to mattsutils as loadable module |
︙ | |||
30 31 32 33 34 35 36 | 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 | - + + + + | ;; This is the currently supported mechanism. Postgres will be added later -mrw- 7/26/2009 ;; (define (twiki:open-db key . create-not-ok) ;; (s:log "Got to twiki:open-db with key: " key) (let* ((create-ok (if (null? create-not-ok) #t (car create-not-ok))) (fdat (twiki:key->fname key)) |
︙ | |||
73 74 75 76 77 78 79 | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | - + | "CREATE TABLE members (id INTEGER PRIMARY KEY,person_id INTEGER,group_id INTEGER);" ;; setup and configuration data "CREATE TABLE meta (id INTEGER PRIMARY KEY,key TEXT,val TEXT);" ;; need to create an entry for *this* twiki (conc "INSERT INTO wikis (id,name,created_on) VALUES (1,'main'," (current-seconds) ");"))) ;; (conc "INSERT INTO tiddlers (wiki_id,name,created_on) VALUES(1,'MainMenu'," (current-seconds) ");"))))) (twiki:save-tiddler db "MainMenu" "[[FirstTiddler]]" "" 1 1))) |
︙ | |||
97 98 99 100 101 102 103 | 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | - + | (p1 (substring keypath 0 delta)) ;; 0 8)) (p2 (substring keypath delta (* delta 2)));; 8 16)) (p3 (substring keypath (* delta 2) (* delta 3)))) ;; 16 24)) (list (string-intersperse (list "twikis" p1 p2 p3) "/") keypath))) ;; look up the wid based on the keys, this is used for sub wikis only. I.e. a wiki instantiated inside another wiki ;; giving a separate namespace to all the tiddlers |
︙ | |||
171 172 173 174 175 176 177 | 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | - + | ;;====================================================================== ;; twiki registry ;;====================================================================== ;; these can be overridden by end user (just create a new routine by the same name) (define (twiki:open-registry) |
︙ | |||
291 292 293 294 295 296 297 | 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | - + | (s:a "delete" 'href (s:link-to (twiki:get-link-back-to-current) 'delete_tiddler tnum))(s:br) (s:input-preserve 'type "text" 'name "twiki_title" 'size "58" 'maxlength "150") (s:textarea-preserve 'type "textarea" 'name "twiki_body" 'rows "10" 'cols "65") (s:p "Tags" (s:input-preserve 'type "text" 'name "twiki_tags" 'size "55" 'maxlength "150"))))) ;; save a tiddler to the db for the twiki twik, getting data from the INPUT (define (twiki:save-curr-tiddler tdb wid) |
︙ | |||
347 348 349 350 351 352 353 | 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 | - + | "INSERT INTO tiddlers (wiki_id,name,dat_id,created_on,owner_id) VALUES(?,?,?,?,?);" wid heading dat-id (current-seconds) uid)) #t) ;; success #f)) ;; non-success ;; text=0, jpg=1, png=2 (define (twiki:save-dat db dat type) |
︙ | |||
477 478 479 480 481 482 483 | 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 | - - - + + + - - - + + + | (define (twiki:get-thumb-dat tdb wid pic-id) (dbi:get-one tdb "SELECT dat FROM pics INNER JOIN dats ON pics.thumb_dat_id=dats.id WHERE pics.id=? AND wiki_id=?;" pic-id wid)) ;; this one sets up the Content type, puts the data into page-dat and is done (define (twiki:return-image-dat tdb wid pic-id) (let ((dat (twiki:get-pic-dat tdb wid pic-id))) (s:log "twiki:return-image-dat dat is: " dat " of size: " (if (blob? dat)(blob-size dat) "[not a blob]")) |
︙ | |||
695 696 697 698 699 700 701 | 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 | - + - - | (dbi:close tdb) result)) ;; should do a single more efficient query but this is good enough (define (twiki:get-tiddlers db wid tnames) (apply twiki:get-tiddlers-by-name db wid tnames)) ;; (let* ((tdlrs '()) |
︙ | |||
773 774 775 776 777 778 779 | 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 | - + - + | (define twiki:u s:u) (define twiki:td s:td) (define twiki:tr s:tr) (define twiki:table s:table) (define twiki:div s:div) (define (twiki:web64enc str) |
︙ |
Modified session.scm from [0524c59e8f] to [74a61ca45d].
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | - + | ;; Copyright 2007-2011, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. (declare (unit session)) (require-library dbi) |
︙ | |||
161 162 163 164 165 166 167 168 | 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | + - - - - - + + + + + + | (let* ((rawconfigdat (session:read-config self)) (configdat (if rawconfigdat (eval rawconfigdat) '())) (sroot (s:find-param 'sroot configdat)) (logfile (s:find-param 'logfile configdat)) (dbtype (s:find-param 'dbtype configdat)) (dbinit (s:find-param 'dbinit configdat)) (domain (s:find-param 'domain configdat)) (twikidir (s:find-param 'twikidir configdat)) (page-dir (s:find-param 'page-dir-style configdat))) |
︙ | |||
377 378 379 380 381 382 383 | 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 | - + - + - + | ;; session vars ;; 1. keys are always a string NOT a symbol ;; 2. values are always a string conversion is the responsibility of the ;; consuming function (at least for now, I'd like to change this) ;; set a session var for the current page ;; |
︙ | |||
704 705 706 707 708 709 710 | 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 | - + | (session:get-param-from params key))) ;; This one will get the first value found regardless of form (define (session:get-input self key) (let* ((formdat (sdat-get-formdat self))) (if (not formdat) #f (if (or (string? key)(number? key)(symbol? key)) |
︙ |
Modified setup.scm from [b36f45d459] to [5a10d6d9bf].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | + + | ;; Copyright 2007-2011, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. (declare (unit setup)) (declare (uses session)) (require-extension srfi-69) (require-extension regex) ;; (define s:session (make-sdat)) (session:initialize s:session) ;; use this for getting data from page to page when scope and evals ;; get in the way |
︙ | |||
56 57 58 59 60 61 62 | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | - + - + - + - + - + | (session:link-to s:session page params)) (define (s:get-param key) (session:get-param s:session key)) ;; these are page local (define (s:get key) |
︙ |
Modified stml.scm from [d231bbdbe7] to [73cbc6a3f2].
︙ | |||
127 128 129 130 131 132 133 | 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | - + | (define (s:form . args) ;; create a link for calling back into the current page and calling a specified ;; function (let* ((action (let ((v (s:find-param 'action args))) (if v v "default"))) (id (let ((i (s:find-param 'id args))) (if i i #f))) |
︙ |
Modified stmlrun.scm from [c4bf2d3a15] to [fd5e8e9132].
︙ | |||
11 12 13 14 15 16 17 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | - + | ;; (require-extension syntax-case) ;; (declare (run-time-macros)) (require-library dbi) (include "requirements.scm") |
︙ |