Change the content type manager to work with the XML files

Description

Background:

The content types should always be present. This issue should solve the problems when code is based on content types which are not available.

The requirements are using the following documentation on the Symfony website.
http://symfony.com/doc/3.4/components/config/resources.html
Here is explained how to `Load Resources` in your project. In the example is spoken about the Yaml loader. We prefer the Xml loader.

The directories added in can be registred with the CompilerPass. To check what kind of documents are set into the XML files, it’s an option to add the type of the document in the CompilerPass, see example.

The content types can’t be deleted in Integrated when they are added from the XML. The name of the `content type` can be changed by clicking on the edit button. The locked property shouldn’t be set in the Database. This will be build into the

Requirements

The content type manager should read the XML files which are registred and add them to the database when not existing yet.

This manager is used several other files:
- \Integrated\Bundle\ContentBundle\Tests\Menu\ContentTypeMenuBuilderTest
- \Integrated\Bundle\ContentBundle\Provider\MediaProvider
- \Integrated\Bundle\ContentBundle\Menu\ContentTypeMenuBuilder
- \Integrated\Bundle\ContentBundle\Form\Type\Job\CompanyJobType
- \Integrated\Bundle\ContentBundle\Form\Type\AuthorType

Examples

CompilerPass example:
$definition->addMethodCall(’registerResource’, [ContentType:class, '@IntegratedContentBundle/Resources/config/integrated/content_types.xml']);

Undefined scenario, only for information

There is a possibility when there is already a content type added for example:
- id news
- class ContentType/Video
- label Video News
In the XML is added:
- id news
- class ContentType/News
- label News

What to do in this situation isn’t described in this document. Because the unique identifier is “id” the Content Type manager doesn’t do anything with this.

Technical tasks

In de SPIKE is beschreven hoe het moet worden geïmplementeerd. Op basis van dit issue kan de documentatie geschreven worden.

Deployment actions

None

Activity

Show:
Ger Jan van den Bosch
May 9, 2018, 12:29 PM
Edited


1. Should be discussed during the Integrated meeting
2. Removed (but comment should be placed into issue )
3. This should be a new issue (the specs are to use a compiler pass)

Marijn Otte
May 11, 2018, 2:00 PM

can you give your vision about the comments above? I was expecting it to work like my comments

the roles loader also uses a compiler pass, but looks into all bundles:
user-bundle/DependencyInjection/Compiler/RegisterRolesParametersPass.php

Ger Jan van den Bosch
May 14, 2018, 6:15 AM

See the example in de the specs:

Michael Jongman
May 14, 2018, 7:12 AM

, i think that we need to discuss this instead of commenting. Can you plan in a meeting?

API
May 15, 2018, 7:33 AM

.Notificatie preview gestuurd naar Integrated Marijn (marijn@e-active.nl)

Assignee

Unassigned

Client

Integrated Marijn

Epic Link

Sprint

None

Fix versions

Configure