Forum OpenACS Q&A: Re: files not found in package

Collapse
Posted by Derick Leony on
When you refer to files located in the file system, the paths are relative to the AOLserver homedir parameter. Using absolute paths is usually the best.

As Dave mentioned, having your procs in the tcl directory is the way to go.

Collapse
Posted by Matthew Smith on
But what about class declarations? Is my only option to have all the code declaring the class in the file that uses it? That would seem to hamper reusability...

Could you give an example of what the absolute path might look like?

Collapse
Posted by Derick Leony on
First, a correction: the parameter is "home", AOLserver's home directory.

I'm not sure where would be the best place to store your class declarations but I guess a -proc file in the tcl directory would work well. Check the files in xowiki/tcl, for example the Page class definition in xowoki-procs.tcl.

About absolute paths, something like /home/user/myfile.ext, check the api-doc to find some procs to get the server and package important directories, but you might not need this anyways :)

Collapse
Posted by Stefan Sobernig on
Matthew,


Is my only option to have all the code declaring the class in the file that uses it?

Definitely not, XOTcl object declarations (as Tcl procs) go into tcl/*-procs.tcl files and are provided to all request-serving threads ("connection threads") through the AOLserver blueprinting mechanism. As for the development cycle, stage your code in www/* scripts, once consolidated, move them to *-procs.tcl to have them served for a wider scope.

Btw., may I give you an advise. Try to manage your code in a publicly browsable location, so when posting questions, you may refer to your package structure/ code. this opens many opportunities to help out more effectively.

Collapse
Posted by Matthew Smith on
I have moved the files into the tcl directory and renamred them to end with -proc.tcl. However I am still getting an error:invalid command name "backendrequestclass".
Collapse
Posted by Matthew Smith on
Where in the api doc should I be looking? I looked around but didn't see anything?

Thanks.

Collapse
Posted by Stefan Sobernig on
Matthew


-proc.tcl

Either this is a typo in your posting or you simply got it wrong: it is supposed to be *-proc>s<.tcl, don't forget about the "s".

Again, if you could make your package structure/ code available for browsing, it would be tremendously easier and would save time (at both ends ;)

//s

Collapse
Posted by Matthew Smith on
Sorry, I'm behind a firewall that makes what you suggest impossible.

I did have it wrong, I forgot the s.

Thanks for the help.