[TASK] FormEngine: The factory 17/39517/6
authorChristian Kuhn <lolli@schwarzbu.ch>
Tue, 12 May 2015 21:41:46 +0000 (23:41 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 18 May 2015 10:20:20 +0000 (12:20 +0200)
commit86f42bc500afc966c84bcfeddd0a723e109c5cb7
tree055957e7a4500d3641808f40370865a2beaf3d99
parent5569bee6b881f59ebc1c59753d71216a25e478dd
[TASK] FormEngine: The factory

Creation of container and elements instances in the FormEngine is
hard coded and hard to overwrite or adapt.
The patch extends the existing NodeFactory with resolver code to
find an appropriate class for a given requested type. All FormEngine
internal container and element requests are now routed through
NodeFactory. This allows to loosen the strict dependency between
TCA config "type" to an implementing class by moving the resolving
code into the factory. This is done for SelectElement which is now
split into multiple smaller classes - one for each display type. The
NodeFactory is covered by unit tests since the resolving code will
become more complex and fine grained in the future.
As a side effect the patch resolves a hack in the FormDataTraverser
which no longer calls internal stuff of the select element.
The NodeFactory is prepared to be extended with an API for extensions
to steer and overwrite default implementations. This will be added
with a next patch.

Change-Id: I2253a0fe3240366d0d271a3cd82119ce3dc52012
Resolves: #67006
Releases: master
Reviewed-on: http://review.typo3.org/39517
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
36 files changed:
typo3/sysext/backend/Classes/Exception.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/AbstractNode.php
typo3/sysext/backend/Classes/Form/Container/FlexFormContainer.php
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/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/Element/AbstractFormElement.php
typo3/sysext/backend/Classes/Form/Element/ImageManipulationElement.php
typo3/sysext/backend/Classes/Form/Element/InputElement.php
typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxElement.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/Element/SelectElement.php [deleted file]
typo3/sysext/backend/Classes/Form/Element/SelectMultipleSideBySideElement.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/Element/SelectSingleBoxElement.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/Element/SelectSingleElement.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/Element/SelectTreeElement.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/Element/TextElement.php
typo3/sysext/backend/Classes/Form/Element/TreeElement.php [deleted file]
typo3/sysext/backend/Classes/Form/Exception.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/FormDataTraverser.php
typo3/sysext/backend/Classes/Form/FormEngine.php
typo3/sysext/backend/Classes/Form/NodeFactory.php
typo3/sysext/backend/Classes/Form/NodeInterface.php [new file with mode: 0644]
typo3/sysext/backend/Classes/Form/Utility/FormEngineUtility.php
typo3/sysext/backend/Tests/Unit/Form/NodeFatoryTest.php [new file with mode: 0644]