[Zope-CMF] Re: Portal Poll Product (also Re: [PTK(252)[2])

Dave Woolston davew@digicool.com
Wed, 18 Apr 2001 11:49:35 -0400


[Tim Hicks wrote]:
> Dave (zope-cmf list added in too, so don't feel obliged to answer my
> questions :-) ),
>
> thanks very much for the updated 'walkthrough', it did indeed seem to
solve
> my problem.

Good - Thanks to gogo for sending me his 'walkthrough' notes

>Combined with Tres telling me not to use the standard
> 'myZClass_factory', but instead use 'myZClass_add' (or as you have shown,
a
> custom method) for the 'portal_types' 'Factory method in product',
> everything seems to be working well for adding instances of my ZClass
> products... thanks very much to both of you.
>
> My problem now is that my instances get added, but I can't see them using
> the 'folder_contents' method on the folder they are in.  I know they are
> there because I can see them using the ZMI and access them by URL.  My
> ZClass sub-classes the following:

This sounds like the filter is filtering them out.  I would try two things:
1) Verify you can add a different type and have it show up (like a Document)
2) You may have the incorrect meta type - actually, the copy I sent you
probably
has this typo - Verify that the meta type name that you use in the
types_tool
definition has the same name as that in your class definition. (This should
be
PortalPollType and not PollClassType if you are following the steps
verbatim.

>
> Base Classes  ZObject, _ZClass_for_PortalContent,
> _ZClass_for_DefaultDublinCoreImpl, CatalogAwareBase
>
> if that makes any difference to the answer.
>
> Incidentally, was I right to sub-class 'CatalogAwareBase' for portal
> content, or should it have been a specific 'CMFCatalogAware' (or some
such)?

I don't believe you have to add CMFCatalogAware to make you content
appear in the catalog any longer, (I think that used to be the case).
Simply by deriving from PortalContent should work.  Items that are
created with the tutorial will appear in the catalog and are searchable
for question or answers.

>
> And one final (related) question, when selecting what to sub-class, am I
> right in thinking that if the zclass is to define *content*, it should not
> really need to sub-class and of the 'whatever Tool' classes?

You are absolutely correct.  This tutorial has evolved over time, and
it makes no longer makes sense to derive *content* from *Tool* classes.
Shane pointed this out to me and I updated the tutorial a little while back.
Tool based classes exist so that you can change the 'behavior' of the
portal by overriding or enhancing the tool.  Sorry if this caused you some
problems.

<snip>

Dave