projects
/
hyperobject.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d2d39ae
)
r5112: *** empty log message ***
author
Kevin M. Rosenberg
<kevin@rosenberg.net>
Thu, 12 Jun 2003 14:46:19 +0000
(14:46 +0000)
committer
Kevin M. Rosenberg
<kevin@rosenberg.net>
Thu, 12 Jun 2003 14:46:19 +0000
(14:46 +0000)
views.lisp
patch
|
blob
|
history
diff --git
a/views.lisp
b/views.lisp
index e5ada414699923f2dae9459700cbbd995a01ce3a..7de59fe736a27e7062667768dd4d05ed00661b1a 100644
(file)
--- a/
views.lisp
+++ b/
views.lisp
@@
-7,7
+7,7
@@
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Apr 2000
;;;;
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Apr 2000
;;;;
-;;;; $Id: views.lisp,v 1.5
2 2003/06/12 12:02:31
kevin Exp $
+;;;; $Id: views.lisp,v 1.5
3 2003/06/12 14:46:19
kevin Exp $
;;;;
;;;; This file is Copyright (c) 2000-2003 by Kevin M. Rosenberg
;;;; *************************************************************************
;;;;
;;;; This file is Copyright (c) 2000-2003 by Kevin M. Rosenberg
;;;; *************************************************************************
@@
-69,16
+69,16
@@
(link-slots :type list :initform nil
:documentation "List of slot names that have hyperlinks"
:accessor link-slots)
(link-slots :type list :initform nil
:documentation "List of slot names that have hyperlinks"
:accessor link-slots)
- (link-page
-printer :type (or string function symbol
null) :initform nil
- :initarg :link-page
-printer
- :accessor link-page
-printer
)
+ (link-page
:type (or string
null) :initform nil
+ :initarg :link-page
+ :accessor link-page)
(link-href-start :type (or string null) :initform nil :initarg :link-href-start
:accessor link-href-start)
(link-href-end :type (or string null) :initform nil :initarg :link-href-end
:accessor link-href-end)
(link-ampersand :type (or string null) :initform nil :initarg :link-ampersand
:accessor link-ampersand))
(link-href-start :type (or string null) :initform nil :initarg :link-href-start
:accessor link-href-start)
(link-href-end :type (or string null) :initform nil :initarg :link-href-end
:accessor link-href-end)
(link-ampersand :type (or string null) :initform nil :initarg :link-ampersand
:accessor link-ampersand))
- (:default-initargs :link-page
-printer
"disp-func1")
+ (:default-initargs :link-page "disp-func1")
(:documentation "View class for a hyperobject"))
(:documentation "View class for a hyperobject"))
@@
-512,13
+512,13
@@
;;; Object Data
;;; Object Data
-(defun make-link-start (view fieldfunc fieldvalue refvars)
+(defun make-link-start (view fieldfunc fieldvalue refvars
link-printer
)
(with-output-to-string (s)
(write-string (link-href-start view) s)
(write-char #\" s)
(with-output-to-string (s)
(write-string (link-href-start view) s)
(write-char #\" s)
- (let ((link-page (link-page
-printer
view)))
- (
typecase link-page
- (
string
+ (let ((link-page (link-page view)))
+ (
cond
+ (
(null link-printer)
(write-string (make-url link-page) s)
(write-string "?func=" s)
(write-simple fieldfunc s)
(write-string (make-url link-page) s)
(write-string "?func=" s)
(write-simple fieldfunc s)
@@
-531,20
+531,18
@@
(write-char #\= s)
(write-simple (cdr var) s))
(write-char #\" s))
(write-char #\= s)
(write-simple (cdr var) s))
(write-char #\" s))
- (null
- nil)
- ((or symbol function)
- (funcall link-page fieldfunc fieldvalue refvars s))))))
+ (link-printer
+ (funcall link-printer link-page fieldfunc fieldvalue refvars s))))))
(defun make-link-end (obj view fieldname)
(declare (ignore obj fieldname))
(link-href-end view))
(defun make-link-end (obj view fieldname)
(declare (ignore obj fieldname))
(link-href-end view))
-(defun fmt-obj-data (obj view strm indent refvars)
+(defun fmt-obj-data (obj view strm indent refvars
link-printer
)
(when (obj-data-indent view)
(indent-spaces indent strm))
(if (link-slots view)
(when (obj-data-indent view)
(indent-spaces indent strm))
(if (link-slots view)
- (fmt-obj-data-with-link obj view strm refvars)
+ (fmt-obj-data-with-link obj view strm refvars
link-printer
)
(fmt-obj-data-plain obj view strm))
(awhen (obj-data-end-str view)
(write-string it strm)))
(fmt-obj-data-plain obj view strm))
(awhen (obj-data-end-str view)
(write-string it strm)))
@@
-553,13
+551,15
@@
(awhen (obj-data-printer view)
(funcall it obj strm nil)))
(awhen (obj-data-printer view)
(funcall it obj strm nil)))
-(defun fmt-obj-data-with-link (obj view strm refvars)
+(defun fmt-obj-data-with-link (obj view strm refvars
link-printer
)
(let ((refvalues '()))
(let ((refvalues '()))
+ (declare (dynamic-extent refvalues))
;; make list of hyperlink link fields for printing to refstr template
(dolist (name (link-slots view))
(awhen (find name (hyperobject-class-hyperlinks obj) :key #'name)
(push (make-link-start view (lookup it) (slot-value obj name)
;; make list of hyperlink link fields for printing to refstr template
(dolist (name (link-slots view))
(awhen (find name (hyperobject-class-hyperlinks obj) :key #'name)
(push (make-link-start view (lookup it) (slot-value obj name)
- (append (link-parameters it) refvars))
+ (append (link-parameters it) refvars)
+ link-printer)
refvalues)
(push (make-link-end obj view name) refvalues)))
(funcall (obj-data-printer view) obj strm (nreverse refvalues))))
refvalues)
(push (make-link-end obj view name) refvalues)))
(funcall (obj-data-printer view) obj strm (nreverse refvalues))))
@@
-580,7
+580,7
@@
objs)
(defun view-hyperobject (objs view category strm &optional (indent 0) filter
objs)
(defun view-hyperobject (objs view category strm &optional (indent 0) filter
- subobjects refvars)
+ subobjects refvars
link-printer
)
"Display a single or list of hyperobject-class instances and their subobjects"
(let-when (objlist (mklist objs))
(let ((nobjs (length objlist))
"Display a single or list of hyperobject-class instances and their subobjects"
(let-when (objlist (mklist objs))
(let ((nobjs (length objlist))
@@
-594,7
+594,7
@@
(dolist (obj objlist)
(unless (and filter (not (funcall filter obj)))
(fmt-obj-start obj view strm indent)
(dolist (obj objlist)
(unless (and filter (not (funcall filter obj)))
(fmt-obj-start obj view strm indent)
- (fmt-obj-data obj view strm (1+ indent) refvars)
+ (fmt-obj-data obj view strm (1+ indent) refvars
link-printer
)
(when (and subobjects (hyperobject-class-subobjects obj))
(dolist (subobj (hyperobject-class-subobjects obj))
(aif (slot-value obj (name-slot subobj))
(when (and subobjects (hyperobject-class-subobjects obj))
(dolist (subobj (hyperobject-class-subobjects obj))
(aif (slot-value obj (name-slot subobj))
@@
-602,14
+602,14
@@
(get-category-view (car (mklist it))
category)
category strm (1+ indent) filter
(get-category-view (car (mklist it))
category)
category strm (1+ indent) filter
- subobjects refvars))))
+ subobjects refvars
link-printer
))))
(fmt-obj-end obj view strm indent)))
(fmt-list-end (car objlist) view strm indent nobjs)))
objs)
(defun view (objs &key (stream *standard-output*) category view
(fmt-obj-end obj view strm indent)))
(fmt-list-end (car objlist) view strm indent nobjs)))
objs)
(defun view (objs &key (stream *standard-output*) category view
- filter subobjects refvars file-wrapper)
+ filter subobjects refvars file-wrapper
link-printer
)
"EXPORTED Function: prints hyperobject-class objects. Calls view-hyperobject"
(let-when (objlist (mklist objs))
(when category
"EXPORTED Function: prints hyperobject-class objects. Calls view-hyperobject"
(let-when (objlist (mklist objs))
(when category
@@
-618,7
+618,8
@@
(setq view (default-view (class-of (car objlist)))))
(when file-wrapper
(fmt-file-start view stream))
(setq view (default-view (class-of (car objlist)))))
(when file-wrapper
(fmt-file-start view stream))
- (view-hyperobject objlist view category stream 0 filter subobjects refvars)
+ (view-hyperobject objlist view category stream 0 filter subobjects refvars
+ link-printer)
(when file-wrapper
(fmt-file-end view stream)))
objs)
(when file-wrapper
(fmt-file-end view stream)))
objs)