silverstripe / gridfieldqueuedexport
Export large data sets from your GridField in the SilverStripe CMS interface through async jobs
Installs: 165 303
Dependents: 5
Suggesters: 7
Security: 0
Stars: 10
Watchers: 10
Forks: 25
Open Issues: 9
Type:silverstripe-vendormodule
Requires
- php: ^8.3
- league/csv: ^9
- silverstripe/framework: ^6
- symbiote/silverstripe-queuedjobs: ^6
Requires (Dev)
- 4.x-dev
- 4.0.x-dev
- 4.0.0-alpha1
- 3.x-dev
- 3.3.x-dev
- 3.3.0
- 3.3.0-rc1
- 3.3.0-beta1
- 3.2.x-dev
- 3.2.0
- 3.2.0-rc1
- 3.2.0-beta1
- 3.1.x-dev
- 3.1.1
- 3.1.0
- 3.1.0-rc1
- 3.1.0-beta1
- 3.0.x-dev
- 3.0.2
- 3.0.1
- 3.0.0
- 3.0.0-rc1
- 3.0.0-beta1
- 2.x-dev
- 2.8.x-dev
- 2.8.3
- 2.8.2
- 2.8.1
- 2.8.0
- 2.8.0-rc1
- 2.8.0-beta1
- 2.7.x-dev
- 2.7.0
- 2.7.0-rc1
- 2.7.0-beta1
- 2.6.x-dev
- 2.6.2
- 2.6.1
- 2.6.0
- 2.5.x-dev
- 2.5.1
- 2.5.0
- 2.5.0-rc1
- 2.5.0-beta1
- 2.5.0-alpha1
- 2.4.x-dev
- 2.4.0
- 2.4.0-rc1
- 2.4.0-beta1
- 2.3.x-dev
- 2.3.0
- 2.2.x-dev
- 2.2.0
- 2.1.x-dev
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.x-dev
- 2.0.0
- 2.0.0-beta1
- 1.x-dev / 1.2.x-dev
- 1.1.x-dev
- 1.1.0
- 1.0.x-dev
- 1.0.0
- 1.0.0-rc2
- 1.0.0-rc1
- dev-dependabot/npm_and_yarn/nanoid-3.3.8
- dev-master
This package is auto-updated.
Last update: 2024-12-14 09:55:02 UTC
README
Introduction
Allows for large data set exports from a GridField
. By using an asynchronous job queue, we avoid
running out of PHP memory or exceeding any maximum execution time limits.
The exact limitations of a standard GridField
export vary based on the server configuration,
server capacity and the complexity of the exported DataObject
.
As a rough guide, you should consider using this module
when more than 1000 records need to be exported. The module should be able to export
10,000 records on a standard server configuration within a few minutes.
Installation
composer require silverstripe/gridfieldqueuedexport
Configuration
Since this component operates on a GridField
, you can simply use it's addComponent()
API.
$gridField = GridField::create('Pages', 'All pages', SiteTree::get()) $config = $gridField->getConfig(); $config->addComponent(GridFieldQueuedExportButton::create('buttons-after-left'));
If you want to replace the GridFieldExportButton
created by the default GridField configuration,
you also need to call removeComponentsByType()
.
// Find GridField $gridField = $fields->fieldByName('MyGridField'); $config = $gridField->getConfig(); // Add new component $oldExportButton = $config->getComponentByType(GridFieldExportButton::class); $config->addComponent($newExportButton = GridFieldQueuedExportButton::create('buttons-after-left')); // Set Header and Export columns on new Export Button $newExportButton->setCsvHasHeader($oldExportButton->getCsvHasHeader()); $newExportButton->setExportColumns($oldExportButton->getExportColumns()); // Remove original component $config->removeComponentsByType(GridFieldExportButton::class);
Note: This module is preconfigured to work with the silverstripe/userforms submission CSV export.
Related
- silverstripe/queuedjobcsvexport: General purpose CSV exports through queuedjobs (without a dependency on GridField)