Skip to content

Commit bd47a8d

Browse files
authored
update changelog and maintened version (#45)
1 parent 8ab924c commit bd47a8d

2 files changed

Lines changed: 83 additions & 39 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Version 4.1.0
2+
3+
* Allow Dataflow 4 by @jeremycr in https://github.com/code-rhapsodie/ezdataflow-bundle/pull/44
4+
15
# Version 4.0.0
26

37
* Add compatibility with Ibexa 4.0+ and drop compatibility for eZPlatform 2 and Ibexa 3

README.md

Lines changed: 79 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
11
# Code Rhapsodie eZ Dataflow Bundle
22

3-
EzDataflowBundle is a bundle integrating [Code Rhapsodie Dataflow bundle](https://github.com/code-rhapsodie/dataflow-bundle) into Ibexa 4.0+.
3+
EzDataflowBundle is a bundle
4+
integrating [Code Rhapsodie Dataflow bundle](https://github.com/code-rhapsodie/dataflow-bundle) into Ibexa 4.0+.
45
Dataflows can be piloted from an interface integrated into the Ibexa backoffice.
56
EzDataflow bundle is intended to manage content imports from external data sources.
67

7-
> Note: before using this bundle, please read the [Code Rhapsodie Dataflow bundle documentation](https://github.com/code-rhapsodie/dataflow-bundle/blob/master/README.md).
8+
> Note: before using this bundle, please read
9+
> the [Code Rhapsodie Dataflow bundle documentation](https://github.com/code-rhapsodie/dataflow-bundle/blob/master/README.md).
810
9-
> Command line notice: When you use Dataflow commands, **use `--siteaccess` instead of `--connection`** expect for `code-rhapsodie:dataflow:dump-schema` command.
11+
> Command line notice: When you use Dataflow commands, **use `--siteaccess` instead of `--connection`** expect
12+
> for `code-rhapsodie:dataflow:dump-schema` command.
13+
14+
| eZ Dataflow Version | Ibexa Content Version | Status |
15+
|---------------------|-----------------------|------------------------------|
16+
| 4.x | 4.x | :white_check_mark: Maintened |
17+
| 3.x | 3.x | :white_check_mark: Maintened |
18+
| 2.x | eZ Platform 2.5 | :x: Not maintened |
19+
| 1.x | eZ Platform 2.5 | :x: Not maintained |
1020

1121
## User Interface (UI)
1222

1323
The UI lets you create workflow processes from any defined `DataflowTypes`, and set options to each.
1424

1525
Processes can be set to run either:
26+
1627
- only once, at a given date and time
1728
- regularly, by defining the first run date and time, and the interval between subsequent runs
1829

@@ -26,7 +37,8 @@ $ composer require code-rhapsodie/ezdataflow-bundle
2637

2738
### Step 2: Enable the bundle
2839

29-
> Note: The loading order between the Dataflow bundle and Ez Dataflow bundle is important. Dataflow must be loaded first.
40+
> Note: The loading order between the Dataflow bundle and Ez Dataflow bundle is important. Dataflow must be loaded
41+
> first.
3042
3143
Add those two lines in the `config/bundles.php` file:
3244

@@ -47,40 +59,45 @@ return [
4759
# config/routing/ezdataflow.yaml
4860

4961
_cr.dataflow:
50-
resource: '@CodeRhapsodieEzDataflowBundle/Resources/config/routing.yaml'
62+
resource: '@CodeRhapsodieEzDataflowBundle/Resources/config/routing.yaml'
5163
```
5264
5365
### Step 4: Update the database schema
5466
55-
Please refer to the [Code-Rhapsodie Dataflow Bundle installation guide](https://github.com/code-rhapsodie/dataflow-bundle#update-the-database).
67+
Please refer to
68+
the [Code-Rhapsodie Dataflow Bundle installation guide](https://github.com/code-rhapsodie/dataflow-bundle#update-the-database).
5669
5770
### Step 5: Schedule the job runner
5871
59-
Please refer to the [Code-Rhapsodie Dataflow Bundle Queue section](https://github.com/code-rhapsodie/dataflow-bundle#queue).
72+
Please refer to
73+
the [Code-Rhapsodie Dataflow Bundle Queue section](https://github.com/code-rhapsodie/dataflow-bundle#queue).
6074
6175
## Configuration
6276
63-
By default, the `ContentWriter` will publish contents using the `admin` user. If you want to use another user (with sufficient permissions), you can configure it like this:
77+
By default, the `ContentWriter` will publish contents using the `admin` user. If you want to use another user (with
78+
sufficient permissions), you can configure it like this:
6479

6580
```yaml
6681
# config/packages/code_rhapsodie_ez_dataflow.yaml
6782
6883
code_rhapsodie_ez_dataflow:
69-
# Integer values are assumed to be user ids, non-integer values are assumed to be user logins
70-
admin_login_or_id: webmaster
84+
# Integer values are assumed to be user ids, non-integer values are assumed to be user logins
85+
admin_login_or_id: webmaster
7186
```
7287

7388
## Define your Dataflow
7489

75-
Before using the admin UI to manage your dataflows, you need to define them. Please refer to [Code-Rhapsodie Dataflow type documentation](https://github.com/code-rhapsodie/dataflow-bundle#define-a-dataflow-type).
90+
Before using the admin UI to manage your dataflows, you need to define them. Please refer
91+
to [Code-Rhapsodie Dataflow type documentation](https://github.com/code-rhapsodie/dataflow-bundle#define-a-dataflow-type).
7692

7793
## Use the ContentWriter
7894

7995
To add or update Ibexa contents, you can use the `CodeRhapsodie\EzDataflowBundle\Writer\ContentWriter` writer.
8096

8197
### Step 1: Inject the dependencies and add the writer
8298

83-
Inject the `ContentWriter` service into the constructor of your DataflowType and add the content writer into the writer list like this:
99+
Inject the `ContentWriter` service into the constructor of your DataflowType and add the content writer into the writer
100+
list like this:
84101

85102
```php
86103
// In your DataflowType
@@ -112,31 +129,37 @@ class MyDataflowType extends AbstractDataflowType
112129

113130
### Step 2: Add a step for prepare the content
114131

115-
To process Ibexa contents into your Dataflow, you need to transform the data into `ContentCreateStructure` or `ContentUpdateStructure` objects.
132+
To process Ibexa contents into your Dataflow, you need to transform the data into `ContentCreateStructure`
133+
or `ContentUpdateStructure` objects.
116134
in order to respectively create or update contents.
117135

118136
But, in order to determine if the content already exists or not, you first need to look up for it.
119137

120138
One way is to use the remote id to search for the content.
121139

122-
In the following example, the remote id pattern is `article-<id>` with the `<id>` replaced by the data id provided by the reader.
140+
In the following example, the remote id pattern is `article-<id>` with the `<id>` replaced by the data id provided by
141+
the reader.
123142
To check if the content exists or not, I use the service `ContentService` provided by Ibexa.
124143

125144
The step is added as an anonymous function and has 3 types of return values:
126145

127146
* When the step returns `false`, the data is dropped.
128147
* When the step returns a `ContentCreateStructure`, the data will be saved into a new Ibexa content.
129-
* When the step returns a `ContentUpdateStructure`, the existing Ibexa content will be updated by overwriting all defined fields in the data.
148+
* When the step returns a `ContentUpdateStructure`, the existing Ibexa content will be updated by overwriting all
149+
defined fields in the data.
130150

131-
For the new content, you must provide one or more "parent location id" as the 3rd argument of the `ContentCreateStructure` constructor.
151+
For the new content, you must provide one or more "parent location id" as the 3rd argument of
152+
the `ContentCreateStructure` constructor.
132153

133154
In this example, I have added a new folder to store all articles.
134155

135-
To get the location id of the parent Ibexa content, go to the admin UI and select the future parent content, click on the details tabs, and read the "Location id" like this:
156+
To get the location id of the parent Ibexa content, go to the admin UI and select the future parent content, click on
157+
the details tabs, and read the "Location id" like this:
136158

137159
![parent folder](src/Resources/doc/dest_folder.jpg)
138160

139-
> Note: the best practice is to define this parent id in your `parameters.yml` file or your `.env.local` file for each execution environment.
161+
> Note: the best practice is to define this parent id in your `parameters.yml` file or your `.env.local` file for each
162+
> execution environment.
140163

141164
```php
142165
// In your DataflowType
@@ -192,11 +215,13 @@ class MyDataflowType extends AbstractDataflowType
192215
}
193216
```
194217

195-
This example uses `ContentStructureFactory` to check if the content exists and returns the adequate `ContentStrucure` to pass to the content writer.
218+
This example uses `ContentStructureFactory` to check if the content exists and returns the adequate `ContentStrucure` to
219+
pass to the content writer.
196220

197221
## Use the NotModifiedContentFilter
198222

199-
When updating contents, you might want to ignore contents where the update would not result in any actual changes in fields values. In that case, you can add the `NotModifiedContentFilter` as one of your steps.
223+
When updating contents, you might want to ignore contents where the update would not result in any actual changes in
224+
fields values. In that case, you can add the `NotModifiedContentFilter` as one of your steps.
200225

201226
```php
202227
// In your DataflowType
@@ -216,11 +241,16 @@ protected function buildDataflow(DataflowBuilder $builder, array $options): void
216241
}
217242
```
218243

219-
This filter compares each field value in the `ContentUpdateStructure` received to the fields values in the existing content object. If all values are identical, this filter will return `false`, otherwise, the `ContentUpdateStructure` will be returned as is.
244+
This filter compares each field value in the `ContentUpdateStructure` received to the fields values in the existing
245+
content object. If all values are identical, this filter will return `false`, otherwise, the `ContentUpdateStructure`
246+
will be returned as is.
220247

221-
Not all field types are supported by this filter. Il a field type is not supported, values will be assumed different. If your dataflow is dealing with content types containing unsupported field types, it is better to simply not use the `NotModifiedContentFilter` to prevent unnecessary overhead.
248+
Not all field types are supported by this filter. Il a field type is not supported, values will be assumed different. If
249+
your dataflow is dealing with content types containing unsupported field types, it is better to simply not use
250+
the `NotModifiedContentFilter` to prevent unnecessary overhead.
222251

223252
### Supported field types
253+
224254
- ezstring
225255
- ezauthor
226256
- ezboolean
@@ -267,10 +297,10 @@ class MyFieldComparator extends AbstractFieldComparator
267297

268298
```yaml
269299
# Service declaration
270-
App\FieldComparator\MyFieldComparator:
271-
parent: 'CodeRhapsodie\EzDataflowBundle\Core\FieldComparator\AbstractFieldComparator'
272-
tags:
273-
- { name: 'coderhapsodie.ezdataflow.field_comparator', fieldType: 'my_field_type_identifier' }
300+
App\FieldComparator\MyFieldComparator:
301+
parent: 'CodeRhapsodie\EzDataflowBundle\Core\FieldComparator\AbstractFieldComparator'
302+
tags:
303+
- { name: 'coderhapsodie.ezdataflow.field_comparator', fieldType: 'my_field_type_identifier' }
274304
```
275305

276306
# Admin UI
@@ -293,33 +323,38 @@ When you access to the eZ Dataflow administration UI, you going here:
293323
1. Scheduled dataflow list
294324
1. Button to add a new scheduled dataflow
295325
1. Tools available for each scheduled dataflow. In order from left to right :
296-
1. Display the history for this dataflow schedule
297-
1. Edit this dataflow schedule
298-
1. Enable/Disable this dataflow schedule
299-
1. Delete this dataflow schedule
326+
1. Display the history for this dataflow schedule
327+
1. Edit this dataflow schedule
328+
1. Enable/Disable this dataflow schedule
329+
1. Delete this dataflow schedule
300330

301331
> Note: You can define more than one schedule for any given dataflow.
302332

303333
## Add a new schedule
304334

305-
Go to the eZ Dataflow admin, and click on the "+" orange button.
335+
Go to the eZ Dataflow admin, and click on the "+" orange button.
306336

307337
In the new popin, fill in the fields:
308338

309339
![Add a new schedule](src/Resources/doc/add_new_schedule.jpg)
310340

311341
1. Type the Dataflow schedule name
312-
1. Select the Dataflow type. The list is automatically generated from the list of Symfony services with the tags `coderhapsodie.dataflow.type`. If your dataflow type is not present, [check the configuration](https://github.com/code-rhapsodie/dataflow-bundle#check-if-your-dataflowtype-is-ready)
313-
1. Type here the Dataflow options. Basic expected format: one option per line and option name and value separated with `: `. For more complex options, the whole YAML format is supported.
314-
1. Type here the frequency. The value must be compatible with the the PHP [strtotime](https://www.php.net/manual/en/function.strtotime.php) function.
342+
1. Select the Dataflow type. The list is automatically generated from the list of Symfony services with the
343+
tags `coderhapsodie.dataflow.type`. If your dataflow type is not
344+
present, [check the configuration](https://github.com/code-rhapsodie/dataflow-bundle#check-if-your-dataflowtype-is-ready)
345+
1. Type here the Dataflow options. Basic expected format: one option per line and option name and value separated
346+
with `: `. For more complex options, the whole YAML format is supported.
347+
1. Type here the frequency. The value must be compatible with the the
348+
PHP [strtotime](https://www.php.net/manual/en/function.strtotime.php) function.
315349
1. Choose the date and time of the first job.
316350
1. Check if you want to run this Dataflow.
317351
318352
Finally, click on the "Create" button.
319353
320354
## Read the history
321355
322-
When you click on the "History" tab in the eZ Dataflow admin UI, the job history for all Dataflow configured and executed is displayed.
356+
When you click on the "History" tab in the eZ Dataflow admin UI, the job history for all Dataflow configured and
357+
executed is displayed.
323358
324359
![History list](src/Resources/doc/history_list.jpg)
325360
@@ -356,15 +391,19 @@ Go to the eZ Dataflow admin UI and click on the "Oneshot" tab. Click on the "+"
356391
![The add one-shot popin](src/Resources/doc/one_shot_job.jpg)
357392
358393
1. Type the Dataflow job name
359-
1. Select the Dataflow type. The list is automatically generated from the list of Symfony services with the tags `coderhapsodie.dataflow.type`. If your dataflow type is not present, [check the configuration](https://github.com/code-rhapsodie/dataflow-bundle#check-if-your-dataflowtype-is-ready)
360-
1. Type here the Dataflow options. Basic expected format: one option per line and option name and value separated with `: `. For more complex options, the whole YAML format is supported.
394+
1. Select the Dataflow type. The list is automatically generated from the list of Symfony services with the
395+
tags `coderhapsodie.dataflow.type`. If your dataflow type is not
396+
present, [check the configuration](https://github.com/code-rhapsodie/dataflow-bundle#check-if-your-dataflowtype-is-ready)
397+
1. Type here the Dataflow options. Basic expected format: one option per line and option name and value separated
398+
with `: `. For more complex options, the whole YAML format is supported.
361399
1. Choose the date and time of the first job.
362400
363401
Finally, click on the "Create" button.
364402
365403
# Rights
366404
367-
If a non-administrator user needs read-only access to the dataflow interface, add the `Setup / Administrate` and `eZ Dataflow / View` policies in one of their roles.
405+
If a non-administrator user needs read-only access to the dataflow interface, add the `Setup / Administrate`
406+
and `eZ Dataflow / View` policies in one of their roles.
368407

369408
# Issues and feature requests
370409

@@ -373,7 +412,8 @@ Please report issues and request features at https://github.com/code-rhapsodie/e
373412
# Contributing
374413

375414
Contributions are very welcome. Please see [CONTRIBUTING.md](CONTRIBUTING.md) for
376-
details. Thanks to [everyone who has contributed](https://github.com/code-rhapsodie/ezdataflow-bundle/graphs/contributors)
415+
details. Thanks
416+
to [everyone who has contributed](https://github.com/code-rhapsodie/ezdataflow-bundle/graphs/contributors)
377417
already.
378418

379419
# License

0 commit comments

Comments
 (0)