Massive patch to compile with modern versions of the libraries. This is only 1/2...
[clinton/lisp-on-lines.git] / src / lisp-on-lines.lisp
index 617b124..911b02d 100644 (file)
@@ -7,6 +7,13 @@
 ;;;; that are part of LoL proper, that is to say, not Mewa 
 ;;;; or Meta-Model.
 
+
+
+(defmacro action (args &body body)
+  `(lambda ,args
+    (with-call/cc
+      ,@body)))
+
 ;;;; ** Initialisation
 (defmethod find-default-attributes ((object t))
   "return the default attributes for a given object using the meta-model's meta-data"
@@ -42,8 +49,6 @@
 
 ;;;; The following macros are used to initialise a set of database tables as LoL objects.
 
-
-
 (eval-when (:compile-toplevel :load-toplevel :execute)
   (defun generate-define-view-for-table (table)
     "
@@ -51,8 +56,8 @@ Generates a form that, when evaluated, initialises the given table as an lol obj
 This involves creating a meta-model, a clsql view-class, and the setting up the default attributes for a mewa presentation"
 
     `(progn 
-      (def-view-class-from-table ,table)
-      (set-default-attributes (quote ,(meta-model::sql->sym table))))))
+       (rofl::gen-view-class ,table :generate-joins :all)
+       (set-default-attributes (quote ,(meta-model::sql->sym table))))))
     
 (defmacro define-view-for-table (&rest tables)
   " expand to a form which initialises TABLES for use with LOL"
@@ -65,60 +70,6 @@ This involves creating a meta-model, a clsql view-class, and the setting up the
   `(define-view-for-table ,@(meta-model::list-tables)))
 
 
-
-;;;; These are some macros over the old presentation system.
-;;;; Considered depreciated, they will eventually be implemented in terms of the new
-;;;; display system, and delegated to backwards-compat-0.2.lisp
-
-(eval-when (:compile-toplevel :load-toplevel :execute)
-  (defun %make-view (object type attributes args)
-   
-    (when attributes
-      (setf args
-           (cons `(:attributes ,attributes) args)))
-    `(mewa::make-presentation
-      ,object
-      :type ,type
-      ,@(when args
-             `(:initargs
-               '(,@ (mapcan #'identity args)))))))
-
-(defmethod make-view (object &rest args &key (type :viewer)
-                     &allow-other-keys )
-  (remf args :type)
-  ;(warn "~A ~A" args `(:type ,type :initargs ,@args))
-  (apply #'make-presentation object `(:type ,type ,@ (when args
-                                                      `(:initargs ,args)))))
-
-(defmacro present-view ((object &optional (type :viewer) (parent 'self))
-                       &body attributes-and-args)
-  (arnesi:with-unique-names (view)
-    `(let ((,view (lol::make-view ,object
-                                :type ,type
-                                ,@(when (car attributes-and-args)
-                                        `(:attributes ',(car attributes-and-args))) 
-                                ,@ (cdr attributes-and-args))))
-      (setf (ucw::parent ,view) ,parent)
-      (lol::present ,view))))
-
-
-(defmacro call-view ((object &optional (type :viewer) (component 'self component-supplied-p))
-                    &body attributes-and-args)  
-  `(ucw:call-component
-    ,component
-    ,(%make-view object type (car attributes-and-args) (cdr attributes-and-args))))
-
-(defmethod slot-view ((self mewa) slot-name)
-  (mewa::find-attribute-slot self slot-name))
-
-(defmethod present-slot-view ((self mewa) slot-name &optional (instance (instance self)))
-  (let ((v (slot-view self slot-name)))
-
-     (if v
-        (present-slot v instance)
-        (<:as-html slot-name))))
-
-
 (defmethod find-slots-of-type (model &key (type 'string)
                              (types '((string)) types-supplied-p))
   "returns a list of slots matching TYPE, or matching any of TYPES"