[Zope-CMF] actions_box not working on new object ???
Jean-Francois.Doyon@CCRS.NRCan.gc.ca
Jean-Francois.Doyon@CCRS.NRCan.gc.ca
Tue, 1 Oct 2002 15:06:38 -0400
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_000_01C2697D.AB2EBA70
Content-Type: text/plain;
charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello,
OK, I've tried everything I can think of, and I'm not having any luck.
I added a new object to CMFDefault (I know, I know ... I shouldn't do =
that
:) ... See the code below ... It's a real simple one, it simply holds a
python list as an attribute.
Now I've added it using the portal_types tool through the ZMI
(Factory-Based), and through the ZMI, everything works just fine. I =
can
create, delete and edit the object (DC Metadata and everything else), =
using
the ZMI.
The object is also used successfully on the public web site.
Where the problem appears is that when logging in through the site =
itself,
CMF-style, when I view the object in question, the actions box shows =
nothing
for it! No status, no actions.
I checked permissions everywhere, and they are the same as other =
CMFDefault
types ... This is not the first extention I have done to CMFDefault, =
and all
my other types work fine, just not THIS one. No errors are generated
anywhere that I can find. It just won't do it.
I also checked my DC Workflow setup. This pretty easy since I just =
have the
one Default workflow. I hit the "Update Security Settings" but that =
didn't
help either.
The view, edit and metadata actions are indeed defined also.
The security settings on the object indicate it's status is private, =
but
again, it doesn't appear in the actions box.
Here is the file I use in CMFDefault:
<<MapList.py>>=20
I of course edited __init__.py and Portal.py accordingly ... All that =
seems
to work OK.
I'm completely out of ideas, and kind of really need this to work ! :)
Any help or insight would be greatly appreciated ... Oh, I'm using Zope
2.5.0 w/ CMF 1.1, on a RedHat 7.3 ... Python 2.1.3 of course.
Thanks in advance,
Jean-Fran=E7ois Doyon
Internet Service Development and Systems Support
GeoAccess Division
Canada Center for Remote Sensing
Natural Resources Canada
http://atlas.gc.ca
Phone: (613) 992-4902
Fax: (613) 947-2410
------_=_NextPart_000_01C2697D.AB2EBA70
Content-Type: application/octet-stream;
name="MapList.py"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="MapList.py"
ADD_CONTENT_PERMISSION =3D 'Add portal content'=0A=
=0A=
from Globals import DTMLFile, InitializeClass=0A=
from AccessControl import ClassSecurityInfo=0A=
from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl=0A=
from Products.CMFCore.PortalContent import PortalContent=0A=
from Products.CMFCore.WorkflowCore import WorkflowAction=0A=
from Products.CMFCore import CMFCorePermissions=0A=
from Products.CMFCore.utils import getToolByName=0A=
from utils import _dtmldir=0A=
=0A=
factory_type_information =3D (=0A=
{'id': 'Map List',=0A=
'meta_type': 'Map List',=0A=
'description': ('Object that contains a list of Map Objects, using =
their Paths.'),=0A=
'product': 'CMFDefault',=0A=
'icon': 'small_map_icon_interactive.gif',=0A=
'factory': 'addMapList',=0A=
'immediate_view': 'maplist_edit_form',=0A=
'actions': ({'id': 'view',=0A=
'name': 'View',=0A=
'action': 'maplist_view',=0A=
'permissions': (CMFCorePermissions.View,)},=0A=
{'id': 'edit',=0A=
'name': 'Edit',=0A=
'action': 'maplist_edit_form',=0A=
'permissions': =
(CMFCorePermissions.ModifyPortalContent,)},=0A=
{ 'id': 'metadata',=0A=
'name': 'Metadata',=0A=
'action': 'metadata_edit_form',=0A=
'permissions': =
(CMFCorePermissions.ModifyPortalContent,)}=0A=
),=0A=
},=0A=
)=0A=
=0A=
def addMapList(self, id, maplist=3D[]):=0A=
"""Create a MapList"""=0A=
maplist_object =3D MapList(id, maplist)=0A=
self._setObject(id, maplist_object)=0A=
=0A=
class MapList(PortalContent, DefaultDublinCoreImpl):=0A=
"""MapList Class"""=0A=
=0A=
__implements__ =3D ( PortalContent.__implements__=0A=
, DefaultDublinCoreImpl.__implements__=0A=
)=0A=
=0A=
meta_type =3D 'Map List'=0A=
=0A=
security =3D ClassSecurityInfo()=0A=
=0A=
def __init__(self, id, maplist=3D[]):=0A=
"""Initialize an instance of the class"""=0A=
DefaultDublinCoreImpl.__init__(self)=0A=
self.id =3D id=0A=
self.maplist =3D maplist=0A=
=0A=
security.declareProtected(CMFCorePermissions.View,'getlist')=0A=
=0A=
def getlist(self):=0A=
return self.maplist=0A=
=0A=
=
security.declareProtected(CMFCorePermissions.ModifyPortalContent,'manage=
_edit')=0A=
=0A=
manage_edit =3D DTMLFile('zmi_editMapList', _dtmldir)=0A=
=0A=
=
security.declareProtected(CMFCorePermissions.ModifyPortalContent,'manage=
_editMapList' )=0A=
=0A=
def manage_editMapList(self, maplist, REQUEST=3DNone):=0A=
""" A ZMI (Zope Management Interface) level editing method =
"""=0A=
self._edit(maplist)=0A=
if REQUEST is not None:=0A=
REQUEST['RESPONSE'].redirect( =0A=
self.absolute_url()=0A=
+ '/manage_edit'=0A=
+ '?manage_tabs_message=3DMap+List+updated'=0A=
)=0A=
=0A=
def _edit(self, maplist):=0A=
"""Change the instance's properties """=0A=
self.maplist =3D maplist=0A=
=0A=
security.declareProtected( CMFCorePermissions.ModifyPortalContent, =
'edit' )=0A=
=0A=
edit =3D WorkflowAction(_edit)=0A=
=0A=
InitializeClass(MapList)=0A=
------_=_NextPart_000_01C2697D.AB2EBA70--