Metadata-Version: 1.1
Name: collective.contentexport
Version: 1.0b2
Summary: Plone add-on to export dexterity content in various formats
Home-page: https://pypi.python.org/pypi/collective.contentexport
Author: Philip Bauer
Author-email: bauer@starzel.de
License: GPL version 2
Description: .. This README is meant for consumption by humans and pypi. Pypi can render rst files so please do not use Sphinx features.
           If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide_addons.html
           This text does not appear on pypi or github. It is a comment.
        
        .. image:: https://travis-ci.org/starzel/collective.contentexport.svg?branch=master
            :target: https://travis-ci.org/starzel/collective.contentexport
        
        .. image:: https://coveralls.io/repos/starzel/collective.contentexport/badge.svg?branch=master&service=github
            :target: https://coveralls.io/github/starzel/collective.contentexport?branch=master
        
        
        ==============================================================================
        collective.contentexport
        ==============================================================================
        
        
        Features
        --------
        
        Exports dexterity content in various formats:
        
        - xlsx
        - xls
        - csv
        - tsv
        - json
        - yaml
        - html (a table)
        - zip-file containing all images from image-fields
        - zip-file containing all files from file-fields
        - zip-file containing related files and images from relationfields
        
        .. figure:: docs/export_screenshot.png
           :align: center
        
        Usage
        -----
        
        Provides a form ``/@@export_view`` to configure the export.
        
        The form allows you to:
        
        - Select the export type
        - Select the content type to export
        - Choose fields from the selected type to be ignored
        - Select the format of richtext-fields (html/plaintext)
        - Select the format for files and images (url, base64, location within zip-file)
        
        collective.contentexport uses `tablib <https://pypi.python.org/pypi/tablib>`_ for several export-formats.
        
        
        Use in code
        -----------
        
        You can use the ``export_view`` in code to have more control over the results.
        
        The view ``export_view`` accepts the following parameters:
        
        - export_type
        - portal_type
        - blob_format
        - richtext_format
        - blacklist
        - whitelist
        - additional
        
        The following example creates a zip-file with images or files from the field ``primary_picture`` for the type ``some_type``:
        
        ..  code-block:: python
        
            view = api.content.get_view('export_view', portal, request)
            view(export_type='related', portal_type='some_type', whitelist='primary_picture')
        
        You can also extend the export.
        In the following example the value ``some_fieldname`` is being extracted from the object using the method ``_somehandler``.
        
        ..  code-block:: python
        
            def _somehandler(obj):
                return some_crazy_transform(obj.custom_field)
        
            additional = {'some_fieldname': _somehandler}
            view = api.content.get_view('export_view', portal, request)
            result = view(export_type='json', portal_type='Document', additional=additional)
        
        You can also override the default methods to modify the default behavior.
        In the following example the ``image`` from Images is being extracted using the method ``_get_imagename`` that only dumps the filename of the image:
        
        ..  code-block:: python
        
            def _get_imagename(obj):
                if obj.image:
                    return obj.image.filename
        
            additional = {'image': _get_imagename}
            view = api.content.get_view('export_view', portal, request)
            result = view(export_type='json', portal_type='Image', additional=additional)
        
        
        Compatability
        -------------
        
        collective.contentexport is tested to work in Plone 4 and Plone 5.
        
        
        Installation
        ------------
        
        Install collective.contentexport by adding it to your buildout::
        
            [buildout]
        
            ...
        
            eggs =
                collective.contentexport
        
        
        and then running ``bin/buildout``
        
        
        Contribute
        ----------
        
        - Issue Tracker: https://github.com/starzel/collective.contentexport/issues
        - Source Code: https://github.com/starzel/collective.contentexport
        
        
        Support
        -------
        
        If you are having issues, please let us know at https://github.com/starzel/collective.contentexport/issues.
        
        
        License
        -------
        
        The project is licensed under the GPLv2.
        
        Contributors
        ============
        
        - Philip Bauer, bauer@starzel.de
        
        Changelog
        =========
        
        
        1.0b2 (2015-11-06)
        ------------------
        
        - Add whitelist (only export fields in the whitelist)
          [pbauer]
        
        - Document extending and overriding the export.
          [pbauer]
        
        
        1.0b1 (2015-11-05)
        ------------------
        
        - Sort fieldnames in blacklist by alphabet.
          [pbauer]
        
        - Add ability to provide additional export-methods for arbitrary data by
          extending ADDITIONAL_MAPPING.
          [pbauer]
        
        - Add tests
          [pbauer]
        
        
        1.0a2 (2015-11-04)
        ------------------
        
        - Localize datetime
          [pbauer]
        
        - Prevent uneven dimension of data-dict
          [pbauer]
        
        - Fix blacklist
          [pbauer]
        
        
        1.0a1 (2015-11-04)
        ------------------
        
        - Get content from all languages.
          [pbauer]
        
        - Add export for multiple images and files related with RelationList.
          [pbauer]
        
        - Allow choosing blacklisted fields from the fields of the selected type.
          [pbauer]
        
        - Use http://docs.python-tablib.org for most exports.
          [pbauer]
        
        - Add German translations.
          [pbauer]
        
        - Moved initial code from client-project to github.
          [pbauer]
        
        
Keywords: Python Plone
Platform: UNKNOWN
Classifier: Environment :: Web Environment
Classifier: Framework :: Plone
Classifier: Framework :: Plone :: 5.0
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
