Forum OpenACS Development: Re: Running a Tcl script at package install time

Collapse
Posted by Mark Aufflick on
Right now all I want to do is to create some group types and add some parameters to them, although I can imagine that this would be handy elsewhere.

One downside to my idea is that any packages that you depend on need to be "reloaded" if they were installed at the same time as you (either that or insist on a resart before you are installed).

WRT creating group types, the source for group_type::new seems to manually create constraints as well as the various pl/pgsql and table that are associated with each group type. Additionally there don't seem to be any pl/pgsql functions with group_type in their name...

package_name_post_instantiation is cool though - I didn't know that mechanism existed - but it doesn't hel in this case since the process must only be run once, and the package will be installed multiple times.

Collapse
Posted by Tilmann Singer on
Ok, now that I actually looked in the code I see that group_type::new is a bit more complicated than just calling one plsql function.

You could try calling it with -execute_p f and see if the resulting plsql code can be used as a basis to build your create script.