From aef3b2470480ecc61a8b0b0fbd878de1d5d73ba3 Mon Sep 17 00:00:00 2001 From: drewc Date: Thu, 16 Jun 2005 21:02:00 -0700 Subject: [PATCH] added the mewa-presentation-search based on presentation-search darcs-hash:20050617040200-39164-427ad9db50ac3ef6f954924a84cd922acd64656a.gz --- src/mewa/presentations.lisp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/mewa/presentations.lisp b/src/mewa/presentations.lisp index 0ec34ee..dd68185 100644 --- a/src/mewa/presentations.lisp +++ b/src/mewa/presentations.lisp @@ -67,3 +67,27 @@ (defmethod get-all-instances ((self mewa-list-presentation)) (instances self)) + + +;;; searching + +(defcomponent mewa-presentation-search (ucw::presentation-search) + ((display-results-p :accessor display-results-p :initarg :display-results-p :initform nil))) + +(defmethod ok ((self mewa-presentation-search) &optional arg) + (declare (ignore arg)) + (setf (display-results-p self) t)) + +(defmethod get-all-instances ((self mewa-presentation-search)) + (clsql:select (class-name (class-of (instance (ucw::search-presentation self)))) :flatp t)) + +(defmethod render-on ((res response) (self mewa-presentation-search)) + (ucw::render-criteria res self) + (when (display-results-p self) + (let ((listing (ucw::list-presentation self))) + (setf (instances listing ) (ucw::valid-instances self) + (slot-value listing 'ucw::calling-component) (slot-value self 'ucw::calling-component) + (slot-value listing 'ucw::place) (slot-value self 'ucw::place) + (slot-value listing 'ucw::continuation) (slot-value self 'ucw::continuation)) + + (render-on res listing)))) \ No newline at end of file -- 2.20.1