Forum OpenACS Q&A: Prototype tool

Posted by Ken Mayer on

The prototype tool uses an oraclism, user_tab_column, to get some info about column sizes. I cobbled together a postgres view that emulates the "important" columns, so I can use the prototyper to make first pass UI's. Here's the view:

CREATE VIEW user_tab_columns AS
SELECT upper(c.relname) AS table_name, 
  upper(a.attname) AS column_name,
  CASE WHEN (t.typprtlen > 0)
  THEN t.typprtlen
  ELSE (a.atttypmod - 4)
  END AS data_length
FROM pg_class c, pg_attribute a, pg_type t
WHERE (a.attrelid = c.oid) AND (a.atttypid = t.oid) AND (a.attnum >
2: Response to Prototype tool (response to 1)
Posted by Don Baccus on
Excellent!  Is the prototyper working, then?

A view is a great solution, as it avoids the need to modify the actual  scripts.  The datamodels change less frequently, and changes are by nature more centralized, so this approach helps lessen the future maintenance load.

If you've tested the prototyper and think it's really working at this point, I'll add the view to the CVS tree (or you can ask Ben to grant you CVS access if you want).

Lemme know ...

3: Response to Prototype tool (response to 1)
Posted by Don Baccus on
I've commited Ken's view to the CVS tree, and the prototyper seems to work now.  Cool!

It's a handy little tool for rough-and-ready UI's.