 (defn -isModifiable [this] false)
 
 (defn -getVariants [this]
-  [(Variant. MediaType/TEXT_HTML)])
+  [(Variant. MediaType/TEXT_HTML) (Variant. MediaType/APPLICATION_ATOM_XML)])
 
 (defn -represent [this variant]
   (try


;;; PAGE NUMBERING

(def *page-size* 10)

(def *window-size* 5)

(defn page-ref [ref number]
  (let [newref (Reference. ref)
        query (.getQueryAsForm newref)]
    (.set query "page" (str number) true)
    (.setQuery newref (.encode query))
    newref))

(defn pagination-html [ref current total-hits]
  (let [last-page (int (Math/ceil (/ total-hits (float *page-size*))))
        window-start (if (< (- current *window-size*) 1)
                       1 (- current *window-size*))
        window-end (if (> (+ current *window-size*) last-page)
                     last-page (+ current *window-size*))]
    (with-out-str
      (print "<div class=\"pagination\"><ul>")
      (print "<li>Pages:</li>")
      (if (= current 1)
        (print "<li class=\"disablepage\">&#171; previous</li>")
        (printf "<li class=\"prevpage\"><a href=\"%s\">&#171; previous</a></li>"
                (str (page-ref ref (dec current)))))
      (when (not= window-start 1)
        (printf "<li><a href=\"%s\">1</a></li>" (str (page-ref ref 1)))
        (print "<li>...</li>"))
      (doseq [n (range window-start (inc window-end))]
        (if (= n current)
          (printf "<li class=\"currentpage\">%d</li>" n)
          (printf "<li><a href=\"%s\">%d</a></li>" (str (page-ref ref n)) n)))
      (when (not= window-end last-page)
        (print "<li>...</li>")
        (printf "<li><a href=\"%s\">%d</a></li>"
                (str (page-ref ref last-page)) last-page))
      (if (= current last-page)
        (print "<li class=\"disablepage\">next &#187;</li>")
        (printf "<li class=\"prevpage\"><a href=\"%s\">next &#187;</a></li>"
                (str (page-ref ref (inc current)))))
      (print "</ul></div>"))))

;;; RENDERING RESULTS


                   (print "</pre>"))
                 (.getMessage (stacktrace/root-cause (:exception data))))))

(defn render-exception MediaType/TEXT_HTML [this variant data]
  (StringRepresentation.
   (html-exception data)
   MediaType/TEXT_HTML
