;;;-*- Syntax: Ansi-Common-Lisp; Base: 10; Mode: lisp; Package: http-user -*- ;;; American Kybernetik, 4702 ;;; Adapted from John C. Mallerys, cl-http documentation example. ;;;------------------------------------------------------------------- ;;; ;; Note that #U is a reader macro that completes a partial URL according ;; to the local context in which is it evaluated, see HTTP:MERGE-URL ;;; ;;; $Header: /home/gene/src/chill/src/RCS/chill.lisp,v 1.7 2004/02/27 07:34:47 gene Exp gene $ ;;; ;;; Copyright (C) 2004 Gene Michael Stover. All rights reserved. ;;; ;;; This library is free software; you can redistribute it ;;; and/or modify it under the terms of version 2.1 of the GNU ;;; Lesser General Public License as published by the Free ;;; Software Foundation. ;;; ;;; This library is distributed in the hope that it will be ;;; useful, but WITHOUT ANY WARRANTY; without even the implied ;;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;;; PURPOSE. See the GNU Lesser General Public License for more ;;; details. ;;; ;;; You should have received a copy of the GNU Lesser General ;;; Public License along with this library; if not, write to the ;;; Free Software Foundation, Inc., 59 Temple Place, Suite 330, ;;; Boston, MA 02111-1307 USA ;;; ;;; by Gene Michael Stover ;;; Thursday, 29 January 2004 ;;; (defvar *url-encode* (let ((ht (make-hash-table :test #'equal))) (setf (gethash #\Space ht) "%20" (gethash #\Newline ht) "%0D%0A" (gethash #\+ ht) "%2B" (gethash #\; ht) "%3B" (gethash #\/ ht) "%2F" (gethash #\? ht) "%3F" (gethash #\: ht) "%3A" (gethash #\@ ht) "%40" (gethash #\= ht) "%3D" (gethash #\& ht) "%26" (gethash #\< ht) "%3C" (gethash #\> ht) "%3E" (gethash #\" ht) "%22" (gethash #\# ht) "%23" (gethash #\% ht) "%25" (gethash #\{ ht) "%7B" (gethash #\} ht) "%7D" (gethash #\| ht) "%7C" (gethash #\\ ht) "%5C" (gethash #\^ ht) "%5E" (gethash #\~ ht) "%7E" (gethash #\[ ht) "%5B" (gethash #\] ht) "%5D" (gethash #\` ht) "%60" (gethash #\A ht) "A" (gethash #\B ht) "B" (gethash #\C ht) "C" (gethash #\D ht) "D" (gethash #\E ht) "E" (gethash #\F ht) "F" (gethash #\G ht) "G" (gethash #\H ht) "H" (gethash #\I ht) "I" (gethash #\J ht) "J" (gethash #\K ht) "K" (gethash #\L ht) "L" (gethash #\M ht) "M" (gethash #\N ht) "N" (gethash #\O ht) "O" (gethash #\P ht) "P" (gethash #\Q ht) "Q" (gethash #\R ht) "R" (gethash #\S ht) "S" (gethash #\T ht) "T" (gethash #\U ht) "U" (gethash #\V ht) "V" (gethash #\W ht) "W" (gethash #\X ht) "X" (gethash #\Y ht) "Y" (gethash #\Z ht) "Z" (gethash #\a ht) "a" (gethash #\b ht) "b" (gethash #\c ht) "c" (gethash #\d ht) "d" (gethash #\e ht) "e" (gethash #\f ht) "f" (gethash #\g ht) "g" (gethash #\h ht) "h" (gethash #\i ht) "i" (gethash #\j ht) "j" (gethash #\k ht) "k" (gethash #\l ht) "l" (gethash #\m ht) "m" (gethash #\n ht) "n" (gethash #\o ht) "o" (gethash #\p ht) "p" (gethash #\q ht) "q" (gethash #\r ht) "r" (gethash #\s ht) "s" (gethash #\t ht) "t" (gethash #\u ht) "u" (gethash #\v ht) "v" (gethash #\w ht) "w" (gethash #\x ht) "x" (gethash #\y ht) "y" (gethash #\z ht) "z" (gethash #\1 ht) "1" (gethash #\2 ht) "2" (gethash #\3 ht) "3" (gethash #\4 ht) "4" (gethash #\5 ht) "5" (gethash #\6 ht) "6" (gethash #\7 ht) "7" (gethash #\8 ht) "8" (gethash #\9 ht) "9" (gethash #\0 ht) "0" (gethash #\$ ht) "$" (gethash #\- ht) "-" (gethash #\_ ht) "_" (gethash #\. ht) "." (gethash #\! ht) "!" (gethash #\* ht) "*" (gethash #\' ht) "'" (gethash #\( ht) "(" (gethash #\) ht) ")") ht)) (defun url-encode (str) ;Return a string which results from encoding STR so it can be safely embedded in an URL. (reduce #'(lambda (&optional x y) (cond (y (concatenate 'string x y)) (x x) (t ""))) (loop for x across str collect (if (gethash x *url-encode*) (gethash x *url-encode*) (make-string 1 :initial-element x)) ) ) ) (defun get-timestamp-plus (serverPrefix) ; Server prefix will identify cluster recipient of initial request (concatenate 'string (concatenate 'string serverPrefix (prin1-to-string (cadr (multiple-value-list (unix:unix-gettimeofday))))) (prin1-to-string (caddr (multiple-value-list (unix:unix-gettimeofday)))) ) ) (export 'url-encode) (export 'get-timestamp-plus) (in-package :http-user) ;; Export Obverse Storefront (the directory is exported in cso.lisp). ;;;------------------------------------------------------------------- ;;; ;;; TOP-LEVEL FRAME ;;; (defparameter *myProjects* '"") (setq *myProjects* (concatenate 'string *myProjects* "
" "C" " R" " U" " D" " E" "
" ) ) (defparameter *shelves* '( ("A = ∫...∫ d X" ("Defined" "http://commoditysoftware.org/proj.html") ) ("他" ("A HodgePodge" "http://commoditysoftware.org/r5.html") ("Class Structure" "http://commoditysoftware.org/r3.html") ("CL-XSL" "http://commoditysoftware.org/cl-xsl.html") ("Dominion Portal" "http://commoditysoftware.org") ("Token Economy XP" "http://commoditysoftware.org/r6.html") ("Transit GIS" "http://commoditysoftware.org/eg/index.php/PTIS") ) ("External" ("CSS Zen" "http://csszengarden.com") ("SQL-Ledger" "http://www.sql-ledger.org") ("More ..." "/ai-integration/links.xasp") ) ("Ω :- " ("Meta_Phor_All." "/ai-integration/documentation.xasp") ) ) ) ;; (with-document-body (:background-url "http://commoditysoftware.org/images/domainMark3.jpg" :background background ;; :foreground foreground :link link :visited-link visited-link ;; :active-link active-link :stream stream) (defmethod write-neoemporium-index-pane ((url http-url) stream) (flet ( (write-heading (stream) (with-centering (:stream stream) (write-string "Projects" stream) (write-string *myProjects* stream) ) ) (index (count) (flet ((get-letter (idx) (aref "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (1- idx)))) (cond ((> count 26) (multiple-value-bind (quotient remainder) (truncate count 26) (coerce (list (get-letter quotient) (get-letter remainder)) 'string))) (t (get-letter count)))))) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (url:languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-document-preamble (:stream stream) (declare-title "Inhalt" :stream stream)) ; (with-standard-document-body (:stream stream) (with-document-body (:foreground "BLACK" :link "FIREBRICK" :visited-link "BLUE" :active-link "CYAN" :background-url "http://commoditysoftware.org/images/projects.gif" :stream stream) (with-section-heading (#'write-heading :stream stream :level 2) (loop for (heading . entries) in *shelves* for count upfrom 1 do (flet ((write-subheading (stream) (fast-format stream "~D ~A" " " heading))) (declare (dynamic-extent #'write-subheading)) (with-section-heading (#'write-subheading :stream stream) (with-enumeration (stream :definition) (with-font (:size 2 :stream stream) (loop for (display-string reference) in entries for count upfrom 1 do (enumerating-item (stream) (with-rendition (:bold :stream stream) (fast-format stream "~D. " count ) (ns4.0:note-anchor Display-string :reference reference ;; :target "display-pane" :stream stream))))) ))))) (write-string "
" stream ) ))))) (export-url #u"/store/content.html" :computed :response-function #'write-neoemporium-index-pane :expiration `(:interval ,(* 15. 60.)) :public t :language :en ; :keywords `(:neoemporium :documentation) ) (defmethod write-neoemporium-title-pane ((url http-url) stream) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (url:languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-standard-document-body (:stream stream) (with-centering (:stream stream) (image "/store/images/tenastu.jpg" "NAK-CSO Storefront" :stream stream :width 256 :height 34 :alignment :top)))))) (defmethod write-neoemporium-display-pane ((url http-url) stream) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (url:languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-standard-document-body (:stream stream ) (with-centering (:stream stream) (image "/store/images/durga.gif" "NAK-CSO Storefront" :stream stream :width 650 :height 704 :alignment :middle)) (with-centering (:stream stream) (image "/store/images/TEXP.png" "Token Economy XP" :stream stream :width 650 :alignment :middle)) )))) (export-url #u"/store/awning.html" :computed :response-function #'write-neoemporium-title-pane :expiration `(:interval ,(* 15. 60.)) :public t :language :en ; :keywords `(:neoemporium :documentation) ) (export-url #u"/store/durga.html" :computed :response-function #'write-neoemporium-display-pane :expiration `(:interval ,(* 15. 60.)) :public t :language :en ; :keywords `(:neoemporium :documentation) ) (export-url #u"/store/images/" :image-directory :pathname "http:www;store;images;" :expiration `(:interval ,(* 15. 60.)) :public t ; :keywords '(:cl-http :demo) :documentation "A directory of images for the general store.") (defmethod write-neoemporium-frame-set ((url http-url) stream) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-location url :content-language (url:languages url)) (with-html-document (:stream stream) (with-document-preamble (:stream stream) (declare-title "North American Kybernetik - Commodity Software Organizaion" :stream stream)) (ns4.0:with-document-frameset (:rows '((:pixel 45) :wild) :stream stream) (ns4.0:note-document-frame :name "title-pane" :reference #u"/store/awning.html" :target "display-pane" :resizable-p t :scrolling nil :stream stream) (ns4.0:with-document-frameset (:columns '((:percentage 13) :wild) :stream stream) (ns4.0:note-document-frame :name "index-pane" :reference #u"/store/content.html" :target "display-pane" :resizable-p t :stream stream) (ns4.0:note-document-frame :name "display-pane" :reference #u"/store/durga.html" :target "display-pane" :resizable-p t :stream stream) ))))) (export-url #u"/store/front.html" :computed :response-function #'write-neoemporium-frame-set :expiration `(:interval ,(* 15. 60.)) :public t :language :en ; :keywords `(:neoemporium :documentation) ) ;;;------------------------------------------------------------------------- ;;; This is the initial PTIS wireframe code for NYC and Broome County. ;;; It is to be replaced by a proper set of objects. (defparameter *PTIS-US-NY-NYC-proto-url-server-0* '"") (defparameter *PTIS-US-NY-NYC-proto-url-tail-1* '" target=_top>Mapism PTIS 0.3
Sponsor Content Wireframe.") (defparameter *PTIS-proto-parms* nil) (defmethod buildPTISResponse (stream server page tail hasParms-p) (write-string server stream) (write-string page stream) (if hasParms-p (write-string-quoting-specials *PTIS-proto-parms* stream) ) (write-line tail stream) ) (defmethod write-PTIS-US-NY-NYC-header-pane ((url http-url) stream) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (url:languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-standard-document-body (:stream stream) (buildPTISResponse stream *PTIS-US-NY-NYC-proto-url-server-1* "metromapism.xasp" *PTIS-US-NY-NYC-proto-url-tail-1* nil) )))) (defmethod write-PTIS-footer-pane ((url http-url) stream) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (url:languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-standard-document-body (:stream stream) (write-line "Sponsor Content Wireframe." stream) )))) (defmethod write-PTIS-US-NY-NYC-origin-pane ((url http-url) stream) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (url:languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-standard-document-body (:stream stream) (buildPTISResponse stream *PTIS-US-NY-NYC-proto-url-server-0* "Embarcadero.jsp?point=org&" *PTIS-US-NY-NYC-proto-url-tail-0* t) )))) (defmethod write-PTIS-US-NY-NYC-destination-pane ((url http-url) stream) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (url:languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-standard-document-body (:stream stream) (buildPTISResponse stream *PTIS-US-NY-NYC-proto-url-server-0* "Embarcadero.jsp?point=dest&" *PTIS-US-NY-NYC-proto-url-tail-0* t) )))) (defmethod write-PTIS-US-NY-NYC-itinerary-pane ((url http-url) stream) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (url:languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-standard-document-body (:stream stream) (buildPTISResponse stream *PTIS-US-NY-NYC-proto-url-server-0* "go.jsp?" *PTIS-US-NY-NYC-proto-url-tail-0* t) )))) (defmethod PTIS-US-NY-NYC-proto ((url url:http-form) stream) (with-successful-response (stream :html :content-location url :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (languages url)) (with-open-file (dStream "/root/debug1" :direction :output :direction :output :if-exists :overwrite :if-does-not-exist :create) (with-html-document (:declare-dtd-version-p t :stream dStream) (with-document-preamble (:stream dStream) (declare-base-reference url :stream dStream) (declare-title "Dummy CL-HTTP Form" :stream dStream)) (with-standard-document-body (:stream dStream) (with-section-heading ("GIS Proto Parms" :stream dStream) (with-fillout-form (:post url :stream dStream) (with-open-file (fStream "/usr/src/web/cl-xsl/www/neoemporium/nycgis/proto.html" :direction :input ) (loop for i from 1 to 233 do (write-line (read-line fStream nil nil t) stream ) ) (accept-input 'string "ORG-PLACE" :stream dStream) (accept-input 'string "ORG-STREET" :stream dStream) (accept-input 'string "ORG-CITY-STATE" :stream dStream) (accept-input 'string "USER-ORG-CITY-STATE" :stream dStream) (accept-input 'string "DEST-PLACE" :stream dStream) (accept-input 'string "DEST-STREET" :stream dStream) (accept-input 'string "DEST-CITY-STATE" :stream dStream) (accept-input 'string "USER-DEST-CITY-STATE" :stream dStream) (accept-input 'string "DAY-OF-WEEK" :stream dStream) (accept-input 'string "TIME-OF-DAY" :stream dStream) (finish-output dStream) ) ) ) ) ) ) ) ) (defmethod respond-to-PTIS-US-NY-NYC-proto ((url url:http-form) stream query-alist) (flet ((clean-up (item) (and item ; don't let NIL through (not (null-string-p (setq item (string-trim '(#\space #\tab #\return #\Linefeed) item)))) item))) (declare (dynamic-extent #'clean-up)) (bind-query-values (day-of-week time-of-day org-place org-street org-city-state user-org-city-state dest-place dest-street dest-city-state user-dest-city-state) (url query-alist) (with-open-file (fStream "/root/dbug" :direction :output :if-exists :overwrite :if-does-not-exist :create ) (setq *PTIS-proto-parms* "") (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "orgPlace=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:url-encode org-place))) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "&orgStreet=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:url-encode org-street))) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "&orgCityState=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:url-encode org-city-state))) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "&userOrgCityState=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:url-encode user-org-city-state))) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "&destPlace=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:url-encode dest-place))) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "&destStreet=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:url-encode dest-street))) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "&destCityState=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:url-encode dest-city-state))) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "&userDestCityState=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:url-encode user-dest-city-state))) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "&dayOfWeek=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:url-encode day-of-week))) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "&timeOfDay=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:url-encode time-Of-Day))) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "&reqId=")) (write-string *PTIS-proto-parms* fStream) (finish-output fStream) ) ) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-location url :content-language (url:languages url)) (with-html-document (:stream stream) (with-document-preamble (:stream stream) (declare-title "New York Metropolitan Public Transit Info - Mapism" :stream stream)) (ns4.0:with-document-frameset (:rows '((:percentage 7) (:percentage 60) (:percentage 32)) :stream stream) (ns4.0:note-document-frame :name "head-pane" :reference #u"/neoemporium/nycgis/header.html" :target "display-pane" :resizable-p t :scrolling nil :stream stream) (ns4.0:with-document-frameset (:columns '((:percentage 28) (:percentage 44) :wild) :stream stream) (ns4.0:note-document-frame :name "origin-pane" :reference #u"/neoemporium/nycgis/origin.html" :target "origin-pane" :resizable-p t :scrolling nil :stream stream) (ns4.0:note-document-frame :name "display-pane" :reference #u"/neoemporium/nycgis/itinerary.xasp" :target "display-pane" :resizable-p t :scrolling nil :stream stream) (ns4.0:note-document-frame :name "destination-pane" :reference #u"/neoemporium/nycgis/destination.html" :target "destination-pane" :resizable-p t :scrolling nil :stream stream) ) (ns4.0:note-document-frame :name "foot-pane" :reference #u"/neoemporium/nycgis/footer.html" :target "display-pane" :resizable-p t :scrolling nil :stream stream) ) ) ) ) ) (export-url #u"/neoemporium/nycgis/landmarks.txt" :text-file :pathname "http:www;neoemporium;nycgis;landmarks.txt" :expiration `(:interval ,(* 0. 60.)) :public t :language :en ; :keywords `(:neoemporium :documentation) ) (export-url #u"/neoemporium/nycgis/header.html" :computed :response-function #'write-PTIS-US-NY-NYC-header-pane :expiration `(:interval ,(* 0. 60.)) :public t :language :en ; :keywords `(:neoemporium :documentation) ) (export-url #u"/neoemporium/nycgis/origin.html" :computed :response-function #'write-PTIS-US-NY-NYC-origin-pane :expiration `(:interval ,(* 0. 60.)) :public t :language :en ; :keywords `(:neoemporium :documentation) ) (export-url #u"/neoemporium/nycgis/destination.html" :computed :response-function #'write-PTIS-US-NY-NYC-destination-pane :expiration `(:interval ,(* 0. 60.)) :public t :language :en ; :keywords `(:neoemporium :documentation) ) (export-url #u"/neoemporium/nycgis/itinerary.xasp" :computed :response-function #'write-PTIS-US-NY-NYC-itinerary-pane :expiration `(:interval ,(* 0. 60.)) :public t :language :en ; :keywords `(:neoemporium :documentation) ) (export-url #u"/neoemporium/nycgis/footer.html" :computed :response-function #'write-PTIS-footer-pane :expiration `(:interval ,(* 0. 60.)) :public t :language :en ; :keywords `(:neoemporium :documentation) ) (export-url #u"/neoemporium/nycgis/metromapism.xasp" :html-computed-form :form-function #'PTIS-US-NY-NYC-proto :expiration `(:interval ,(* 0. 60.)) :response-function #'respond-to-PTIS-US-NY-NYC-proto :public t :language :en ) (defparameter *PTIS-US-NY-BC-proto-url-server-0* '"") (defparameter *PTIS-US-NY-BC-proto-url-tail-1* '" target=_top>Broome County, NY: PTIS v 0.3
Sponsor Content Wireframe.") (defmethod write-PTIS-US-NY-BC-header-pane ((url http-url) stream) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (url:languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-standard-document-body (:stream stream) (buildPTISResponse stream *PTIS-US-NY-BC-proto-url-server-1* "bc.xasp" *PTIS-US-NY-BC-proto-url-tail-1* nil) )))) (defmethod write-PTIS-US-NY-BC-origin-pane ((url http-url) stream) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (url:languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-standard-document-body (:stream stream) (buildPTISResponse stream *PTIS-US-NY-BC-proto-url-server-0* "Embarcadero.jsp?point=org&" *PTIS-US-NY-BC-proto-url-tail-0* t) )))) (defmethod write-PTIS-US-NY-BC-destination-pane ((url http-url) stream) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (url:languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-standard-document-body (:stream stream) (buildPTISResponse stream *PTIS-US-NY-BC-proto-url-server-0* "Embarcadero.jsp?point=dest&" *PTIS-US-NY-BC-proto-url-tail-0* t) )))) (defmethod write-PTIS-US-NY-BC-itinerary-pane ((url http-url) stream) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (url:languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-standard-document-body (:stream stream) (buildPTISResponse stream *PTIS-US-NY-BC-proto-url-server-0* "go.jsp?" *PTIS-US-NY-BC-proto-url-tail-0* t) )))) (defmethod PTIS-US-NY-BC-proto ((url url:http-form) stream) (with-successful-response (stream :html :content-location url :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (languages url)) (with-open-file (dStream "/root/debug1" :direction :output :direction :output :if-exists :overwrite :if-does-not-exist :create) (with-html-document (:declare-dtd-version-p t :stream dStream) (with-document-preamble (:stream dStream) (declare-base-reference url :stream dStream) (declare-title "Dummy CL-HTTP Form" :stream dStream)) (with-standard-document-body (:stream dStream) (with-section-heading ("GIS Proto Parms" :stream dStream) (with-fillout-form (:post url :stream dStream) (with-open-file (fStream "/usr/src/web/cl-xsl/www/neoemporium/PTIS/BC/proto.html" :direction :input ) (loop for i from 1 to 214 do (write-line (read-line fStream nil nil t) stream ) ) (accept-input 'string "ORG-PLACE" :stream dStream) (accept-input 'string "ORG-STREET" :stream dStream) (accept-input 'string "ORG-CITY-STATE" :stream dStream) (accept-input 'string "USER-ORG-CITY-STATE" :stream dStream) (accept-input 'string "DEST-PLACE" :stream dStream) (accept-input 'string "DEST-STREET" :stream dStream) (accept-input 'string "DEST-CITY-STATE" :stream dStream) (accept-input 'string "USER-DEST-CITY-STATE" :stream dStream) (accept-input 'string "DAY-OF-WEEK" :stream dStream) (accept-input 'string "TIME-OF-DAY" :stream dStream) (finish-output dStream) ) ) ) ) ) ) ) ) (defmethod respond-to-PTIS-US-NY-BC-proto ((url url:http-form) stream query-alist) (flet ((clean-up (item) (and item ; don't let NIL through (not (null-string-p (setq item (string-trim '(#\space #\tab #\return #\Linefeed) item)))) item))) (declare (dynamic-extent #'clean-up)) (bind-query-values (day-of-week time-of-day org-place org-street org-city-state user-org-city-state dest-place dest-street dest-city-state user-dest-city-state) (url query-alist) (with-open-file (fStream "/root/dbug" :direction :output :if-exists :overwrite :if-does-not-exist :create ) (setq *PTIS-proto-parms* "") (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "orgPlace=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:url-encode org-place))) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "&orgStreet=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:url-encode org-street))) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "&orgCityState=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:url-encode org-city-state))) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "&userOrgCityState=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:url-encode user-org-city-state))) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "&destPlace=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:url-encode dest-place))) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "&destStreet=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:url-encode dest-street))) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "&destCityState=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:url-encode dest-city-state))) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "&userDestCityState=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:url-encode user-dest-city-state))) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "&dayOfWeek=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:url-encode day-of-week))) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "&timeOfDay=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:url-encode time-Of-Day))) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* "&reqId=")) (setq *PTIS-proto-parms* (concatenate 'string *PTIS-proto-parms* (cl-user:get-timestamp-plus "xasp"))) (write-string *PTIS-proto-parms* fStream) (finish-output fStream) ) ) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-location url :content-language (url:languages url)) (with-html-document (:stream stream) (with-document-preamble (:stream stream) (declare-title "Broome County Transit Info - American Kybernetik" :stream stream)) (ns4.0:with-document-frameset (:rows '((:percentage 7) (:percentage 60) (:percentage 32)) :stream stream) (ns4.0:note-document-frame :name "head-pane" :reference #u"/neoemporium/PTIS/BC/header.html" :target "display-pane" :resizable-p t :scrolling nil :stream stream) (ns4.0:with-document-frameset (:columns '((:percentage 28) (:percentage 44) :wild) :stream stream) (ns4.0:note-document-frame :name "origin-pane" :reference #u"/neoemporium/PTIS/BC/origin.html" :target "origin-pane" :resizable-p t :scrolling nil :stream stream) (ns4.0:note-document-frame :name "display-pane" :reference #u"/neoemporium/PTIS/BC/itinerary.xasp" :target "display-pane" :resizable-p t :scrolling nil :stream stream) (ns4.0:note-document-frame :name "destination-pane" :reference #u"/neoemporium/PTIS/BC/destination.html" :target "destination-pane" :resizable-p t :scrolling nil :stream stream) ) (ns4.0:note-document-frame :name "foot-pane" :reference #u"/neoemporium/PTIS/BC/footer.html" :target "display-pane" :resizable-p t :scrolling nil :stream stream) ) ) ) ) ) (export-url #u"/neoemporium/PTIS/BC/landmarks.txt" :text-file :pathname "http:www;neoemporium;PTIS;BC;landmarks.txt" :expiration `(:interval ,(* 0. 60.)) :public t :language :en ; :keywords `(:neoemporium :documentation) ) (export-url #u"/neoemporium/PTIS/BC/header.html" :computed :response-function #'write-PTIS-US-NY-BC-header-pane :expiration `(:interval ,(* 0. 60.)) :public t :language :en ; :keywords `(:neoemporium :documentation) ) (export-url #u"/neoemporium/PTIS/BC/origin.html" :computed :response-function #'write-PTIS-US-NY-BC-origin-pane :expiration `(:interval ,(* 0. 60.)) :public t :language :en ; :keywords `(:neoemporium :documentation) ) (export-url #u"/neoemporium/PTIS/BC/destination.html" :computed :response-function #'write-PTIS-US-NY-BC-destination-pane :expiration `(:interval ,(* 0. 60.)) :public t :language :en ; :keywords `(:neoemporium :documentation) ) (export-url #u"/neoemporium/PTIS/BC/itinerary.xasp" :computed :response-function #'write-PTIS-US-NY-BC-itinerary-pane :expiration `(:interval ,(* 0. 60.)) :public t :language :en ; :keywords `(:neoemporium :documentation) ) (export-url #u"/neoemporium/PTIS/BC/footer.html" :computed :response-function #'write-PTIS-footer-pane :expiration `(:interval ,(* 0. 60.)) :public t :language :en ; :keywords `(:neoemporium :documentation) ) (export-url #u"/neoemporium/PTIS/BC/bc.xasp" :html-computed-form :form-function #'PTIS-US-NY-BC-proto :expiration `(:interval ,(* 0. 60.)) :response-function #'respond-to-PTIS-US-NY-BC-proto :public t :language :en ) ;;--------------------------------------------------------------------------- ;; Export Obverse Storefront (the directory is exported in cso.lisp). ;;;------------------------------------------------------------------- ;;; ;;; TOP-LEVEL FRAME ;;; (defparameter *spaces* '( ("Π ∈ 空¹" ("Projects" "/store/content.html") ("Register" "http://commoditysoftware.org/r4.html") ) ("∫ ∂ 空" ("DIY" "/ai-integration/self-managed.xasp") ("Job Shop" "http://commoditysoftware.org/FreeJobShop") ("Managed" "/ai-integration/wizard.xasp") ) ("∑ ∀ 空" ("Sign-in" "http://ns.commoditysoftware.org:42666/ai-integration/logIn.xasp") ("Sign-out" "/ai-integration/durga.html") ) ) ) (defmethod write-storeFront-index-pane ((url http-url) stream) (flet ((write-heading (stream) (with-centering (:stream stream) (write-string "TE XP
" stream))) (index (count) (flet ((get-letter (idx) (aref "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (1- idx)))) (cond ((> count 26) (multiple-value-bind (quotient remainder) (truncate count 26) (coerce (list (get-letter quotient) (get-letter remainder)) 'string))) (t (get-letter count))))) ) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (url:languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-document-preamble (:stream stream) (declare-title "Content" :stream stream)) (with-standard-document-body (:stream stream) (write-string "
" stream ) (with-section-heading (#'write-heading :stream stream :level 2) (loop for (heading . entries) in *spaces* for count upfrom 1 do (flet ((write-subheading (stream) (fast-format stream "~D ~A" " " heading))) ;; (fast-format stream "~D. ~A" (index count) heading))) (declare (dynamic-extent #'write-subheading)) (with-section-heading (#'write-subheading :stream stream) (with-enumeration (stream :definition) (with-font (:size 2 :stream stream) (loop for (display-string reference) in entries for count upfrom 1 do (enumerating-item (stream) (with-rendition (:bold :stream stream) (fast-format stream "~D. " count ) (ns4.0:note-anchor Display-string :reference reference :target "display-pane" :stream stream) )))))))) ) (write-string "
" stream) (with-centering (:stream stream) (image "/store/images/HouFengRenJuan.png" "XASP/2 Ren Juan" :stream stream :alignment :middle) ) (write-string "
© 4703
203 Shoshone
Buffalo, NY
14214-1021
01-716-834-5015


¹空 = 'space'

NAK-CSO
" stream) ) ) ) ) ) (export-url #u"/ai-integration/content.html" :computed :response-function #'write-storeFront-index-pane :expiration `(:interval ,(* 15. 60.)) :public t :language :en ; :keywords `(:storeFront :documentation) ) (defmethod write-storeFront-title-pane ((url http-url) stream) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (url:languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-standard-document-body (:stream stream) (with-centering (:stream stream) (image "/store/images/tenastu.jpg" "NAK-CSO Storefront" :stream stream :width 256 :height 34 :alignment :top) ) )))) (defparameter *durga* '"") (setq *durga* (concatenate 'string *durga* "" "" "
" "" "
" "
local
" "Ancient Goodbye Images
" ) ) (defmethod write-storeFront-display-pane ((url http-url) stream) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (url:languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-standard-document-body (:stream stream) (write-string *durga* stream) )))) (export-url #u"/ai-integration/awning.html" :computed :response-function #'write-storeFront-title-pane :expiration `(:interval ,(* 15. 60.)) :public t :language :en ; :keywords `(:storeFront :documentation) ) (export-url #u"/ai-integration/durga.html" :computed :response-function #'write-storeFront-display-pane :expiration `(:interval ,(* 15. 60.)) :public t :language :en ; :keywords `(:storeFront :documentation) ) (export-url #u"/ai-integration/images/" :image-directory :pathname "http:www;store;images;" :expiration `(:interval ,(* 15. 60.)) :public t ; :keywords '(:cl-http :demo) :documentation "A directory of images for the general store.") (defmethod write-storeFront-frame-set ((url http-url) stream) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-location url :content-language (url:languages url)) (with-html-document (:stream stream) (with-document-preamble (:stream stream) (declare-title "AI-Integration.biz (AII) - A Commodity Software Project" :stream stream)) (ns4.0:with-document-frameset (:rows '((:pixel 45) :wild) :stream stream) (ns4.0:note-document-frame :name "title-pane" :reference #u"/ai-integration/awning.html" :target "display-pane" :resizable-p t :scrolling nil :stream stream) (ns4.0:with-document-frameset (:columns '((:percentage 10) :wild) :stream stream) (ns4.0:note-document-frame :name "index-pane" :reference #u"/ai-integration/content.html" :target "display-pane" :resizable-p t :stream stream) (ns4.0:note-document-frame :name "display-pane" :reference "http://commoditysoftware.org/FreeJobShop/storeFront.html" :target "display-pane" :resizable-p t :stream stream) ))))) (export-url #u"/ai-integration/index.html" :computed :response-function #'write-storeFront-frame-set :expiration `(:interval ,(* 15. 60.)) :public t :language :en ; :keywords `(:storeFront :documentation) ) (export-url #u"/ai-integration" :computed :response-function #'write-storeFront-frame-set :expiration `(:interval ,(* 15. 60.)) :public t :language :en ; :keywords `(:storeFront :documentation) ) (export-url #u"/ai-integration/resindex.html" :html-file :pathname (pathname "http:www;neoemporium;resindex.html") :public t :language :en ; :keywords `(:storeFront :documentation) ) (defparameter *noTimeForBullShit* '"") (setq *noTimeForBullShit* (concatenate 'string *noTimeForBullShit* (concatenate 'string "


" "" "" "" "" "" "" "" "" "
... (and all-phor-one λ) ;;; mouseover binding labels" "
" ) ) ) (defmethod write-storeDocs ((url http-url) stream) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (url:languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-document-body (:stream stream :background-url "http://commoditysoftware.org/images/domainMark3A.jpg" ) (with-centering (:stream stream) (write-string *noTimeForBullShit* stream) ) ) ))) (defparameter *storeLinksArray* '"") (setq *storeLinksArray* (concatenate 'string *storeLinksArray* "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "
Academic Publications
BIND, DHCP, IPV6, LDAP, etc.
Apache
CL.net CLiki.net
CL-HTTP
Haskell
IETF
Orbeon XForms
Postgres
Protege
Pragsoft (UML Studio)
ProNTo
Reference Platform
Squeak
" "Subversion
SWI Prolog" " Twiki
XPlanner , XP Web
WWW
" "See Also: AutoConsult Credits.
" ) ) (defmethod write-storeLinks ((url http-url) stream) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (url:languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-document-body (:stream stream :background-url "http://commoditysoftware.org/images/projects2.jpg" ) (with-centering (:stream stream) (write-string *storeLinksArray* stream) ) ) ))) (defparameter *selfManagedSpace* '"") (setq *selfManagedSpace* (concatenate 'string *selfManagedSpace* "
DIY: Self-Managed Space" "
" "
The Managed domain service guides you in use of the packages below." " Do It Yourself if you have an entitled account, but to avoid conflicts " " don't use the wizard (卜) at the same time. The MS Project, " "Tofs, and UML Studio files linked in the public user context of this page are public deliverables of our project." "

" "EssentialRecommendedOptimizing " "

" "
" "¹ Your dominion virtual desktop or SPO requires Squeak plug-in.
" "² Should start Windows application if installed (Project 2K or later, UML Studio 7.1 or later).
" "³ Out of print software, retained for best practices. Zip of CI db/tree(ToFS 98.2).
" "
" ) ) (defmethod write-DIY ((url http-url) stream) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (url:languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-document-body (:stream stream :background-url "http://commoditysoftware.org/images/domainMark3A.jpg" ) (with-centering (:stream stream) (write-string *selfManagedSpace* stream) ) ) ))) (defparameter *wizardString* '"") (setq *wizardString* (concatenate 'string *wizardString* "" "" "" "" "
Managed Space Wizard
" " Use a expert system to optimize your projects:
" "
" ) ) (defmethod write-wiz ((url http-url) stream) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (url:languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-document-body (:stream stream :background-url "http://commoditysoftware.org/images/wizback.gif" ) (with-centering (:stream stream) (write-string *wizardString* stream) ) ) ))) (defmethod write-store-blank ((url http-url) stream) (http:with-conditional-get-response (stream :html :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (url:languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-document-body (:stream stream :background-url "http://commoditysoftware.org/images/storeBack.jpg" ) (with-centering (:stream stream) (write-string " " stream) ) ) ))) (defparameter *computed-choices* '("Computed Form")) (defparameter *default-computed-choices* '("Not Selected")) (defmethod write-LogIn-form ((url http-url) stream) (with-successful-response (stream :html :content-location url :expires (url:expiration-universal-time url) :cache-control (url:response-cache-control-directives url) :content-language (languages url)) (with-html-document (:declare-dtd-version-p t :stream stream) (with-document-preamble (:stream stream) (declare-base-reference url :stream stream) (declare-title "Domain Anmeldung" :stream stream)) (with-document-body (:stream stream :background-url "http://commoditysoftware.org/images/xasp2Portal.jpg" ) (write-string "
" stream) (with-section-heading ("Sign ..." :stream stream) ;; (http::image-line :stream stream) (with-fillout-form (:post url :stream stream) (write-string "U" stream) (accept-input 'string "DOMAIN-USERID" :size 30 :stream stream) (write-string "P" stream) (accept-input 'password "DOMAIN-PASSWORD" :size 30 :stream stream) (submit-and-reset-buttons stream) (write-string "
    ... thru Wikipedia CMS" stream)) ;; (http::image-line :stream stream) (cl-http-signature stream))))))) (defmethod respond-to-logIn ((url url:http-form) stream query-alist) (flet ((clean-up (item) (and item ; don't let NIL through (not (null-string-p (setq item (string-trim '(#\space #\tab #\return #\Linefeed) item)))) item))) (declare (dynamic-extent #'clean-up)) (bind-query-values (choices add-choice delete-choice computed-choices) (url query-alist) (let ((real-choices (delete "Not Selected" (ensure-list choices) :test #'equalp)) (*computed-choices* (read-from-armor-plated-string computed-choices))) (setq *default-computed-choices* (if real-choices real-choices '("Not Selected"))) (cond-every ((setq add-choice (clean-up add-choice)) (pushnew add-choice (cdr *computed-choices*) :test #'equalp)) ((setq delete-choice (clean-up delete-choice)) ;; Don't allow deletion of no selection and keep at least two choices. (when (cdr *computed-choices*) (setq *computed-choices* (delete delete-choice *computed-choices* :test #'equalp))) ;; Keep the default in sync (setq *default-computed-choices* (or (delete delete-choice *default-computed-choices* :test #'equalp) '("Not Selected"))))) ;; generate another version of the form with the new values. (compute-form url stream))))) (export-url #u"/ai-integration/documentation.xasp" :computed :response-function #'write-storeDocs :expiration `(:interval ,(* 15. 60.)) :public t :language :en ; :keywords `(:storeFront :documentation) ) (export-url #u"/ai-integration/self-managed.xasp" :computed :response-function #'write-DIY :expiration `(:interval ,(* 15. 60.)) :public t :language :en ; :keywords `(:storeFront :documentation) ) (export-url #u"/ai-integration/wizard.xasp" :computed :response-function #'write-wiz :expiration `(:interval ,(* 15. 60.)) :public t :language :en ; :keywords `(:storeFront :documentation) ) (export-url #u"/ai-integration/links.xasp" :computed :response-function #'write-storeLinks :expiration `(:interval ,(* 15. 60.)) :public t :language :en ; :keywords `(:storeFront :documentation) ) (export-url #u"/neoemporium/account.xasp" :computed :response-function #'write-store-blank :expiration `(:interval ,(* 0. 60.)) :language :en ; :keywords `(:neoemporium :documentation) ) (export-url #u"/neoemporium/browseproj.xasp" :computed :response-function #'write-Store-blank :expiration `(:interval ,(* 0. 60.)) :language :en ; :keywords `(:neoemporium :documentation) ) (export-url #u"/neoemporium/createproj.xasp" :computed :response-function #'write-store-blank :expiration `(:interval ,(* 0. 60.)) :language :en ; :keywords `(:neoemporium :documentation) ) (export-url #u"/neoemporium/workspace.xasp" :computed :response-function #'write-store-blank :expiration `(:interval ,(* 0. 60.)) :language :en ; :keywords `(:neoemporium :documentation) ) (export-url #u"/neoemporium/DIY.xasp" :computed :response-function #'write-store-blank :expiration `(:interval ,(* 0. 60.)) :language :en ; :keywords `(:neoemporium :documentation) ) (export-url #u"/ai-integration/logIn.xasp" :html-computed-form :form-function #'write-logIn-form :expiration '(:no-expiration-header) :response-function #'respond-to-logIn :public t :language :en ; :keywords '(:cl-http :demo) ; :documentation "An example of copmuting the form html on the fly and responding to the resulting submissions." )