X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=mop.lisp;h=39e58b9b4c49bc4c007ae42d5bdf02539c1309ae;hb=d7f427eeebf7e6404ad2d1ebabbc8ebaa064898c;hp=960195134da2aa579e99cfc055f4be8b70c9d4d3;hpb=cda49a13fa66d935f4d7db644364cc741b9c1c4c;p=hyperobject.git diff --git a/mop.lisp b/mop.lisp index 9601951..39e58b9 100644 --- a/mop.lisp +++ b/mop.lisp @@ -11,7 +11,7 @@ ;;;; in Text, HTML, and XML formats. This includes hyperlinking ;;;; capability and sub-objects. ;;;; -;;;; $Id: mop.lisp,v 1.2 2002/11/29 05:05:29 kevin Exp $ +;;;; $Id: mop.lisp,v 1.4 2002/12/01 21:07:28 kevin Exp $ ;;;; ;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg ;;;; @@ -34,17 +34,22 @@ :documentation "Class description") (version :initarg :version :initform nil :documentation "Version number for class") + (sql-name :initarg :table-name :initform nil :reader sql-name) ;;; The remainder of these fields are calculated one time ;;; in finalize-inheritence. (subobjects :initform nil :documentation "List of fields that contain a list of subobjects objects.") - (references :type list :initform nil :documentation - "List of fields that have references") + (hyperlinks :type list :initform nil :documentation + "List of fields that have hyperlinks") (class-id :type integer :initform nil :documentation "Unique ID for the class") + (create-table-cmd :initform nil :reader create-table-cmd) + (create-index-cmds :initform nil :reader create-index-cmds) + (drop-table-cmd :initform nil :reader drop-table-cmd) + (value-func :initform nil :type function) (xmlvalue-func :initform nil :type function) (fmtstr-text :initform nil :type string) @@ -68,13 +73,13 @@ (print-unreadable-object (obj s :type t :identity t) (format s "~S" (name obj)))) -(defclass reference () +(defclass hyperlink () ((name :type symbol :initform nil :initarg :name :reader name) (lookup :type function :initform nil :initarg :lookup :reader lookup) (link-parameters :type list :initform nil :initarg :link-parameters :reader link-parameters))) -(defmethod print-object ((obj reference) (s stream)) +(defmethod print-object ((obj hyperlink) (s stream)) (print-unreadable-object (obj s :type t :identity t) (format s "~S" (name obj)))) @@ -162,7 +167,7 @@ :sql-type sql-type :print-formatter (slot-value dsd 'print-formatter) :subobject (slot-value dsd 'subobject) - :reference (slot-value dsd 'reference) + :hyperlink (slot-value dsd 'hyperlink) :description (slot-value dsd 'description) ia))) ) @@ -207,6 +212,23 @@ (otherwise ho-type))) + + +(defun ho-type-to-sql-type (sqltype) + (ecase sqltype + (:string + 'string) + (:fixnum + 'fixnum) + (:bigint + 'integer) + (:short-float + 'short-float) + (:long + 'long-float) + (:text + 'string))) + ;;;; Class initialization function (defun process-subobjects (cl) @@ -246,6 +268,7 @@ "Initialize a hyperobject class. Calculates all class slots" (process-subobjects cl) (process-views cl) + (process-sql cl) (process-documentation cl)) @@ -291,8 +314,8 @@ (defun hyperobject-class-subobjects (obj) (slot-value (class-of obj) 'subobjects)) -(defun hyperobject-class-references (obj) - (slot-value (class-of obj) 'references)) +(defun hyperobject-class-hyperlinks (obj) + (slot-value (class-of obj) 'hyperlinks)) (defun hyperobject-class-fields (obj) (class-slots (class-of obj)))