I propose creating an acs_object_type for each package type as a subtype of apm_package.
This would allow for a hierarchy of package types. The most common example we might think of is dotlrn. The dotlrn package could be a subtype of the subsite package. This would allow an easier way to determine if a package takes on the role of a subsite type package and it could greatly simplify all the code that has to be special-cased to determine if dotlrn is installed.
This would also allow simplification of the case when a new package is created to customize the user interface of another package. For example, many people would like to customize the forums package, to change the style of user interface. If we had a custom-forums packge type that was subtyped from forums, we could have a simple and consistent mechnism to defer pages to the parent package type for handling. This would allow much easier reuse of pages and would make it very simple for local customizations to be handled safely without worrying about accidentally adding custom code back into OpenACS.
The immediate goal of this work is to make the dotlrn package a subtype of the acs-subsite package. I have done preliminary work to turn dotlrn communities (groups) into application groups of the dotlrn package also. This should make it easier to do an upgrade to an existing dotlrn install that will support subsite based dotlrn.
Previous work includes the http://openacs.org/api-doc/proc-view?proc=subsite%3a%3apackage%5fkeys subsite::package_keys procedure. This basically is a hard coded list of packages that fufuill the subsite role. Defining children of a subsite object_type would allow greatly flexibility and use the existing features of the toolkit.
Steps to implement
1) Make a new object_type for existing package_types when a new package type is created. Default is subtype of apm_package.
2) Add parameter to package create code to specify package supertype
3) Add tag to info file supertype which is optional and will default to apm_package. This tag will have the same behavior as requires element so tcl libraries are loaded of the supertype.
4) Add attribute to apm_package_types for inherit_ui_p to specify if URL resolution will go up the package type hierarchy.
5) Update apm_paramaters to support setting parameters for the supertype package parameters up the package type hierarchy. Allow subtyped packages to override the default value of an inherited parameter.
6) Fix package loading to load tcl libraries in package dependency order.
See previous discussion
http://openacs.org/xowiki/package-object-types
Request notifications