Forum OpenACS Q&A: Re: calling an xowiki object proc

Collapse
Posted by Stefan Sobernig on
MAtthew,

Right now I am trying to incorporate it into a tcl/adp page in my package.

You are starting to confuse matters. The code as provided by Gustaf Neumann cannot seamlessly be incorporated into your package code or be treated as bare XOTcl objects. ::xowiki::Object (which has nothing to do with ::xotcl::Object besides being an instance of it) is a XOWiki-specific idiom. The code is meant to be used as XOWiki prototype page, remember? This somehow is proven by the "-title" and "-text" flags, isn't it?

It is supposed to be put it into a script, sourced from there and then handled further (from XOWiki internals).

set content [$reference content]

As I said, this can't work, why? Simply because there is NO method "content" defined or resolvable for the ::xowiki::Object. Why? Well, because you assume that "proc content ..." in the value of parameter "-text" is meant to be a per-object method on the ::xowiki::Object instance. But it isn't! The value of -text which is a perfect Tcl script is not evaluated before being persisted to the database and then rendered as a wiki page _from XOWiki_ (besides other details).

Again, I would really stick with the already proposed techniques. Stick to the extensions mechansims documented (Guatemala talk), read existing code _in context_, and consider the adp integration as proposed by Gustaf Neumann. You will be fine (from what I know from your task) ...

Collapse
Posted by Matthew Smith on
Thank you for the guidance, Stefan.