I started a validate package for object_ids and attributes.
The code is avaiable
here. I'm working on bringing up a 4.6/postgres version of acs so I can produce openacs packages. The current version is only about 100 lines of code so porting should be easy.
Validate
Validate makes ad page contract filters for all acs_object_types and acs_attributes. This allows
ad_page_contract {
} {
user_id:user_id
lastname:person_lastname
}
Future Versions
The current version supports acs 4.2 and Oracle.
It should be easy to add Postgres.
There is one query that uses the Oracle user_tab_columns table to find the field length.
The attribute validattion needs work. It would be nice to add more info to the metadata
as well as have some kind of pluggable filters for new acs_datatypes. The good news is enhancments should be transparent to the user.
Currently valiate is global to the site. It should be subsite aware.
A filter which validates whole objects instead of ids might be nice also.
This would allow
ad_page_contract {
} {
person:array,person
}
This would work similar to the address widget and set the value person(last_name), person(first_names) etc.
The current version may require two database hits to validate an object_id.
Add a parameter to disable the database hits and only valildate for integer.