Skip to content

RedTurtle/redturtle.exporter.base

Repository files navigation

Redturtle Exporter base

image

Tool that exports Plone contents for a major migration.

This should be used with redturtle.importer.base/volto packages.

Features

  • Easily to include in your old site (just add to the buildout)
  • No dependencies to other tools
  • Easily to extend (see below)

Custom exporters

This base product exports standard content-types (also Archetype-based).

If your site has some additional content-types to be exported and need to structure output in a more specific way, you can create a more specific package (for example redturtle.importer.project_name) where you can add specific exporters like this:

<browser:page
  for="my.project.interfaces.IMyCustomType"
  name="get_item"
  class=".jsonify.MyCustomTypeGetItem"
  permission="zope2.ViewManagementScreens"
  />

where GetItem class is:

from redturtle.exporter.base.browser.jsonify import GetItem as BaseGetter
class MyCustomTypeGetItem(GetItem):

    def __call__(self):

        context_dict = super(MyCustomTypeGetItem, self).__call__()
        ... do something with context_dict ...

        return get_json_object(self, context_dict)

Additional data exporter

You can add some additional data to exported json registering an adapter for ICustomDataExporter:

<subscriber factory=".my_data.ExtraDataExporter"
            provides="redturtle.exporter.base.interfaces.ICustomDataExporter"/>

and in python code you need to return a dictionary with needed informations:

@adapter(Interface, Interface)
@implementer(ICustomDataExporter)
class ExtraDataExporter(object):
    order = 4  # set an execution order

    def __init__(self, context, request):
        self.context = context
        self.request = request

    def __call__(self):
        """
        """
        return {'foo': 'bar'}

Export users and groups

There are two additional views that can be called (only Site Managers has access to these views) to export the list of users and groups:

  • /export_users
  • /export_groups

These views returns a json with all the informations.

Installation

Install redturtle.exporter.base by adding it to your buildout:

[buildout]

...

eggs =
    redturtle.exporter.base

and then running bin/buildout

Contribute

Credits

This product has been developed with some help from

kitconcept

License

The project is licensed under the GPLv2.

About

Exports Plone contents in json format

Resources

License

GPL-2.0, Unknown licenses found

Licenses found

GPL-2.0
LICENSE.GPL
Unknown
LICENSE.rst

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •