From 2b0fd9c886908c6492c66cc30fcacf5fd600bf8e Mon Sep 17 00:00:00 2001 From: Drew Crampsie Date: Thu, 23 Feb 2006 04:49:10 -0800 Subject: [PATCH] Major patch touching a lot, representing the new lol. is mostly drop-in backwards compatable. darcs-hash:20060223124910-5417e-ebb4390759c4cfba78cbb388636d2cea65059049.gz --- lisp-on-lines.asd | 11 +- src/attributes/numbers.lisp | 26 +++ src/backwards-compat.lisp | 31 ++++ src/components/ajax.lisp | 6 +- src/components/dojo.lisp | 3 +- src/components/search.lisp | 139 +++++++++++++++ src/defdisplay.lisp | 226 +++++++++++++++--------- src/dojo-attributes.lisp | 85 +++++++++ src/mewa.lisp | 283 ++++++++++++++++++------------ src/packages.lisp | 4 + src/properties.lisp | 57 ++++++ src/relational-attributes.lisp | 53 ++++-- src/slot-presentations.lisp | 3 +- src/special-initargs.lisp | 38 ++++ src/standard-attributes.lisp | 221 +++++++++++++++++------ src/standard-display.lisp | 310 ++++++++++++++++----------------- src/standard-occurence.lisp | 24 +++ src/standard-wrappers.lisp | 82 ++++++--- src/ucw-test-component.lisp | 10 +- 19 files changed, 1155 insertions(+), 457 deletions(-) create mode 100644 src/attributes/numbers.lisp create mode 100644 src/components/search.lisp rewrite src/defdisplay.lisp (93%) create mode 100644 src/dojo-attributes.lisp create mode 100644 src/properties.lisp create mode 100644 src/special-initargs.lisp rewrite src/standard-attributes.lisp (68%) rewrite src/standard-display.lisp (85%) create mode 100644 src/standard-occurence.lisp rewrite src/standard-wrappers.lisp (76%) diff --git a/lisp-on-lines.asd b/lisp-on-lines.asd index cee71e9..9629103 100644 --- a/lisp-on-lines.asd +++ b/lisp-on-lines.asd @@ -12,7 +12,11 @@ :components ((:static-file "lisp-on-lines.asd") (:file "src/packages") (:module :src - :components ((:file "static-presentations") + :components ((:file "special-initargs") + (:file "properties") + ;;;; legacy UCW presentations + (:file "static-presentations") + (:file "mewa") (:file "validation") (:file "validation/email-address") @@ -22,12 +26,17 @@ (:file "slot-presentations/date") (:file "defdisplay") (:file "standard-display") + (:file "standard-occurence") (:file "standard-attributes") + (:file "dojo-attributes") (:file "standard-wrappers") (:file "relational-attributes") (:file "backwards-compat")) :serial t) + (:module :attributes + :pathname "src/attributes/" + :components ((:file "numbers"))) (:module :components :pathname "src/components/" :components ((:file "range-list") diff --git a/src/attributes/numbers.lisp b/src/attributes/numbers.lisp new file mode 100644 index 0000000..8eeff63 --- /dev/null +++ b/src/attributes/numbers.lisp @@ -0,0 +1,26 @@ +(in-package :lisp-on-lines) + +(defattribute number-attribute (base-attribute) + () + (:type-name number)) + +;;;; INTEGER +(defattribute integer-attribute (base-attribute) + () + (:type-name integer)) + +;;;; REALS + +(defattribute real-attribute (base-attribute) + () + (:type-name real)) + + +;;;; Currency +(defattribute currency-attribute (base-attribute) + () + (:type-name currency)) + +(defdisplay + ((currency currency-attribute) object) + (<:as-html (format nil "$~$" (attribute-value object currency)))) diff --git a/src/backwards-compat.lisp b/src/backwards-compat.lisp index c2ab9e8..429d325 100644 --- a/src/backwards-compat.lisp +++ b/src/backwards-compat.lisp @@ -7,7 +7,38 @@ ;;;; with the past. You learn to live with it. +(defmethod find-old-type (type) + type) + ;;!legacy string (defmethod find-attribute-class-for-type ((type (eql 'mewa-string))) 'string-attribute) +;; legacy int +(defmethod find-attribute-class-for-type ((type (eql 'mewa-integer))) + 'integer-attribute) + +;; currency +(defmethod find-attribute-class-for-type ((type (eql 'mewa-currency))) + 'currency-attribute) +;; legacy relations + +(defmethod find-attribute-class-for-type ((type (eql 'ajax-foreign-key))) + 'lol::has-a) + + +(defmethod find-attribute-class-for-type ((type (eql 'foreign-key))) + 'lol::has-a) + +(defmethod find-layer-for-type ((type (eql 'mewa-one-line-presentation))) + 'one-line) + +(defmethod find-old-type ((type (eql 'one-line))) + 'mewa-one-line-presentation) + +(defmethod find-old-type ((type (eql 'one-line))) + 'mewa-one-line-presentation) + + + + diff --git a/src/components/ajax.lisp b/src/components/ajax.lisp index 6b4f23f..f3a9f83 100644 --- a/src/components/ajax.lisp +++ b/src/components/ajax.lisp @@ -199,6 +199,7 @@ but here's what i use." (meta-model:explode-foreign-key instance (slot-name slot))))))) (flet ((render-s () (when foreign-instance (call-next-method)))) + (if (slot-boundp slot 'ucw::place) (cond ((editablep slot) @@ -212,11 +213,12 @@ but here's what i use." (