Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions docs/api/extending_the_rest_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,31 @@ class DefaultController extends BaseController

As mentioned earlier, your REST routes are required to use the REST URI prefix. To do so, the easiest way is to import your routing file using this prefix.

**app/config/routing.yml**
**config/routing.yaml**

``` yaml
myRestBundle_rest_routes:
resource: '@MyRestBundle/Resources/config/routing_rest.yml'
resource: '@MyRestBundle/Resources/config/routing_rest.yaml'
prefix: '%ezpublish_rest.path_prefix%'
```

Using a distinct file for REST routes allows you to use the prefix for all this file's routes without affecting other routes from your bundle.

Next, you need to create the REST route. Define the route's [controller as a service](http://symfony.com/doc/current/cookbook/controller/service.html) since your controller was defined as such.

**My/Bundle/RestBundle/Resources/config/routing\_rest.yml**
**My/Bundle/RestBundle/Resources/config/routing\_rest.yaml**

``` yaml
myRestBundle_hello_world:
path: '/my_rest_bundle/hello/{name}'
defaults:
_controller: myRestBundle.controller.default:sayHello
_controller: My\Bundle\RestBundle\Rest\Controller\DefaultController::sayHelloAction
methods: [GET]
```

Due to [EZP-23016](https://jira.ez.no/browse/EZP-23016) - Custom REST API routes (v2) are not accessible from the legacy backend, custom REST routes must be prefixed with `ezpublish_rest_`, or they won't be detected correctly.

**My/Bundle/RestBundle/Resources/config/services.yml**
**My/Bundle/RestBundle/Resources/config/services.yaml**

``` yaml
services:
Expand Down Expand Up @@ -122,7 +122,7 @@ A `ValueObjectVisitor` will take a Value returned by a REST controller, whatever

Create the service for your `ValueObjectVisitor` first.

**My/Bundle/RestBundle/Resources/config/services.yml**
**My/Bundle/RestBundle/Resources/config/services.yaml**

``` yaml
services:
Expand Down Expand Up @@ -208,9 +208,9 @@ Let's see what it would look like with a Content-Type of `application/vnd.my.Gre
</Greetings>
```

First, you need to create a service with the appropriate tag in `services.yml`.
First, you need to create a service with the appropriate tag in `services.yaml`.

**My/Bundle/RestBundle/Resources/config/services.yml**
**My/Bundle/RestBundle/Resources/config/services.yaml**

``` yaml
services:
Expand Down Expand Up @@ -280,13 +280,13 @@ use EzSystems\EzPlatformRest\Message;

The `inputDispatcher` is responsible for matching the `Content-Type` sent in the header with the Greetings `InputParser` class.

Finally, a new Route should be added to `routing_rest.yml`
Finally, a new Route should be added to `routing_rest.yaml`

``` yaml
myRestBundle_hello_world_using_post:
path: /my_rest_bundle/hello/
defaults:
_controller: myRestBundle.controller.default:sayHelloUsingPost
_controller: My\Bundle\RestBundle\Rest\Controller\DefaultController::sayHelloUsingPostAction
methods: [POST]
```

Expand Down
8 changes: 4 additions & 4 deletions docs/api/field_type_form_and_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ The special `defaultValue` key allows you to specify a field for setting the def
The FormMapper must be registered as a service:

``` yaml
Acme\ExampleBundle\FieldType\Mapper\CustomFieldTypeMapper:
App\FieldType\Mapper\CustomFieldTypeMapper:
tags:
- { name: ez.fieldFormMapper.definition, fieldType: custom }
- { name: ez.fieldFormMapper.value, fieldType: custom }
Expand Down Expand Up @@ -172,7 +172,7 @@ ezpublish:
<siteaccess>:
field_templates:
-
template: 'AcmeExampleBundle:fields:custom_field_template.html.twig'
template: 'fields/custom_field_template.html.twig'
# Priority is optional (default is 0). The higher it is, the higher your template gets in the list.
priority: 10
```
Expand All @@ -192,7 +192,7 @@ ezpublish:
systems:
admin_group:
field_templates:
- { template: 'AcmeExampleBundle:adminui/field:custom_field_view.html.twig', priority: 10 }
- { template: 'adminui/field/custom_field_view.html.twig', priority: 10 }
```

### Field edit template
Expand All @@ -203,7 +203,7 @@ under the `twig.form_themes` key:
``` yaml
twig:
form_themes:
- 'AcmeExampleBundle:adminui/field:custom_field_template.html.twig'
- 'adminui/field/custom_field_template.html.twig'
```

We encourage using custom form types for encapsulation as this makes templating easier by providing Twig block name.
Expand Down
8 changes: 4 additions & 4 deletions docs/api/field_type_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,7 @@ Example:
Example use:

``` yaml
# ezplatform.yml
# ezplatform.yaml
ezpublish:
system:
site_group:
Expand Down Expand Up @@ -1707,7 +1707,7 @@ services:
Example usage:

``` html+twig
{{ render_esi(controller('EzPlatformPageFieldTypeBundle:Block:render', {
{{ render_esi(controller('EzPlatformPageFieldTypeBundle\Controller\BlockController::renderAction', {
'locationId': locationId,
'blockId': block.id,
'versionNo': versionInfo.versionNo,
Expand All @@ -1727,9 +1727,9 @@ services:
{% for block in blocks %}
{# create a new layer with appropriate ID #}
<div class="landing-page__block block_{{ block.type }}" data-ez-block-id="{{ block.id }}">
{# render the block by using the "EzPlatformPageFieldTypeBundle:Block:render" controller #}
{# render the block by using the "EzPlatformPageFieldTypeBundle\Controller\BlockController::renderAction" controller #}
{# location.id is the ID of the Location of the current Content item, block.id is the ID of the current block #}
{{ render_esi(controller('EzPlatformPageFieldTypeBundle:Block:render', {
{{ render_esi(controller('EzPlatformPageFieldTypeBundle\Controller\BlockController::renderAction', {
'locationId': locationId,
'blockId': block.id,
'versionNo': versionInfo.versionNo,
Expand Down
4 changes: 2 additions & 2 deletions docs/api/field_type_search.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ This method gets name of the default field to be used for sorting. As Field Type

## Register Indexable Implementations

Implement `eZ\Publish\SPI\FieldType\Indexable` as an extra service and register this Service using the `ezpublish.fieldType.indexable` tag. Example from [`indexable_fieldtypes.yml`](https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/Core/settings/indexable_fieldtypes.yml):
Implement `eZ\Publish\SPI\FieldType\Indexable` as an extra service and register this Service using the `ezpublish.fieldType.indexable` tag. Example from [`indexable_fieldtypes.yaml`](https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/Core/settings/indexable_fieldtypes.yml):

``` yml
ezpublish.fieldType.indexable.ezkeyword:
Expand Down Expand Up @@ -83,7 +83,7 @@ The default available search Field Types that can be found in the `eZ\Publish\SP
As mentioned before, if you use the standard type definitions, there is no need to configure the search backend in any way.
The Field definitions are handled using `dynamicField` definitions in Solr, for example.

If you want to configure the handling of your field, you can always add a special field definition to the Solr `schema.xml`. For fields, the Field Type names used by the Solr search backend look like this: `<content_type_identifier>/<field_identifier>/<search_field_name>_<type>`.
If you want to configure the handling of your field, you can always add a special field definition to the Solr `schema.xml`. For fields, the Field Type names used by the Solr search backend look like this: `<content_type_identifier>/<field_identifier>/<search_field_name>_<type>`.
You can define custom `dynamicField` definitions to match, for example, on your custom `_<type>` definition.

You could also define a custom Field definition for certain fields, like for the name Field in an article:
Expand Down
10 changes: 5 additions & 5 deletions docs/api/field_type_storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The tag has the following attribute:

!!! tip

Converter configuration for built-in Field Types is located in [`eZ/Publish/Core/settings/fieldtype_external_storages.yml`](https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/Core/settings/fieldtype_external_storages.yml).
Converter configuration for built-in Field Types is located in [`eZ/Publish/Core/settings/fieldtype_external_storages.yaml`](https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/Core/settings/fieldtype_external_storages.yml).

## Storing external data

Expand Down Expand Up @@ -125,14 +125,14 @@ services:
autoconfigure: true
public: false

Acme\ExampleBundle\FieldType\MyField\Storage\MyFieldStorage: ~
App\FieldType\MyField\Storage\MyFieldStorage: ~
tags:
- {name: ezpublish.fieldType.externalStorageHandler, alias: myfield}
```

The configuration requires providing the `ezpublish.fieldType.externalStorageHandler` tag, with the `alias` attribute being the *fieldTypeIdentifier*. You also have to inject the gateway in `arguments`, [see below](#gateway-based-storage).

External storage configuration for basic Field Types is located in [eZ/Publish/Core/settings/fieldtype_external_storages.yml](https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/Core/settings/fieldtype_external_storages.yml).
External storage configuration for basic Field Types is located in [eZ/Publish/Core/settings/fieldtype_external_storages.yaml](https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/Core/settings/fieldtype_external_storages.yml).

#### Registration

Expand All @@ -145,7 +145,7 @@ services:
autoconfigure: true
public: false

Acme\ExampleBundle\FieldType\MyField\Storage\Gateway\DoctrineStorage: ~
App\FieldType\MyField\Storage\Gateway\DoctrineStorage: ~
```

Note that `ezpublish.api.storage_engine.legacy.connection` is of type `Doctrine\DBAL\Connection`. If your gateway still uses an implementation of `eZ\Publish\Core\Persistence\Database\DatabaseHandler` (`eZ\Publish\Core\Persistence\Doctrine\ConnectionHandler`), instead of the `ezpublish.api.storage_engine.legacy.connection`, you can pass the `ezpublish.api.storage_engine.legacy.dbhandler` service.
Expand All @@ -155,4 +155,4 @@ Also note that there can be several gateways per Field Type (one per storage eng

!!! tip

Gateway configuration for built-in Field Types is located in [`EzPublishCoreBundle/Resources/config/storage_engines.yml`](https://github.com/ezsystems/ezpublish-kernel/blob/v7.5.0/eZ/Bundle/EzPublishCoreBundle/Resources/config/storage_engines.yml).
Gateway configuration for built-in Field Types is located in [`EzPublishCoreBundle/Resources/config/storage_engines.yaml`](https://github.com/ezsystems/ezpublish-kernel/blob/v7.5.0/eZ/Bundle/EzPublishCoreBundle/Resources/config/storage_engines.yml).
2 changes: 1 addition & 1 deletion docs/api/field_type_type_and_value.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ The `alias` key is the `fieldTypeIdentifier`.

!!! tip

The configuration of built-in Field Types is located in [`EzPublishCoreBundle/Resources/config/fieldtypes.yml`](https://github.com/ezsystems/ezpublish-kernel/blob/v7.5.0/eZ/Publish/Core/settings/fieldtypes.yml).
The configuration of built-in Field Types is located in [`EzPublishCoreBundle/Resources/config/fieldtypes.yaml`](https://github.com/ezsystems/ezpublish-kernel/blob/v7.5.0/eZ/Publish/Core/settings/fieldtypes.yml).

## Field Type settings

Expand Down
4 changes: 1 addition & 3 deletions docs/api/general_rest_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,12 @@ More information can be found in [Session-based authentication chapter of the RE

### HTTP Basic authentication

To enable HTTP basic authentication, you need to edit `app/config/security.yml`, and add/uncomment the following block. Note that this is enabled by default.
To enable HTTP basic authentication, you need to edit `config/packages/security.yaml`, and add/uncomment the following block. Note that this is enabled by default.

!!! caution

Until [EZP-22192](https://jira.ez.no/browse/EZP-22192) is implemented, enabling basic authentication in REST will prevent PlatformUI from working.

**ezplatform.yml**

``` yaml
ezpublish_rest:
pattern: ^/api/ezp/v2
Expand Down
8 changes: 4 additions & 4 deletions docs/api/graphql_customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ You can customize the GraphQL schema that is generated from your repository.

You can use it if your application requires custom GraphQL resources, for instance for Doctrine entities.

To do so, create an `app/config/graphql/Query.types.yml` file. It will be used as the GraphQL query root.
To do so, create an `app/config/graphql/Query.types.yaml` file. It will be used as the GraphQL query root.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Path to types file will change but I have to fix GraphQL package first. I will ping you once it done.


In that file, add new fields that use any custom type or custom logic you require, based
on [overblog/GraphQLBundle](https://github.com/overblog/GraphQLBundle).
Expand All @@ -17,7 +17,7 @@ You can include the eZ Platform schema in two ways: either through inheritance o

#### Inheritance

To use inheritance, apply the following configuration in `app/config/graphql/Query.types.yml`:
To use inheritance, apply the following configuration in `app/config/graphql/Query.types.yaml`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.


``` yaml
Query:
Expand All @@ -33,7 +33,7 @@ Query:
#### Composition

To use composition, define eZ Platform schema as a field in your custom schema.
For example, in `app/config/graphql/Query.types.yml`:
For example, in `app/config/graphql/Query.types.yaml`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same


``` yaml
Query:
Expand All @@ -49,7 +49,7 @@ Query:
### Custom mutations

Custom mutations are created in the same way as custom query configuration.
An `app/config/graphql/Mutation.types.yml` file will be used as the source for mutation definitions in your schema.
An `app/config/graphql/Mutation.types.yaml` file will be used as the source for mutation definitions in your schema.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.


``` yaml
Mutation:
Expand Down
12 changes: 6 additions & 6 deletions docs/api/public_php_api_customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ You are going to generate a "EzSystems\Bundle\CookbookBundle\EzSystemsCookbookBu
Do you confirm generation [yes]? yes
```

The wizard will generate the bundle, check autoloading, and ask about the activation of your bundle. Hit Enter in the answer to both questions to have your bundle automatically added to your kernel (`app/AppKernel.php`) and routes from your bundle added to the existing routes (`app/config/routing.yml`).
The wizard will generate the bundle, check autoloading, and ask about the activation of your bundle. Hit Enter in the answer to both questions to have your bundle automatically added to your kernel (`app/AppKernel.php`) and routes from your bundle added to the existing routes (`config/routes.yaml`).

**Activation and generation**

Expand Down Expand Up @@ -210,13 +210,13 @@ Hello world

In this short chapter, you will see how to create a new route that will catch a custom URL and execute a controller action. You will create a new route, `/cookbook/test`, that displays a simple 'Hello world' message. This tutorial is a simplified version of the official one that can be found on <http://symfony.com/doc/current/book/controller.html>.

During your bundle's generation, you have chosen to generate the bundle with default code snippets. Fortunately, almost everything you need is part of those snippets. You just need to do some editing, in particular in two locations: `src/EzSystems/Resources/CookbookBundle/config/routing.yml` and `src/EzSystems/CookbookBundle/Controllers/DefaultController.php`. The first one will be used to configure your route (`/cookbook/test`) as well as the controller action the route should execute, while the latter will contain the actual action's code.
During your bundle's generation, you have chosen to generate the bundle with default code snippets. Fortunately, almost everything you need is part of those snippets. You just need to do some editing, in particular in two locations: `src/EzSystems/Resources/CookbookBundle/config/routing.yaml` and `src/EzSystems/CookbookBundle/Controllers/DefaultController.php`. The first one will be used to configure your route (`/cookbook/test`) as well as the controller action the route should execute, while the latter will contain the actual action's code.

### routing.yml
### routing.yaml

This is the file where you define your action's URL matching. The generated file contains this YAML block:

**Generated routing.yml**
**Generated routing.yaml**

``` yaml
ez_systems_cookbook_homepage:
Expand All @@ -226,7 +226,7 @@ ez_systems_cookbook_homepage:

You can safely remove this default code, and replace it with this:

**Edited routing.yml**
**Edited routing.yaml**

``` yaml
ezsystems_cookbook_hello:
Expand All @@ -251,7 +251,7 @@ public function helloAction( $name )
}
```

This method receives the parameter defined in `routing.yml`. It is called "name" in the route definition, and must be called $name in the matching action. Since the action is named "hello" in `routing.yml`, the expected method name is `helloAction`.
This method receives the parameter defined in `routing.yaml`. It is called "name" in the route definition, and must be called $name in the matching action. Since the action is named "hello" in `routing.yaml`, the expected method name is `helloAction`.

Controller actions **must** return a Response object that will contain the response's content, the headers, and various optional properties that affect the action's behavior. In your case, you simply set the content, using `setContent()`, to "Hello $name". Go to <http://ezplatform/cookbook/hello/YourName>, and you should get "Hello YourName".

Expand Down
4 changes: 2 additions & 2 deletions docs/api/rest_api_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ No special preparations are necessary to use the REST API. As long as your eZ Pl

As explained in more detail in the [authentication page](general_rest_usage.md#rest-api-authentication), two authentication methods are currently supported: session and basic. By default, session authentication is the active mode, it uses a session cookie. The alternative, basic auth authentication requires a login / password to be sent using basic HTTP authentication.

To enable basic auth based authentication, you need to edit `app/config/security.yml` and uncomment the configuration block about REST
To enable basic auth based authentication, you need to edit `config/packages/security.yaml` and uncomment the configuration block about REST

**security.yml**
**security.yaml**

```yaml
security:
Expand Down
16 changes: 5 additions & 11 deletions docs/community_resources/support_maintenance_faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The language of the Back Office is based on the browser language.
In order to change it you should install the proper package for your language (see [language packages list](https://github.com/ezplatform-i18n)).
Once you have language packages installed, you can switch the language of the Back Office in the User Settings menu.

If you do not have a language defined in the browser, it will be selected based on the `parameters.locale_fallback` parameter located in `default_parameters.yml`.
If you do not have a language defined in the browser, it will be selected based on the `parameters.locale_fallback` parameter located in `config/packages/ezplatform.yaml`.

To read more about language managing in eZ Platform, see the following doc pages:

Expand Down Expand Up @@ -98,21 +98,15 @@ rm -rf var/cache/*
In order to avoid merge conflicts on important configuration settings during upgrades,
moving as much as possible of your configuration to your own files can be a good idea.

There are two basic approaches to achieving that goal:

1. All project-specific parameters should be kept in separate files,
e.g. configuration for Landing Page Blocks could be placed in `landing_page_blocks.yml` which should be imported in `app/config/config.yml`:
All project-specific parameters should be kept in separate files.
For example, configuration for Landing Page Blocks could be placed in `config/packages/landing_page_blocks.yaml`.
You can also place it in `config/landing_page_blocks.yaml`, which should be imported in `config/ezplatform.yaml`:

```yaml
imports:
- { resource: landing_page_blocks.yml }
- { resource: ../landing_page_blocks.yaml }
```

2. The same configuration could be moved to your bundle e.g. `AppBundle/Resources/config/landing_page_blocks.yml`.

For more information, see [Configuration documentation](../guide/configuration.md)
and [Symfony best practices](https://symfony.com/doc/3.4/best_practices/configuration.html).

#### How can I implement authentication in an eZ Platform-based project?

The best approach is to use Symfony authentication.
Expand Down
Loading