[!!!][TASK] The FormEngine is dead, long live the FormEngine! 33/41933/101
authorChristian Kuhn <lolli@schwarzbu.ch>
Thu, 23 Jul 2015 19:07:46 +0000 (21:07 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 8 Sep 2015 17:19:37 +0000 (19:19 +0200)
commitb524fc860c96077eabe6adb6fc9d0eab197aea9e
tree48abb1d02f0408b1044aa4d7b3585025bfc3757a
parentbbe40115aaa40b0f39e2d0363cf4fb6c9fd5bf4c
[!!!][TASK] The FormEngine is dead, long live the FormEngine!

tl;dr: This patch makes FormEngine insanely flexible, extensions
however should not rely on structures for now, since class names
and array content will change.

The patch applies a separation of concerns to the FormEngine
class structure by extracting the data processing from rendering.

As a main goal the render part consisting of container and element
classes routed through the flexible NodeFactory only works on data
created by the new FormDataCompiler class construct. This makes the
FormEngine much more flexible and opens ways to not only use the render
part in the context of database driven data, but on anything that is
fed to it.

This patch creates the main structure for this. The FormDataCompiler
class returns a defined array container and elements can work on it.
Data is added by single FormDataProvider, which are combined in
FormDataGroups. FormDataProvider may depend on each other and a
FormDataGroup "knows" its providers and calls them in a dedicated order.

For instance, the "FullDatabaseRecord" FormDataGroup first calls a
provider that fetches the record defined by uid and table name and
a later called provider determines the given record type this record
is assigned to, so another provider can then work on TCA to determine
the list of record fields to be shown. The FormDataProvider used
for the main FormDataGroup are defined in TYPO3_CONF_VARS, so
extensions can add and remove their own providers to add or change
certain data if needed. This is highly flexible and extensions are
able to hook in at a specific position within the provider chain for
the main data groups.

This construct obsoletes the DataPreprocessor as well as several
other side classes.

With this patch the main architecture is created and lots of data
preparation is transfered already, supported by a high unit test
coverage.

The FormEngine class itself is removed: The inline ajax entry point
is moved to an own controller class, the getMainFields() and friends
methods are substituted with FormDataCompiler / NodeFactory combinations
and the data gathering is for now parked in a FormResultCompiler class.

However, this process is not yet finished and lots of @todo
statements are added to the code base to document open ends and to
further separate the data handling from the render engine. Especially
the IRRE data handling is currently still located within the render
engine and makes the whole thing much more complicated than it should
be. Lots of detail patches need to follow to bring this code
to a level where it belongs to be.

Warning: While this patch is already insanely huge touching more than
22 thousands lines of code, lots of loose ends need to be tackled and
the API is not final yet. The arrays will be reduced and sharpened
during the next weeks, class names may change and structures will
change.

Change-Id: Ief1769f478373cc26d1bf6c49114258f0dae8355
Resolves: #69568
Releases: master
Reviewed-on: http://review.typo3.org/41933
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Florian Peters <fpeters1392@googlemail.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
168 files changed:
typo3/sysext/backend/Classes/Configuration/TranslationConfigurationProvider.php
typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php
typo3/sysext/backend/Classes/Controller/EditDocumentController.php
typo3/sysext/backend/Classes/Controller/File/CreateFolderController.php
typo3/sysext/backend/Classes/Controller/FormInlineAjaxController.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Classes/Controller/Wizard/AddController.php
typo3/sysext/backend/Classes/Controller/Wizard/RteController.php
typo3/sysext/backend/Classes/Form/AbstractNode.php
typo3/sysext/backend/Classes/Form/Container/AbstractContainer.php
typo3/sysext/backend/Classes/Form/Container/FlexFormContainer.php [deleted file]
typo3/sysext/backend/Classes/Form/Container/FlexFormContainerContainer.php
typo3/sysext/backend/Classes/Form/Container/FlexFormElementContainer.php
typo3/sysext/backend/Classes/Form/Container/FlexFormLanguageContainer.php
typo3/sysext/backend/Classes/Form/Container/FlexFormNoTabsContainer.php
typo3/sysext/backend/Classes/Form/Container/FlexFormSectionContainer.php
typo3/sysext/backend/Classes/Form/Container/FlexFormTabsContainer.php
typo3/sysext/backend/Classes/Form/Container/FullRecordContainer.php
typo3/sysext/backend/Classes/Form/Container/InlineControlContainer.php
typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php
typo3/sysext/backend/Classes/Form/Container/ListOfFieldsContainer.php
typo3/sysext/backend/Classes/Form/Container/NoTabsContainer.php
typo3/sysext/backend/Classes/Form/Container/OuterWrapContainer.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/Container/PaletteAndSingleContainer.php
typo3/sysext/backend/Classes/Form/Container/SingleFieldContainer.php
typo3/sysext/backend/Classes/Form/Container/SoloFieldContainer.php
typo3/sysext/backend/Classes/Form/Container/TabsContainer.php
typo3/sysext/backend/Classes/Form/DataPreprocessor.php [deleted file]
typo3/sysext/backend/Classes/Form/Element/AbstractFormElement.php
typo3/sysext/backend/Classes/Form/Element/CheckboxElement.php
typo3/sysext/backend/Classes/Form/Element/GroupElement.php
typo3/sysext/backend/Classes/Form/Element/ImageManipulationElement.php
typo3/sysext/backend/Classes/Form/Element/InputElement.php
typo3/sysext/backend/Classes/Form/Element/NoneElement.php
typo3/sysext/backend/Classes/Form/Element/RadioElement.php
typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxElement.php
typo3/sysext/backend/Classes/Form/Element/SelectMultipleSideBySideElement.php
typo3/sysext/backend/Classes/Form/Element/SelectSingleBoxElement.php
typo3/sysext/backend/Classes/Form/Element/SelectSingleElement.php
typo3/sysext/backend/Classes/Form/Element/SelectTreeElement.php
typo3/sysext/backend/Classes/Form/Element/TextElement.php
typo3/sysext/backend/Classes/Form/Element/UnknownElement.php
typo3/sysext/backend/Classes/Form/Element/UserElement.php
typo3/sysext/backend/Classes/Form/Exception/AccessDeniedContentEditException.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/Exception/AccessDeniedEditInternalsException.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/Exception/AccessDeniedException.php
typo3/sysext/backend/Classes/Form/Exception/AccessDeniedHookException.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/Exception/AccessDeniedPageEditException.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/Exception/AccessDeniedPageNewException.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/Exception/AccessDeniedRootNodeException.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/Exception/AccessDeniedTableModifyException.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/Exception/DatabaseDefaultLanguageException.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/Exception/DatabaseRecordException.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FlexFormsHelper.php [deleted file]
typo3/sysext/backend/Classes/Form/FormDataCompiler.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataGroup/FlexFormSegment.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataGroup/OnTheFly.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataGroup/TcaDatabaseRecord.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataGroupInterface.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractDatabaseRecordProvider.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseEditRow.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseEffectivePid.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseLanguageRows.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/DatabasePageLanguageOverlayRows.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/DatabasePageRootline.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseParentPageRow.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseRecordTypeValue.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseRowDateTimeFields.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseRowDefaultValues.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseRowGroupRelations.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseRowInitializeNew.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseSystemLanguageRows.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseUniqueUidNewRow.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseUserPermissionCheck.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/InitializeProcessedTca.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/PageTsConfig.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/PageTsConfigMerged.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/ParentPageTca.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/ReturnUrl.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/TableTca.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaCheckboxItems.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsOverrides.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaFlex.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaInline.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaRadioItems.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectValues.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaTypesShowitem.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProvider/UserTsConfig.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataProviderInterface.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataTraverser.php
typo3/sysext/backend/Classes/Form/FormEngine.php [deleted file]
typo3/sysext/backend/Classes/Form/FormResultCompiler.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/InlineRelatedRecordResolver.php
typo3/sysext/backend/Classes/Form/NodeFactory.php
typo3/sysext/backend/Classes/Form/NodeInterface.php
typo3/sysext/backend/Classes/Form/NodeResolverInterface.php
typo3/sysext/backend/Classes/Form/Utility/FormEngineUtility.php
typo3/sysext/backend/Classes/Form/Wizard/SuggestWizard.php
typo3/sysext/backend/Classes/Form/Wizard/ValueSliderWizard.php
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/backend/Classes/View/BackendLayoutView.php
typo3/sysext/backend/Resources/Private/Templates/FormEngine.html [deleted file]
typo3/sysext/backend/Resources/Private/Templates/alt_doc.html
typo3/sysext/backend/Resources/Public/JavaScript/jsfunc.inline.js
typo3/sysext/backend/Tests/Functional/Fixtures/Extensions/inlinetest/Configuration/TCA/tx_inlinetest_inline.php [deleted file]
typo3/sysext/backend/Tests/Functional/Fixtures/Extensions/inlinetest/Configuration/TCA/tx_inlinetest_record.php [deleted file]
typo3/sysext/backend/Tests/Functional/Fixtures/Extensions/inlinetest/ext_emconf.php [deleted file]
typo3/sysext/backend/Tests/Functional/Fixtures/Extensions/inlinetest/ext_tables.sql [deleted file]
typo3/sysext/backend/Tests/Functional/Fixtures/inlinetest.xml [deleted file]
typo3/sysext/backend/Tests/Functional/Form/FormEngineInlineTest.php [deleted file]
typo3/sysext/backend/Tests/Unit/Controller/FormInlineAjaxControllerTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataComplierTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataGroup/FlexFormSegmentTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataGroup/OnTheFlyTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataGroup/TcaDatabaseRecordTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseEditRowTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseEffectivePidTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseLanguageRowsTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabasePageLanguageOverlayRowsTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseParentPageRowTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseRecordTypeValueTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseRowDateTimeFieldsTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseRowDefaultValuesTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseRowGroupRelationsTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseRowInitializeNewTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseSystemLanguageRowsTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseUniqueUidNewRowTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseUserPermissionCheckTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/InitializeProcessedTcaTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/PageTsConfigMergedTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/ParentPageTcaTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TableTcaTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaCheckboxItemsTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaColumnsOverridesTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaFlexTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaRadioItemsTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectItemsTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectValuesTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaTypesShowitemTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/UserTsConfigTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormEngineTest.php [deleted file]
typo3/sysext/backend/Tests/Unit/Form/NodeFactoryTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/NodeFatoryTest.php [deleted file]
typo3/sysext/backend/Tests/Unit/Utility/BackendUtilityTest.php
typo3/sysext/backend/Tests/Unit/Utility/Fixtures/ExcludeFieldsReturnsCorrectFieldListFixture.php [deleted file]
typo3/sysext/backend/Tests/Unit/Utility/Fixtures/ExcludeFieldsReturnsCorrectListWithFlexFormFieldsFixture.php [deleted file]
typo3/sysext/compatibility6/Migrations/Code/ClassAliasMap.php
typo3/sysext/compatibility6/Migrations/Code/LegacyClassesForIde.php
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Classes/DataHandling/ItemProcessingService.php
typo3/sysext/core/Classes/Database/DatabaseConnection.php
typo3/sysext/core/Classes/Database/RelationHandler.php
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/core/Configuration/DefaultConfiguration.php
typo3/sysext/core/Documentation/Changelog/7.1/Feature-61711-SignalAtVeryEndOfDataPreprocessorFetchRecord.rst [deleted file]
typo3/sysext/core/Documentation/Changelog/7.3/Breaking-63846-FormEngineRefactoring.rst
typo3/sysext/core/Documentation/Changelog/master/Breaking-69568-FormEngine.rst [new file with mode: 0644]
typo3/sysext/core/Documentation/Changelog/master/Deprecation-69562-DeprecateHelperMethodsForRedundantCSRFProtection.rst
typo3/sysext/core/Documentation/Changelog/master/Deprecation-69568-VariousFormEngineRelatedMethods.rst [new file with mode: 0644]
typo3/sysext/core/Documentation/Changelog/master/Feature-69568-FormEngineDataProcessing.rst [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Service/DependencyOrderingServiceTest.php
typo3/sysext/install/Tests/Unit/Updates/TableFlexFormToTtContentFieldsUpdateTest.php
typo3/sysext/rsaauth/Classes/Form/Element/RsaInputElement.php
typo3/sysext/rtehtmlarea/Classes/Form/Element/RichTextElement.php
typo3/sysext/rtehtmlarea/Classes/Form/Resolver/RichTextNodeResolver.php
typo3/sysext/t3editor/Classes/Form/Element/T3editorElement.php