Index: doc/howto.txt ================================================================== --- doc/howto.txt +++ doc/howto.txt @@ -7,10 +7,17 @@ NOT OK: (begin (function1 param1)(function2 param2)) Various components ================== + +The URL: + +http://the.domain.com/pagename/p1/p2/p3?param1=value1 + +(s:get-page-params) => '("p1" "p2") + ====================================================================== 1. Create a link. (s:null "[" (s:a name 'href DELETED doc/stml-manual.odt Index: doc/stml-manual.odt ================================================================== --- doc/stml-manual.odt +++ /dev/null cannot compute difference between binary files Index: session.scm ================================================================== --- session.scm +++ session.scm @@ -174,10 +174,13 @@ (dbinit (eval (sdat-get-dbinit self))) (dbexists #f)) (let ((dbfname (alist-ref 'dbname dbinit))) (if debugmode (session:log self "session:setup dbfname=" dbfname ", dbtype=" dbtype ", dbinit=" dbinit)) (if (eq? dbtype 'sqlite3) + ;; The 'auto method will distribute dbs across the disk using hash + ;; of user host and user. TODO + ;; (if (eq? dbfname 'auto) ;; This is the auto assignment of a db based on hash of IP (let ((dbpath (pathname-directory dbfname))) ;; do a couple sanity checks here to make setting up easier (if debugmode (session:log self "INFO: setting up for sqlite3 db access to " dbfname)) (if (not (file-write-access? dbpath)) (session:log self "WARNING: Cannot write to " dbpath) (if debugmode (session:log self "INFO: " dbpath " is writeable"))) @@ -620,16 +623,23 @@ self ;; the session (sdat-get-conn self) ;; the db connection (sdat-get-shared-hash self) ;; a shared hash table for passing data to/from page calls )) ((flat) - (load (conc dir page ".so")) - ((eval (string->symbol (conc "pages:" page))) - self ;; the session - (sdat-get-conn self) ;; the db connection - (sdat-get-shared-hash self) ;; a shared hash table for passing data to/from page calls - )) + (let* ((so-file (conc dir page ".so")) + (scm-file (conc dir page ".scm")) + (src-file (or (file-exists? so-file) + (file-exists? scm-file)))) + (if src-file + (begin + (load src-file) + ((eval (string->symbol (conc "pages:" page))) + self ;; the session + (sdat-get-conn self) ;; the db connection + (sdat-get-shared-hash self) ;; a shared hash table for passing data to/from page calls + )) + (list "
Page not found " page "
")))) ;; first the control ;; (let ((control-file (conc "pages/" page "_ctrl.scm")) ;; (view-file (conc "pages/" page "_view.scm"))) ;; (if (and (file-exists? control-file) ;; (not (eq? parts 'view))) Index: setup.scm ================================================================== --- setup.scm +++ setup.scm @@ -93,10 +93,15 @@ (define (s:load-model model) (session:load-model s:session model)) (define (s:model-path model) (session:model-path s:session model)) + +;; http://foo.bar.com/pagename/p1/p2 => '("p1" "p2") +;; +(define (s:get-page-params) + (sdat-get-page-params s:session)) (define (s:db) (sdat-get-conn s:session)) (define (s:never-called-page? page)