diff --git a/docs/scos/dev/feature-integration-guides/202307.0/glue-api/data-exchange-api/install-the-data-exchange-api.md b/docs/scos/dev/feature-integration-guides/202307.0/glue-api/data-exchange-api/install-the-data-exchange-api.md index 9dea6b59232..f18c10725a3 100644 --- a/docs/scos/dev/feature-integration-guides/202307.0/glue-api/data-exchange-api/install-the-data-exchange-api.md +++ b/docs/scos/dev/feature-integration-guides/202307.0/glue-api/data-exchange-api/install-the-data-exchange-api.md @@ -6,6 +6,7 @@ template: feature-integration-guide-template redirect_from: - /docs/scos/dev/feature-integration-guides/202304.0/glue-api/data-exchange-api/data-exchange-api-integration.html - /docs/scos/dev/feature-integration-guides/202307.0/glue-api/data-exchange-api-integration.html + - docs/scos/dev/feature-integration-guides/202307.0/glue-api/dynamic-data-api/data-exchange-api-integration.html related: - title: How to configure Data Exchange API link: docs/scos/dev/glue-api-guides/page.version/data-exchange-api/how-to-guides/how-to-configure-data-exchange-api.html @@ -165,6 +166,108 @@ class DynamicEntityGuiConfig extends SprykerDynamicEntityGuiConfig } ``` +### Configure Dynamic Data installation + +1. Optional: To set the default configuration data, create a configuration file: + +
src/Pyz/Zed/DynamicEntity/data/installer/configuration.json + +```json +[ + { + "tableName": "spy_country", + "tableAlias": "countries", + "isActive": true, + "definition": { + "identifier": "id_country", + "fields": [ + { + "fieldName": "id_country", + "fieldVisibleName": "id_country", + "isCreatable": true, + "isEditable": true, + "type": "integer", + "validation": { "isRequired": false } + }, + { + "fieldName": "iso2_code", + "fieldVisibleName": "iso2_code", + "isCreatable": true, + "isEditable": true, + "type": "string", + "validation": { "isRequired": true } + }, + { + "fieldName": "iso3_code", + "fieldVisibleName": "iso3_code", + "isCreatable": true, + "isEditable": true, + "type": "string", + "validation": { "isRequired": false } + }, + { + "fieldName": "name", + "fieldVisibleName": "name", + "isCreatable": true, + "isEditable": true, + "type": "string", + "validation": { "isRequired": false } + }, + { + "fieldName": "postal_code_mandatory", + "fieldVisibleName": "postal_code_mandatory", + "isCreatable": true, + "isEditable": true, + "type": "string", + "validation": { "isRequired": false } + }, + { + "fieldName": "postal_code_regex", + "fieldVisibleName": "postal_code_regex", + "isCreatable": true, + "isEditable": true, + "type": "string", + "validation": { "isRequired": false } + } + ] + } + } +] +``` +
+2. Add the path to the configuration file, to `DynamicEntityConfig`: + +**src/Pyz/Zed/DynamicEntity/DynamicEntityConfig.php** + +```php +src/Pyz/Zed/DynamicEntity/data/installer/configuration.json - -```json -[ - { - "tableName": "spy_country", - "tableAlias": "countries", - "isActive": true, - "definition": { - "identifier": "id_country", - "fields": [ - { - "fieldName": "id_country", - "fieldVisibleName": "id_country", - "isCreatable": true, - "isEditable": true, - "type": "integer", - "validation": { "isRequired": false } - }, - { - "fieldName": "iso2_code", - "fieldVisibleName": "iso2_code", - "isCreatable": true, - "isEditable": true, - "type": "string", - "validation": { "isRequired": true } - }, - { - "fieldName": "iso3_code", - "fieldVisibleName": "iso3_code", - "isCreatable": true, - "isEditable": true, - "type": "string", - "validation": { "isRequired": false } - }, - { - "fieldName": "name", - "fieldVisibleName": "name", - "isCreatable": true, - "isEditable": true, - "type": "string", - "validation": { "isRequired": false } - }, - { - "fieldName": "postal_code_mandatory", - "fieldVisibleName": "postal_code_mandatory", - "isCreatable": true, - "isEditable": true, - "type": "string", - "validation": { "isRequired": false } - }, - { - "fieldName": "postal_code_regex", - "fieldVisibleName": "postal_code_regex", - "isCreatable": true, - "isEditable": true, - "type": "string", - "validation": { "isRequired": false } - } - ] - } - } -] -``` - - -2. Add file path to `DynamicEntityConfig`: - -**src/Pyz/Zed/DynamicEntity/DynamicEntityConfig.php** - -```php - - */ - public function getApplicationPlugins(Container $container): array - { - $applicationPlugins = parent::getApplicationPlugins($container); - - $applicationPlugins[] = new PropelApplicationPlugin(); - - return $applicationPlugins; - } -} -``` - -**src/Pyz/Glue/DocumentationGeneratorApi/DocumentationGeneratorApiDependencyProvider.php** - -```php -addExpander(new DynamicEntityApiSchemaContextExpanderPlugin(), [static::GLUE_BACKEND_API_APPLICATION_NAME]); - } -} -``` - -**src/Pyz/Glue/DocumentationGeneratorOpenApi/DocumentationGeneratorOpenApiDependencyProvider.php** - -```php - - */ - protected function getOpenApiSchemaFormatterPlugins(): array - { - return [ - new DynamicEntityOpenApiSchemaFormatterPlugin(), - ]; - } -} -``` - -**src/Pyz/Glue/GlueBackendApiApplication/GlueBackendApiApplicationDependencyProvider.php** - -```php - - */ - protected function getRouteProviderPlugins(): array - { - return [ - new DynamicEntityRouteProviderPlugin(), - ]; - } -} -``` - - -**src/Pyz/Zed/Installer/InstallerDependencyProvider.php** - -```php - - */ - public function getInstallerPlugins(): array - { - return [ - new DynamicEntityInstallerPlugin(), - ]; - } -} -``` - -{% info_block warningBox %} - -When `DynamicEntityInstallerPlugin` is enabled, run the following command: - -```bash -console setup:init-db -``` - -{% endinfo_block %} - -{% info_block warningBox "Verification" %} - -If everything is set up correctly, you can operate with the data. Follow this link to discover how to perform it:[How to send request in Data Exchange API](/docs/scos/dev/glue-api-guides/{{page.version}}/dynamic-data-api/how-to-guides/how-to-send-request-in-data-exchange-api.html) - -{% endinfo_block %} diff --git a/docs/scos/dev/glue-api-guides/202307.0/dynamic-data-api/how-to-guides/how-to-configure-data-exchange-api.md b/docs/scos/dev/glue-api-guides/202307.0/dynamic-data-api/how-to-guides/how-to-configure-data-exchange-api.md index 8412fed1612..54fae950593 100644 --- a/docs/scos/dev/glue-api-guides/202307.0/dynamic-data-api/how-to-guides/how-to-configure-data-exchange-api.md +++ b/docs/scos/dev/glue-api-guides/202307.0/dynamic-data-api/how-to-guides/how-to-configure-data-exchange-api.md @@ -10,7 +10,7 @@ redirect_from: This guide shows how to configure the Data Exchange API endpoints. -To incorporate a new endpoint for interacting with entities in the database, add a corresponding row to the `spy_dynamic_entity_configuration` table or create a configuration file and install configuration data. For details, see the [Configure Data Exchange installation](/docs/scos/dev/feature-integration-guides/202307.0/glue-api/dynamic-data-api/data-exchange-api-integration.html#configure-data-exchange-installation). +To incorporate a new endpoint for interacting with entities in the database, add a corresponding row to the `spy_dynamic_entity_configuration` table or create a configuration file and install configuration data. For details, see the [Configure Data Exchange installation](/docs/scos/dev/feature-integration-guides/202307.0/glue-api/dynamic-data-api/data-exchange-api-integration.html). The `spy_dynamic_entity_configuration` table represents the configuration for dynamic entity endpoints in the system. It has the following columns: