[Zope-CMF] portal_types & actions

Ausum Studio ausum_studio@hotmail.com
Sat, 31 Aug 2002 07:54:59 -0500


Don't expect to render your object by the id of the action. Use instead the
name of the method. That's what the action box retrieves for you, doesn't
it?:

http://10.10.10.105:8080/Portal/Newsletter/1030540991/file_view_popup

Kind of weird that the id doesn't work for this, huh?. But it happens for
every factory-based object type. Try this: Create a new type based on a
Document, go the actions tab and change everything trying to get rid of the
word "view" for the first action, and you'll see that calling "view" will
still retrieve your custom non-document_view-named action.


Ausum


----- Original Message -----
From: "Kevin Carlson" <khcarlso@bellsouth.net>
To: <zope-cmf@zope.org>
Sent: Friday, August 30, 2002 9:48 PM
Subject: [Zope-CMF] portal_types & actions


> I have a portal_type which is simply a copy of the CMF type "File" that
has
> been renamed to "Newsletter".  Under the Newsletter type, I am trying to
add
> an action named "View Popup" that has the id viewpopup and the action of
> file_view_popup.
>
> All other actions work fine, but I repeatedly get an error of  "The
> requested resource does not exist".  The url in question is:
>
> http://10.10.10.105:8080/Portal/Newsletter/1030540991/viewpopup
>
> If I simply change the name of the action at the end of the url string to
> "view", things work fine.  To test things, I made the file_view_popup
method
> for the viewpopup action a copy of  the file_view method for the view
> action. Both methods exist in the skin folder for the current skin. Still
no
> luck.
>
> The action is defined like this:
>
> Name:        View Popup
> Id:          viewpopup
> Action:      file_view_popup
> Permission:  View
> Category:    object
> Visible:     false
>
> The traceback is as follows:
>
>
> Traceback (innermost last):
>   File /usr/local/Zope-2.5.0-linux2-x86/lib/python/ZPublisher/Publish.py,
> line 150, in publish_module
>   File /usr/local/Zope-2.5.0-linux2-x86/lib/python/ZPublisher/Publish.py,
> line 114, in publish
>   File /zope/lib/python/Zope/__init__.py, line 158, in
> zpublisher_exception_hook
>     (Object: 1030540991)
>   File /usr/local/Zope-2.5.0-linux2-x86/lib/python/ZPublisher/Publish.py,
> line 89, in publish
>   File
> /usr/local/Zope-2.5.0-linux2-x86/lib/python/ZPublisher/BaseRequest.py,
line
> 311, in traverse
>   File
> /usr/local/Zope-2.5.0-linux2-x86/lib/python/ZPublisher/HTTPResponse.py,
line
> 470, in notFoundError
> NotFound: (see above)
>
>
> Anyone have any idea why the new action for this type won't work?
>
> Thanks,
>
> Kevin
>
>
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
>
> See http://collector.zope.org/CMF for bug reports and feature requests
>