;;; -*- mode: Lisp; Syntax: Common-Lisp; -*- ;;; ;;; Copyright (c) 2009 by the authors. ;;; ;;; See LICENCE for details. (in-package :hu.dwim.blog) ;;;;;; ;;; Application (def (class* e) blog-application (application-with-persistent-login-support application-with-perec-support application-with-home-package application-with-dojo-support) ()) (def (special-variable e) *blog-application* (make-instance 'blog-application :database *blog-database*)) (def method authorize-operation ((application blog-application) form) (blog-authorization form)) (def method iterate-possible-authentication-instruments ((application blog-application) identifier visitor) (bind ((users (select-similar-instances blog-user :user-name identifier))) (dolist (user users) (foreach visitor (authentication-instruments-of user))))) ;;;;;; ;;; Server (def (special-variable e) *blog-server* (make-instance 'broker-based-server :host +any-host+ :port +default-http-server-port+ :brokers (list* *blog-application* (make-default-broker-list)))) (def localization-loader-callback blog-localization-loader :hu.dwim.blog "localization/") ;;;;;; ;;; Production (def function executable-toplevel () "The toplevel function that is called when the dwim Server is started from the command line. For development use (asdf:develop-system :hu.dwim.blog) instead." (with-standard-toplevel-restarts (bind ((options (append (list +help-command-line-option+) (list +quiet-command-line-option+) (copy-command-line-options +database-command-line-options+ :database-port hu.dwim.rdbms.postgresql::+default-postgresql-database-server-port+ :database-name +default-database-name+ :database-user-name +default-database-user-name+ :database-password +default-database-password+) +generic-command-line-options+)) (arguments (parse-command-line-arguments options))) (process-help-command-line-argument options arguments) (process-quiet-command-line-argument arguments) (blog.debug "Parsed command line arguments are: ~S" arguments) (hu.dwim.meta-model::run-production-server arguments :hu.dwim.blog *blog-server* *blog-application* :database *blog-database*)) +process-return-code/no-error+))