/**
  * Call a sub-module's controller
  *
  */
 protected function invokeModuleController()
 {
     $activeModuleDescription = $this->moduleManager->getModuleDescription($this->activeModuleName);
     $request = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request');
     /* @var Request $request */
     $request->setControllerExtensionName(ucfirst($activeModuleDescription['extensionKey']));
     $request->setControllerName($activeModuleDescription['controller'] . 'Module');
     $request->setControllerActionName('index');
     if (!is_null($this->site)) {
         $request->setArgument('site', $this->site);
     }
     $request->setPluginName($this->request->getPluginName());
     if ($this->request->hasArgument('moduleAction')) {
         // TODO check whether action is registered/allowed
         $request->setControllerActionName($this->request->getArgument('moduleAction'));
     }
     // transfer additional parameters
     foreach ($this->request->getArguments() as $argumentName => $argumentValue) {
         if (in_array($argumentName, array('module', 'moduleAction', 'controller'))) {
             // these have been transferred already
             continue;
         }
         $request->setArgument($argumentName, $argumentValue);
     }
     $response = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response');
     /* @var Response $response */
     while (!$request->isDispatched()) {
         try {
             $this->activeModule->processRequest($request, $response);
         } catch (StopActionException $ignoredException) {
         }
     }
     $this->view->assign('moduleContent', $response->getContent());
 }
 /**
  * Handles a request. The result output is returned by altering the given response.
  *
  * @param RequestInterface $request The request object
  * @param ResponseInterface $response The response, modified by this handler
  * @return void
  * @api
  */
 public function processRequest(RequestInterface $request, ResponseInterface $response)
 {
     if ($request instanceof WidgetRequest) {
         $this->widgetConfiguration = $request->getWidgetContext()->getWidgetConfiguration();
     }
     parent::processRequest($request, $response);
 }
Esempio n. 3
0
 /**
  * @param RequestInterface $request
  * @param ResponseInterface $response
  * @throws \Exception
  */
 public function processRequest(RequestInterface $request, ResponseInterface $response)
 {
     try {
         parent::processRequest($request, $response);
     } catch (\Exception $exception) {
         $this->handleKnownExceptionsElseThrowAgain($exception);
     }
 }
Esempio n. 4
0
 /**
  * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request
  * @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response
  * @throws \RuntimeException
  */
 public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
 {
     try {
         parent::processRequest($request, $response);
     } catch (\TYPO3\CMS\Extbase\Property\Exception $exception) {
         throw new \RuntimeException($this->getRuntimeIdentifier() . ': ' . $exception->getMessage() . ' (' . $exception->getCode() . ')');
     }
 }
 /**
  * Processes a general request. The result can be returned by altering the given response.
  *
  * @param RequestInterface $request The request object
  * @param ResponseInterface $response The response, modified by this handler
  */
 public function processRequest(RequestInterface $request, ResponseInterface $response)
 {
     $GLOBALS['SOBE'] = new \stdClass();
     $GLOBALS['SOBE']->doc = $this->documentTemplate;
     parent::processRequest($request, $response);
     $pageHeader = $this->documentTemplate->startpage($this->languageService->sL('LLL:EXT:typo3_forum/Resources/Private/Language/locallang_mod.xml:module.title'));
     $pageEnd = $this->documentTemplate->endPage();
     $response->setContent($pageHeader . $response->getContent() . $pageEnd);
 }
Esempio n. 6
0
 /**
  * Processes a general request. The result can be returned by altering the given response.
  *
  * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request The request object
  * @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response The response, modified by this handler
  * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException if the controller doesn't support the current request type
  * @return void
  */
 public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
 {
     $this->template = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
     $this->pageRenderer = $this->template->getPageRenderer();
     $GLOBALS['SOBE'] = new \stdClass();
     $GLOBALS['SOBE']->doc = $this->template;
     parent::processRequest($request, $response);
     $pageHeader = $this->template->startpage($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:module.title'));
     $pageEnd = $this->template->endPage();
     $response->setContent($pageHeader . $response->getContent() . $pageEnd);
 }
 /**
  * Load and persist module data
  *
  * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request
  * @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response
  * @return void
  * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
  */
 public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
 {
     $this->moduleData = $this->moduleDataStorageService->loadModuleData();
     // We "finally" persist the module data.
     try {
         parent::processRequest($request, $response);
         $this->moduleDataStorageService->persistModuleData($this->moduleData);
     } catch (\TYPO3\CMS\Extbase\Mvc\Exception\StopActionException $e) {
         $this->moduleDataStorageService->persistModuleData($this->moduleData);
         throw $e;
     }
 }
 /**
  * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request
  * @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response
  * @return void
  * @throws \Exception
  * @override \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
  * @see http://nerdcenter.de/extbase-fehlerbehandlung/
  */
 public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
 {
     try {
         parent::processRequest($request, $response);
     } catch (PropertyException $exception) {
         // If the property mapper did throw a \TYPO3\CMS\Extbase\Property\Exception, because it was unable to find the requested entity, call the page-not-found handler.
         $previousException = $exception->getPrevious();
         if ($previousException instanceof PropertyTargetNotFoundException || $previousException instanceof PropertyInvalidSourceException) {
             $GLOBALS['TSFE']->pageNotFoundAndExit($this->entityNotFoundMessage);
         }
         throw $exception;
     }
 }
 /**
  * Load and persist module data
  *
  * @param RequestInterface $request
  * @param ResponseInterface $response
  *
  * @throws StopActionException
  * @return void
  */
 public function processRequest(RequestInterface $request, ResponseInterface $response)
 {
     /* @var $persistenceManager \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager */
     $persistenceManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager');
     // We "finally" persist the module data.
     try {
         parent::processRequest($request, $response);
         $persistenceManager->persistAll();
     } catch (StopActionException $e) {
         $persistenceManager->persistAll();
         throw $e;
     }
 }
 /**
  * Redirect request from post when forced
  *
  * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request The request object
  * @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response The response, modified by this handler
  * @return void
  */
 public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
 {
     parent::processRequest($request, $response);
     if ($request instanceof \TYPO3\CMS\Extbase\Mvc\Web\Request) {
         $arguments = $request->getArguments();
         if (isset($arguments['forceRedirect']) && (bool) $arguments['forceRedirect'] === true) {
             unset($arguments['forceRedirect'], $arguments['controller'], $arguments['action']);
             // Remove empty arguments
             $arguments = array_filter($arguments);
             $this->redirect($request->getControllerActionName(), null, null, $arguments);
         }
     }
 }
 /**
  * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request
  * @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response
  * @return void
  * @throws \Exception
  * @override \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
  */
 public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
 {
     try {
         parent::processRequest($request, $response);
     } catch (\Exception $exception) {
         if ($this->isAjax) {
             if ($this->response instanceof \TYPO3\CMS\Extbase\Mvc\Web\Response) {
                 $this->response->setStatus(500);
             }
             $this->response->appendContent($exception->getMessage());
         } else {
             throw $exception;
         }
     }
 }
 /**
  * Adds code to the standard request processor for saving the last action.
  *
  * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request
  * @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response
  *
  * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
  */
 public function processRequest(RequestInterface $request, ResponseInterface $response)
 {
     parent::processRequest($request, $response);
     // We are here ony if the action did not throw exceptions (==successful and not forwarded). Save the action.
     $this->storeLastModuleInformation();
 }
Esempio n. 13
0
 /**
  * Override the action name if found in the uc of the user
  *
  * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request
  * @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response
  * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
  */
 public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
 {
     $vars = GeneralUtility::_GET('tx_indexedsearch_web_indexedsearchisearch');
     $beUser = $this->getBackendUserAuthentication();
     if (is_array($vars) && isset($vars['action']) && method_exists($this, $vars['action'] . 'Action')) {
         $action = $vars['action'];
         switch ($action) {
             case 'saveStopwordsKeywords':
                 $action = 'statisticDetails';
                 break;
             case 'deleteIndexedItem':
                 $action = 'statistic';
                 break;
         }
         $beUser->uc['indexed_search']['action'] = $action;
         $beUser->uc['indexed_search']['arguments'] = $request->getArguments();
         $beUser->writeUC();
     } elseif (isset($beUser->uc['indexed_search']['action'])) {
         if ($request instanceof WebRequest) {
             $request->setControllerActionName($beUser->uc['indexed_search']['action']);
         }
         if (isset($beUser->uc['indexed_search']['arguments'])) {
             $request->setArguments($beUser->uc['indexed_search']['arguments']);
         }
     }
     parent::processRequest($request, $response);
 }
 /**
  * Handles a request. The result output is returned by altering the given response.
  *
  * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request The request object
  * @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response The response, modified by this handler
  * @return void
  * @api
  */
 public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
 {
     if (method_exists($request, 'getWidgetContext')) {
         $this->widgetConfiguration = $request->getWidgetContext()->getWidgetConfiguration();
     }
     \TYPO3\CMS\Extbase\Mvc\Controller\ActionController::processRequest($request, $response);
 }
 /**
  * Fires end-of-lifecycle signal if processing backend request.
  * 
  * @see processRequest() in parent
  */
 public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
 {
     parent::processRequest($request, $response);
     if (TYPO3_MODE === 'BE') {
         // if we are in BE mode, this ist the last line called
         $this->lifecycleManager->updateState(Tx_PtExtbase_Lifecycle_Manager::END);
     }
 }
Esempio n. 16
0
 /**
  * Handles a request. The result output is returned by altering the given response.
  *
  * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request The request object
  * @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response The response, modified by this handler
  * @return void
  * @api
  */
 public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
 {
     $this->widgetConfiguration = $request->getWidgetContext()->getWidgetConfiguration();
     parent::processRequest($request, $response);
 }
 /**
  * Handles a request. The result output is returned by altering the given response.
  *
  * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request The request object
  * @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response The response, modified by this handler
  * @return void
  * @api
  */
 public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
 {
     if ($request instanceof WidgetRequest) {
         $this->widgetConfiguration = $request->getWidgetContext()->getWidgetConfiguration();
     }
     ActionController::processRequest($request, $response);
 }
 /**
  * @param RequestInterface $request
  * @param ResponseInterface $response
  * @return void
  * @throws \Exception
  * @override \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
  */
 public function processRequest(RequestInterface $request, ResponseInterface $response)
 {
     try {
         parent::processRequest($request, $response);
     } catch (\Exception $exception) {
         // If the property mapper did throw a \TYPO3\CMS\Extbase\Property\Exception, because it was unable to find the requested entity, call the page-not-found handler.
         $previousException = $exception->getPrevious();
         if ($exception instanceof Exception && ($previousException instanceof TargetNotFoundException || $previousException instanceof InvalidSourceException)) {
             $configuration = isset($this->settings[strtolower($request->getControllerName())]['detail']['errorHandling']) ? $this->settings[strtolower($request->getControllerName())]['detail']['errorHandling'] : NULL;
             if ($configuration) {
                 $this->handleEntityNotFoundError($configuration);
             }
         }
         throw $exception;
     }
 }
Esempio n. 19
0
 /**
  * Catches all PaymentExceptions and sets the Exception message to the response content
  *
  * @param RequestInterface $request
  * @param ResponseInterface $response
  * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
  */
 public function processRequest(RequestInterface $request, ResponseInterface $response)
 {
     try {
         parent::processRequest($request, $response);
     } catch (\DERHANSEN\SfEventMgt\Exception $e) {
         $response->setContent('<div class="payment-error">' . $e->getMessage() . '</div>');
     } catch (\TYPO3\CMS\Extbase\Security\Exception\InvalidHashException $e) {
         $response->setContent('<div class="payment-error">' . $e->getMessage() . '</div>');
     }
 }