1. Ed Crewe
  2. ilrt.contentmigrator
  3. Issues
Issue #4 resolved

archetypes content not exported

created an issue

I installed the product in Plone 3.1.5. Export seems to work (for at least for richdocument content objects), but not for archetypes objects. For folders containing archetypes objects, an .objects file is generated which lists the title and and content type of the archetypes objects. (So far so good). However there were no files that contained the actual field values in the objects. The only other file (properties) had information related to the enclosing folder.

For example, if I have an archetype object of type "Publication" with title "Hello World" and custom schema field values "author:John Doe" and "abstract:A nice story". The .objects file has:


But the field values: "author:John Doe" and "abstract:A nice story" are not exported. If anyone has a suggestion, please let me know.

Comments (4)

  1. Ed Crewe repo owner

    See around line 576 of ilrt.contentmigrator.ContentMigrator/ContentExporter.py

    For custom content types there is I believe a convention that the page content is returned by the .text method or attribute. Since the content type could have any attributes then there is no other way for the migrator to know what one (or combination of them) should form the textual html content.

    The same for other standard Plone content manipulation tools ... text is expected or at least a getText() method that returns text.

    If no text is found for something that should be a textual content object the migrator doesnt export it (- probably in itself this is a bug).

    You should be able to work around this - either by adding a text method that returns the abstract field to your content type - or by substitute in the attribute name your content type uses for 'text' or modifying the code at line 576 to check for it too, ie. check both ['abstract','text']

  2. Ed Crewe repo owner

    Change this to enhancement request to be able to configure a list of attributes to check for in addition for the default .text attribute for custom content types.

  3. Ed Crewe repo owner

    This has been added in 1.13

    See ilrt/contentmigrator/ContentMigrator/config.py ... at the bottom ...

    Some objects have custom text methods that process it for rendering

    ... you probably want to export that rather than the raw text so add them here

    first one that returns the text in the method list is used otherwise obj.text

    TEXT_GETTERS = ['CookedBody', 'getText']

  4. Log in to comment