[Zope-CMF] Adapting ExternalFile for use in CMF

Kevin Carlson khcarlso@bellsouth.net
Mon, 15 Apr 2002 23:00:50 -0400

The script mentioned is actually in /Control_Panel/Product/ExternalFile...

-----Original Message-----
From: zope-cmf-admin@zope.org [mailto:zope-cmf-admin@zope.org]On Behalf
Of Kevin Carlson
Sent: Monday, April 15, 2002 10:24 PM
To: zope-cmf group
Subject: [Zope-CMF] Adapting ExternalFile for use in CMF

I am attempting to adapt the External File product so that it can be used in
CMF.  I am running into an error in what looks to be the area of a guarded
function of some sort.  Here's what I've done so far:

I created a new portal type call CMFExternalFile and set the following:

 MetaType = "External File"
 Product Name = "ExternalFile"
 Factory Method... = "addCMFExternalFile"
 Initial View Name = "manage_addForm"

I also added a python script in the folder /Control_Panel/ExternalFile named
"addCMFExternalFile" with the following lines of code:

   return id

When I try to add a product of type CMFExternalFile from within the CMF I
get the following exception:

   Error Type: AttributeError
   Error Value: createInObjectManager

and the following stack trace:

Traceback (innermost last):
  File C:\PROGRA~1\ZopeTest\lib\python\ZPublisher\Publish.py, line 150, in
  File C:\PROGRA~1\ZopeTest\lib\python\ZPublisher\Publish.py, line 114, in
  File C:\PROGRA~1\ZopeTest\lib\python\Zope\__init__.py, line 158, in
    (Object: A)
  File C:\PROGRA~1\ZopeTest\lib\python\ZPublisher\Publish.py, line 98, in
  File C:\PROGRA~1\ZopeTest\lib\python\ZPublisher\mapply.py, line 88, in
    (Object: invokeFactory)
  File C:\PROGRA~1\ZopeTest\lib\python\ZPublisher\Publish.py, line 39, in
    (Object: invokeFactory)
  File C:\PROGRA~1\ZopeTest\lib\python\Products\CMFCore\PortalFolder.py,
line 335, in invokeFactory
    (Object: A)
  File C:\PROGRA~1\ZopeTest\lib\python\Products\CMFCore\TypesTool.py, line
701, in constructContent
    (Object: portal_types)
  File C:\PROGRA~1\ZopeTest\lib\python\Products\CMFCore\TypesTool.py, line
429, in constructInstance
    (Object: CMFExternal)
  File C:\PROGRA~1\ZopeTest\lib\python\Shared\DC\Scripts\Bindings.py, line
252, in __call__
    (Object: addCMFExternalFile)
  File C:\PROGRA~1\ZopeTest\lib\python\Shared\DC\Scripts\Bindings.py, line
283, in _bindAndExec
    (Object: addCMFExternalFile)
C:\PROGRA~1\ZopeTest\lib\python\Products\PythonScripts\PythonScript.py, line
291, in _exec
    (Object: addCMFExternalFile)
    (Info: ({'script': <PythonScript instance at 022CB0F8>, 'context':
<__FactoryDispatcher__ instance at 01427270>, 'container':
<__FactoryDispatcher__ instance at 01427270>, 'traverse_subpath': []},
('blah',), {}, None))
  File Script (Python), line 1, in addCMFExternalFile
  File C:\PROGRA~1\ZopeTest\lib\python\AccessControl\ZopeGuards.py, line 47,
in guarded_getattr
AttributeError: (see above)

It appears that the 'createInObjectManager' method doesn't exist -- Any
ideas on where I'm going wrong or on how to accomplish this a different way?



Zope-CMF maillist  -  Zope-CMF@zope.org

See http://www.zope.org/Products/PTK/Tracker for bug reports and feature