r5097: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 12 Jun 2003 11:10:38 +0000 (11:10 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 12 Jun 2003 11:10:38 +0000 (11:10 +0000)
package.lisp
pubmed-src.lisp

index d0c9f2b4ddb5ebcf060084e08ada05f14edd0923..668da3f8b4c470e40c709759392299c3b02cef95 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Jun 2001
 ;;;;
-;;;; $Id: package.lisp,v 1.1 2003/06/06 22:04:05 kevin Exp $
+;;;; $Id: package.lisp,v 1.2 2003/06/12 11:10:38 kevin Exp $
 ;;;;
 ;;;; This file, part of cl-pubmed, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
@@ -26,6 +26,7 @@
    #:pubmed-condition
    #:pubmed-query-error
    #:pubmed-server-error
+   #:pubmed-condition-response
    
    ;; Query functions
    #:pm-query
index a2e832adf321ca31dbb07b257a94a83b3b8ece0d..2977609864b24623c3407f8a5af7731c9d20be4b 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Jun 2001
 ;;;;
-;;;; $Id: pubmed-src.lisp,v 1.1 2003/06/06 22:04:05 kevin Exp $
+;;;; $Id: pubmed-src.lisp,v 1.2 2003/06/12 11:10:38 kevin Exp $
 ;;;;
 ;;;; This file, part of cl-pubmed, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
 (define-condition pubmed-server-error (error pubmed-condition)
   ((response :initarg :response
             :initform nil
-            :reader pubmed-server-error-response))
+            :reader pubmed-condition-response))
   (:report (lambda (c stream)
             (format stream "A PubMed server error occurred.")
-            (awhen (pubmed-server-error-response c)
+            (awhen (pubmed-condition-response c)
                    (format stream " The server response was:~&~S" it)))))
 
 (define-condition pubmed-query-error (error pubmed-condition)
   ((response :initarg :response
             :initform nil
-            :reader pubmed-query-error-response))
+            :reader pubmed-condition-response))
   (:report (lambda (c stream)
             (format stream "A PubMed server error occurred.")
-            (awhen (pubmed-query-error-response c)
+            (awhen (pubmed-condition-response c)
                    (format stream " The server response was:~&~S" it)))))
   
 ;;; Article-Set and Article Classes
           (string-append ref (format nil ":~a" it)))
     ref))
 
-(defmethod print-article-set ((artset pm-article-set) &key (os *standard-output*) (format :text)
-                                                      (complete nil) (print-link t))
+(defmethod print-article-set ((artset pm-article-set)
+                             &key (os *standard-output*) (format :text)
+                             (complete nil) (print-link nil))
   "Display an article set to specified stream in specified format"
   (dotimes (i (articles-count artset))
     (print-article (nth i (articles artset)) :os os :format format 
   artset)
 
 (defmethod print-article ((art pm-article) &key (os *standard-output*)
-                         (format :text) (complete nil) (print-link t))
+                         (format :text) (complete nil) (print-link nil))
   "Display an article"
   (ecase format
     (:text
      (:html
       (let ((has-link (or (article-abstract art) (article-mesh-headings art))))
        (when (and print-link has-link)
-         (format os "<a href=\"~a?key=~a\">" (make-url "print-article") (article-pmid art)))
-       (format os "<div class=\"article-title\">~a</div>~%" (article-title art))
+         (format os "<a href=\"~A\">" (funcall print-link
+                                               (article-pmid art))))
+       (format os "<div class=\"article-title\">~a</div>~%"
+               (article-title art))
        (when (and print-link has-link)
          (format os "</a>"))
        (format os "<div class=\"article-authors\">~a</div>~%"