[!!!][TASK] Improve FormEngine and sub classes separation 65/37265/6
authorChristian Kuhn <lolli@schwarzbu.ch>
Sat, 7 Feb 2015 20:19:13 +0000 (21:19 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 28 Feb 2015 16:24:32 +0000 (17:24 +0100)
commit212b9dbfc490f2f7bc8a88fef176f51ffc63f733
tree9b1c9f3b1dacf66afc232427f795e4e6bb1689ef
parent223237b8bcdbf9da80c1a99aae8b8921ad55d0e9
[!!!][TASK] Improve FormEngine and sub classes separation

This patch improves the separation of FormEngine and its sub
classes. Currently, all sub classes like single element and wizard
classes get an instance of the parent object to call various methods
and properties on them. This is very hard to refactor and the mesh
of call trees must be simplified to ease further refactoring and
improve maintainability of code.

This patch follows a divide & conquer approach:
* Methods only used by sub elements are moved to AbstractFormElement
* Properties FormEngine "knows" that are needed by element classes
  are given down in a data array during element instatiation to have
  a clear definition of what element classes know.
* Methods used by both FormEngine and sub classes that do not need
  an instance of FormEngine are moved to a static helper for now to
  reduce the amount of code in FormEngine and to mark certain areas
  as stateless.
* Class instances are not created on a global level anymore but
  created only in the scope where they are used
* Class instances injected by outer code are created internally
  for enabling the using code to be moved around.

All in all, this patch is mostly a preparation of defining a
fully separated structure with defined concerns for every sub class.

Most methods are moved around "as is" without changing functionality.
The only area that is refactored codewise is renderWizards().

There is still a nasty circular dependency between FormEngine,
FlexFormElement and InlineElement. This is not resolved by the patch,
but the surrounding code is now separated enough that this structure
could be refactored to a tree. This may follow with other patches.

This patch evolved on catharsis in branch formengine with 53 single
patches. Details can be looked up there, all single patches are
prefixed with [FormEngine].
https://github.com/lolli42/TYPO3.CMS-Catharsis/tree/formengine

Change-Id: I332ad51f5e94c09555480099e3a8a0257bed378f
Releases: master
Resolves: #65357
Resolves: #63848
Resolves: #63849
Resolves: #63851
Resolves: #63853
Resolves: #63855
Resolves: #63857
Resolves: #63867
Resolves: #63868
Resolves: #63869
Resolves: #63870
Resolves: #63871
Resolves: #63872
Resolves: #63873
Resolves: #63874
Resolves: #63875
Resolves: #63877
Resolves: #63879
Resolves: #63880
Resolves: #63884
Resolves: #63885
Resolves: #63886
Resolves: #63887
Resolves: #63888
Resolves: #63890
Resolves: #63892
Reviewed-on: http://review.typo3.org/37265
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
46 files changed:
typo3/sysext/backend/Classes/Controller/EditDocumentController.php
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Classes/Controller/SimpleDataHandlerController.php
typo3/sysext/backend/Classes/Controller/Wizard/RteController.php
typo3/sysext/backend/Classes/Form/DataPreprocessor.php
typo3/sysext/backend/Classes/Form/DatabaseFileIconsHookInterface.php
typo3/sysext/backend/Classes/Form/Element/AbstractFormElement.php
typo3/sysext/backend/Classes/Form/Element/CheckboxElement.php
typo3/sysext/backend/Classes/Form/Element/FlexElement.php
typo3/sysext/backend/Classes/Form/Element/GroupElement.php
typo3/sysext/backend/Classes/Form/Element/InlineElement.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/SelectElement.php
typo3/sysext/backend/Classes/Form/Element/SuggestDefaultReceiver.php [deleted file]
typo3/sysext/backend/Classes/Form/Element/SuggestElement.php [deleted file]
typo3/sysext/backend/Classes/Form/Element/TextElement.php
typo3/sysext/backend/Classes/Form/Element/TreeElement.php
typo3/sysext/backend/Classes/Form/Element/UnknownElement.php
typo3/sysext/backend/Classes/Form/Element/ValueSlider.php [deleted file]
typo3/sysext/backend/Classes/Form/FlexFormsHelper.php
typo3/sysext/backend/Classes/Form/FormEngine.php
typo3/sysext/backend/Classes/Form/FrontendFormEngine.php
typo3/sysext/backend/Classes/Form/Utility/FormEngineUtility.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/Wizard/SuggestWizard.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/Wizard/SuggestWizardDefaultReceiver.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/Wizard/ValueSliderWizard.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/backend/Classes/View/BackendLayoutView.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/backend/Migrations/Code/ClassAliasMap.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/Element/InlineElementTest.php
typo3/sysext/backend/Tests/Unit/Form/Element/NoneElementTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormEngineTest.php [deleted file]
typo3/sysext/compatibility6/Migrations/Code/ClassAliasMap.php
typo3/sysext/compatibility6/Migrations/Code/LegacyClassesForIde.php
typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php
typo3/sysext/core/Configuration/DefaultConfiguration.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-65357-DependenciesToFormEngine.rst [new file with mode: 0644]
typo3/sysext/core/Documentation/Changelog/master/Deprecation-65357-DependenciesToFormEngine.rst [new file with mode: 0644]
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php
typo3/sysext/rtehtmlarea/Classes/Controller/FrontendRteController.php
typo3/sysext/rtehtmlarea/Classes/RteHtmlAreaBase.php
typo3/sysext/sys_action/Classes/ActionTask.php
typo3/sysext/t3editor/Classes/FormWizard.php