You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Tim Larson <ti...@keow.org> on 2004/02/02 17:15:52 UTC

form repository

Lets start working on a form repository.

This discussion focuses on the form model, but we could use these same
concepts to handle form binding and form template fragments.

The form fragments in a repository could be called "types" and we could
use Marc's idea of using "id", "type-ref", and "type-def" to indicate
respectively: create a widget, use or extend a type of widget, and
define a new type of widget.  I suggest naming these attributes "id",
"base", and "type" to keep the names short and somewhat parallel the
names used for datatypes.

To allow types (form fragments) to be retrieved from anywhere that can
be referenced as a source we could use import statements of the form:
  <wd:import prefix="some-prefix" uri="some-uri"/>
For example, we could use the "cocoon://" protocol:
  <wd:import prefix="utility" uri="cocoon://utility.xml"/>

When an import statement is encountered in a form, we would need to do
pretty much the same work as is done by the DefaultFormManager's
getFormDefinition(Source) method, and then somehow register the types
found in the source so the form has access to them.  The prefix
specified in the import statement could be used to prevent ambiguity
between types that happen to have matching name but come from different
sources.

WDYT?
--Tim Larson