You are here

README.txt in Entity Export CSV 8

CONTENTS OF THIS FILE
---------------------

 * Introduction
 * Requirements
 * Similar modules
 * Installation
 * Configuration
 * Usage
 * Extending Entity Export CSV
 * Resources
 * Troubleshooting
 * FAQ
 * Maintainers

INTRODUCTION
------------

The Entity Export CSV module allows:

  * To export any content entity from Drupal 8
  * To select which fields are exportable for each entity and each bundle
  * To configure how each field of an entity is exported
  * To configure field by field their export behavior when multiple fields are
    involved (export in a single column with separator and export of each value
    in a separate column)

The module is easily customizable for the export of a particular field, with a
specific business need. It is designed to be usable by an end user without
special administrative rights on the configuration of a Drupal 8 project
(Views, Entity View Mode, etc.).

REQUIREMENTS
------------
None.

SIMILAR MODULES
------------

The Views Data Export module, as its name indicates, is based on the Core Views
module to configure and set up CSV exports. Using Views we can then configure
an export for any Drupal 8 entities, usually for a particular bundle. We then
need to configure as many views as we need to export and some limitations may
appear when it comes to exporting multiple fields. Setting up CSV export with
this module requires administrative rights to create and manage views of a
Drupal 8 project, with some understanding of how Views works. It is therefore
not really intended for end users.

The Content Export CSV module allows you to quickly export the nodes of a
Drupal 8 site. Its configuration options are very limited, especially the
choice of exported fields and their values, in addition to the fact that only
nodes can be exported with this module. Conversely, this module can be used
directly by end users.

The Entity Content Export module allows many configuration options. It can
export all Drupal 8 content entities and the exports of each entity can be
configured based on the entity view modes, including field formatters that we
can select and configure for a given content export. However, it requires a
consequent initial configuration, with very high administrative access rights,
at the level of each entity bundle that we want to make exportable.

Entity Export CSV try to be so easily usable as Content Export CSV can be, and
so customizable and configurable as the Entity Content Export end/or
Views Data Export modules can be.

INSTALLATION
------------

Install as you would normally install a contributed Drupal module. See:
https://www.drupal.org/docs/8/extending-drupal-8/installing-drupal-8-modules
for further information.

CONFIGURATION
-------------

The configuration page is under the menu Configuration > Content authoring >
Entity Export CSV settings (/admin/config/content/entity-export-csv/settings).

This configuration page allows you to select which content entities will be
exportable from among the content entities present in a project and, if
necessary, to limit them to one or more bundles, and also to limit (or not)
the fields of these entity bundles that will be exportable.

USAGE
-----

The export page is under the menu Content > Export CSV
(/admin/content/entity-export-csv). This export page allows, on the basis of
the initial selection configuration, the entity to be exported, then to
configure for each field whether it should be included in the export and if
so how it should be exported. Field multiple are supported, and also field with
multiple properties, i.e. you can export each property of a field into the same
column or into separate columns belong your needs, and this for single or
multiple field (unlimited cardinality).

EXTENDING ENTITY EXPORT CSV
---------------------------
The Entity Export CSV module relies on a Plugin system to export all fields
and can therefore be easily extended by a Drupal 8 developer to support any
type of special case or fields created by contributed modules (for example,
the module includes a Plugin for the fields of the Geolocation module and
the Address module).

To create a Field Export Plugin, a FieldTypeExport Plugin must therefore be
created in the src/Plugin/FieldTypeExport namespace of any Drupal 8 module.

The annotations of this plugin allow you to control certain behaviors of the
Plugin and its availability. Let's look at these annotations with the example
of the Geolocation plugin included in the module.


namespace Drupal\entity_export_csv\Plugin\FieldTypeExport;

use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\entity_export_csv\Plugin\FieldTypeExportBase;
use Drupal\Core\Field\FieldItemInterface;

/**
 * Defines a Geolocation field type export plugin.
 *
 * @FieldTypeExport(
 *   id = "geolocation_export",
 *   label = @Translation("Geolocation export"),
 *   description = @Translation("Geolocation export"),
 *   weight = 0,
 *   field_type = {
 *     "geolocation",
 *   },
 *   entity_type = {},
 *   bundle = {},
 *   field_name = {},
 *   exclusive = FALSE,
 * )
 */
class GeolocationExport extends FieldTypeExportBase {

}
The annotations of a FieldTypeExport plugin are : * weight: the weight of the plugin. The plugin with the highest weight will be the plugin selected by default if more than one plugin is available for a field. * field_type: the type of field to which the plugin applies. Multiple field types can be specified if necessary. This option is mandatory. * entity_type: it is possible here to limit the plugin to only certain entity types. Leave empty and the plugin will be available for the field type on any entity type. * bundle: it is possible here to limit the plugin to only certain entity bundles. Leave empty and the plugin will be available for the field type on any bundles * field_name: here it is possible to limit the plugin to one particular field. Leave empty and the plugin will be available for the field type on all fields of that type. * exclusive: this option if set to TRUE will make this plugin exclusive, i.e. all other plugins available for this field type will no longer be visible. Useful if you want to limit the options available to export a specific field by a particular field. Default value is FALSE. You can then override all the methods available on the Base Plugin in order to customize the export rendering of the field. In particular you can expose new configuration options, and of course implement the massageExportPropertyValue() method which is in charge of formatting the export of a field instance. RESOURCES --------- Blog posts about Entity Export CSV : * https://www.flocondetoile.fr/blog/export-content-csv-drupal-8 TROUBLESHOOTING --------------- FAQ --- MAINTAINERS ----------- Current maintainers: * flocondetoile - https://drupal.org/u/flocondetoile

File

README.txt
View source
  1. CONTENTS OF THIS FILE
  2. ---------------------
  3. * Introduction
  4. * Requirements
  5. * Similar modules
  6. * Installation
  7. * Configuration
  8. * Usage
  9. * Extending Entity Export CSV
  10. * Resources
  11. * Troubleshooting
  12. * FAQ
  13. * Maintainers
  14. INTRODUCTION
  15. ------------
  16. The Entity Export CSV module allows:
  17. * To export any content entity from Drupal 8
  18. * To select which fields are exportable for each entity and each bundle
  19. * To configure how each field of an entity is exported
  20. * To configure field by field their export behavior when multiple fields are
  21. involved (export in a single column with separator and export of each value
  22. in a separate column)
  23. The module is easily customizable for the export of a particular field, with a
  24. specific business need. It is designed to be usable by an end user without
  25. special administrative rights on the configuration of a Drupal 8 project
  26. (Views, Entity View Mode, etc.).
  27. REQUIREMENTS
  28. ------------
  29. None.
  30. SIMILAR MODULES
  31. ------------
  32. The Views Data Export module, as its name indicates, is based on the Core Views
  33. module to configure and set up CSV exports. Using Views we can then configure
  34. an export for any Drupal 8 entities, usually for a particular bundle. We then
  35. need to configure as many views as we need to export and some limitations may
  36. appear when it comes to exporting multiple fields. Setting up CSV export with
  37. this module requires administrative rights to create and manage views of a
  38. Drupal 8 project, with some understanding of how Views works. It is therefore
  39. not really intended for end users.
  40. The Content Export CSV module allows you to quickly export the nodes of a
  41. Drupal 8 site. Its configuration options are very limited, especially the
  42. choice of exported fields and their values, in addition to the fact that only
  43. nodes can be exported with this module. Conversely, this module can be used
  44. directly by end users.
  45. The Entity Content Export module allows many configuration options. It can
  46. export all Drupal 8 content entities and the exports of each entity can be
  47. configured based on the entity view modes, including field formatters that we
  48. can select and configure for a given content export. However, it requires a
  49. consequent initial configuration, with very high administrative access rights,
  50. at the level of each entity bundle that we want to make exportable.
  51. Entity Export CSV try to be so easily usable as Content Export CSV can be, and
  52. so customizable and configurable as the Entity Content Export end/or
  53. Views Data Export modules can be.
  54. INSTALLATION
  55. ------------
  56. Install as you would normally install a contributed Drupal module. See:
  57. https://www.drupal.org/docs/8/extending-drupal-8/installing-drupal-8-modules
  58. for further information.
  59. CONFIGURATION
  60. -------------
  61. The configuration page is under the menu Configuration > Content authoring >
  62. Entity Export CSV settings (/admin/config/content/entity-export-csv/settings).
  63. This configuration page allows you to select which content entities will be
  64. exportable from among the content entities present in a project and, if
  65. necessary, to limit them to one or more bundles, and also to limit (or not)
  66. the fields of these entity bundles that will be exportable.
  67. USAGE
  68. -----
  69. The export page is under the menu Content > Export CSV
  70. (/admin/content/entity-export-csv). This export page allows, on the basis of
  71. the initial selection configuration, the entity to be exported, then to
  72. configure for each field whether it should be included in the export and if
  73. so how it should be exported. Field multiple are supported, and also field with
  74. multiple properties, i.e. you can export each property of a field into the same
  75. column or into separate columns belong your needs, and this for single or
  76. multiple field (unlimited cardinality).
  77. EXTENDING ENTITY EXPORT CSV
  78. ---------------------------
  79. The Entity Export CSV module relies on a Plugin system to export all fields
  80. and can therefore be easily extended by a Drupal 8 developer to support any
  81. type of special case or fields created by contributed modules (for example,
  82. the module includes a Plugin for the fields of the Geolocation module and
  83. the Address module).
  84. To create a Field Export Plugin, a FieldTypeExport Plugin must therefore be
  85. created in the src/Plugin/FieldTypeExport namespace of any Drupal 8 module.
  86. The annotations of this plugin allow you to control certain behaviors of the
  87. Plugin and its availability. Let's look at these annotations with the example
  88. of the Geolocation plugin included in the module.
  89. @code
  90. namespace Drupal\entity_export_csv\Plugin\FieldTypeExport;
  91. use Drupal\Core\Field\FieldDefinitionInterface;
  92. use Drupal\Core\Form\FormStateInterface;
  93. use Drupal\entity_export_csv\Plugin\FieldTypeExportBase;
  94. use Drupal\Core\Field\FieldItemInterface;
  95. /**
  96. * Defines a Geolocation field type export plugin.
  97. *
  98. * @FieldTypeExport(
  99. * id = "geolocation_export",
  100. * label = @Translation("Geolocation export"),
  101. * description = @Translation("Geolocation export"),
  102. * weight = 0,
  103. * field_type = {
  104. * "geolocation",
  105. * },
  106. * entity_type = {},
  107. * bundle = {},
  108. * field_name = {},
  109. * exclusive = FALSE,
  110. * )
  111. */
  112. class GeolocationExport extends FieldTypeExportBase {
  113. // Stuff.
  114. }
  115. @endcode
  116. The annotations of a FieldTypeExport plugin are :
  117. * weight: the weight of the plugin. The plugin with the highest weight will
  118. be the plugin selected by default if more than one plugin is available for
  119. a field.
  120. * field_type: the type of field to which the plugin applies. Multiple field
  121. types can be specified if necessary. This option is mandatory.
  122. * entity_type: it is possible here to limit the plugin to only certain entity
  123. types. Leave empty and the plugin will be available for the field type on
  124. any entity type.
  125. * bundle: it is possible here to limit the plugin to only certain entity
  126. bundles. Leave empty and the plugin will be available for the field type
  127. on any bundles
  128. * field_name: here it is possible to limit the plugin to one particular
  129. field. Leave empty and the plugin will be available for the field type on
  130. all fields of that type.
  131. * exclusive: this option if set to TRUE will make this plugin exclusive, i.e.
  132. all other plugins available for this field type will no longer be visible.
  133. Useful if you want to limit the options available to export a specific
  134. field by a particular field. Default value is FALSE.
  135. You can then override all the methods available on the Base Plugin in order to
  136. customize the export rendering of the field. In particular you can expose new
  137. configuration options, and of course implement the massageExportPropertyValue()
  138. method which is in charge of formatting the export of a field instance.
  139. RESOURCES
  140. ---------
  141. Blog posts about Entity Export CSV :
  142. * https://www.flocondetoile.fr/blog/export-content-csv-drupal-8
  143. TROUBLESHOOTING
  144. ---------------
  145. FAQ
  146. ---
  147. MAINTAINERS
  148. -----------
  149. Current maintainers:
  150. * flocondetoile - https://drupal.org/u/flocondetoile