Dexterity Items cannot be imported using GS

classic Classic list List threaded Threaded
4 messages Options
Franco Pellegrini-2 Franco Pellegrini-2
Reply | Threaded
Open this post in threaded view
|

Dexterity Items cannot be imported using GS

Today i found that if i want to load content to my site using the GS import content step, then this happens:

Traceback (innermost last):
  Module ZPublisher.Publish, line 126, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 46, in call_object
  Module <string>, line 6, in reinstallProducts
  Module AccessControl.requestmethod, line 70, in _curried
  Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 640, in reinstallProducts
  Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 580, in installProducts
  Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 512, in installProduct
   - __traceback_info__: ('test.package',)
  Module Products.GenericSetup.tool, line 350, in runAllImportStepsFromProfile
   - __traceback_info__: profile-test.package:default
  Module Products.GenericSetup.tool, line 1100, in _runImportStepsFromContext
  Module Products.GenericSetup.tool, line 1015, in _doRunImportStep
   - __traceback_info__: content
  Module Products.CMFCore.exportimport.content, line 34, in importSiteStructure
  Module Products.CMFCore.exportimport.content, line 190, in import_
TypeError: ('Could not adapt', <Item at /Plone/test-content>, <InterfaceClass Products.GenericSetup.interfaces.IFilesystemImporter>)


This, however, does not happen, if the content is a Dexterity Container, and the content gets imported properly...

Digging a bit, i found that there's an adapter for IFolderish, that provides
IFilesystemImporter defined in Products/CMFCore/exportimport/configure.zcml but there's none for IItem or similar.

Non folderish AT items, provide IDAVAware, for which there's an import handler defined in Products/GenericSetup/configure.zcml

From this, i have a couple of questions:

1) Am i missing something or is this a bug?
2) If it is a bug, what would be a proper solution?
2.a) Dexterity Items should provide IDAVAware?
2.b) Should there be an import/export handler for IItems?
2.c) Etc ?


Regards,
Franco

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Plone-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers
Martin Aspeli Martin Aspeli
Reply | Threaded
Open this post in threaded view
|

Re: Dexterity Items cannot be imported using GS

Hi,


On 24 January 2013 18:57, Franco Pellegrini <[hidden email]> wrote:
Today i found that if i want to load content to my site using the GS import content step, then this happens:

Traceback (innermost last):
  Module ZPublisher.Publish, line 126, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 46, in call_object
  Module <string>, line 6, in reinstallProducts
  Module AccessControl.requestmethod, line 70, in _curried
  Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 640, in reinstallProducts
  Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 580, in installProducts
  Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 512, in installProduct
   - __traceback_info__: ('test.package',)
  Module Products.GenericSetup.tool, line 350, in runAllImportStepsFromProfile
   - __traceback_info__: profile-test.package:default
  Module Products.GenericSetup.tool, line 1100, in _runImportStepsFromContext
  Module Products.GenericSetup.tool, line 1015, in _doRunImportStep
   - __traceback_info__: content
  Module Products.CMFCore.exportimport.content, line 34, in importSiteStructure
  Module Products.CMFCore.exportimport.content, line 190, in import_
TypeError: ('Could not adapt', <Item at /Plone/test-content>, <InterfaceClass Products.GenericSetup.interfaces.IFilesystemImporter>)


This, however, does not happen, if the content is a Dexterity Container, and the content gets imported properly...

Digging a bit, i found that there's an adapter for IFolderish, that provides
IFilesystemImporter defined in Products/CMFCore/exportimport/configure.zcml but there's none for IItem or similar.

Non folderish AT items, provide IDAVAware, for which there's an import handler defined in Products/GenericSetup/configure.zcml

From this, i have a couple of questions:

1) Am i missing something or is this a bug?

Maybe a missing feature? ;-)
 
2) If it is a bug, what would be a proper solution?
2.a) Dexterity Items should provide IDAVAware?

Dexterity items do support the Zope DAV protocol, so it may be worth doing this, but I'm not sure if it'd introduce a dodgy dependency.
 
2.b) Should there be an import/export handler for IItems?

This feels most appropriate to me, all other things being equal.

Martin

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Plone-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers
Franco Pellegrini-2 Franco Pellegrini-2
Reply | Threaded
Open this post in threaded view
|

Re: Dexterity Items cannot be imported using GS

Hi,


On Thu, Jan 24, 2013 at 4:45 PM, Martin Aspeli <[hidden email]> wrote:
Hi,


On 24 January 2013 18:57, Franco Pellegrini <[hidden email]> wrote:
Today i found that if i want to load content to my site using the GS import content step, then this happens:

Traceback (innermost last):
  Module ZPublisher.Publish, line 126, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 46, in call_object
  Module <string>, line 6, in reinstallProducts
  Module AccessControl.requestmethod, line 70, in _curried
  Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 640, in reinstallProducts
  Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 580, in installProducts
  Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 512, in installProduct
   - __traceback_info__: ('test.package',)
  Module Products.GenericSetup.tool, line 350, in runAllImportStepsFromProfile
   - __traceback_info__: profile-test.package:default
  Module Products.GenericSetup.tool, line 1100, in _runImportStepsFromContext
  Module Products.GenericSetup.tool, line 1015, in _doRunImportStep
   - __traceback_info__: content
  Module Products.CMFCore.exportimport.content, line 34, in importSiteStructure
  Module Products.CMFCore.exportimport.content, line 190, in import_
TypeError: ('Could not adapt', <Item at /Plone/test-content>, <InterfaceClass Products.GenericSetup.interfaces.IFilesystemImporter>)


This, however, does not happen, if the content is a Dexterity Container, and the content gets imported properly...

Digging a bit, i found that there's an adapter for IFolderish, that provides
IFilesystemImporter defined in Products/CMFCore/exportimport/configure.zcml but there's none for IItem or similar.

Non folderish AT items, provide IDAVAware, for which there's an import handler defined in Products/GenericSetup/configure.zcml

From this, i have a couple of questions:

1) Am i missing something or is this a bug?

Maybe a missing feature? ;-)

Aha ! hehe... :)
 
 
2) If it is a bug, what would be a proper solution?
2.a) Dexterity Items should provide IDAVAware?

Dexterity items do support the Zope DAV protocol, so it may be worth doing this, but I'm not sure if it'd introduce a dodgy dependency.
 
2.b) Should there be an import/export handler for IItems?

This feels most appropriate to me, all other things being equal.

Martin


I'll take a look at 2.a soon, but for 2.b sounds like a nice TODO for the Emerald sprint :)

Cheers,
Franco

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Plone-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers
David Glick (Plone) David Glick (Plone)
Reply | Threaded
Open this post in threaded view
|

Re: Dexterity Items cannot be imported using GS

In reply to this post by Franco Pellegrini-2
On 1/24/13 10:57 AM, Franco Pellegrini wrote:

> Today i found that if i want to load content to my site using the GS
> import content step, then this happens:
>
> Traceback (innermost last):
>   Module ZPublisher.Publish, line 126, in publish
>   Module ZPublisher.mapply, line 77, in mapply
>   Module ZPublisher.Publish, line 46, in call_object
>   Module <string>, line 6, in reinstallProducts
>   Module AccessControl.requestmethod, line 70, in _curried
>   Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 640,
> in reinstallProducts
>   Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 580,
> in installProducts
>   Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 512,
> in installProduct
>    - __traceback_info__: ('test.package',)
>   Module Products.GenericSetup.tool, line 350, in
> runAllImportStepsFromProfile
>    - __traceback_info__: profile-test.package:default
>   Module Products.GenericSetup.tool, line 1100, in
> _runImportStepsFromContext
>   Module Products.GenericSetup.tool, line 1015, in _doRunImportStep
>    - __traceback_info__: content
>   Module Products.CMFCore.exportimport.content, line 34, in
> importSiteStructure
>   Module Products.CMFCore.exportimport.content, line 190, in import_
> TypeError: ('Could not adapt', <Item at /Plone/test-content>,
> <InterfaceClass Products.GenericSetup.interfaces.IFilesystemImporter>)
>
>
> This, however, does not happen, if the content is a Dexterity
> Container, and the content gets imported properly...
>
> Digging a bit, i found that there's an adapter for IFolderish, that
> provides
> IFilesystemImporter defined in
> Products/CMFCore/exportimport/configure.zcml but there's none for
> IItem or similar.
>
> Non folderish AT items, provide IDAVAware, for which there's an import
> handler defined in Products/GenericSetup/configure.zcml
>
> From this, i have a couple of questions:
>
> 1) Am i missing something or is this a bug?
> 2) If it is a bug, what would be a proper solution?
> 2.a) Dexterity Items should provide IDAVAware?
> 2.b) Should there be an import/export handler for IItems?
> 2.c) Etc ?
>
I just added support in plone.dexterity for GS import/export, based on
the existing rfc822 serialization support for WebDAV:
https://github.com/plone/plone.dexterity/commit/a028c264d3f8749654b17818083de5992ff8b5ad

David

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Plone-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers