[ZWeb] Zope.org feedback: [Documentation patch] Build a simple ZClass (CatalogAware, non-default Catalog, Folderish)
Martijn Pieters
mj@zope.com
Fri, 1 Feb 2002 14:17:40 -0500
Hi Chui Tey,
You've reached the maintainers of the Zope.org website instead of kedai. I
have forarded your message to him for you; please use the "feedback to this
page's author" for feedback to owner of a page to reach him directly.
Hope this helps!
On Thu, Jan 31, 2002 at 05:29:18PM -0500, Chui Tey wrote:
> 1. def_index should be placed in the Talkback folder, not the tbContainer folder.
>
> 2. tbContainer_add (PythonScript version)
>
> URL1=REQUEST.URL1
> RESPONSE=REQUEST.response
>
> new_container = script.tbContainer.createInObjectManager(REQUEST['id'], REQUEST)
> new_catalog = new_container.manage_addProduct['ZCatalog'].manage_addZCatalog('tbCatalog')
>
> new_container.zcatalog.manage_delColumn('summary')
> new_container.zcatalog.manage_addColumn('username')
> new_container.zcatalog.manage_addColumn('bodytext')
> new_container.zcatalog.manage_addColumn('email')
> new_container.zcatalog.manage_addIndex('username','FieldIndex')
>
> new_container.manage_addDTMLMethod('index_html', '', script.def_index)
>
> if hasattr(REQUEST,'DestinationURL'):
> RESPONSE.redirect(REQUEST.DestinationURL+'/manage_workspace')
> else:
> RESPONSE.redirect(REQUEST.URL2+'/manage_workspace')
>
> 3. tbEntry_add (Pythonscript version)
>
> new_id=str(context.ZopeTime().strftime('%Y%m%d%H%M%S'))
> new_entry=container.tbEntry.createInObjectManager(new_id, REQUEST)
>
> new_entry.propertysheets.tbProperty.manage_editProperties(REQUEST)
>
> #
> # Notify the entry to use a catalog called zcatalog.
> # (by default, CatalogAware instances catalog themselves in a catalog
> # called Catalog
> #
> new_entry.manage_editCataloger('tbCatalog')
> new_entry.reindex_object()
>
> RESPONSE=REQUEST.response
> if getattr(REQUEST,'DestinationURL',''):
> RESPONSE.redirect(REQUEST.DestinationURL+'/manage_workspace')
> else:
> RESPONSE.redirect(REQUEST.URL1+'/manage_workspace')
>
>
> ----------------------------------------------------------
> This email was generated from the Zope.org feedback form
> It was invoked from a link on http://www.zope.org/Members/kedai/BuildSimpleZClass
>
>
> _______________________________________________
> Zope-web maillist - Zope-web@zope.org
> http://lists.zope.org/mailman/listinfo/zope-web
--
Martijn Pieters
| Software Engineer mailto:mj@zope.com
| Zope Corporation http://www.zope.com/
| Creators of Zope http://www.zope.org/
---------------------------------------------