I've extended cl-prevalence slightly to support some custom serialization and deserialization of user data types. The attached diff contains a patch that allows users to hook into the serialization protocol at the appropriate places.
Here is an example of how to hook into the protocol. The last two functions (of 3) were added in the diff.
;; Serializer support for persistent objects
(defmethod s-serialization::serialize-xml-internal ((object persistent) stream serialization-state) (declare (ignore serialization-state)) (write-string "<PERSISTENT ID="" stream) (prin1 (oid object) stream) (write-string ""/>" stream))
(defmethod s-serialization::deserialize-xml-new-element-aux ((name (eql :persistent)) attributes) (elephant::controller-recreate-instance *store-controller* (parse-integer (s-serialization::get-attribute-value :id attributes))))
;; Not needed in this app: ;; (defgeneric deserialize-xml-finish-element-aux ((name (eql :persistent)) attributes parent-seed seed) ;; seed)
Regards, Ian
I've extended cl-prevalence slightly to support some custom serialization and deserialization of user data types. The attached diff contains a patch that allows users to hook into the serialization protocol at the appropriate places.
I have applied your patch to my development branch at
Is your branch going to be integrated with the mainline (perhaps you should get commit permissions) or are you likely to maintain a parallel branch that deals with weblocks integration issues?
Ian
On Feb 3, 2009, at 10:25 AM, Leslie P. Polzer wrote:
I've extended cl-prevalence slightly to support some custom serialization and deserialization of user data types. The attached diff contains a patch that allows users to hook into the serialization protocol at the appropriate places.
I have applied your patch to my development branch at
http://bitbucket.org/skypher/cl-prevalence/
cl-prevalence-devel site list cl-prevalence-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-prevalence-devel
cl-prevalence-devel@common-lisp.net