fixed shared list structure bug for default presentation contexts.
[clinton/lisp-on-lines.git] / src / mewa.lisp
index cf6ea00..dc8b278 100644 (file)
@@ -1,4 +1,4 @@
-(in-package :mewa)
+(in-package :lisp-on-lines)
  
 (defparameter *default-type* :ucw)
 
  
 (defparameter *default-type* :ucw)
 
@@ -98,7 +98,7 @@ attributes is an alist keyed on the attribute name."
 (defun find-presentation-attributes (model)
   (remove nil (mapcar #'(lambda (att)
              (when (keywordp (car att))
 (defun find-presentation-attributes (model)
   (remove nil (mapcar #'(lambda (att)
              (when (keywordp (car att))
-               att))
+               (copy-list att) ))
          (cdr (find-class-attributes model)))))
 
 
          (cdr (find-class-attributes model)))))
 
 
@@ -318,7 +318,9 @@ attributes is an alist keyed on the attribute name."
 
 
 (defmethod make-presentation ((object t) &key (type :viewer) (initargs nil))
 
 
 (defmethod make-presentation ((object t) &key (type :viewer) (initargs nil))
+  
   (let* ((p (make-instance 'mewa-object-presentation))
   (let* ((p (make-instance 'mewa-object-presentation))
+        
         (a (progn (setf (slot-value p 'instance) object)
                   (initialize-slots p) 
                   (assoc type (find-all-attributes p))))
         (a (progn (setf (slot-value p 'instance) object)
                   (initialize-slots p) 
                   (assoc type (find-all-attributes p))))
@@ -330,13 +332,14 @@ attributes is an alist keyed on the attribute name."
                                          (symbol-name type)
                                          type))
                   (plist-union initargs (cddr a)))))
                                          (symbol-name type)
                                          type))
                   (plist-union initargs (cddr a)))))
+    
+    
     (setf (slot-value i 'instance) object)
     (initialize-slots i)
     (setf (slot-value i 'initializedp) t)
     i))
 
     (setf (slot-value i 'instance) object)
     (initialize-slots i)
     (setf (slot-value i 'initializedp) t)
     i))
 
-(defmethod make-presentation ((list list) &key (type :listing) (initargs nil))
-
+(defmethod make-presentation ((list list) &key (type :listing) (initargs nil))  
   (let ((args (append
               `(:type ,type) 
               `(:initargs 
   (let ((args (append
               `(:type ,type) 
               `(:initargs 
@@ -379,7 +382,7 @@ attributes is an alist keyed on the attribute name."
 
 (defaction cancel-save-instance ((self mewa))
   (cond  
 
 (defaction cancel-save-instance ((self mewa))
   (cond  
-    ((instance-is-stored-p (instance self))
+    ((meta-model::persistentp (instance self))
       (meta-model::update-instance-from-records (instance self))
       (answer self))
     (t (answer nil))))
       (meta-model::update-instance-from-records (instance self))
       (answer self))
     (t (answer nil))))