howto format/customize property sheets for zclasses ?
good afternoon, basic question : how does one format/customize the "properties" management page of a zclass instance ? this must be quite obvious but even after a shower i can't find it. eg. say i have a zclass called "Article". creating this via the zope interface will automatically create the following : Article Article_add (Article constructor) Article_addForm (Article constructor input form) Article_add_permission (Article constructor permission) Article_factory (Article factory) i have edited the Article_addForm dtml-document to make the html form better (eg. larger text areas larger with WRAP attributes). so, now it is easier to create a new instance of this zclass. but when somebody wishes to edit/update the properties of this instance, the following form is used : http://domain/[zclass-instance]/propertysheets/properties/manage is there a quick and easy way to over-ride this ? i'm only going to add a few things (like better textareas or comments for users) in the name of usability. (going back to the Lotus Notes analogy earlier, how does one format/customize the "form" ?) cheers, chas
answering my own question :
basic question : how does one format/customize the "properties" management page of a zclass instance ?
the answer lies in that most thrilling of documents, "the zope product api" (on the sixth reading, it made more sense). so, looks like i'll have to create a product the old fashioned way (following the steps outlined in the product API for the 'poll' example). i had hoped the zclasses would allow us to easily format the property-update page but seems like they're still baking (unlike my brain which is fried)... happy monday to all. chas
basic question : how does one format/customize the "properties" management page of a zclass instance ? this must be quite obvious but even after a shower i can't find it.
eg. say i have a zclass called "Article". creating this via the zope interface will automatically create the following :
Article Article_add (Article constructor) Article_addForm (Article constructor input form) Article_add_permission (Article constructor permission) Article_factory (Article factory)
i have edited the Article_addForm dtml-document to make the html form better (eg. larger text areas larger with WRAP attributes). so, now it is easier to create a new instance of this zclass.
but when somebody wishes to edit/update the properties of this instance, the following form is used : http://domain/[zclass-instance]/propertysheets/properties/manage
is there a quick and easy way to over-ride this ? i'm only going to add a few things (like better textareas or comments for users) in the name of usability.
(going back to the Lotus Notes analogy earlier, how does one format/customize the "form" ?)
cheers,
chas
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
You don't need to make a product. It's quite easy to edit properties from a custom form. You can use two document methods (DM) in your ZClass for this. The first is just a form for editing (edit DM which calls update DM): <dtml-var standard_html_header> <H2>Edit Info</H2> <form action=update method=post> <table> <tr> <td>Title</td> <td><input type=text name=title size=40 value="<dtml-var title>"></td> </tr> <tr> <td>Software Name</td> <td><input type=text name=sw-name size=40 value="<dtml-var sw-name>"></td> </tr> ... (update DM) <dtml-call "REQUEST.set('ts', ZopeTime())"> <dtml-call "REQUEST.set('modified-date', ts)"> <dtml-call "propertysheets.item_info.manage_changeProperties(REQUEST)"> <dtml-call "RESPONSE.redirect(URL2+'/view')"> In the REQUEST I create a new value to change the property modified-date, this could probably done also with the let-tag. Than all changed values from the edit form are in REQUEST. item_info is a propertysheet in my ZClass. I have learned a lot from the K!MnetNews package from Kevin Dangoor, b.t.w. thanks Kevin :-) HTH __Janko
thank you very much Janko, this will no doubt save me a great deal of time :
You don't need to make a product. It's quite easy to edit properties from a custom form. You can use two document methods (DM) in your ZClass for this.
The first is just a form for editing (edit DM which calls update DM):
<dtml-var standard_html_header> <H2>Edit Info</H2> <form action=update method=post> <table> <tr> <td>Title</td> <td><input type=text name=title size=40 value="<dtml-var title>"></td> </tr> <tr> <td>Software Name</td> <td><input type=text name=sw-name size=40 value="<dtml-var sw-name>"></td> </tr> ...
(update DM) <dtml-call "REQUEST.set('ts', ZopeTime())"> <dtml-call "REQUEST.set('modified-date', ts)"> <dtml-call "propertysheets.item_info.manage_changeProperties(REQUEST)"> <dtml-call "RESPONSE.redirect(URL2+'/view')"> In the REQUEST I create a new value to change the property modified-date, this could probably done also with the let-tag. Than all changed values from the edit form are in REQUEST. item_info is a propertysheet in my ZClass.
i think i can safely say that saved a precious hour or six or running around like a headless chicken .... thank you very much ! :-)
I have learned a lot from the K!MnetNews package from Kevin Dangoor,
yeah, i just downloaded that ... you're right. thanks again - your help is much appreciated. chas
At 08:45 05/09/99 , chas wrote:
good afternoon,
basic question : how does one format/customize the "properties" management page of a zclass instance ? this must be quite obvious but even after a shower i can't find it.
eg. say i have a zclass called "Article". creating this via the zope interface will automatically create the following :
Article Article_add (Article constructor) Article_addForm (Article constructor input form) Article_add_permission (Article constructor permission) Article_factory (Article factory)
i have edited the Article_addForm dtml-document to make the html form better (eg. larger text areas larger with WRAP attributes). so, now it is easier to create a new instance of this zclass.
but when somebody wishes to edit/update the properties of this instance, the following form is used : http://domain/[zclass-instance]/propertysheets/properties/manage
is there a quick and easy way to over-ride this ? i'm only going to add a few things (like better textareas or comments for users) in the name of usability.
(going back to the Lotus Notes analogy earlier, how does one format/customize the "form" ?)
You can make two DTML Methods in your ZClass, one to present your form with the current values filled in, and one to reap the changes and update the properties. You then assign a tab to the first method and uses then can click on that tab to edit the properties the way you want them to do it. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------
participants (3)
-
chas -
Janko Hauser -
Martijn Pieters