[Zope] generating <dtml-var with dtml

Sin Hang Kin infoez@macauweb.com
Thu, 25 May 2000 22:16:37 +0800


This is a multi-part message in MIME format.

------=_NextPart_000_0013_01BFC696.E5027200
Content-Type: text/plain;
	charset="Windows-1252"
Content-Transfer-Encoding: 7bit

Hi,

I have a dtml-method which is going to generate a data enter form like what
metapublisher is doing, but fully in dtml, now I have the following problem:

The method generate a DTML document with fieldname as its id, lable as title
and the input code as its content, its help text as help. Assume that the
field name is abc and the label is Abc and the data entry form input code
will be:

<th title="help text">Abc</th><td><input type="text:int" name="abc"
value="<dtml-var abc>"></td>

The code which is used to generate the above is :

<th title="<dtml-var help>"><dtml-var title_or_id></th><td><input
type="text:int" name="<dtml-var id>" value="????">

The problem is I don't know how ??? should be.

I have try <dtml-var <dtml-var id>> which is not acceptable by zope. If I
use

&lt;dtml-var <dtml-var id>>

It will generate &lt;dtml-var abc> not what required <dtml-var abc>.

I have attached the interfacew.zexp which is a folder, you create a
sub-folder for each form under it and use the interface to generate the
field objects, then you use genform to generate the form. More dtml-method
for more types were need. I would also like to hear from you about this.

Rgs,

Kent Sin
---------------------------------
kentsin.weblogs.com
kentsin.imeme.net


------=_NextPart_000_0013_01BFC696.E5027200
Content-Type: application/x-compressed;
	name="interfacew.zexp"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="interfacew.zexp"

ZEXP=00=00=00=00=00=00j=F6=00=00=00=00=00=00=02=FB((U=0A=
OFS.Folderq=01U=06Folderq=02tq=03Nt.}q=04(U=02idq=05U=0A=
interfacewq=06U=12__ac_local_roles__q=07}q=08U=07kentsinq	]q=0A=
U=05Ownerq=0BasU=08_objectsq=0C(}q=0D(U	meta_typeq=0EU=0BDTML =
Methodq=0FU=02idq=10U=0Baddnewfieldq=11u}q=12(U	meta_typeq=13U=0BDTML =
Methodq=14U=02idq=15U=0A=
index_htmlq=16u}q=17(U	meta_typeq=18U=0BDTML =
Methodq=19U=02idq=1AU=0Bdeletefieldq=1Bu}q=1C(U	meta_typeq=1DU=0BDTML =
Methodq=1EU=02idq=1FU=03intq u}q!(U	meta_typeq"U=0BDTML =
Methodq#U=02idq$U=06stringq%u}q&(U	meta_typeq'U=0BDTML =
Methodq(U=02idq)U=07genformq*u}q+(U	=
meta_typeq,U=06Folderq-U=02idq.U=04tbl2q/uth=11(U=08=00=00=00=00=00=00j=F8=
q0(U=0EOFS.DTMLMethodq1U=0A=
DTMLMethodq2ttQh/(U=08=00=00=00=00=00=00obq3(h=01U=06Folderq4ttQU=0A=
index_htmlq5(U=08=00=00=00=00=00=00j=F9q6(h1U=0A=
DTMLMethodq7ttQh=1B(U=08=00=00=00=00=00=00k=02q8(h1U=0A=
DTMLMethodq9ttQU=03intq:(U=08=00=00=00=00=00=00k=03q;(h1U=0A=
DTMLMethodq<ttQU=05titleq=3DU=00U=06stringq>(U=08=00=00=00=00=00=00m1q?(h=
1U=0A=
DTMLMethodq@ttQh*(U=08=00=00=00=00=00=00m2qA(h1U=0A=
DTMLMethodqBttQu.=00=00=00=00=00=00j=F8=00=00=00=00=00=00=03:((U=0EOFS.DT=
MLMethodq=01U=0A=
DTMLMethodq=02tq=03Nt.}q=04(U=12__ac_local_roles__q=05}q=06U=07kentsinq=07=
]q=08U=05Ownerq	asU=08__name__q=0A=
U=0Baddnewfieldq=0BU=05titleq=0CU=00U=0C_proxy_rolesq=0D(U=07Managerq=0Et=
q=0FU=07globalsq=10}q=11U=03rawq=12Tm=02=00=00<html><body>=0A=
<dtml-if type>=0A=
  <dtml-call "REQUEST.set('ncode', _.getitem(type).read())">=0A=
</dtml-if>=0A=
=0A=
=0A=
=0A=
<dtml-call "manage_addDTMLDocument(oid, otitle, ncode)">=0A=
=0A=
<dtml-if hideflds>=0A=
   <dtml-call "REQUEST.set('avoid', hideflds)">=0A=
<dtml-else>=0A=
   <dtml-call "REQUEST.set('avoid', 'oid:data:title:add_dtmlDocument')">=0A=
</dtml-if>=0A=
=0A=
<dtml-in "REQUEST.form.keys()">=0A=
   <dtml-if "_.string.find(avoid, _['sequence-item'] )">=0A=
       <dtml-call =
"_.getitem(oid).manage_addProperty(_['sequence-item'],REQUEST.form[_['seq=
uence-item']], 'string', REQUEST)">=0A=
   </dtml-if>=0A=
</dtml-in>=0A=
=0A=
<dtml-call "RESPONSE.redirect(URL1)">=0A=
</body>=0A=
</html>=0A=
q=13U=05_varsq=14}q=15u.=00=00=00=00=00=00ob=00=00=00=00=00=00=00~((U=0A=
OFS.Folderq=01U=06Folderq=02tq=03Nt.}q=04(U=02idq=05U=04tbl2q=06U=12__ac_=
local_roles__q=07}q=08U=07kentsinq	]q=0A=
U=05Ownerq=0BasU=08_objectsq=0C)U=05titleq=0DU=00u.=00=00=00=00=00=00j=F9=
=00=00=00=00=00=00=08=91((U=0EOFS.DTMLMethodq=01U=0A=
DTMLMethodq=02tq=03Nt.}q=04(U=12__ac_local_roles__q=05}q=06U=07kentsinq=07=
]q=08U=05Ownerq	asU=08__name__q=0A=
U=0A=
index_htmlq=0BU=05titleq=0CU=00U=0C_proxy_rolesq=0D(U	=
Anonymousq=0Etq=0FU=07globalsq=10}q=11U=03rawq=12T=C3=07=00=00<dtml-var =
standard_html_header>=0A=
<h2><dtml-var title_or_id> <dtml-var document_title></h2>=0A=
<p>Currently defined fields :</p>=0A=
<form action=3D"./" method=3D"post">=0A=
<input type=3D"hidden" name=3D"hideflds" =
value=3D"hideflds:oid:otitle:ids:data:addnewfield">=0A=
<table width=3D"95%" align=3D"center" border=3D"1">=0A=
<tead><td width=3D"3%">order</td>=0A=
<td width=3D"10%">name</td>=0A=
<td width=3D"3%">type</td>=0A=
<td width=3D"10%">label</td>=0A=
<td width=3D"2%">rep.</td>=0A=
<td width=3D"72%">help text</td></thead>=0A=
<dtml-in "objectItems(['DTML Document'])">=0A=
<TR>=0A=
  <TD width=3D"3%">=0A=
  <INPUT TYPE=3D"CHECKBOX" NAME=3D"ids:list" VALUE=3D"<dtml-var =
sequence-key html_quote>">   <dtml-var taborder missing=3D"&nbsp;"></td>=0A=
  <TD width=3D"10%">=0A=
  <A HREF=3D"<dtml-var sequence-key =
url_quote>/manage_workspace"><dtml-var sequence-key =
fmt=3D"html-quote"></A></td>=0A=
  <td width=3D"3%"><dtml-var type missing=3D"&nbsp;"></td>=0A=
  <td width=3D"10%"><dtml-var title missing=3D"&nbsp;"></td>=0A=
  <td width=3D"2%"><dtml-var rep missing=3D"&nbsp;"></td>=0A=
  <td width=3D"72%"><dtml-var help missing=3D"&nbsp;"></td>=0A=
=0A=
</TR>=0A=
</dtml-in>=0A=
</table>=0A=
<hr>=0A=
<p>Add new field: </p>=0A=
<table width=3D"70%" align=3D"center">=0A=
<tr>=0A=
<th>tab order</th><td><input type=3D"text" name=3D"taborder" value=3D"0" =
size=3D"50"></td></tr>=0A=
<tr><th>id</th><td><input type=3D"text" name=3D"oid" =
size=3D"50"></td><tr>=0A=
<tr><th>type</th><td><select name=3D"type"><option =
valut=3D"int">int</option><option =
value=3D"string">string</option><option =
value=3D"text">text</option></select></td></tr>=0A=
<tr><th>label</th><td><input type=3D"text" name=3D"otitle" =
size=3D"50"></td></tr>=0A=
<tr><th>help</th><td><textarea name=3D"help" rows=3D"3" cols=3D"50" =
wrap=3Dvirtual></textarea></td></tr>=0A=
<tr><th>repetable</th><td><input type=3D"checkbox" name=3D"rep" =
checked></td></tr>=0A=
<tr><th></th><td align=3D"center">=0A=
<input type=3D"submit" name=3D"addnewfield:method" value=3D"add new =
field">=0A=
 &nbsp; <input type=3D"submit" name=3D"deletefield:method" =
value=3D"delete">=0A=
 &nbsp; <input type=3D"submit" name=3D"dump_request:method" =
value=3D"debug">=0A=
</td></tr>=0A=
=0A=
</table>=0A=
</form>=0A=
<dtml-var =
standard_html_footer>q=13U=05_varsq=14}q=15u.=00=00=00=00=00=00k=02=00=00=
=00=00=00=00=01=1D((U=0EOFS.DTMLMethodq=01U=0A=
DTMLMethodq=02tq=03Nt.}q=04(U=12__ac_local_roles__q=05}q=06U=07kentsinq=07=
]q=08U=05Ownerq	asU=08__name__q=0A=
U=0Bdeletefieldq=0BU=05titleq=0CU=00U=0C_proxy_rolesq=0D(U=07Managerq=0Et=
q=0FU=07globalsq=10}q=11U=03rawq=12US<dtml-call "manage_delObjects(ids, =
REQUEST)">=0A=
<dtml-call =
"RESPONSE.redirect(URL1)">q=13U=05_varsq=14}q=15u.=00=00=00=00=00=00k=03=00=
=00=00=00=00=00=01=90((U=0EOFS.DTMLMethodq=01U=0A=
DTMLMethodq=02tq=03Nt.}q=04(U=05titleq=05U=00U=03rawq=06U=ED<tr><th =
title=3D"<dtml-var help missing>"><dtml-var title_or_id></th>=0A=
<td>=0A=
<input type=3D"text:int" name=3D"<dtml-var id>" size=3D"50" <dtml-if =
"taborder>0">tabindex=3D"<dtml-var taborder>"</dtml-if> =
value=3D"&lt;dtml-var <dtml-var id>>">=0A=
</td></tr>q=07U=12__ac_local_roles__q=08}q	U=07kentsinq=0A=
]q=0BU=05Ownerq=0CasU=07globalsq=0D}q=0EU=08__name__q=0FU=03intq=10U=05_v=
arsq=11}q=12u.=00=00=00=00=00=00m1=00=00=00=00=00=00=01=8E((U=0EOFS.DTMLM=
ethodq=01U=0A=
DTMLMethodq=02tq=03Nt.}q=04(U=05titleq=05U=00U=03rawq=06U=E8<tr><th =
title=3D"<dtml-var help missing>">=0A=
<dtml-var title_or_id>=0A=
</th>=0A=
<td>=0A=
<input type=3D"text:string" name=3D"<dtml-var id>" <dtml-if =
"taborder>0">tabindex=3D"<dtml-var taborder>"</dtml-if> =
value=3D"&lt;dtml-var <dtml-var id>">=0A=
</td>=0A=
</tr>q=07U=12__ac_local_roles__q=08}q	U=07kentsinq=0A=
]q=0BU=05Ownerq=0CasU=07globalsq=0D}q=0EU=08__name__q=0FU=06stringq=10U=05=
_varsq=11}q=12u.=00=00=00=00=00=00m2=00=00=00=00=00=00=01=FD((U=0EOFS.DTM=
LMethodq=01U=0A=
DTMLMethodq=02tq=03Nt.}q=04(U=05titleq=05U=00U=03rawq=06TS=01=00=00<dtml-=
var standard_html_header>=0A=
<h2><dtml-var title_or_id> <dtml-var document_title></h2>=0A=
<form action=3D"./" method=3D"post">=0A=
<table>=0A=
<dtml-in "objectItems(['DTML Document'])" sort=3Did>=0A=
  <dtml-var "_['sequence-item']">=0A=
</dtml-in>=0A=
</table>=0A=
<input type=3D"submit" name=3D"add_dtmlDocument:method" value=3D"OK">=0A=
</form>=0A=
<dtml-var standard_html_footer>q=07U=12__ac_local_roles__q=08}q	=
U=07kentsinq=0A=
]q=0BU=05Ownerq=0CasU=07globalsq=0D}q=0EU=08__name__q=0FU=07genformq=10U=05=
_varsq=11}q=12u.=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF
------=_NextPart_000_0013_01BFC696.E5027200--