[Xotcl] please help me understand some code

Gustaf Neumann neumann at wu-wien.ac.at
Fri May 16 18:06:44 CEST 2008


Dear Matthew,

the question is more of an OpenACS question than an XOTcl question.

however, some answers:
 - i was the "someone" who wrote a sample script for you.

 > in the lines:
 >    ::xo::cc set_parameter master 0
 >    ::xo::cc set_parameter content-type $content_type
 > what does the "::xo::cc" mean?

 - ::xo::cc is an the connection context object created by xotcl-core.
 - The connection context object contains per request information
 - The conneciton context ist used as well by the "view" method of
   XoWiki pages to control, whether or not the output should be
   included in a master adp file (with login etc or not). You will
   not like to have this around e.g.  a json code.
  
 > If the object is being created, how do I reference the object? 

i have to assume, that by "object" you refer to an instance of the
class ::xowiki::Object. If you load the prototype page - as described
in my answer in the openacs forum - then an acs_object is
created in the openacs content repository. The entries in the
OpenACS content repository are referenced by name.
When you call e.g. http://..../xowiki/PAGEAME, an
::xowiki::Object with the name PAGENAME residing
in the content folder for the xowiki-instance will be fetched
from the content repository, on this object, the method view
is called, and the ouput is presented to the user.


 > For instance, I would like to set a
 > variable to "content".   How would I do this?

 From your other positing in the OpenACS forum i see
that you want to include the page in some other adp page

you can do this
<include src="/packages/xowiki/lib/view" url="@url@" 
template_file="view-links">

The variable "url" should point to the xowiki page to be included (e.g. 
/xowiki/my_page). 

best regards
-gustaf neumann

PS: it makes sense to concentrate the discussion to one place, e.g. the
OpenACS forums.




More information about the Xotcl mailing list