Git Product home page Git Product logo

Comments (9)

Rudd-O avatar Rudd-O commented on September 24, 2024

Related: #93

from collective.exportimport.

Rudd-O avatar Rudd-O commented on September 24, 2024

Aha:

ERROR:collective.exportimport.export_content:Error exporting http://nohost/manuelamador.name/manuel-amador-lebenslauf
Traceback (most recent call last):
  File "/home/user/optplone/deployments/master/src/collective.exportimport/src/collective/exportimport/export_content.py", line 281, in export_content
    item = serializer()
  File "/home/user/optplone/buildout-cache/eggs/cp38/plone.restapi-6.15.0-py3.8.egg/plone/restapi/serializer/dxcontent.py", line 107, in __call__
    result["allow_discussion"] = getMultiAdapter(
  File "/home/user/optplone/buildout-cache/eggs/cp38/zope.component-4.6.2-py3.8.egg/zope/component/_api.py", line 104, in getMultiAdapter
    raise ComponentLookupError(objects, interface, name)
zope.interface.interfaces.ComponentLookupError: ((<Document at /manuelamador.name/manuel-amador-lebenslauf>, <HTTPRequest, URL=http://nohost>), <InterfaceClass zope.interface.Interface>, 'conversation_view')

All of my content objects raise ComponentLookupError when exported via the CLI. This does not arise when exporting via the Web interface by point and click.

What gives? Is my REQUEST object not valid or something?

from collective.exportimport.

Rudd-O avatar Rudd-O commented on September 24, 2024

The snippet of code in dxcontent.py that specifically causes this:

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

Why is the conversation view not registered for my Dexterity content? This happens for all my sites, even freshly-created ones. I have to conclude there is something about running from the Plone debug CLI that causes this. How can I trace the situation to the problem? Thanks in advance.

from collective.exportimport.

Rudd-O avatar Rudd-O commented on September 24, 2024

By the way, the export from CLI problem happens in both Plone 5.x and Plone 6.

from collective.exportimport.

Rudd-O avatar Rudd-O commented on September 24, 2024

Note that I have verified that the configure.zcml from plone.app.discussion.browser that registers the conversation_view is in fact loaded during the client script startup (I broke it intentionally and saw it fail to start).

from collective.exportimport.

Rudd-O avatar Rudd-O commented on September 24, 2024

OK.

Using the CLI:

(<FolderishDocument at /manuelamador.name/manuel-amador-lebenslauf>, <HTTPRequest, URL=http://nohost>) [classImplements(?), directlyProvides(HTTPRequest, IDefaultBrowserLayer, IPathBlobsMarker, IMigrationMarker, IRawRichTextMarker, classImplements(HTTPRequest, IBrowserRequest, IAttributeAnnotatable))]
ERROR:collective.exportimport.export_content:Error exporting http://nohost/manuelamador.name/manuel-amador-lebenslauf
Traceback (most recent call last):
  File "/home/user/optplone/deployments/601a/src/collective.exportimport/src/collective/exportimport/export_content.py", line 280, in export_content
    item = serializer(include_items=False)
  File "/home/user/optplone/buildout-cache/eggs/cp38/plone.restapi-8.16.2-py3.8.egg/plone/restapi/serializer/dxcontent.py", line 150, in __call__
    folder_metadata = super().__call__(version=version)
  File "/home/user/optplone/buildout-cache/eggs/cp38/plone.restapi-8.16.2-py3.8.egg/plone/restapi/serializer/dxcontent.py", line 111, in __call__
    result["allow_discussion"] = getMultiAdapter(
  File "/home/user/optplone/buildout-cache/eggs/cp38/zope.component-4.6.2-py3.8.egg/zope/component/_api.py", line 104, in getMultiAdapter
    raise ComponentLookupError(objects, interface, name)
zope.interface.interfaces.ComponentLookupError: ((<FolderishDocument at /manuelamador.name/manuel-amador-lebenslauf>, <HTTPRequest, URL=http://nohost>), <InterfaceClass zope.interface.Interface>, 'conversation_view')

Using the Web UI:

(<FolderishDocument at /manuelamador.name/manuel-amador-lebenslauf>, <WSGIRequest, URL=http://127.0.1.4:8080/manuelamador.name/@@export_content>) [classImplements(?), directlyProvides(WSGIRequest, IPloneFormLayer, IDiscussionLayer, IThemingLayer, IBrowserLayer, IPloneAppContenttypesLayer, IThemeSpecific, collective.folderishtypes.dx.interfaces.IThemeSpecific, IManuelAmadorPolicyLayer, IDefaultBrowserLayer, IPathBlobsMarker, IMigrationMarker, IRawRichTextMarker)]

The differences are stark in what interfaces are provided by the object when requested via the CLI, vs. when requested via the Web UI.

Why!?

from collective.exportimport.

Rudd-O avatar Rudd-O commented on September 24, 2024

Uh there's also no difference what request I use (tried both makerequest and a hack to use WSGIRequest).

Is there some special initialization I need to be doing right before I call the export_content() view? Thanks in advance.

from collective.exportimport.

Rudd-O avatar Rudd-O commented on September 24, 2024

Could it be that the call to setDefaultSkin during Zope startup (executed during do_run() by plone.recipe.zope2instance.ctl)is not actually including the correct skins? I tried adding option no_request to it, and it seems like it worked to not add the REQUEST object to the app, but ...

from collective.exportimport.

Rudd-O avatar Rudd-O commented on September 24, 2024

Updated gist of code: https://gist.github.com/Rudd-O/4e657a90b8bc405de08d143221cee5ac (the part where "content" is skipped should be removed).

To be run using bin/client --no-request -c export_content.py site_id /path/to/export.

from collective.exportimport.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.