collective / collective/collective.exportimport

ComponentLookupError with programmatic exporter

Open
#113 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
19
Forks
20
PR merge metrics
No merged PRs in 30d

Description

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://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: ((, ), , '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 ...`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at collective/exportimport/export_content.py line 281 and trace the serializer call that raises ComponentLookupError. Compare the bin/instance run entry point with the referenced plone.restapi serializer and the exporter script's request and site setup. Done means determining whether programmatic execution should load the conversation_view configuration and documenting or fixing the failing export path.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.