Forum OpenACS Development: Adding to acs_datatypes and cleaning up acs_attributes.

The templating system wants datatype currency and knows how to validate url and email as well so I would like to change money to currency, and add email and url.

All this matters since the automatic form generation from cms and elsewhere want to take the datatype of the attribute and use that for the template::data::validate call. I think it should be pretty easy to get automatic form generation for content working but want to clean up the mismatches between acs_attributes, templating, and cms.

Anyone have any objections?

Anyway, here is what is currently defined:

$ select * from acs_datatypes
DATATYPE					   MAX_N_VALUES
-------------------------------------------------- ------------
string
boolean 						      1
number
integer 						      1
money
date
timestamp
time_of_day
enumeration
text
keyword 						      1
and these are the ones that are actually used:
$ select datatype, count(*) from acs_attributes group by datatype;
DATATYPE					     COUNT(*)
-------------------------------------------------- ----------
boolean 						   16
date							    6
integer 						  198
keyword 						    4
number							    7
string							  304
text							   40
timestamp						    5
Here are the available validation types:
template::data::validate::boolean
template::data::validate::currency
template::data::validate::date
template::data::validate::email
template::data::validate::file
template::data::validate::filename
template::data::validate::integer
template::data::validate::keyword
template::data::validate::search
template::data::validate::string
template::data::validate::text
template::data::validate::url
Here are the form widgets cms knows about:
$ select * from cm_form_widgets;

WIDGET
--------------------------------------------------------------------------------
checkbox
date
multiselect
radio
search
select
text
textarea
And here are the ones templating knows (more or less):
template::widget::ampmFragment
template::widget::button
template::widget::checkbox
template::widget::comment
template::widget::currency
template::widget::date
template::widget::dateFragment
template::widget::file
template::widget::hidden
template::widget::inform
template::widget::input
template::widget::menu
template::widget::monthFragment
template::widget::numericRange
template::widget::multiselect
template::widget::password
template::widget::radio
template::widget::search
template::widget::select
template::widget::submit
template::widget::text
template::widget::textarea
Collapse
Posted by Don Baccus on
It would be nice if each template::data::validate proc were mirrored with a template::widget proc, even if that proc just calls template::widget::text.

When this is true, in ad_form you can just say "my_bool:boolean" rather than "my_bool:boolean(text)"

The inverse is true, too, it would be nice to be able to just say "my_checkbox:checkbox" rather than "my_checkbox:text(checkbox)".  You're forced to do that now because there's no validation proc named "checkbox".

I also have a couple of widgets/datatypes from Greenpeace work I'd like to get in there, in particular better button stuff.

Are you looking at 4.6.2 for this stuff?

Collapse
Posted by Jeff Davis on
adding the url and email types and changing money to currency I was thinking of doing now. It does not seem like it would impact anything.

Getting the automatic form generation that exists in the attribute:: procs and content::item_new_form working properly would be 4.6.2 (and the current attribute data needs to be cleaned up some as well).