Forum OpenACS Development: Re: creating a new xowiki class

Collapse
Posted by Stefan Sobernig on
Alvaro!

- If I restart the server, it loads my procs file first and throws an error because it needs some other definitions on the next files (not a big deal).

The OpenACS package initialisation procedure is rather hostile to the kind of package refinement you are probing; due to its alphanumerical sorting of packages/files to be evaluated upon start-up.

Place the following in the first *-procs.tcl in your xowiki-derived package:

::xo::db::require package xowiki

this will source xowiki before your package, so everything needed is in place ...


- To test my new app right now I changed the index.vuh so instead of call the initialize from ::xowiki::Package it calls ::myapp::Package but I need to leave it independent from the rest of the pages, I tried using another .vuh file inside another folder or using a .tcl file but it always says that "page" is not available. (the xowiki message if I want to create that page)

this one i don't quite understand (that is, what you try to achieve). would you mind posting your sources somewhere, preferably the entire package (public scm, archive), so we can have a look. it's a thousand times easier to comment on code than to comment on comments on invisible code ...

//stefan

Collapse
Posted by Alvaro Rodriguez on
Thanks for the help Stefan,

I know the second part sounds confusing but is actually not that confusing.

The xowiki's index.vuh does this:

::xowiki::Package initialize -ad_doc {
} ...

and I changed it to do this:

::myapp::Package initialize -ad_doc {
} ...

So now when I call a xowiki/?edit-new=1 it actually initializes myapp and it works, but I can't leave the index.vuh file like this.

My question is how could I set a file to work the way I want, should I use a .vuh. I tried using a tcl file with that code but when it founds the part of the code:

::myapp::Package initialize -ad_doc {
} ...

it ignores the file.

Collapse
Posted by Alvaro Rodriguez on
I checked the s5 package and noticed that I wasn't doing things right, my procs file was on the /xowiki directory and it should be in /myapp directory along with my new index.vuh
Collapse
Posted by Gustaf Neumann on
right... as described in the tutorial section... :)

everything ok by now?

Collapse
Posted by Alvaro Rodriguez on
I read the tutorial but the first time I missed that.

I haven't tried that yet, I need to do a little extra work first but I'll check the s5 package to guide my work. If I need any help I'll let you know...

Thanks for all the help,

Collapse
Posted by Alvaro Rodriguez on
Everything worked out well, but for some reason I keep getting the same error about the loading packages.

I placed the line "::xo::db::require package xowiki" at the beginning of myapp-procs.tcl (the only procs file), I did it exactly the same way as the s5 package but it keeps failing.

Is there anything else I need to check for this ...