[+FEATURE] Fluid (Core/Widget): Added Tx_Fluid_Core_Widget_Bootstrap that is used...
authorBastian Waidelich <bastian@typo3.org>
Sun, 14 Nov 2010 13:38:48 +0000 (13:38 +0000)
committerBastian Waidelich <bastian@typo3.org>
Sun, 14 Nov 2010 13:38:48 +0000 (13:38 +0000)
[~TASK] Fluid (Compatibility): Removed Tx_Fluid_Compatibility_ObjectManager and replaced instances by Tx_Extbase_Object_ObjectManagerInterface instances
[~TASK] Fluid (Core/Widget): AbstractWidgetController has to be a singleton so it can be injected in the WidgetViewHelper.. To be discussed!
[+TASK] Fluid (Core/Widget): AjaxWidgetContextHolder is now correctly stored in the BE/FE Users session if the ajaxWidget of the corresponding Widget is TRUE.
[+TASK] Fluid (Core/Widget): The WidgetContext now contains a reference to the parent extension & plugin name. That's needed for the widgetAjaxResponse.
[+BUGFIX] Fluid (Core/Widget): WidgetRequestBuilder now correctly interprets GET parameters and dispatches Ajax requests
[+BUGFIX] Fluid (ViewHelpers): Modified ViewHelpers cObject, format.crop, format.html, image, uri.image so that they use dependency injection in order to retrieve the current cObject instance from the configurationManager
[+BUGFIX] Fluid (ViewHelpers): Fixed form ViewHelper to respect configured pluginNamespace in field name prefixes
[+BUGFIX] Fluid (ViewHelpers): link.widget/uri.widget ViewHelpers now create correct URIs
[+BUGFIX] Fluid (ViewHelpers): replaced @inject annotation by injectController method in AutocompleteViewHelper.

35 files changed:
typo3/sysext/fluid/Classes/Compatibility/DocbookGeneratorService.php
typo3/sysext/fluid/Classes/Compatibility/TemplateParserBuilder.php
typo3/sysext/fluid/Classes/Core/Parser/Interceptor/Escape.php
typo3/sysext/fluid/Classes/Core/Parser/TemplateParser.php
typo3/sysext/fluid/Classes/Core/Rendering/RenderingContext.php
typo3/sysext/fluid/Classes/Core/Rendering/RenderingContextInterface.php
typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetController.php
typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetViewHelper.php
typo3/sysext/fluid/Classes/Core/Widget/AjaxWidgetContextHolder.php
typo3/sysext/fluid/Classes/Core/Widget/Bootstrap.php [new file with mode: 0644]
typo3/sysext/fluid/Classes/Core/Widget/WidgetContext.php
typo3/sysext/fluid/Classes/Core/Widget/WidgetRequestBuilder.php
typo3/sysext/fluid/Classes/Core/Widget/WidgetRequestHandler.php
typo3/sysext/fluid/Classes/View/AbstractTemplateView.php
typo3/sysext/fluid/Classes/View/StandaloneView.php
typo3/sysext/fluid/Classes/View/TemplateView.php
typo3/sysext/fluid/Classes/ViewHelpers/CObjectViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/FormViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Format/CropViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/ImageViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Link/WidgetViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Uri/ImageViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Uri/WidgetViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Widget/AutocompleteViewHelper.php
typo3/sysext/fluid/Configuration/TypoScript/setup.txt [new file with mode: 0644]
typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/ViewHelperNodeTest.php
typo3/sysext/fluid/Tests/Unit/Core/Parser/TemplateParserTest.php
typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetControllerTest.php
typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetRequestBuilderTest.php
typo3/sysext/fluid/Tests/Unit/View/StandaloneViewTest.php
typo3/sysext/fluid/ext_autoload.php
typo3/sysext/fluid/ext_tables.php [new file with mode: 0644]
typo3/sysext/fluid/ext_typoscript_setup.txt [new file with mode: 0644]

index edfd42c..571213f 100644 (file)
@@ -72,7 +72,7 @@ class Tx_Fluid_Compatibility_DocbookGeneratorService extends Tx_Fluid_Service_Do
        }
 
        protected function instanciateViewHelper($className) {
-               $objectFactory = t3lib_div::makeInstance('Tx_Fluid_Compatibility_ObjectFactory');
+               $objectFactory = t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager');
                return $objectFactory->create($className);
        }
 }
index 2b676c9..ba4bb35 100644 (file)
@@ -29,7 +29,7 @@ class Tx_Fluid_Compatibility_TemplateParserBuilder {
         */
        static public function build() {
                $templateParser = t3lib_div::makeInstance('Tx_Fluid_Core_Parser_TemplateParser');
-               $templateParser->injectObjectManager(t3lib_div::makeInstance('Tx_Fluid_Compatibility_ObjectManager'));
+               $templateParser->injectObjectManager(t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager'));
                return $templateParser;
        }
 }
index de04bab..66ce822 100644 (file)
@@ -36,19 +36,22 @@ class Tx_Fluid_Core_Parser_Interceptor_Escape implements Tx_Fluid_Core_Parser_In
        /**
         * A stack of ViewHelperNodes which currently disable the interceptor.
         * Needed to enable the interceptor again.
-        * 
+        *
         * @var array<Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface>
         */
        protected $viewHelperNodesWhichDisableTheInterceptor = array();
-       
+
        /**
-        * Inject object factory
-        *
-        * @param Tx_Fluid_Compatibility_ObjectManager $objectManager
+        * @var Tx_Extbase_Object_ObjectManagerInterface
+        */
+       protected $objectManager;
+
+       /**
+        * @param Tx_Extbase_Object_ObjectManagerInterface $objectManager
         * @return void
         * @author Karsten Dambekalns <karsten@typo3.org>
         */
-       public function injectObjectManager(Tx_Fluid_Compatibility_ObjectManager $objectManager) {
+       public function injectObjectManager(Tx_Extbase_Object_ObjectManagerInterface $objectManager) {
                $this->objectManager = $objectManager;
        }
 
index 2a348c4..10ceb6b 100644 (file)
@@ -268,7 +268,7 @@ class Tx_Fluid_Core_Parser_TemplateParser implements t3lib_Singleton {
        );
 
        /**
-        * @var Tx_Fluid_Compatibility_ObjectManager
+        * @var Tx_Extbase_Object_ObjectManagerInterface
         */
        protected $objectManager;
 
@@ -288,13 +288,11 @@ class Tx_Fluid_Core_Parser_TemplateParser implements t3lib_Singleton {
        }
 
        /**
-        * Inject object factory
-        *
-        * @param Tx_Fluid_Compatibility_ObjectManager $objectManager
+        * @param Tx_Extbase_Object_ObjectManagerInterface $objectManager
         * @return void
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
-       public function injectObjectManager(Tx_Fluid_Compatibility_ObjectManager $objectManager) {
+       public function injectObjectManager(Tx_Extbase_Object_ObjectManagerInterface $objectManager) {
                $this->objectManager = $objectManager;
        }
 
@@ -614,7 +612,7 @@ class Tx_Fluid_Core_Parser_TemplateParser implements t3lib_Singleton {
 
                        // Object Accessor
                if (strlen($objectAccessorString) > 0) {
-                       
+
                        $node = $this->objectManager->create('Tx_Fluid_Core_Parser_SyntaxTree_ObjectAccessorNode', $objectAccessorString);
                        $this->callInterceptor($node, Tx_Fluid_Core_Parser_InterceptorInterface::INTERCEPT_OBJECTACCESSOR);
 
@@ -842,7 +840,7 @@ class Tx_Fluid_Core_Parser_TemplateParser implements t3lib_Singleton {
        protected function textHandler(Tx_Fluid_Core_Parser_ParsingState $state, $text) {
                $node = $this->objectManager->create('Tx_Fluid_Core_Parser_SyntaxTree_TextNode', $text);
                $this->callInterceptor($node, Tx_Fluid_Core_Parser_InterceptorInterface::INTERCEPT_TEXT);
-               
+
                $state->getNodeFromStack()->addChildNode($node);
        }
 
index 03321ca..b6dd073 100644 (file)
@@ -39,7 +39,7 @@ class Tx_Fluid_Core_Rendering_RenderingContext implements Tx_Fluid_Core_Renderin
         * Object manager which is bubbled through. The ViewHelperNode cannot get an ObjectManager injected because
         * the whole syntax tree should be cacheable
         *
-        * @var Tx_Fluid_Compatibility_ObjectManager
+        * @var Tx_Extbase_Object_ObjectManagerInterface
         */
        protected $objectManager;
 
@@ -58,12 +58,10 @@ class Tx_Fluid_Core_Rendering_RenderingContext implements Tx_Fluid_Core_Renderin
        protected $viewHelperVariableContainer;
 
        /**
-        * Inject the object manager
-        *
-        * @param Tx_Fluid_Compatibility_ObjectManager $objectManager
+        * @param Tx_Extbase_Object_ObjectManagerInterface $objectManager
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
-       public function injectObjectManager(Tx_Fluid_Compatibility_ObjectManager $objectManager) {
+       public function injectObjectManager(Tx_Extbase_Object_ObjectManagerInterface $objectManager) {
                $this->objectManager = $objectManager;
                $this->templateVariableContainer = $this->objectManager->create('Tx_Fluid_Core_ViewHelper_TemplateVariableContainer');
                $this->viewHelperVariableContainer = $this->objectManager->create('Tx_Fluid_Core_ViewHelper_ViewHelperVariableContainer');
@@ -72,7 +70,7 @@ class Tx_Fluid_Core_Rendering_RenderingContext implements Tx_Fluid_Core_Renderin
        /**
         * Returns the object manager. Only the ViewHelperNode should do this.
         *
-        * @param Tx_Fluid_Compatibility_ObjectManager $objectManager
+        * @param Tx_Extbase_Object_ObjectManagerInterface $objectManager
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
        public function getObjectManager() {
index 0b0f0e7..7658c0e 100644 (file)
@@ -30,7 +30,7 @@ interface Tx_Fluid_Core_Rendering_RenderingContextInterface {
        /**
         * Returns the object manager. Only the ViewHelperNode should do this.
         *
-        * @param Tx_Fluid_Compatibility_ObjectManager $objectManager
+        * @param Tx_Extbase_Object_ObjectManagerInterface $objectManager
         */
        public function getObjectManager();
 
index a48e9ea..f16c094 100644 (file)
@@ -28,7 +28,7 @@
  * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
  * @api
  */
-abstract class Tx_Fluid_Core_Widget_AbstractWidgetController extends Tx_Extbase_MVC_Controller_ActionController {
+abstract class Tx_Fluid_Core_Widget_AbstractWidgetController extends Tx_Extbase_MVC_Controller_ActionController implements t3lib_Singleton {
 
        /**
         * @var array
index 811ee41..3485b15 100644 (file)
@@ -52,7 +52,7 @@ abstract class Tx_Fluid_Core_Widget_AbstractWidgetViewHelper extends Tx_Fluid_Co
        private $ajaxWidgetContextHolder;
 
        /**
-        * @var Tx_Fluid_Compatibility_ObjectManager
+        * @var Tx_Extbase_Object_ObjectManagerInterface
         */
        private $objectManager;
 
@@ -71,11 +71,11 @@ abstract class Tx_Fluid_Core_Widget_AbstractWidgetViewHelper extends Tx_Fluid_Co
        }
 
        /**
-        * @param Tx_Fluid_Compatibility_ObjectManager $objectManager
+        * @param Tx_Extbase_Object_ObjectManagerInterface $objectManager
         * @return void
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
-       public function injectObjectManager(Tx_Fluid_Compatibility_ObjectManager $objectManager) {
+       public function injectObjectManager(Tx_Extbase_Object_ObjectManagerInterface $objectManager) {
                $this->objectManager = $objectManager;
                $this->widgetContext = $this->objectManager->create('Tx_Fluid_Core_Widget_WidgetContext');
        }
@@ -102,21 +102,23 @@ abstract class Tx_Fluid_Core_Widget_AbstractWidgetViewHelper extends Tx_Fluid_Co
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
        private function initializeWidgetContext() {
-               if ($this->ajaxWidget === TRUE) {
-                       $this->ajaxWidgetContextHolder->store($this->widgetContext);
-               }
-
                $this->widgetContext->setWidgetConfiguration($this->getWidgetConfiguration());
                $this->initializeWidgetIdentifier();
 
                $controllerObjectName = ($this->controller instanceof Tx_Fluid_AOP_ProxyInterface) ? $this->controller->FLOW3_AOP_Proxy_getProxyTargetClassName() : get_class($this->controller);
                $this->widgetContext->setControllerObjectName($controllerObjectName);
 
-               $pluginSignature = strtolower($this->controllerContext->getRequest()->getControllerExtensionName() . '_' . $this->controllerContext->getRequest()->getPluginName());
-               $pluginNamespace = Tx_Extbase_Utility_Extension::getPluginNamespaceByPluginSignature($pluginSignature);
+               $extensionName = $this->controllerContext->getRequest()->getControllerExtensionName();
+               $pluginName = $this->controllerContext->getRequest()->getPluginName();
+               $this->widgetContext->setParentExtensionName($extensionName);
+               $this->widgetContext->setParentPluginName($pluginName);
+               $pluginNamespace = Tx_Extbase_Utility_Extension::getPluginNamespace($extensionName, $pluginName);
                $this->widgetContext->setParentPluginNamespace($pluginNamespace);
 
                $this->widgetContext->setWidgetViewHelperClassName(get_class($this));
+               if ($this->ajaxWidget === TRUE) {
+                       $this->ajaxWidgetContextHolder->store($this->widgetContext);
+               }
        }
 
        /**
@@ -156,7 +158,10 @@ abstract class Tx_Fluid_Core_Widget_AbstractWidgetViewHelper extends Tx_Fluid_Co
         */
        protected function initiateSubRequest() {
                if (!($this->controller instanceof Tx_Fluid_Core_Widget_AbstractWidgetController)) {
-                       throw new Tx_Fluid_Core_Widget_Exception_MissingControllerException('initiateSubRequest() can not be called if there is no controller inside $this->controller. Make sure to add the @inject annotation in your widget class.', 1284401632);
+                       if (isset($this->controller)) {
+                               throw new Tx_Fluid_Core_Widget_Exception_MissingControllerException('initiateSubRequest() can not be called if there is no valid controller extending Tx_Fluid_Core_Widget_AbstractWidgetController. Got "' . get_class($this->controller) . '" in class "' . get_class($this) . '".', 1289422564);
+                       }
+                       throw new Tx_Fluid_Core_Widget_Exception_MissingControllerException('initiateSubRequest() can not be called if there is no controller inside $this->controller. Make sure to add a corresponding injectController method to your WidgetViewHelper class "' . get_class($this) . '".', 1284401632);
                }
 
                $subRequest = $this->objectManager->create('Tx_Fluid_Core_Widget_WidgetRequest');
index 4a7289c..4572905 100644 (file)
@@ -48,7 +48,33 @@ class Tx_Fluid_Core_Widget_AjaxWidgetContextHolder implements t3lib_Singleton {
         */
        protected $widgetContexts = array();
 
-    /**
+       /**
+        * @var string
+        */
+       protected $widgetContextsStorageKey = 'Tx_Fluid_Core_Widget_AjaxWidgetContextHolder_widgetContexts';
+
+       /**
+        * Constructor
+        */
+       public function __construct() {
+               $this->loadWidgetContexts();
+       }
+
+       /**
+        * Loads the windget contexts from the TYPO3 user session
+        *
+        * @return void
+        */
+       protected function loadWidgetContexts() {
+               if (TYPO3_MODE === 'FE') {
+                       $this->widgetContexts = unserialize($GLOBALS['TSFE']->fe_user->getKey('ses', $this->widgetContextsStorageKey));
+               } else {
+                       $this->widgetContexts = unserialize($GLOBALS['BE_USER']->uc[$this->widgetContextsStorageKey]);
+                       $GLOBALS['BE_USER']->writeUC();
+               }
+       }
+
+       /**
         * Get the widget context for the given $ajaxWidgetId.
         *
         * @param integer $ajaxWidgetId
@@ -72,9 +98,29 @@ class Tx_Fluid_Core_Widget_AjaxWidgetContextHolder implements t3lib_Singleton {
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
        public function store(Tx_Fluid_Core_Widget_WidgetContext $widgetContext) {
-               $ajaxWidgetId = $this->nextFreeAjaxWidgetId++;
+               // TODO persist nextFreeAjaxWidgetId in session
+               $ajaxWidgetId = $this->nextFreeAjaxWidgetId ++;
                $widgetContext->setAjaxWidgetIdentifier($ajaxWidgetId);
                $this->widgetContexts[$ajaxWidgetId] = $widgetContext;
+               $this->storeWidgetContexts();
+       }
+
+       /**
+        * Persists the widget contexts in the TYPO3 user session
+        * @return void
+        */
+       protected function storeWidgetContexts() {
+               if (TYPO3_MODE === 'FE') {
+                       $GLOBALS['TSFE']->fe_user->setKey(
+                               'ses',
+                               $this->widgetContextsStorageKey,
+                               serialize($this->widgetContexts)
+                       );
+                       $GLOBALS['TSFE']->fe_user->storeSessionData();
+               } else {
+                       $GLOBALS['BE_USER']->uc[$this->widgetContextsStorageKey] = serialize($this->widgetContexts);
+                       $GLOBALS['BE_USER']->writeUc();
+               }
        }
 }
 
diff --git a/typo3/sysext/fluid/Classes/Core/Widget/Bootstrap.php b/typo3/sysext/fluid/Classes/Core/Widget/Bootstrap.php
new file mode 100644 (file)
index 0000000..d71c478
--- /dev/null
@@ -0,0 +1,93 @@
+<?php
+
+/*
+ * This script belongs to the FLOW3 package "Fluid".                      *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * This is the bootstrap for Ajax Widget responses
+ *
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ */
+class Tx_Fluid_Core_Widget_Bootstrap {
+
+       /**
+        * Back reference to the parent content object
+        * This has to be public as it is set directly from TYPO3
+        *
+        * @var tslib_cObj
+        */
+       public $cObj;
+
+       /**
+        * @var Tx_Extbase_Object_ObjectManagerInterface
+        */
+       protected $objectManager;
+
+       /**
+        * @param string $content The content
+        * @param array $configuration The TS configuration array
+        * @return string $content The processed content
+        */
+       public function run($content, $configuration) {
+               $this->initializeClassLoader();
+               $this->objectManager = t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager');
+               $this->initializeConfiguration($configuration);
+               $ajaxWidgetContextHolder = $this->objectManager->get('Tx_Fluid_Core_Widget_AjaxWidgetContextHolder');
+
+               $widgetIdentifier = t3lib_div::_GET('fluid-widget-id');
+               $widgetContext = $ajaxWidgetContextHolder->get($widgetIdentifier);
+               $configuration['extensionName'] = $widgetContext->getParentExtensionName();
+               $configuration['pluginName'] = $widgetContext->getParentPluginName();
+
+               $extbaseBootstrap = $this->objectManager->get('Tx_Extbase_Core_Bootstrap');
+               $extbaseBootstrap->cObj = $this->cObj;
+               return $extbaseBootstrap->run($content, $configuration);
+       }
+
+       /**
+        * Initializes the autoload mechanism of Extbase. This is supplement to the core autoloader.
+        *
+        * @return void
+        * @see initialize()
+        */
+       protected function initializeClassLoader() {
+               if (!class_exists('Tx_Extbase_Utility_ClassLoader', FALSE)) {
+                       require(t3lib_extmgm::extPath('extbase') . 'Classes/Utility/ClassLoader.php');
+               }
+
+               $classLoader = new Tx_Extbase_Utility_ClassLoader();
+               spl_autoload_register(array($classLoader, 'loadClass'));
+       }
+
+       /**
+        * Initializes the Object framework.
+        *
+        * @return void
+        * @see initialize()
+        */
+       public function initializeConfiguration($configuration) {
+               $this->configurationManager = $this->objectManager->get('Tx_Extbase_Configuration_ConfigurationManagerInterface');
+               $contentObject = isset($this->cObj) ? $this->cObj : t3lib_div::makeInstance('tslib_cObj');
+               $this->configurationManager->setContentObject($contentObject);
+               $this->configurationManager->setConfiguration($configuration);
+       }
+}
+
+?>
\ No newline at end of file
index 6cdb32f..7467108 100644 (file)
@@ -91,6 +91,16 @@ class Tx_Fluid_Core_Widget_WidgetContext {
        /**
         * @var string
         */
+       protected $parentExtensionName;
+
+       /**
+        * @var string
+        */
+       protected $parentPluginName;
+
+       /**
+        * @var string
+        */
        protected $widgetViewHelperClassName;
 
        /**
@@ -147,6 +157,44 @@ class Tx_Fluid_Core_Widget_WidgetContext {
        }
 
        /**
+        * Sets the Extension name of the plugin that contains the widget
+        *
+        * @param string $parentExtensionName
+        * @return void
+        */
+       public function setParentExtensionName($parentExtensionName) {
+               $this->parentExtensionName = $parentExtensionName;
+       }
+
+       /**
+        * Returns the Extension name of the plugin that contains the widget
+        *
+        * @return string
+        */
+       public function getParentExtensionName() {
+               return $this->parentExtensionName;
+       }
+
+       /**
+        * Sets the name of the plugin that contains the widget
+        *
+        * @param string $parentPluginName
+        * @return void
+        */
+       public function setParentPluginName($parentPluginName) {
+               $this->parentPluginName = $parentPluginName;
+       }
+
+       /**
+        * Returns the name of the plugin that contains the widget
+        *
+        * @return string
+        */
+       public function getParentPluginName() {
+               return $this->parentPluginName;
+       }
+
+       /**
         * Sets the fully qualified class name of the view helper this context belongs to
         *
         * @param string $widgetViewHelperClassName
@@ -225,5 +273,12 @@ class Tx_Fluid_Core_Widget_WidgetContext {
        public function getViewHelperChildNodeRenderingContext() {
                return $this->viewHelperChildNodeRenderingContext;
        }
+
+       /**
+        * @return array
+        */
+       public function __sleep() {
+               return array('widgetIdentifier', 'ajaxWidgetIdentifier', 'widgetConfiguration', 'controllerObjectName', 'parentPluginNamespace', 'parentExtensionName', 'parentPluginName', 'widgetViewHelperClassName');
+       }
 }
 ?>
\ No newline at end of file
index 94ee6e7..7602711 100644 (file)
@@ -50,17 +50,22 @@ class Tx_Fluid_Core_Widget_WidgetRequestBuilder extends Tx_Extbase_MVC_Web_Reque
         */
        public function build() {
                $request = $this->objectManager->create('Tx_Fluid_Core_Widget_WidgetRequest');
-               $request->injectEnvironment($this->environment);
-               $request->setMethod($this->environment->getRequestMethod());
-               $this->setArgumentsFromRawRequestData($request);
+               $request->setRequestURI(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'));
+               $request->setBaseURI(t3lib_div::getIndpEnv('TYPO3_SITE_URL'));
+               $request->setMethod((isset($_SERVER['REQUEST_METHOD'])) ? $_SERVER['REQUEST_METHOD'] : NULL);
+               if (strtolower($_SERVER['REQUEST_METHOD']) === 'post') {
+                       $request->setArguments(t3lib_div::_POST());
+               } else {
+                       $request->setArguments(t3lib_div::_GET());
+               }
 
-               $rawGetArguments = $this->environment->getRawGetArguments();
+               $rawGetArguments = t3lib_div::_GET();
                        // TODO: rename to @action, to be consistent with normal naming?
                if (isset($rawGetArguments['action'])) {
                        $request->setControllerActionName($rawGetArguments['action']);
                }
 
-               $widgetContext = $this->ajaxWidgetContextHolder->get($rawGetArguments['f3-fluid-widget-id']);
+               $widgetContext = $this->ajaxWidgetContextHolder->get($rawGetArguments['fluid-widget-id']);
                $request->setWidgetContext($widgetContext);
                return $request;
        }
index 3993b5b..2fe4978 100644 (file)
  * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
  * @scope prototype
  */
-class Tx_Fluid_Core_Widget_WidgetRequestHandler extends Tx_Extbase_MVC_Web_RequestHandler {
+class Tx_Fluid_Core_Widget_WidgetRequestHandler extends Tx_Extbase_MVC_Web_AbstractRequestHandler {
+
+       /**
+        * @var Tx_Fluid_Core_Widget_AjaxWidgetContextHolder
+        */
+       protected $ajaxWidgetContextHolder;
+
+       /**
+        * @var Tx_Extbase_Configuration_ConfigurationManagerInterface
+        */
+       protected $configurationManager;
+
+       /**
+        * @param Tx_Extbase_Configuration_ConfigurationManagerInterface $configurationManager
+        * @return void
+        */
+       public function injectConfigurationManager(Tx_Extbase_Configuration_ConfigurationManagerInterface $configurationManager) {
+               $this->configurationManager = $configurationManager;
+       }
+
+       /**
+        * @param Tx_Fluid_Core_Widget_AjaxWidgetContextHolder $ajaxWidgetContextHolder
+        * @return void
+        * @author Sebastian Kurfürst <sebastian@typo3.org>
+        */
+       public function injectAjaxWidgetContextHolder(Tx_Fluid_Core_Widget_AjaxWidgetContextHolder $ajaxWidgetContextHolder) {
+               $this->ajaxWidgetContextHolder = $ajaxWidgetContextHolder;
+       }
+
+       /**
+        * Injects the request handler
+        *
+        * @param Tx_Fluid_Core_Widget_WidgetRequestBuilder $requestBuilder
+        * @return void
+        */
+       public function injectRequestBuilder(Tx_Fluid_Core_Widget_WidgetRequestBuilder $requestBuilder) {
+               $this->requestBuilder = $requestBuilder;
+       }
+
+       /**
+        * Handles the web request. The response will automatically be sent to the client.
+        *
+        * @return Tx_Extbase_MVC_Web_Response
+        */
+       public function handleRequest() {
+               $request = $this->requestBuilder->build();
+               if (isset($this->cObj->data) && is_array($this->cObj->data)) {
+                       $request->setContentObjectData($this->cObj->data);
+               }
+               $response = $this->objectManager->create('Tx_Extbase_MVC_Web_Response');
+
+               $this->dispatcher->dispatch($request, $response);
+               return $response;
+       }
 
        /**
         * @return boolean TRUE if it is an AJAX widget request
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
        public function canHandleRequest() {
-               $rawGetArguments = $this->environment->getRawGetArguments();
-               return isset($rawGetArguments['f3-fluid-widget-id']);
+               $rawGetArguments = t3lib_div::_GET();
+               return isset($rawGetArguments['fluid-widget-id']);
        }
 
        /**
index ed91bb9..35fe9e8 100644 (file)
@@ -42,7 +42,7 @@ abstract class Tx_Fluid_View_AbstractTemplateView implements Tx_Extbase_MVC_View
        protected $controllerContext;
 
        /**
-        * @var Tx_Fluid_Compatibility_ObjectManager
+        * @var Tx_Extbase_Object_ObjectManagerInterface
         */
        protected $objectManager;
 
@@ -68,13 +68,11 @@ abstract class Tx_Fluid_View_AbstractTemplateView implements Tx_Extbase_MVC_View
        protected $renderingStack = array();
 
        /**
-        * Injects the Object Manager
-        *
-        * @param Tx_Fluid_Compatibility_ObjectManager $objectManager
+        * @param Tx_Extbase_Object_ObjectManagerInterface $objectManager
         * @return void
         * @author Robert Lemke <robert@typo3.org>
         */
-       public function injectObjectManager(Tx_Fluid_Compatibility_ObjectManager $objectManager) {
+       public function injectObjectManager(Tx_Extbase_Object_ObjectManagerInterface $objectManager) {
                $this->objectManager = $objectManager;
        }
 
@@ -296,7 +294,7 @@ abstract class Tx_Fluid_View_AbstractTemplateView implements Tx_Extbase_MVC_View
                $parserConfiguration = $this->objectManager->create('Tx_Fluid_Core_Parser_Configuration');
                if ($this->controllerContext->getRequest()->getFormat() === 'html') {
                        $parserConfiguration->addInterceptor($this->objectManager->get('Tx_Fluid_Core_Parser_Interceptor_Escape'));
-                       
+
                }
                return $parserConfiguration;
        }
index 1121fa3..68a3479 100644 (file)
@@ -60,9 +60,9 @@ class Tx_Fluid_View_StandaloneView extends Tx_Fluid_View_AbstractTemplateView {
                if (!t3lib_extMgm::isLoaded('extbase')) {
                        return 'In the current version you still need to have Extbase installed in order to use the Fluid Standalone view!';
                }
-           $this->initializeAutoloader();
+               $this->initializeAutoloader();
                $this->injectTemplateParser(Tx_Fluid_Compatibility_TemplateParserBuilder::build());
-               $this->injectObjectManager(t3lib_div::makeInstance('Tx_Fluid_Compatibility_ObjectManager'));
+               $this->injectObjectManager(t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager'));
                $this->setRenderingContext($this->objectManager->create('Tx_Fluid_Core_Rendering_RenderingContext'));
 
                $request = t3lib_div::makeInstance('Tx_Extbase_MVC_Web_Request');
index 5fdf53d..58b7869 100644 (file)
@@ -97,7 +97,7 @@ class Tx_Fluid_View_TemplateView extends Tx_Fluid_View_AbstractTemplateView {
 
        public function __construct() {
                        $this->injectTemplateParser(Tx_Fluid_Compatibility_TemplateParserBuilder::build());
-                       $this->injectObjectManager(t3lib_div::makeInstance('Tx_Fluid_Compatibility_ObjectManager'));
+                       $this->injectObjectManager(t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager'));
                        $this->setRenderingContext($this->objectManager->create('Tx_Fluid_Core_Rendering_RenderingContext'));
                }
 
index 51ea76d..dc5c6e0 100644 (file)
@@ -35,25 +35,18 @@ class Tx_Fluid_ViewHelpers_CObjectViewHelper extends Tx_Fluid_Core_ViewHelper_Ab
        protected $tsfeBackup;
 
        /**
-        * Constructor. Used to create an instance of tslib_cObj used by the render() method.
-        *
-        * @param tslib_cObj $contentObject injector for tslib_cObj (optional)
-        * @param array $typoScriptSetup global TypoScript setup (optional)
+        * @var Tx_Extbase_Configuration_ConfigurationManagerInterface
+        */
+       protected $configurationManager;
+
+       /**
+        * @param Tx_Extbase_Configuration_ConfigurationManagerInterface $configurationManager
         * @return void
-        * @author Bastian Waidelich <bastian@typo3.org>
         */
-       public function __construct($contentObject = NULL, array $typoScriptSetup = NULL) {
-               $this->contentObject = $contentObject !== NULL ? $contentObject : t3lib_div::makeInstance('tslib_cObj');
-               if ($typoScriptSetup !== NULL) {
-                       $this->typoScriptSetup = $typoScriptSetup;
-               } else {
-                       $configurationManager = Tx_Extbase_Dispatcher::getConfigurationManager();
-                       if ($configurationManager === NULL) {
-                               $configurationManager = t3lib_div::makeInstance('Tx_Extbase_Configuration_FrontendConfigurationManager');
-                               $configurationManager->setContentObject($this->contentObject);
-                       }
-                       $this->typoScriptSetup = $configurationManager->loadTypoScriptSetup();
-               }
+       public function injectConfigurationManager(Tx_Extbase_Configuration_ConfigurationManagerInterface $configurationManager) {
+               $this->configurationManager = $configurationManager;
+               $this->contentObject = $this->configurationManager->getContentObject();
+               $this->typoScriptSetup = $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
        }
 
        /**
index e04cb3a..1007313 100644 (file)
@@ -389,9 +389,9 @@ class Tx_Fluid_ViewHelpers_FormViewHelper extends Tx_Fluid_ViewHelpers_Form_Abst
                        $pluginName = $request->getPluginName();
                }
 
-               return 'tx_' . strtolower($extensionName) . '_' . strtolower($pluginName);
+               return Tx_Extbase_Utility_Extension::getPluginNamespace($extensionName, $pluginName);
        }
-       
+
        /**
         * Remove Checkbox field names from ViewHelper variable container, to start from scratch when a new form starts.
         */
index 5278afe..494c60c 100644 (file)
@@ -65,12 +65,17 @@ class Tx_Fluid_ViewHelpers_Format_CropViewHelper extends Tx_Fluid_Core_ViewHelpe
        protected $tsfeBackup;
 
        /**
-        * Constructor. Used to create an instance of tslib_cObj used by the render() method.
-        *
+        * @var Tx_Extbase_Configuration_ConfigurationManagerInterface
+        */
+       protected $configurationManager;
+
+       /**
+        * @param Tx_Extbase_Configuration_ConfigurationManagerInterface $configurationManager
         * @return void
         */
-       public function __construct() {
-               $this->contentObject = t3lib_div::makeInstance('tslib_cObj');
+       public function injectConfigurationManager(Tx_Extbase_Configuration_ConfigurationManagerInterface $configurationManager) {
+               $this->configurationManager = $configurationManager;
+               $this->contentObject = $this->configurationManager->getContentObject();
        }
 
        /**
index 192092f..10d6a8d 100644 (file)
@@ -61,12 +61,17 @@ class Tx_Fluid_ViewHelpers_Format_HtmlViewHelper extends Tx_Fluid_Core_ViewHelpe
        protected $escapingInterceptorEnabled = FALSE;
 
        /**
-        * Constructor. Used to create an instance of tslib_cObj used by the render() method.
-        * @param tslib_cObj $contentObject injector for tslib_cObj (optional)
+        * @var Tx_Extbase_Configuration_ConfigurationManagerInterface
+        */
+       protected $configurationManager;
+
+       /**
+        * @param Tx_Extbase_Configuration_ConfigurationManagerInterface $configurationManager
         * @return void
         */
-       public function __construct($contentObject = NULL) {
-               $this->contentObject = $contentObject !== NULL ? $contentObject : t3lib_div::makeInstance('tslib_cObj');
+       public function injectConfigurationManager(Tx_Extbase_Configuration_ConfigurationManagerInterface $configurationManager) {
+               $this->configurationManager = $configurationManager;
+               $this->contentObject = $this->configurationManager->getContentObject();
        }
 
        /**
@@ -98,9 +103,8 @@ class Tx_Fluid_ViewHelpers_Format_HtmlViewHelper extends Tx_Fluid_Core_ViewHelpe
         */
        protected function simulateFrontendEnvironment() {
                $this->tsfeBackup = isset($GLOBALS['TSFE']) ? $GLOBALS['TSFE'] : NULL;
-               $configurationManager = Tx_Extbase_Dispatcher::getConfigurationManager();
                $GLOBALS['TSFE'] = new stdClass();
-               $GLOBALS['TSFE']->tmpl->setup = $configurationManager->loadTypoScriptSetup();
+               $GLOBALS['TSFE']->tmpl->setup = $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
        }
 
        /**
index a657413..41386a4 100644 (file)
@@ -45,14 +45,17 @@ class Tx_Fluid_ViewHelpers_ImageViewHelper extends Tx_Fluid_Core_ViewHelper_Abst
        protected $workingDirectoryBackup;
 
        /**
-        * Constructor. Used to create an instance of tslib_cObj used by the render() method.
-        *
-        * @param tslib_cObj $contentObject injector for tslib_cObj (optional)
+        * @var Tx_Extbase_Configuration_ConfigurationManagerInterface
+        */
+       protected $configurationManager;
+
+       /**
+        * @param Tx_Extbase_Configuration_ConfigurationManagerInterface $configurationManager
         * @return void
         */
-       public function __construct($contentObject = NULL) {
-               $this->contentObject = $contentObject !== NULL ? $contentObject : t3lib_div::makeInstance('tslib_cObj');
-               parent::__construct();
+       public function injectConfigurationManager(Tx_Extbase_Configuration_ConfigurationManagerInterface $configurationManager) {
+               $this->configurationManager = $configurationManager;
+               $this->contentObject = $this->configurationManager->getContentObject();
        }
 
        /**
index d722396..83315d5 100644 (file)
@@ -86,7 +86,9 @@ class Tx_Fluid_ViewHelpers_Link_WidgetViewHelper extends Tx_Fluid_Core_ViewHelpe
                        $action = $this->controllerContext->getRequest()->getControllerActionName();
                }
                $arguments['action'] = $action;
-               $arguments['f3-fluid-widget-id'] = $this->controllerContext->getRequest()->getWidgetContext()->getAjaxWidgetIdentifier();
+               $arguments['fluid-widget-id'] = $this->controllerContext->getRequest()->getWidgetContext()->getAjaxWidgetIdentifier();
+               // TODO page type should be configurable
+               $arguments['type'] = 7076857368;
                return '?' . http_build_query($arguments, NULL, '&');
        }
 
@@ -100,6 +102,7 @@ class Tx_Fluid_ViewHelpers_Link_WidgetViewHelper extends Tx_Fluid_Core_ViewHelpe
        protected function getWidgetUri() {
                $uriBuilder = $this->controllerContext->getUriBuilder();
 
+               // TODO adjust arguments that should be excluded
                $argumentsToBeExcludedFromQueryString = array(
                        '@extension',
                        '@subpackage',
@@ -111,6 +114,7 @@ class Tx_Fluid_ViewHelpers_Link_WidgetViewHelper extends Tx_Fluid_Core_ViewHelpe
                        ->setArgumentPrefix($this->controllerContext->getRequest()->getArgumentPrefix())
                        ->setSection($this->arguments['section'])
                        ->setCreateAbsoluteUri(TRUE)
+                       ->setAddQueryString(TRUE)
                        ->setArgumentsToBeExcludedFromQueryString($argumentsToBeExcludedFromQueryString)
                        ->setFormat($this->arguments['format'])
                        ->uriFor($this->arguments['action'], $this->arguments['arguments'], '', '', '');
index 5c52af5..f226b67 100644 (file)
@@ -17,7 +17,7 @@
  * renders a image according to the given dimensions
  *
  * @return relative path to the image (typo3temp/...)
- * 
+ *
  */
 class Tx_Fluid_ViewHelpers_Uri_ImageViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractViewHelper {
 
@@ -26,18 +26,18 @@ class Tx_Fluid_ViewHelpers_Uri_ImageViewHelper extends Tx_Fluid_Core_ViewHelper_
         */
        protected $contentObject;
 
+       /**
+        * @var Tx_Extbase_Configuration_ConfigurationManagerInterface
+        */
+       protected $configurationManager;
 
        /**
-        * Constructor. Used to create an instance of tslib_cObj used by the render() method.
-        *
-        * @param tslib_cObj $contentObject injector for tslib_cObj (optional)
+        * @param Tx_Extbase_Configuration_ConfigurationManagerInterface $configurationManager
         * @return void
         */
-       public function __construct($contentObject = NULL) {
-               $this->contentObject = $contentObject !== NULL ? $contentObject : t3lib_div::makeInstance('tslib_cObj');
-               if (TYPO3_MODE === 'BE') {
-                       throw new Tx_Fluid_Core_ViewHelper_Exception('uri.image ViewHelper does not (yet) work in backend mode' , 1277367648);
-               }
+       public function injectConfigurationManager(Tx_Extbase_Configuration_ConfigurationManagerInterface $configurationManager) {
+               $this->configurationManager = $configurationManager;
+               $this->contentObject = $this->configurationManager->getContentObject();
        }
 
        /**
@@ -56,6 +56,9 @@ class Tx_Fluid_ViewHelpers_Uri_ImageViewHelper extends Tx_Fluid_Core_ViewHelper_
         * @author Christian Baer <chr.baer@googlemail.com>
         */
        public function render($src, $width = NULL, $height = NULL, $minWidth = NULL, $minHeight = NULL, $maxWidth = NULL, $maxHeight = NULL) {
+               if (TYPO3_MODE === 'BE') {
+                       throw new Tx_Fluid_Core_ViewHelper_Exception('uri.image ViewHelper does not (yet) work in backend mode' , 1277367648);
+               }
                $setup = array(
                        'width' => $width,
                        'height' => $height,
index 640e092..d48d610 100644 (file)
@@ -64,7 +64,10 @@ class Tx_Fluid_ViewHelpers_Uri_WidgetViewHelper extends Tx_Fluid_Core_ViewHelper
                        $action = $this->controllerContext->getRequest()->getControllerActionName();
                }
                $arguments['action'] = $action;
-               $arguments['f3-fluid-widget-id'] = $this->controllerContext->getRequest()->getWidgetContext()->getAjaxWidgetIdentifier();
+               $arguments['fluid-widget-id'] = $this->controllerContext->getRequest()->getWidgetContext()->getAjaxWidgetIdentifier();
+               $arguments['id'] = $GLOBALS['TSFE']->id;
+               // TODO page type should be configurable
+               $arguments['type'] = 7076857368;
                return '?' . http_build_query($arguments, NULL, '&');
        }
 
@@ -78,6 +81,7 @@ class Tx_Fluid_ViewHelpers_Uri_WidgetViewHelper extends Tx_Fluid_Core_ViewHelper
        protected function getWidgetUri() {
                $uriBuilder = $this->controllerContext->getUriBuilder();
 
+               // TODO adjust arguments that should be excluded
                $argumentsToBeExcludedFromQueryString = array(
                        '@extension',
                        '@subpackage',
@@ -89,6 +93,7 @@ class Tx_Fluid_ViewHelpers_Uri_WidgetViewHelper extends Tx_Fluid_Core_ViewHelper
                        ->setArgumentPrefix($this->controllerContext->getRequest()->getArgumentPrefix())
                        ->setSection($this->arguments['section'])
                        ->setCreateAbsoluteUri(TRUE)
+                       ->setAddQueryString(TRUE)
                        ->setArgumentsToBeExcludedFromQueryString($argumentsToBeExcludedFromQueryString)
                        ->setFormat($this->arguments['format'])
                        ->uriFor($this->arguments['action'], $this->arguments['arguments'], '', '', '');
index bc67706..2139a36 100644 (file)
@@ -43,12 +43,19 @@ class Tx_Fluid_ViewHelpers_Widget_AutocompleteViewHelper extends Tx_Fluid_Core_W
        protected $ajaxWidget = TRUE;
 
        /**
-        * @inject
         * @var Tx_Fluid_ViewHelpers_Widget_Controller_AutocompleteController
         */
        protected $controller;
 
        /**
+        * @param Tx_Fluid_ViewHelpers_Widget_Controller_AutocompleteController $controller
+        * @return void
+        */
+       public function injectController(Tx_Fluid_ViewHelpers_Widget_Controller_AutocompleteController $controller) {
+               $this->controller = $controller;
+       }
+
+       /**
         *
         * @param Tx_Extbase_Persistence_QueryResult $objects
         * @param string $for
@@ -56,6 +63,7 @@ class Tx_Fluid_ViewHelpers_Widget_AutocompleteViewHelper extends Tx_Fluid_Core_W
         * @return string
         */
        public function render(Tx_Extbase_Persistence_QueryResult $objects, $for, $searchProperty) {
+               $GLOBALS['TSFE']->additionalHeaderData['Tx_Fluid_ViewHelpers_Widget_AutocompleteViewHelper'] ='<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script>';
                return $this->initiateSubRequest();
        }
 }
diff --git a/typo3/sysext/fluid/Configuration/TypoScript/setup.txt b/typo3/sysext/fluid/Configuration/TypoScript/setup.txt
new file mode 100644 (file)
index 0000000..4c7f602
--- /dev/null
@@ -0,0 +1,7 @@
+ # jQuery library and default styles for Fluid Autocomplete Widget (optional)
+page.headerData.jquery = TEXT
+page.headerData.jquery.value (
+       <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script>
+       <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.3/themes/base/jquery-ui.css" type="text/css" media="all" />
+       <link rel="stylesheet" href="http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css" type="text/css" media="all" />
+)
\ No newline at end of file
index fa2ab2a..1d6acfc 100644 (file)
@@ -38,7 +38,7 @@ class Tx_Fluid_Tests_Unit_Core_Parser_SyntaxTree_ViewHelperNodeTest extends Tx_E
 
        /**
         * Object factory mock
-        * @var Tx_Fluid_Compatibility_ObjectManager
+        * @var Tx_Extbase_Object_ObjectManagerInterface
         */
        protected $mockObjectManager;
 
@@ -66,7 +66,7 @@ class Tx_Fluid_Tests_Unit_Core_Parser_SyntaxTree_ViewHelperNodeTest extends Tx_E
        public function setUp() {
                $this->renderingContext = new Tx_Fluid_Core_Rendering_RenderingContext();
 
-               $this->mockObjectManager = $this->getMock('Tx_Fluid_Compatibility_ObjectManager');
+               $this->mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
                $this->renderingContext->injectObjectManager($this->mockObjectManager);
 
                $this->templateVariableContainer = $this->getMock('Tx_Fluid_Core_ViewHelper_TemplateVariableContainer');
index e21c7b2..c5ca879 100644 (file)
@@ -49,7 +49,7 @@ class Tx_Fluid_Tests_Unit_Core_Parser_TemplateParserTest extends Tx_Extbase_Base
         * extractNamespaceDefinitions($templateString)
         * splitTemplateAtDynamicTags($templateString)
         * buildObjectTree($splitTemplate)
-        * 
+        *
         * @test
         * @author Karsten Dambekalns <karsten@typo3.org>
         */
@@ -169,7 +169,7 @@ class Tx_Fluid_Tests_Unit_Core_Parser_TemplateParserTest extends Tx_Extbase_Base
                $mockState->expects($this->once())->method('pushNodeToStack')->with($mockRootNode);
                $mockState->expects($this->once())->method('countNodeStack')->will($this->returnValue(1));
 
-               $mockObjectManager = $this->getMock('Tx_Fluid_Compatibility_ObjectManager');
+               $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
                $mockObjectManager->expects($this->at(0))->method('create')->with('Tx_Fluid_Core_Parser_ParsingState')->will($this->returnValue($mockState));
                $mockObjectManager->expects($this->at(1))->method('create')->with('Tx_Fluid_Core_Parser_SyntaxTree_RootNode')->will($this->returnValue($mockRootNode));
 
@@ -190,7 +190,7 @@ class Tx_Fluid_Tests_Unit_Core_Parser_TemplateParserTest extends Tx_Extbase_Base
                $mockState = $this->getMock('Tx_Fluid_Core_Parser_ParsingState');
                $mockState->expects($this->once())->method('countNodeStack')->will($this->returnValue(2));
 
-               $mockObjectManager = $this->getMock('Tx_Fluid_Compatibility_ObjectManager');
+               $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
                $mockObjectManager->expects($this->at(0))->method('create')->with('Tx_Fluid_Core_Parser_ParsingState')->will($this->returnValue($mockState));
                $mockObjectManager->expects($this->at(1))->method('create')->with('Tx_Fluid_Core_Parser_SyntaxTree_RootNode')->will($this->returnValue($mockRootNode));
 
@@ -208,7 +208,7 @@ class Tx_Fluid_Tests_Unit_Core_Parser_TemplateParserTest extends Tx_Extbase_Base
                $mockRootNode = $this->getMock('Tx_Fluid_Core_Parser_SyntaxTree_RootNode');
                $mockState = $this->getMock('Tx_Fluid_Core_Parser_ParsingState');
                $mockState->expects($this->once())->method('countNodeStack')->will($this->returnValue(1));
-               $mockObjectManager = $this->getMock('Tx_Fluid_Compatibility_ObjectManager');
+               $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
                $mockObjectManager->expects($this->at(0))->method('create')->with('Tx_Fluid_Core_Parser_ParsingState')->will($this->returnValue($mockState));
                $mockObjectManager->expects($this->at(1))->method('create')->with('Tx_Fluid_Core_Parser_SyntaxTree_RootNode')->will($this->returnValue($mockRootNode));
 
@@ -265,7 +265,7 @@ class Tx_Fluid_Tests_Unit_Core_Parser_TemplateParserTest extends Tx_Extbase_Base
                $mockNodeOnStack = $this->getMock('Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface');
                $mockNodeOnStack->expects($this->once())->method('addChildNode')->with($mockViewHelperNode);
 
-               $mockObjectManager = $this->getMock('Tx_Fluid_Compatibility_ObjectManager');
+               $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
                $mockObjectManager->expects($this->at(0))->method('create')->with('Tx_Fluid_ViewHelpers_MyownViewHelper')->will($this->returnValue($mockViewHelper));
                $mockObjectManager->expects($this->at(1))->method('create')->with('Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode')->will($this->returnValue($mockViewHelperNode));
 
@@ -293,7 +293,7 @@ class Tx_Fluid_Tests_Unit_Core_Parser_TemplateParserTest extends Tx_Extbase_Base
 
                $mockNodeOnStack = $this->getMock('Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface');
 
-               $mockObjectManager = $this->getMock('Tx_Fluid_Compatibility_ObjectManager');
+               $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
                $mockObjectManager->expects($this->at(0))->method('create')->with('Tx_Fluid_ViewHelpers_MyownViewHelper')->will($this->returnValue($mockViewHelper));
                $mockObjectManager->expects($this->at(1))->method('create')->with('Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode')->will($this->returnValue($mockViewHelperNode));
 
@@ -319,7 +319,7 @@ class Tx_Fluid_Tests_Unit_Core_Parser_TemplateParserTest extends Tx_Extbase_Base
                $mockNodeOnStack = $this->getMock('Tx_Fluid_Core_Parser_SyntaxTree_NodeInterface');
                $mockNodeOnStack->expects($this->once())->method('addChildNode')->with($mockViewHelperNode);
 
-               $mockObjectManager = $this->getMock('Tx_Fluid_Compatibility_ObjectManager');
+               $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
                $mockObjectManager->expects($this->at(0))->method('create')->with('Tx_Fluid_ViewHelpers_MyownViewHelper')->will($this->returnValue($mockViewHelper));
                $mockObjectManager->expects($this->at(1))->method('create')->with('Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode')->will($this->returnValue($mockViewHelperNode));
 
@@ -453,7 +453,7 @@ class Tx_Fluid_Tests_Unit_Core_Parser_TemplateParserTest extends Tx_Extbase_Base
        public function objectAccessorHandlerCreatesObjectAccessorNodeWithExpectedValueAndAddsItToStack() {
                $objectAccessorNode = $this->getMock('Tx_Fluid_Core_Parser_SyntaxTree_ObjectAccessorNode', array(), array(), '', FALSE);
 
-               $mockObjectManager = $this->getMock('Tx_Fluid_Compatibility_ObjectManager');
+               $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
                $mockObjectManager->expects($this->once())->method('create')->with('Tx_Fluid_Core_Parser_SyntaxTree_ObjectAccessorNode', 'objectAccessorString')->will($this->returnValue($objectAccessorNode));
 
                $mockNodeOnStack = $this->getMock('Tx_Fluid_Core_Parser_SyntaxTree_AbstractNode', array(), array(), '', FALSE);
@@ -479,7 +479,7 @@ class Tx_Fluid_Tests_Unit_Core_Parser_TemplateParserTest extends Tx_Extbase_Base
                $parserConfiguration = $this->getMock('Tx_Fluid_Core_Parser_Configuration');
                $parserConfiguration->expects($this->once())->method('getInterceptors')->with(Tx_Fluid_Core_Parser_InterceptorInterface::INTERCEPT_OBJECTACCESSOR)->will($this->returnValue(array($objectAccessorNodeInterceptor)));
 
-               $mockObjectManager = $this->getMock('Tx_Fluid_Compatibility_ObjectManager');
+               $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
                $mockObjectManager->expects($this->once())->method('create')->will($this->returnValue($objectAccessorNode));
 
                $mockNodeOnStack = $this->getMock('Tx_Fluid_Core_Parser_SyntaxTree_AbstractNode', array(), array(), '', FALSE);
@@ -521,7 +521,7 @@ class Tx_Fluid_Tests_Unit_Core_Parser_TemplateParserTest extends Tx_Extbase_Base
         * @author Karsten Dambekalns <karsten@typo3.org>
         */
        public function buildArgumentObjectTreeReturnsTextNodeForSimplyString() {
-               $mockObjectManager = $this->getMock('Tx_Fluid_Compatibility_ObjectManager');
+               $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
                $mockObjectManager->expects($this->once())->method('create')->with('Tx_Fluid_Core_Parser_SyntaxTree_TextNode', 'a very plain string')->will($this->returnValue('theTextNode'));
 
                $templateParser = $this->getAccessibleMock('Tx_Fluid_Core_Parser_TemplateParser', array('dummy'));
@@ -550,7 +550,7 @@ class Tx_Fluid_Tests_Unit_Core_Parser_TemplateParserTest extends Tx_Extbase_Base
         * @author Karsten Dambekalns <karsten@typo3.org>
         */
        public function textAndShorthandSyntaxHandlerDelegatesAppropriately() {
-               $mockObjectManager = $this->getMock('Tx_Fluid_Compatibility_ObjectManager');
+               $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
                $mockObjectManager->expects($this->any())->method('create')->will($this->returnArgument(1));
                $mockState = $this->getMock('Tx_Fluid_Core_Parser_ParsingState');
 
@@ -575,7 +575,7 @@ class Tx_Fluid_Tests_Unit_Core_Parser_TemplateParserTest extends Tx_Extbase_Base
                $mockState = $this->getMock('Tx_Fluid_Core_Parser_ParsingState');
                $mockState->expects($this->once())->method('getNodeFromStack')->will($this->returnValue($mockNodeOnStack));
 
-               $mockObjectManager = $this->getMock('Tx_Fluid_Compatibility_ObjectManager');
+               $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
                $mockObjectManager->expects($this->once())->method('create')->with('Tx_Fluid_Core_Parser_SyntaxTree_ArrayNode', 'processedArrayText')->will($this->returnValue($arrayNode));
 
                $templateParser = $this->getAccessibleMock('Tx_Fluid_Core_Parser_TemplateParser', array('recursiveArrayHandler'));
@@ -603,7 +603,7 @@ class Tx_Fluid_Tests_Unit_Core_Parser_TemplateParserTest extends Tx_Extbase_Base
         * @author Karsten Dambekalns <karsten@typo3.org>
         */
        public function recursiveArrayHandlerReturnsExpectedArray($arrayText, $expectedArray) {
-               $mockObjectManager = $this->getMock('Tx_Fluid_Compatibility_ObjectManager');
+               $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
                $mockObjectManager->expects($this->any())->method('create')->will($this->returnArgument(1));
 
                $templateParser = $this->getAccessibleMock('Tx_Fluid_Core_Parser_TemplateParser', array('buildArgumentObjectTree'));
@@ -625,7 +625,7 @@ class Tx_Fluid_Tests_Unit_Core_Parser_TemplateParserTest extends Tx_Extbase_Base
                $parserConfiguration = $this->getMock('Tx_Fluid_Core_Parser_Configuration');
                $parserConfiguration->expects($this->once())->method('getInterceptors')->with(Tx_Fluid_Core_Parser_InterceptorInterface::INTERCEPT_TEXT)->will($this->returnValue(array($textInterceptor)));
 
-               $mockObjectManager = $this->getMock('Tx_Fluid_Compatibility_ObjectManager');
+               $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
                $mockObjectManager->expects($this->once())->method('create')->with('Tx_Fluid_Core_Parser_SyntaxTree_TextNode', 'string')->will($this->returnValue($textNode));
 
                $mockNodeOnStack = $this->getMock('Tx_Fluid_Core_Parser_SyntaxTree_AbstractNode', array(), array(), '', FALSE);
index 8217c96..e8f4c73 100644 (file)
@@ -51,7 +51,7 @@ class Tx_Fluid_Tests_Unit_Core_Widget_AbstractWidgetControllerTest extends Tx_Ex
 
                $abstractWidgetController = $this->getAccessibleMock('Tx_Fluid_Core_Widget_AbstractWidgetController', array('initializeUriBuilder', 'resolveActionMethodName', 'initializeActionMethodArguments', 'initializeActionMethodValidators', 'mapRequestArgumentsToControllerArguments', 'resolveView', 'callActionMethod'), array(), '', FALSE);
 
-               $objectManager = $this->getMock('Tx_Fluid_Compatibility_ObjectManager');
+               $objectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
                $abstractWidgetController->_set('objectManager', $objectManager);
 
                $abstractWidgetController->processRequest($request, $response);
index 7876470..5e32b94 100644 (file)
@@ -43,7 +43,7 @@ class Tx_Fluid_Tests_Unit_Core_Widget_AbstractWidgetViewHelperTest extends Tx_Ex
        protected $widgetContext;
 
        /**
-        * @var Tx_Fluid_Compatibility_ObjectManager
+        * @var Tx_Extbase_Object_ObjectManagerInterface
         */
        protected $objectManager;
 
@@ -69,8 +69,8 @@ class Tx_Fluid_Tests_Unit_Core_Widget_AbstractWidgetViewHelperTest extends Tx_Ex
                $this->widgetContext = $this->getMock('Tx_Fluid_Core_Widget_WidgetContext');
                $this->viewHelper->injectWidgetContext($this->widgetContext);
 
-               new Tx_Fluid_Compatibility_ObjectManager() = $this->getMock('Tx_Fluid_Compatibility_ObjectManager');
-               $this->viewHelper->injectObjectManager(new Tx_Fluid_Compatibility_ObjectManager());
+               $this->objectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
+               $this->viewHelper->injectObjectManager($this->objectManager);
 
                $this->controllerContext = $this->getMock('Tx_Extbase_MVC_Controller_ControllerContext', array(), array(), '', FALSE);
                $this->viewHelper->_set('controllerContext', $this->controllerContext);
@@ -136,7 +136,7 @@ class Tx_Fluid_Tests_Unit_Core_Widget_AbstractWidgetViewHelperTest extends Tx_Ex
                $rootNode->expects($this->at(1))->method('addChildNode')->with($node2);
                $rootNode->expects($this->at(2))->method('addChildNode')->with($node3);
 
-               new Tx_Fluid_Compatibility_ObjectManager()->expects($this->once())->method('create')->with('Tx_Fluid_Core_Parser_SyntaxTree_RootNode')->will($this->returnValue($rootNode));
+               $this->objectManager->expects($this->once())->method('create')->with('Tx_Fluid_Core_Parser_SyntaxTree_RootNode')->will($this->returnValue($rootNode));
 
                $renderingContext = $this->getMock('Tx_Fluid_Core_Rendering_RenderingContextInterface');
                $this->viewHelper->expects($this->once())->method('getRenderingContext')->will($this->returnValue($renderingContext));
@@ -168,8 +168,8 @@ class Tx_Fluid_Tests_Unit_Core_Widget_AbstractWidgetViewHelperTest extends Tx_Ex
                // Initial Setup
                $widgetRequest = $this->getMock('Tx_Fluid_Core_Widget_WidgetRequest');
                $response = $this->getMock('Tx_Fluid_MVC_Web_Response');
-               new Tx_Fluid_Compatibility_ObjectManager()->expects($this->at(0))->method('create')->with('Tx_Fluid_Core_Widget_WidgetRequest')->will($this->returnValue($widgetRequest));
-               new Tx_Fluid_Compatibility_ObjectManager()->expects($this->at(1))->method('create')->with('Tx_Fluid_MVC_Web_Response')->will($this->returnValue($response));
+               $this->objectManager->expects($this->at(0))->method('create')->with('Tx_Fluid_Core_Widget_WidgetRequest')->will($this->returnValue($widgetRequest));
+               $this->objectManager->expects($this->at(1))->method('create')->with('Tx_Fluid_MVC_Web_Response')->will($this->returnValue($response));
 
                // Widget Context is set
                $widgetRequest->expects($this->once())->method('setWidgetContext')->with($this->widgetContext);
index 2cae288..ebf9df7 100644 (file)
@@ -33,7 +33,7 @@ class Tx_Fluid_Tests_Unit_Core_Widget_WidgetRequestBuilderTest extends Tx_Extbas
        protected $widgetRequestBuilder;
 
        /**
-        * @var Tx_Fluid_Compatibility_ObjectManager
+        * @var Tx_Extbase_Object_ObjectManagerInterface
         */
        protected $mockObjectManager;
 
@@ -65,7 +65,7 @@ class Tx_Fluid_Tests_Unit_Core_Widget_WidgetRequestBuilderTest extends Tx_Extbas
 
                $this->mockWidgetRequest = $this->getMock('Tx_Fluid_Core_Widget_WidgetRequest');
 
-               $this->mockObjectManager = $this->getMock('Tx_Fluid_Compatibility_ObjectManager');
+               $this->mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
                $this->mockObjectManager->expects($this->once())->method('create')->with('Tx_Fluid_Core_Widget_WidgetRequest')->will($this->returnValue($this->mockWidgetRequest));
 
                $this->widgetRequestBuilder->_set('objectManager', $this->mockObjectManager);
index 2494004..6ce7eca 100644 (file)
@@ -53,7 +53,7 @@ class Tx_Fluid_View_StandaloneViewTest extends Tx_Extbase_BaseTestCase {
        protected $mockTemplateParser;
 
        /**
-        * @var Tx_Fluid_Compatibility_ObjectManager
+        * @var Tx_Extbase_Object_ObjectManagerInterface
         */
        protected $mockObjectManager;
 
@@ -78,7 +78,7 @@ class Tx_Fluid_View_StandaloneViewTest extends Tx_Extbase_BaseTestCase {
                $this->mockParsedTemplate = $this->getMock('Tx_Fluid_Core_Parser_ParsedTemplateInterface');
                $this->mockTemplateParser->expects($this->any())->method('parse')->will($this->returnValue($this->mockParsedTemplate));
                $this->view->injectTemplateParser($this->mockTemplateParser);
-               $this->mockObjectManager = $this->getMock('Tx_Fluid_Compatibility_ObjectManager');
+               $this->mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
                $this->view->injectObjectManager($this->mockObjectManager);
                $this->mockRenderingContext = $this->getMock('Tx_Fluid_Core_Rendering_RenderingContextInterface');
                $this->mockViewHelperVariableContainer = $this->getMock('Tx_Fluid_Core_ViewHelper_ViewHelperVariableContainer');
index 6fa21a5..91410dc 100644 (file)
@@ -7,9 +7,9 @@ return array(
        'tx_fluid_exception' => $extensionClassesPath . 'Exception.php',
        'tx_fluid_fluid' => $extensionClassesPath . 'Fluid.php',
        'tx_fluid_compatibility_docbookgeneratorservice' => $extensionClassesPath . 'Compatibility/DocbookGeneratorService.php',
-       'tx_fluid_compatibility_objectmanager' => $extensionClassesPath . 'Compatibility/ObjectManager.php',
        'tx_fluid_compatibility_templateparserbuilder' => $extensionClassesPath . 'Compatibility/TemplateParserBuilder.php',
        'tx_fluid_core_exception' => $extensionClassesPath . 'Core/Exception.php',
+       'tx_fluid_core_widget_bootstrap' => $extensionClassesPath . 'Core/Widget/Bootstrap.php',
        'tx_fluid_core_parser_configuration' => $extensionClassesPath . 'Core/Parser/Configuration.php',
        'tx_fluid_core_parser_exception' => $extensionClassesPath . 'Core/Parser/Exception.php',
        'tx_fluid_core_parser_interceptorinterface' => $extensionClassesPath . 'Core/Parser/InterceptorInterface.php',
diff --git a/typo3/sysext/fluid/ext_tables.php b/typo3/sysext/fluid/ext_tables.php
new file mode 100644 (file)
index 0000000..4d57815
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+if (!defined ('TYPO3_MODE')) die ('Access denied.');
+
+t3lib_extMgm::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'Fluid: Default Ajax Configuration');
+?>
\ No newline at end of file
diff --git a/typo3/sysext/fluid/ext_typoscript_setup.txt b/typo3/sysext/fluid/ext_typoscript_setup.txt
new file mode 100644 (file)
index 0000000..4941613
--- /dev/null
@@ -0,0 +1,22 @@
+fluidAjaxWidgetResponse = PAGE
+fluidAjaxWidgetResponse {
+       typeNum = 7076857368 # todo: make page type configurable
+       headerData >
+       config {
+               no_cache=1
+               disableAllHeaderCode = 1
+               additionalHeaders = Content-type:text/plain
+       }
+       10 = USER_INT
+       10 {
+               userFunc = tx_fluid_core_widget_bootstrap->run
+       }
+}
+
+config.tx_extbase {
+       mvc {
+               requestHandlers {
+                       Tx_Fluid_Core_Widget_WidgetRequestHandler = Tx_Fluid_Core_Widget_WidgetRequestHandler
+               }
+       }
+}
\ No newline at end of file