[Zope] Zope PTK Wizard

Tres Seaver tseaver@digicool.com
Fri, 26 Jan 2001 22:16:38 -0500


"Priya Ramkumar" <pra@baba9.com> wrote:

> I am trying to create a wizard in my portal to enable users to store
> information. In addition to the features of the already existing Document
> Wizard, I would like my Wizard to have more features like information about
> the category of the document, etc. I created a file called "Userdocument.py"
> with a method "addUserdocument" which will be called to add a new document.
> I have also added the new entry to the PTKBases & PTKDemos __init__.py. But
> as soon as Zope starts, it gives this error
> 
> 
> 2001-01-25T06:07:07 ERROR(200) Zope Couldn't import Products.PTKDemo
> Traceback (innermost last):
>   File /export/usr/local/Zope-2.2.4-src/lib/python/OFS/Application.py, line
> 397,
> in import_products
>     (Object: string)
>   File
> "/export/usr/local/Zope-2.2.4-src/lib/python/Products/PTKDemo/__init__.py
> ", line 159
>      PTKBase.Userdocument = Userdocument
>                                         ^
> SyntaxError: invalid token
> 
> Could anyone please tell me how to create custom wizards and to register
> them?

Priya,

First, the PTK has its own mailing list, zope-ptk@zope.org;  you
are much likelier to get useful and timely advice there about
PTK-specific issues.

Second, I don't think the region of code in which you have injected
that line needs it;  it exists solely to provide backward-compatibility
with portals created before version 0.8 of the PTK.

Third, I can't see anything about your code which woudl trigger a
syntax error;  typically, in this case, the real error would be
a line or two ahead (opening but not closing a parenthesis, omitting
a comma, etc.

Fourth, you would typically add a new content class in a separate
product, either on the filesystem or in a "through-the-web"
ZClass product;  mixing your stuff with PTKBase/PTKDemo means
you will be forced to deal with lots of merge conflicts (and these
days, I mean *LOTS*).

I would recommend creating a new CVS sandbox, as described in my
"State of the PTK" message today:

  http://lists.zope.org/pipermail/zope-ptk/2001-January/002258.html

Then, move your 'Userdocument' module into a new Product, a "sibling"
of PTKBase and PTKDemo.  Register it just as 'PTKDemo.Document' is
registered, and create a Wizard for it by cloning the Document wizard
and "filing off the serial numbers".

Hope that helps,

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@digicool.com
Digital Creations     "Zope Dealers"       http://www.zope.org