The idea is you can create acs_object_types with a GUI interface then write out the definition in either TCL or plsql. The TCL interface is very handy because it's database independent and it creates all the acs_object_type metadata for free. The form and list code build the data structures for ad_form and template:list from the metadata. For example to create a form for an object:
ad_form -name object_type -mode $form_mode \
-form [object_type::ad_form -form -object_type $object_type] \
-select_query [object_type::ad_form -select_query -object_type $object_type] \
-edit_data [object_type::ad_form -edit_data -object_type $object_type]
or
<include src="/packages/object-types/lib/form" object_type="@object_type@>
or for a list
template::list::create \
-name attributes \
-multirow attributes \
-elements [object_type::list -elements -object_type acs_attribute] \
-filters {
object_type {}
}
The code special cases acs_object_type and acs_attribute to make them appear as acs_object_types even though they are not. This allows the GUI to be built with the form generating code.
I built something similar for my previous project but I was not suitable for general release. The goal of this package is to build on top of the existing datamodel and templating system so it can be useful to a broad audience.
TODO:
- Implement enough of the ad_form interface to create and save any object_type
- Allow objects to contain other objects. For example a contact could be a person and an address object.
- Port to Postgres
- Allow selecting of attributes to display
- Make acs_attributes real objects and build permissions into the form builder
See here for a sample. The TCL Object Def link will generate PL/SQL from a TCL list. The other links show the beginning of an object_type editor and the form builder. Saves have been disabled so clicking around should be harmless. I'll be hacking on the code throughout the day so you might see a request error or two.
comments?
Request notifications