Skip to content

Commit 1e87b14

Browse files
mattamonlukmzigmartineibermcop1alexz707
authored
[Task] Refactor csv export to one route (#926)
* Refactor csv export to one route * Minor styling issues * Apply php-cs-fixer changes * Remove unecessary controller * Update docs * Using elements instead of asset for config steps * Update docs * [Task] Csv export objects (#952) * Add messenges and handlers * Update data object export handler * Restructure csv export to make exporting objects possible * Apply php-cs-fixer changes * Split lines * Apply php-cs-fixer changes * Split more lines * Make explicitly nullable * Add missing params * Add columndefinition params * Apply php-cs-fixer changes * Make multiline comment * Make explicitly nullable * Make explicitly nullable * Also the interface needs to be explicitly nullable * Remove circular reference * Apply php-cs-fixer changes * Split lines * Apply php-cs-fixer changes * merge based on 1.x * Apply php-cs-fixer changes * fiX sonar * fiX STAN * add export logic to adapters * Apply php-cs-fixer changes * add adapter method for encrypted field export * Apply php-cs-fixer changes * Update src/Grid/Service/ClassDefinitionService.php Co-authored-by: Martin Eiber <martin.eiber@pimcore.com> * Update src/Grid/Service/ClassDefinitionService.php Co-authored-by: Martin Eiber <martin.eiber@pimcore.com> * Apply php-cs-fixer changes * apply feedback from review * remove unused column definitions --------- Co-authored-by: lukmzig <lukas.mzigot@pimcore.com> Co-authored-by: lukmzig <30526586+lukmzig@users.noreply.github.com> Co-authored-by: Martin Eiber <martin.eiber@pimcore.com> * add new property for legacy context params * Apply php-cs-fixer changes * [Translations] Allow creation of case-sensitive translation keys (#1001) * Added collation * Apply php-cs-fixer changes * Change dependencies in composer (#1003) * [Classification Store] Get Layout (#1002) * Get Layout Definition for Group ID * Get Layout Definition for Collection ID * Apply php-cs-fixer changes * Fix Style. * Fix Style. * Remove internal form Event and the according Schema. * Apply php-cs-fixer changes --------- Co-authored-by: martineiber <11687066+martineiber@users.noreply.github.com> * [Data Object Editor] Invalid localized fields context (#985) * fix: context object can be null * Apply php-cs-fixer changes * create abstract data for context if there is none present * Always create a new FieldContextData object for each type inside fc * Apply php-cs-fixer changes * Added support for localized fields in block * Apply php-cs-fixer changes * Adapted support for localized fields in block container --------- Co-authored-by: Marco Perberschlager <marco.perberschlager@pimcore.com> Co-authored-by: mcop1 <89011527+mcop1@users.noreply.github.com> * [Grid] [Elements] XLSX Export (#1009) * add initial xlsx export settings * add initial xlsx export settings * add missing routes * Apply php-cs-fixer changes --------- Co-authored-by: lukmzig <lukas.mzigot@pimcore.com> Co-authored-by: lukmzig <30526586+lukmzig@users.noreply.github.com> Co-authored-by: Martin Eiber <martin.eiber@pimcore.com> Co-authored-by: mcop1 <89011527+mcop1@users.noreply.github.com> Co-authored-by: Al3x Zamponi <562324+alexz707@users.noreply.github.com> Co-authored-by: martineiber <11687066+martineiber@users.noreply.github.com> Co-authored-by: Marco Perberschlager <marco.perberschlager@pimcore.com>
1 parent 97b46f8 commit 1e87b14

99 files changed

Lines changed: 2394 additions & 755 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

config/assets.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ services:
5252
Pimcore\Bundle\StudioBackendBundle\Asset\Service\ExecutionEngine\ZipServiceInterface:
5353
class: Pimcore\Bundle\StudioBackendBundle\Asset\Service\ExecutionEngine\ZipService
5454

55-
Pimcore\Bundle\StudioBackendBundle\Asset\Service\ExecutionEngine\CsvServiceInterface:
56-
class: Pimcore\Bundle\StudioBackendBundle\Asset\Service\ExecutionEngine\CsvService
57-
58-
5955
#
6056
# Updaters
6157
#
@@ -79,8 +75,8 @@ services:
7975

8076
Pimcore\Bundle\StudioBackendBundle\Asset\ExecutionEngine\AutomationAction\Messenger\Handler\AssetCloneHandler: ~
8177
Pimcore\Bundle\StudioBackendBundle\Asset\ExecutionEngine\AutomationAction\Messenger\Handler\AssetUploadHandler: ~
82-
Pimcore\Bundle\StudioBackendBundle\Asset\ExecutionEngine\AutomationAction\Messenger\Handler\CsvAssetDataCollectionHandler: ~
83-
Pimcore\Bundle\StudioBackendBundle\Asset\ExecutionEngine\AutomationAction\Messenger\Handler\CsvFolderDataCollectionHandler: ~
78+
Pimcore\Bundle\StudioBackendBundle\Asset\ExecutionEngine\AutomationAction\Messenger\Handler\ExportDataCollectionHandler: ~
79+
Pimcore\Bundle\StudioBackendBundle\Asset\ExecutionEngine\AutomationAction\Messenger\Handler\ExportFolderDataCollectionHandler: ~
8480
Pimcore\Bundle\StudioBackendBundle\Asset\ExecutionEngine\AutomationAction\Messenger\Handler\ZipDownloadHandler: ~
8581
Pimcore\Bundle\StudioBackendBundle\Asset\ExecutionEngine\AutomationAction\Messenger\Handler\ZipUploadHandler: ~
8682

config/data_objects.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ services:
208208
#
209209

210210
Pimcore\Bundle\StudioBackendBundle\DataObject\ExecutionEngine\AutomationAction\Messenger\Handler\CloneHandler: ~
211+
Pimcore\Bundle\StudioBackendBundle\DataObject\ExecutionEngine\AutomationAction\Messenger\Handler\ExportDataCollectionHandler: ~
212+
Pimcore\Bundle\StudioBackendBundle\DataObject\ExecutionEngine\AutomationAction\Messenger\Handler\ExportFolderDataCollectionHandler: ~
211213

212214
#
213215
# Event Subscriber

config/export.yaml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,42 @@ services:
1515
# Handler
1616
#
1717

18-
Pimcore\Bundle\StudioBackendBundle\Export\ExecutionEngine\AutomationAction\Messenger\Handler\CsvCreationHandler: ~
18+
Pimcore\Bundle\StudioBackendBundle\Export\ExecutionEngine\AutomationAction\Messenger\Handler\CsvCreationHandler:
19+
arguments:
20+
$csvExportService: '@Pimcore\Bundle\StudioBackendBundle\Export\Service\CsvExportService'
21+
22+
Pimcore\Bundle\StudioBackendBundle\Export\ExecutionEngine\AutomationAction\Messenger\Handler\XlsxCreationHandler:
23+
arguments:
24+
$xlsxExportService: '@Pimcore\Bundle\StudioBackendBundle\Export\Service\XlsxExportService'
1925

2026
#
2127
# Services
2228
#
2329

24-
Pimcore\Bundle\StudioBackendBundle\Export\Csv\CsvExportService: ~
25-
Pimcore\Bundle\StudioBackendBundle\Export\ExportServiceInterface: '@Pimcore\Bundle\StudioBackendBundle\Export\Csv\CsvExportService'
30+
Pimcore\Bundle\StudioBackendBundle\Export\Service\CsvExportService: ~
31+
Pimcore\Bundle\StudioBackendBundle\Export\Service\XlsxExportService: ~
32+
2633
Pimcore\Bundle\StudioBackendBundle\Export\Service\DownloadServiceInterface:
2734
class: Pimcore\Bundle\StudioBackendBundle\Export\Service\DownloadService
2835

36+
Pimcore\Bundle\StudioBackendBundle\Export\Service\ExecutionEngine\ExportServiceInterface:
37+
class: Pimcore\Bundle\StudioBackendBundle\Export\Service\ExecutionEngine\ExportService
38+
2939
#
3040
# Event Subscriber
3141
#
3242

33-
Pimcore\Bundle\StudioBackendBundle\Export\EventSubscriber\Csv\CsvCreationSubscriber: ~
43+
Pimcore\Bundle\StudioBackendBundle\Export\EventSubscriber\CsvCreationSubscriber:
44+
arguments:
45+
$csvExportService: '@Pimcore\Bundle\StudioBackendBundle\Export\Service\CsvExportService'
46+
47+
Pimcore\Bundle\StudioBackendBundle\Export\EventSubscriber\XlsxCreationSubscriber:
48+
arguments:
49+
$xlsxExportService: '@Pimcore\Bundle\StudioBackendBundle\Export\Service\XlsxExportService'
50+
51+
#
52+
# Mercure SSE
53+
#
54+
55+
Pimcore\Bundle\StudioBackendBundle\Export\Mercure\Provider\ExportTopicProvider:
56+
tags: [ 'pimcore.studio_backend.mercure.topic.provider' ]

config/pimcore/execution_engine.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,20 @@ pimcore_generic_execution_engine:
1111
framework:
1212
messenger:
1313
routing:
14-
Pimcore\Bundle\StudioBackendBundle\Asset\ExecutionEngine\AutomationAction\Messenger\Messages\CsvAssetCollectionMessage: pimcore_generic_execution_engine
15-
Pimcore\Bundle\StudioBackendBundle\Asset\ExecutionEngine\AutomationAction\Messenger\Messages\CsvFolderCollectionMessage: pimcore_generic_execution_engine
1614
Pimcore\Bundle\StudioBackendBundle\Asset\ExecutionEngine\AutomationAction\Messenger\Messages\AssetCloneMessage: pimcore_generic_execution_engine
1715
Pimcore\Bundle\StudioBackendBundle\Asset\ExecutionEngine\AutomationAction\Messenger\Messages\AssetUploadMessage: pimcore_generic_execution_engine
16+
Pimcore\Bundle\StudioBackendBundle\Asset\ExecutionEngine\AutomationAction\Messenger\Messages\ExportDataCollectionMessage: pimcore_generic_execution_engine
17+
Pimcore\Bundle\StudioBackendBundle\Asset\ExecutionEngine\AutomationAction\Messenger\Messages\ExportFolderDataCollectionMessage: pimcore_generic_execution_engine
1818
Pimcore\Bundle\StudioBackendBundle\Asset\ExecutionEngine\AutomationAction\Messenger\Messages\ZipDownloadMessage: pimcore_generic_execution_engine
1919
Pimcore\Bundle\StudioBackendBundle\Asset\ExecutionEngine\AutomationAction\Messenger\Messages\ZipUploadMessage: pimcore_generic_execution_engine
20+
Pimcore\Bundle\StudioBackendBundle\CustomReport\ExecutionEngine\AutomationAction\Messenger\Messages\CsvCollectionMessage: pimcore_generic_execution_engine
21+
Pimcore\Bundle\StudioBackendBundle\DataObject\ExecutionEngine\AutomationAction\Messenger\Messages\CloneMessage: pimcore_generic_execution_engine
22+
Pimcore\Bundle\StudioBackendBundle\DataObject\ExecutionEngine\AutomationAction\Messenger\Messages\ExportDataCollectionMessage: pimcore_generic_execution_engine
23+
Pimcore\Bundle\StudioBackendBundle\DataObject\ExecutionEngine\AutomationAction\Messenger\Messages\ExportFolderDataCollectionMessage: pimcore_generic_execution_engine
2024
Pimcore\Bundle\StudioBackendBundle\Element\ExecutionEngine\AutomationAction\Messenger\Messages\ElementDeleteMessage: pimcore_generic_execution_engine
21-
Pimcore\Bundle\StudioBackendBundle\Element\ExecutionEngine\AutomationAction\Messenger\Messages\RecycleBinMessage: pimcore_generic_execution_engine
22-
Pimcore\Bundle\StudioBackendBundle\Element\ExecutionEngine\AutomationAction\Messenger\Messages\PatchMessage: pimcore_generic_execution_engine
2325
Pimcore\Bundle\StudioBackendBundle\Element\ExecutionEngine\AutomationAction\Messenger\Messages\PatchFolderMessage: pimcore_generic_execution_engine
26+
Pimcore\Bundle\StudioBackendBundle\Element\ExecutionEngine\AutomationAction\Messenger\Messages\PatchMessage: pimcore_generic_execution_engine
27+
Pimcore\Bundle\StudioBackendBundle\Element\ExecutionEngine\AutomationAction\Messenger\Messages\RecycleBinMessage: pimcore_generic_execution_engine
2428
Pimcore\Bundle\StudioBackendBundle\Element\ExecutionEngine\AutomationAction\Messenger\Messages\RewriteRefMessage: pimcore_generic_execution_engine
2529
Pimcore\Bundle\StudioBackendBundle\Export\ExecutionEngine\AutomationAction\Messenger\Messages\CsvCreationMessage: pimcore_generic_execution_engine
26-
Pimcore\Bundle\StudioBackendBundle\DataObject\ExecutionEngine\AutomationAction\Messenger\Messages\CloneMessage: pimcore_generic_execution_engine
27-
Pimcore\Bundle\StudioBackendBundle\Tag\ExecutionEngine\AutomationAction\Messenger\Messages\BatchTagOperationMessage: pimcore_generic_execution_engine
28-
Pimcore\Bundle\StudioBackendBundle\CustomReport\ExecutionEngine\AutomationAction\Messenger\Messages\CsvCollectionMessage: pimcore_generic_execution_engine
30+
Pimcore\Bundle\StudioBackendBundle\Tag\ExecutionEngine\AutomationAction\Messenger\Messages\BatchTagOperationMessage: pimcore_generic_execution_engine

src/Asset/Controller/Grid/GetController.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ final class GetController extends AbstractApiController
4242
{
4343
public function __construct(
4444
SerializerInterface $serializer,
45-
private readonly GridServiceInterface $gridService,
45+
private readonly GridServiceInterface $gridService
4646
) {
4747
parent::__construct($serializer);
4848
}
@@ -73,6 +73,8 @@ public function __construct(
7373
])]
7474
public function getAssetGrid(#[MapRequestPayload] GridParameter $gridParameter): JsonResponse
7575
{
76-
return $this->jsonResponse($this->gridService->getAssetGrid($gridParameter));
76+
return $this->jsonResponse(
77+
$this->gridService->getAssetGrid($gridParameter)
78+
);
7779
}
7880
}

src/Asset/ExecutionEngine/AutomationAction/Messenger/Handler/CsvAssetDataCollectionHandler.php renamed to src/Asset/ExecutionEngine/AutomationAction/Messenger/Handler/ExportDataCollectionHandler.php

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818

1919
use Exception;
2020
use Pimcore\Bundle\StaticResolverBundle\Models\User\UserResolverInterface;
21-
use Pimcore\Bundle\StudioBackendBundle\Asset\ExecutionEngine\AutomationAction\Messenger\Messages\CsvAssetCollectionMessage;
21+
use Pimcore\Bundle\StudioBackendBundle\Asset\ExecutionEngine\AutomationAction\Messenger\Messages\ExportDataCollectionMessage;
2222
use Pimcore\Bundle\StudioBackendBundle\Asset\Service\AssetServiceInterface;
2323
use Pimcore\Bundle\StudioBackendBundle\ExecutionEngine\AutomationAction\AbstractHandler;
2424
use Pimcore\Bundle\StudioBackendBundle\ExecutionEngine\Util\Config;
2525
use Pimcore\Bundle\StudioBackendBundle\ExecutionEngine\Util\StepConfig;
2626
use Pimcore\Bundle\StudioBackendBundle\ExecutionEngine\Util\Trait\HandlerProgressTrait;
27+
use Pimcore\Bundle\StudioBackendBundle\Export\Util\Trait\CsvExportHandlerSetupTrait;
28+
use Pimcore\Bundle\StudioBackendBundle\Grid\Service\ColumnConfigurationServiceInterface;
2729
use Pimcore\Bundle\StudioBackendBundle\Grid\Service\GridServiceInterface;
2830
use Pimcore\Bundle\StudioBackendBundle\Mercure\Service\PublishServiceInterface;
2931
use Pimcore\Bundle\StudioBackendBundle\Util\Constant\ElementTypes;
@@ -33,11 +35,13 @@
3335
* @internal
3436
*/
3537
#[AsMessageHandler]
36-
final class CsvAssetDataCollectionHandler extends AbstractHandler
38+
final class ExportDataCollectionHandler extends AbstractHandler
3739
{
3840
use HandlerProgressTrait;
41+
use CsvExportHandlerSetupTrait;
3942

4043
public function __construct(
44+
private readonly ColumnConfigurationServiceInterface $columnConfigurationService,
4145
private readonly PublishServiceInterface $publishService,
4246
private readonly UserResolverInterface $userResolver,
4347
private readonly GridServiceInterface $gridService,
@@ -49,7 +53,7 @@ public function __construct(
4953
/**
5054
* @throws Exception
5155
*/
52-
public function __invoke(CsvAssetCollectionMessage $message): void
56+
public function __invoke(ExportDataCollectionMessage $message): void
5357
{
5458
$jobRun = $this->getJobRun($message);
5559
if (!$this->shouldBeExecuted($jobRun)) {
@@ -67,7 +71,7 @@ public function __invoke(CsvAssetCollectionMessage $message): void
6771
));
6872
}
6973

70-
$jobAsset = $this->extractConfigFieldFromJobStepConfig($message, StepConfig::ASSET_TO_EXPORT->value);
74+
$jobAsset = $this->extractConfigFieldFromJobStepConfig($message, StepConfig::ELEMENT_TO_EXPORT->value);
7175

7276
$asset = $this->assetService->getAssetForUser($jobAsset['id'], $user);
7377

@@ -84,21 +88,37 @@ public function __invoke(CsvAssetCollectionMessage $message): void
8488

8589
$columns = $this->extractConfigFieldFromJobStepConfig($message, StepConfig::CONFIG_COLUMNS->value);
8690

87-
$columnCollection = $this->gridService->getConfigurationFromArray(
91+
$columnsDefinitions = $this->columnConfigurationService->getAvailableAssetColumnConfiguration();
92+
93+
$columnCollection = $this->gridService->getConfigurationForExport(
8894
$columns,
89-
true
95+
$columnsDefinitions
9096
);
9197

9298
try {
9399
$assetData = [
94100
$asset->getId() => $this->gridService->getGridValuesForElement(
95101
$columnCollection,
96102
$asset,
97-
ElementTypes::TYPE_ASSET
103+
ElementTypes::TYPE_ASSET,
104+
true
98105
),
99106
];
100107

101-
$this->updateContextArrayValues($jobRun, StepConfig::CSV_EXPORT_DATA->value, $assetData);
108+
$this->updateContextArrayValues($jobRun, StepConfig::GRID_EXPORT_DATA->value, $assetData);
109+
110+
$csvExportDataInfo = $jobRun->getContext()[StepConfig::GRID_EXPORT_DATA_INFO->value] ?? null;
111+
112+
if ($csvExportDataInfo === null) {
113+
$this->updateContextArrayValues(
114+
$jobRun,
115+
StepConfig::GRID_EXPORT_DATA_INFO->value,
116+
[
117+
'type' => ElementTypes::TYPE_ASSET,
118+
]
119+
);
120+
}
121+
102122
} catch (Exception $e) {
103123
$this->abort($this->getAbortData(
104124
Config::CSV_DATA_COLLECTION_FAILED_MESSAGE->value,
@@ -111,18 +131,4 @@ public function __invoke(CsvAssetCollectionMessage $message): void
111131

112132
$this->updateProgress($this->publishService, $jobRun, $this->getJobStep($message)->getName());
113133
}
114-
115-
protected function configureStep(): void
116-
{
117-
$this->stepConfiguration->setRequired(StepConfig::ASSET_TO_EXPORT->value);
118-
$this->stepConfiguration->setAllowedTypes(
119-
StepConfig::ASSET_TO_EXPORT->value,
120-
StepConfig::CONFIG_TYPE_ARRAY->value
121-
);
122-
$this->stepConfiguration->setRequired(StepConfig::CONFIG_COLUMNS->value);
123-
$this->stepConfiguration->setAllowedTypes(
124-
StepConfig::CONFIG_COLUMNS->value,
125-
StepConfig::CONFIG_TYPE_ARRAY->value
126-
);
127-
}
128134
}

src/Asset/ExecutionEngine/AutomationAction/Messenger/Handler/CsvFolderDataCollectionHandler.php renamed to src/Asset/ExecutionEngine/AutomationAction/Messenger/Handler/ExportFolderDataCollectionHandler.php

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@
1818

1919
use Exception;
2020
use Pimcore\Bundle\StaticResolverBundle\Models\User\UserResolverInterface;
21-
use Pimcore\Bundle\StudioBackendBundle\Asset\ExecutionEngine\AutomationAction\Messenger\Messages\CsvFolderCollectionMessage;
21+
use Pimcore\Bundle\StudioBackendBundle\Asset\ExecutionEngine\AutomationAction\Messenger\Messages\ExportFolderDataCollectionMessage;
2222
use Pimcore\Bundle\StudioBackendBundle\DataIndex\Grid\GridSearchInterface;
2323
use Pimcore\Bundle\StudioBackendBundle\ExecutionEngine\AutomationAction\AbstractHandler;
2424
use Pimcore\Bundle\StudioBackendBundle\ExecutionEngine\Util\Config;
2525
use Pimcore\Bundle\StudioBackendBundle\ExecutionEngine\Util\StepConfig;
2626
use Pimcore\Bundle\StudioBackendBundle\ExecutionEngine\Util\Trait\HandlerProgressTrait;
2727
use Pimcore\Bundle\StudioBackendBundle\Grid\MappedParameter\GridParameter;
2828
use Pimcore\Bundle\StudioBackendBundle\Grid\Mapper\FilterParameterMapperInterface;
29+
use Pimcore\Bundle\StudioBackendBundle\Grid\Service\ColumnConfigurationServiceInterface;
2930
use Pimcore\Bundle\StudioBackendBundle\Grid\Service\GridServiceInterface;
3031
use Pimcore\Bundle\StudioBackendBundle\Mercure\Service\PublishServiceInterface;
3132
use Pimcore\Bundle\StudioBackendBundle\Util\Constant\ElementTypes;
@@ -36,11 +37,12 @@
3637
* @internal
3738
*/
3839
#[AsMessageHandler]
39-
final class CsvFolderDataCollectionHandler extends AbstractHandler
40+
final class ExportFolderDataCollectionHandler extends AbstractHandler
4041
{
4142
use HandlerProgressTrait;
4243

4344
public function __construct(
45+
private readonly ColumnConfigurationServiceInterface $columnConfigurationService,
4446
private readonly FilterParameterMapperInterface $filterParameterMapper,
4547
private readonly PublishServiceInterface $publishService,
4648
private readonly UserResolverInterface $userResolver,
@@ -53,7 +55,7 @@ public function __construct(
5355
/**
5456
* @throws Exception
5557
*/
56-
public function __invoke(CsvFolderCollectionMessage $message): void
58+
public function __invoke(ExportFolderDataCollectionMessage $message): void
5759
{
5860
$jobRun = $this->getJobRun($message);
5961
if (!$this->shouldBeExecuted($jobRun)) {
@@ -71,7 +73,7 @@ public function __invoke(CsvFolderCollectionMessage $message): void
7173
));
7274
}
7375

74-
$jobFolder = $this->extractConfigFieldFromJobStepConfig($message, StepConfig::FOLDER_TO_EXPORT->value);
76+
$jobFolder = $this->extractConfigFieldFromJobStepConfig($message, StepConfig::ELEMENT_TO_EXPORT->value);
7577

7678
$columns = $this->extractConfigFieldFromJobStepConfig($message, StepConfig::CONFIG_COLUMNS->value);
7779

@@ -92,9 +94,11 @@ public function __invoke(CsvFolderCollectionMessage $message): void
9294
return;
9395
}
9496

95-
$columnCollection = $this->gridService->getConfigurationFromArray(
97+
$columnsDefinitions = $this->columnConfigurationService->getAvailableAssetColumnConfiguration();
98+
99+
$columnCollection = $this->gridService->getConfigurationForExport(
96100
$columns,
97-
true
101+
$columnsDefinitions
98102
);
99103

100104
foreach ($assets->getItems() as $asset) {
@@ -103,11 +107,12 @@ public function __invoke(CsvFolderCollectionMessage $message): void
103107
$asset->getId() => $this->gridService->getGridValuesForElement(
104108
$columnCollection,
105109
$asset,
106-
ElementTypes::TYPE_ASSET
110+
ElementTypes::TYPE_ASSET,
111+
true
107112
),
108113
];
109114

110-
$this->updateContextArrayValues($jobRun, StepConfig::CSV_EXPORT_DATA->value, $assetData);
115+
$this->updateContextArrayValues($jobRun, StepConfig::GRID_EXPORT_DATA->value, $assetData);
111116
} catch (Exception $e) {
112117
$this->abort($this->getAbortData(
113118
Config::CSV_DATA_COLLECTION_FAILED_MESSAGE->value,
@@ -119,14 +124,26 @@ public function __invoke(CsvFolderCollectionMessage $message): void
119124
}
120125
}
121126

127+
$csvExportDataInfo = $jobRun->getContext()[StepConfig::GRID_EXPORT_DATA_INFO->value] ?? null;
128+
129+
if ($csvExportDataInfo === null) {
130+
$this->updateContextArrayValues(
131+
$jobRun,
132+
StepConfig::GRID_EXPORT_DATA_INFO->value,
133+
[
134+
'type' => ElementTypes::TYPE_ASSET,
135+
]
136+
);
137+
}
138+
122139
$this->updateProgress($this->publishService, $jobRun, $this->getJobStep($message)->getName());
123140
}
124141

125142
protected function configureStep(): void
126143
{
127-
$this->stepConfiguration->setRequired(StepConfig::FOLDER_TO_EXPORT->value);
144+
$this->stepConfiguration->setRequired(StepConfig::ELEMENT_TO_EXPORT->value);
128145
$this->stepConfiguration->setAllowedTypes(
129-
StepConfig::FOLDER_TO_EXPORT->value,
146+
StepConfig::ELEMENT_TO_EXPORT->value,
130147
StepConfig::CONFIG_TYPE_ARRAY->value
131148
);
132149
$this->stepConfiguration->setRequired(StepConfig::CONFIG_COLUMNS->value);

src/Asset/ExecutionEngine/AutomationAction/Messenger/Messages/CsvAssetCollectionMessage.php renamed to src/Asset/ExecutionEngine/AutomationAction/Messenger/Messages/ExportDataCollectionMessage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
/**
2222
* @internal
2323
*/
24-
final class CsvAssetCollectionMessage extends AbstractExecutionEngineMessage
24+
final class ExportDataCollectionMessage extends AbstractExecutionEngineMessage
2525
{
2626
}

src/Asset/ExecutionEngine/AutomationAction/Messenger/Messages/CsvFolderCollectionMessage.php renamed to src/Asset/ExecutionEngine/AutomationAction/Messenger/Messages/ExportFolderDataCollectionMessage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
/**
2222
* @internal
2323
*/
24-
final class CsvFolderCollectionMessage extends AbstractExecutionEngineMessage
24+
final class ExportFolderDataCollectionMessage extends AbstractExecutionEngineMessage
2525
{
2626
}

src/Asset/ExecutionEngine/Util/JobSteps.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,4 @@ enum JobSteps: string
2222
case ZIP_UPLOADING = 'studio_ee_jop_step_zip_uploading';
2323
case ASSET_CLONING = 'studio_ee_job_step_asset_cloning';
2424
case ASSET_UPLOADING = 'studio_ee_job_step_asset_uploading';
25-
case CSV_COLLECTION = 'studio_ee_job_step_csv_collection';
2625
}

0 commit comments

Comments
 (0)