;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-WISE; Base: 10 -*- ;;; This software is Copyright (c) Sunil Mishra, 2009. ;;; Sunil Mishra grants you the rights to distribute ;;; and use this software as governed by the terms ;;; of the Lisp Lesser GNU Public License ;;; (http://opensource.franz.com/preamble.html), ;;; known as the LLGPL. ;;; $Id: wiki-extns.lisp 151 2009-04-13 18:23:09Z smishra $ (in-package "CL-WISE") (defgeneric wise (wise) (:documentation "Request handler for CL-WISE.") (:method ((wise wise-wiki)) (wiki:wiki wise))) (defmethod webapp:get-url-dispatchers append ((server wise-wiki)) (list (tbnl:create-folder-dispatcher-and-handler "/_static/" (merge-pathnames "_static/" *wise-software-directory*)))) (defmethod webapp:get-default-url-handler ((server wise-wiki)) (lambda () (wise server))) (defmethod webapp:configure-application ((server wise-wiki) class-override-p) (declare (ignore class-override-p)) (call-next-method)) (defun make-wise (class data-directory) "Instantiate a wise server, without starting the server." (make-instance class :software-directory *wise-software-directory* :module-name "wise" :directory data-directory :data-directory data-directory)) (defun start (&key (class 'wise-wiki class-supplied-p) (data-directory *wise-software-directory*)) "Startup function for the semantic wiki." (setq *wise-server* (make-wise class data-directory)) (webapp:configure-application *wise-server* (not class-supplied-p)) (webapp:start-http-server *wise-server*) *wise-server*) ;;; EOF