[Xotcl] Scripted Value Constraints

Gustaf Neumann neumann at wu.ac.at
Mon Feb 19 12:35:42 CET 2024


Hi Maksym,

The blueprint of NaviServer does not contain the system namespaces (tcl, 
nx, xotcl),
unless exporting of particular methods is explicitly requested from the 
serializer class
via "::Serializer exportMethods { ... }".

Check out

https://github.com/openacs/xotcl-core/blob/oacs-5-10/tcl/01-debug-procs.tcl

and search e.g. for "type=range"

All the best

-g

On 18.02.24 20:40, Maksym Zinchenko wrote:
> Hello, I have an issue I can't understand. On my naviserver I have a global
> tcl module, inside init.tcl I have defined a scripted value checker for
> uuid:
>
> ::nx::Slot method type=uuid {name value} {
>> set pattern
>> {^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$}
>> if {![regexp $pattern $value]} {
>> error "Value '$value' of parameter $name is not UUID"
>> }
>> return $value
>> }
>
> I have a class definition in like:
>
> ::nx::Class create eFaturaClass -superclass ::oodz::baseObj {
>> :property {company:object,required}
>> :property {uuid:uuid,required}
>> :property {doc_type:integer,required}
>>
>> :method init {} {
>> ....
>>
> }
>> ....
>> }
>>
> But when im trying to create an object it gives me an error like:
>
> ::eFaturaClass create ef -company ::companyObj -doc_type 1 -uuid  0dbd469a-
>> 6669-435e-8a11-621f1b988479
>>
>> method 'type=uuid' unknown for slot ::eFaturaClass::slot::uuid; valid are: {definition destroy getParameterSpec getPropertyDefinitionOptions onError parameter reconfigure setCheckedInstVar value=add value=delete value=exists value=get v
>> alue=set value=unset}
>>
>>
> It looks like I'm doing something wrong, thank you.
> _______________________________________________
> Xotcl mailing list
> Xotcl at alice.wu.ac.at
> http://alice.wu.ac.at/mailman/listinfo/xotcl


More information about the Xotcl mailing list