[zzoss-devel] installer: XML config input form
Status: Alpha
Brought to you by:
czonsius
|
From: Sandro Z. <san...@zz...> - 2003-03-25 14:09:41
|
Hi,
the input forms for configuration parameters displayed by the installer c=
an=20
now be defined in XML. This is of huge advantage to integrate non-PHP=20
packages. Let me describe how the XML input form descriptor works:
This is a sample descriptor:
<input>
=09<widget=09name=3D"path" label=3D"Error Log Path"
=09=09variable=3D"zzoss_errors_logs"
=09=09validation=3D"not empty" default=3D"{ZI_data}zzoss_errors/logs/" />
=09<widget=09name=3D"select" label=3D"Debug Errors?"
=09=09variable=3D"zzoss_errors_debug" default=3D"1"
=09=09list=3D"0 =3D> No, 1 =3D> Yes"/>
=09<widget=09name=3D"email" label=3D"Error notification"
=09=09variable=3D"zzoss_errors_notification"
=09=09validation=3D"email" default=3D"web...@ex..." />
</input>
As you see, we simply define widgets inside the input root element. I use=
d the=20
existing widgets and modified them to suit our new needs.
The first widget we define is based on the "path" widget. This will show =
a=20
HTML input text field of size 40 and maxlength 255. We also provide the l=
abel=20
which will be written at the left handside of the input field and we tell=
the=20
name of the REQUEST variable. The validation attribute tells that the val=
ue=20
is not allowed to be empty and we furthermore define a default value writ=
ten=20
to the text field upon initial showup. A {ZI_data} placeholder is put in=20
front of the default value. This placeholder will automatically be replac=
ed=20
by the absolute path of the data directory.
Please draw your attention to the next widget "select" where you can see,=
how=20
the options list of a select drop-down list are defined with the list=20
attribute.
The last widget is meant for emails. As you can see, the validation attri=
bute=20
is set to email, this means that the syntax of the provided email will be=
=20
checked automatically after the user hit the send button.
It's all in CVS.
Sandro
|