;;;; ** Initialisation
;;;; 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)
"
(when attributes
(setf args
(cons `(:attributes ,attributes) args)))
- `(mewa:make-presentation
+ `(mewa::make-presentation
,object
:type ,type
,@(when args
`(:initargs
'(,@ (mapcan #'identity args)))))))
-(defmethod make-view (object &rest args &key (type :viewer) (attributes nil)
+(defmethod make-view (object &rest args &key (type :viewer)
&allow-other-keys )
- (warn "~A ~A ~A" attributes type object)
- (remf args :type )
- (remf args :attributes)
- (apply #'make-presentation object (cddr (%make-view object type attributes args))))
+ (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
+ `(let ((,view (lol::make-view ,object
:type ,type
- :attributes ,(car attributes-and-args)
+ ,@(when (car attributes-and-args)
+ `(:attributes ',(car attributes-and-args)))
,@ (cdr attributes-and-args))))
(setf (ucw::parent ,view) ,parent)
- (lol:present ,view))))
+ (lol::present ,view))))
(defmacro call-view ((object &optional (type :viewer) (component 'self component-supplied-p))
(defmethod word-search (class-name slots (s string) &rest args)
- (apply #'word-search class-name slots
- (split-sequence:split-sequence #\Space s) args))
+ (apply #'word-search class-name slots (list s) args))
(defmethod word-search-where (class-name slots search-terms &key (format-string "%~a%"))
(sql-or