Index: TODO =================================================================== diff -u -rbc85b3848186ff8269496f53c45255a11c556f53 -r8b9b0b97f0661bdef9c30e4c574c0bea18d9993c --- TODO (.../TODO) (revision bc85b3848186ff8269496f53c45255a11c556f53) +++ TODO (.../TODO) (revision 8b9b0b97f0661bdef9c30e4c574c0bea18d9993c) @@ -2227,6 +2227,9 @@ - removed parameter option "slotobj=" in toParameterSyntax - renamed to [from|to]parameterSyntax to [from|to]parameterSpec +- serializer.tcl: reactivated methodSerialize + (used in api-browser of OpenACS) + TODO: - object parameter type forward: - regression test Index: library/serialize/serializer.tcl =================================================================== diff -u -rc2e5b33d1823fb862c04ef5f62d230afe669be02 -r8b9b0b97f0661bdef9c30e4c574c0bea18d9993c --- library/serialize/serializer.tcl (.../serializer.tcl) (revision c2e5b33d1823fb862c04ef5f62d230afe669be02) +++ library/serialize/serializer.tcl (.../serializer.tcl) (revision 8b9b0b97f0661bdef9c30e4c574c0bea18d9993c) @@ -438,10 +438,16 @@ return $result } - :class-object method methodSerialize {object method prefix} { + :public class-object method methodSerialize {object method prefix} { set s [:new -childof [::nsf::current object] -volatile] - #$s volatile - concat $object [$s method-serialize $object $method $prefix] + foreach oss [ObjectSystemSerializer info instances] { + if {[$oss responsibleSerializer $object]} { + set result [$oss serializeExportedMethod $object $prefix $method] + break + } + } + #concat $object [$s method-serialize $object $method $prefix] + return $result } :public class-object method deepSerialize {-ignoreVarsRE -ignore -map args} { @@ -512,6 +518,10 @@ # # Handle association between objects and responsible serializers # + :public method responsibleSerializer {object} { + return [::nsf::dispatch $object ::nsf::methods::object::info::hastype ${:rootClass}] + } + :public method registerSerializer {s instances} { # Communicate responsibility to serializer object $s foreach i $instances { @@ -727,7 +737,7 @@ expr {[$object info method type $name] ne ""} } - :method serializeExportedMethod {object kind name} { + :public method serializeExportedMethod {object kind name} { # todo: object modifier is missing return [:method-serialize $object $name ""] } @@ -854,9 +864,13 @@ } } - :method serializeExportedMethod {object kind name} { + :public method serializeExportedMethod {object kind name} { set code "" switch $kind { + "" - inst { + # legacy; kind is prefix + set code [:method-serialize $object $name $kind]\n + } proc - instproc { if {[$object info ${kind}s $name] ne ""} { set prefix [expr {$kind eq "proc" ? "" : "inst"}]