[Split cms and libraries from main project
clinton@unknownlamer.org**20070507162429] {
adddir ./cms-src
addfile ./cms-src/cms-pkg.lisp
addfile ./cms-src/cms.lisp
addfile ./cms-src/component-manager.lisp
addfile ./cms-src/tests.lisp
addfile ./cms-src/users.lisp
addfile ./cms.asd
adddir ./libraries
adddir ./libraries/acl
addfile ./libraries/acl/acl.asd
adddir ./libraries/acl/src
addfile ./libraries/acl/src/acl-pkg.lisp
addfile ./libraries/acl/src/acl.lisp
addfile ./libraries/acl/src/tests.lisp
adddir ./libraries/notifications
addfile ./libraries/notifications/notifications.asd
adddir ./libraries/notifications/src
addfile ./libraries/notifications/src/notifications-pkg.lisp
addfile ./libraries/notifications/src/notifications.lisp
addfile ./libraries/notifications/src/tests.lisp
hunk ./cms-src/cms-pkg.lisp 1
-
+(defpackage :org.unknownlamer.cms.cms
+  (:use :common-lisp)
+  (:nicknames :cms))
+
+(defpackage u:org.unknownlamer.cms.users
+  (:use :common-lisp)
+  (:nicknames :cms-users))
+
+(defpackage :org.unknownlamer.cms.component-manager
+  (:use :common-lisp)
+  (:nicknames :cms-cm))
+
+(defpackage :org.unknownlamer.cms.tests
+  (:use :common-lisp :fiveam)
+  (:nicknames :cms-tests))
hunk ./cms-src/cms.lisp 1
-
+(in-package :org.unknownlamer.notifications.notifications)
hunk ./cms-src/component-manager.lisp 1
-
+(in-package :org.unknownlamer.cms.component-manager)
+
+(defvar *cms* nil
+  "Default cms")
+
+(defgeneric register-managed-component (component &optional cms)
+  (:documentation "Makes component available in the component manager"))
hunk ./cms-src/tests.lisp 1
-
+(in-package :org.unknownlamer.cms.tests)
hunk ./cms-src/users.lisp 1
-
+(in-package :org.unknownlamer.cms.users)
+
+(defclass cms-user ()
+  ((user-name :documentation "Short username used for logins and
+  uniquely identifying the user throughout the system")
+   (password :documentation "Hashed password")))
hunk ./cms.asd 1
-
+(defpackage :org.unknownlamer.cms.system
+  (:use :common-lisp :asdf))
+
+(in-package :org.unknownlamer.cms.system)
+
+(defsystem "cms"
+  :description "Generic CMS Library"
+  :author "Clinton Ebadi"
+  :components ((:module :src
+			:components
+			((:file "cms-pkg")
+			 (:file "cms")
+			 (:file "users")
+			 (:file "component-manager")
+			 (:file "tests"))
+			:serial t)) ; todo: when deps stop being serial...
+  :depends-on (:fiveam :cl-utilities))
hunk ./libraries/acl/acl.asd 1
-
+(defpackage :org.unknownlamer.acl.system
+  (:use :common-lisp :asdf))
+
+(in-package :org.unknownlamer.acl.system)
+
+(defsystem "acl"
+  :description "Access Control List Library"
+  :author "Clinton Ebadi"
+  :components ((:module :src
+			:components
+			((:file "acl-pkg")
+			 (:file "acl")
+			 (:file "tests"))
+			:serial t)) ; todo: when deps stop being serial...
+  :depends-on (:fiveam :cl-utilities))
hunk ./libraries/acl/src/acl-pkg.lisp 1
-
+(defpackage :org.unknownlamer.acl.acl
+  (:use :common-lisp)
+  (:nicknames :acl))
+
+(defpackage :org.unknownlamer.acl.tests
+  (:use :common-lisp :fiveam)
+  (:nicknames :acl-tests))
hunk ./libraries/acl/src/acl.lisp 1
-
+(in-package :org.unknownlamer.acl.acl)
+
+;;; Access Groups
+(defclass acl-listable ()
+  ()
+  (:documentation "Superclass of all items able to be placed onto an acl"))
+
+(defclass user (acl-listable)
+  ((groups :documentation "Groups in which the user is a member"))
+  (:documentation "ACL User"))
+
+;; DESIGN: should this be or contain a cl-container?
+(defclass access-group (user)
+  ((members :documentation "Members of the access group"))
+  (:documentation "Group of acl-listable items that is itself
+  listable on an acl"))
+
+;;; Permissions
+(defclass standard-permission-class (standard-class)
+  ()
+  (:documentation "Permission metaclass"))
+
+(defclass permission ()
+  ((negative-p :documentation "Negative permission flag. If true
+  then the permission is inverted (e.g. negative read = disallow
+  read)"))
+  (:documentation "Superclass of all permissions")
+  (:metaclass standard-permission-class))
+
+(defmacro defpermission (permission-name)
+  "Define a permission with name `permission-name'"
+  `(defclass ,permission-name (permission)
+     ()
+     (:metaclass standard-permission-class)))
+
+(defgeneric get-permission (name)
+  (:documentation "Return the permission class for permission `name'"))
+
+(defgeneric has-permission-p (user permission acl)
+  (:documentation "Determine whether `user' has `permission' in `acl'"))
+
+;;; Access Lists
+(defclass acl-entry ()
+  ((item :documentation "ACL Entry (User/Group)")
+   (permissions :documentation "List of permissions item has"))
+  (:documentation "ACL Entry; Associates a user and a set of permissions"))
+
+;; DESIGN: should this be or contain a cl-container?
+(defclass acl ()
+  ((valid-permissions :documentation "List of valid permissions
+  classes for the ACL")
+   (entries :documentation "ACL Entries"))
+  (:documentation "Access Control List Container"))
+
+(defgeneric add-entry (item permissions acl)
+  (:documentation "Adds item to acl with listed permissions"))
+
+(defgeneric remove-entry! (item acl)
+  (:documentation "Remove item from acl"))
hunk ./libraries/acl/src/tests.lisp 1
-
+(in-package :org.unknownlamer.org.acl.tests)
hunk ./libraries/notifications/notifications.asd 1
-
+(defpackage :org.unknownlamer.notifications.system
+  (:use :common-lisp :asdf))
+
+(in-package :org.unknownlamer.notifications.system)
+
+(defsystem "notifications"
+  :description "Generic Notifications Library"
+  :author "Clinton Ebadi"
+  :components ((:module :src
+			:components
+			((:file "notifications-pkg")
+			 (:file "notifications")
+			 (:file "tests"))
+			:serial t)) ; todo: when deps stop being serial...
+  :depends-on (:fiveam :cl-utilities))
hunk ./libraries/notifications/src/notifications-pkg.lisp 1
-
+(defpackage :org.unknownlamer.notifications.notifications
+  (:use :common-lisp)
+  (:nicknames :notifications))
+
+(defpackage :org.unknownlamer.notifications.tests
+  (:use :common-lisp :fiveam)
+  (:nicknames :notifications-tests))
hunk ./libraries/notifications/src/notifications.lisp 1
-
+(in-package :org.unknownlamer.notifications.notifications)
+
+;;; Event Metaclass
+
+(defclass standard-event-class (standard-class)
+  ((observers :documentation "Collection of closures to notify
+  when event is triggered"))
+  (:documentation "Event metaclass"))
+
+;; Protocol
+
+(defgeneric register-observer (event-type closure)
+  (:documentation "Register a closure to be run when an event of
+  type `event-type' is triggered. `closure' must take a single
+  argument which is the actual event object"))
+
+(defgeneric unregister-observer (event-type closure)
+  (:documentation "Cease to run `closure' when `event-type' is
+  triggered. The first object that is eq `closure' will be
+  removed."))
+
+;;; Event Class
+
+(defclass event ()
+  ()
+  (:documentation "Superclass for all events"))
+
+;; Protocol
+
+(defgeneric trigger-event (event-type &key &allow-other-keys &rest initargs)
+  (:documentation "Triggers an event of type `event-type' and
+  passes all keyword arguments to make-instance"))
hunk ./libraries/notifications/src/tests.lisp 1
-
+(in-package :org.unknownlamer.notifications.tests)
}