Forum OpenACS Q&A: Re: Extensibility in OpenACS - Four Architecture Options

Frank, since the original posting here, have you made any headway on this topic?

Just curious as to any insights you may have gained since then.

The same goes for anyone that has either posted or is interested in this topic.

Collapse
Posted by Tom Jackson on
I think ad_form is still the way to go if you want to maintain something familiar with most developers here. I have never used ad_form for several reasons, but it works and there are lots of examples of how to use it. That is important, and so is the ability to get help here if you have trouble.

I've tried a different approach than ad_form. I use the .tcl page just to setup variables/multirows. The template has all the HTML. One reason is that I find it difficult to handle complex cases. I also don't like to tie together the SELECTion and CREATE/UPDATE/DELETE functions, because I might want to do multiple of these at one time, and even handle multiple objects at one time.

Here are some examples of how I have approached the problem:

http://rmadilo.com/files/merchant-system/examples/

Each form has multiple possible operations. The edit (purchase order) is a very good example of a typical situation I need to handle.

The template files have hand written forms, although it would be possible to create reusable sub-templates to do the same thing. But one interesting feature is to surround the form with a decoration which can be replaced without much editing of the template. If you look at the forms you will see why they can't be easily handled by ad_form.

One thing I disagree with in the above problem description is that you can automatically add in a different data model or code to the .tcl page. This pretty much breaks the application, and the developer should admit that it is different from the original. I do have ways to limit the fields and field values available depending on the role of the user, but these are not show in the examples.