Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ComponentLookupError with programmatic exporter #113

Open
zopyx opened this issue Apr 13, 2022 · 1 comment
Open

ComponentLookupError with programmatic exporter #113

zopyx opened this issue Apr 13, 2022 · 1 comment

Comments

@zopyx
Copy link
Contributor

zopyx commented Apr 13, 2022

I am using this exporter script

acl = app.acl_users
user = acl.getUser(USER)
newSecurityManager(None, user.__of__(acl))

site = app.eteaching
makerequest(site)

setSite(site)

export_content = api.content.get_view('export_content', site, site.REQUEST)
site.REQUEST.form['form.submitted'] = True
export_content(portal_type=['Folder', 'Document', 'Event'], include_blobs=2, download_to_server=True)

that returns this error:

2022-04-13 07:18:14 ERROR collective.exportimport.export_content Error exporting http:https://nohost/eteaching/community/communityevents/workshops/community-workshop/arbeitsblaetter
Traceback (most recent call last):
  File "/home/ajung/sandboxes/iwm/plone4.buildout/src/collective.exportimport/src/collective/exportimport/export_content.py", line 281, in export_content
    item = serializer(include_items=False)
  File "/home/ajung/.buildout/eggs/plone.restapi-6.13.4-py2.7.egg/plone/restapi/serializer/dxcontent.py", line 161, in __call__
    folder_metadata = super(SerializeFolderToJson, self).__call__(version=version)
  File "/home/ajung/.buildout/eggs/plone.restapi-6.13.4-py2.7.egg/plone/restapi/serializer/dxcontent.py", line 108, in __call__
    (self.context, self.request), name="conversation_view"
  File "/home/ajung/.buildout/eggs/zope.component-3.9.5-py2.7.egg/zope/component/_api.py", line 109, in getMultiAdapter
    raise ComponentLookupError(objects, interface, name)
ComponentLookupError: ((<Folder at /eteaching/community/communityevents/workshops/community-workshop/arbeitsblaetter>, <HTTPRequest, URL=http:https://nohost>), <InterfaceClass zope.interface.Interface>, 'conversation_view')

I run the script using bin/instance run myexport.py. In my understanding, Zope/Plone would pick up the related ZCML configurations for view etc. also when using bin/instance run ...

@zopyx
Copy link
Contributor Author

zopyx commented Apr 13, 2022

This is more related to plone.restapi:

        result["allow_discussion"] = getMultiAdapter(
            (self.context, self.request), name="conversation_view"
        ).enabled()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant