TYPO3 CMS  TYPO3_6-2
QueueController.php
Go to the documentation of this file.
1 <?php
3 
21 
26  protected $contentRepository;
27 
31  protected $defaultViewObjectName = 'TYPO3\\CMS\\Extbase\\Mvc\\View\\JsonView';
32 
36  public function indexAction() {
37  $calls = array();
38  $calls[] = array('Content', 'list');
39  $contents = $this->contentRepository->findAll();
40  foreach ($contents as $content) {
41  $uid = $content->getUid();
42  $calls[] = array('Content', 'show', array('content' => (string)$uid));
43  }
44  $this->getQueueService()->set($calls);
45  $this->forward('process');
46  }
47 
51  public function processAction() {
52  $call = $this->getQueueService()->shift();
53  if ($call === NULL) {
54  $this->forward('finish');
55  }
56  // Clear these states and fetch fresh entities!
57  $this->getPersistenceManager()->clearState();
58  $this->forward($call[1], $call[0], NULL, isset($call[2]) ? $call[2] : NULL);
59  }
60 
61  public function finishAction() {
62  $this->request->setDispatched(TRUE);
63  $value = $this->getQueueService()->getValues();
64  $this->view->assign('value', $value);
65  }
66 
75  protected function resolveController(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request) {
76  $controllerObjectName = $request->getControllerObjectName();
77  $controller = $this->objectManager->get($controllerObjectName);
78  if (!$controller instanceof \TYPO3\CMS\Extbase\Mvc\Controller\ControllerInterface) {
79  throw new \TYPO3\CMS\Extbase\Mvc\Exception\InvalidControllerException('Invalid controller "' . $request->getControllerObjectName() . '". The controller must implement the TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerInterface.', 1202921619);
80  }
81  return $controller;
82  }
83 
84 }
$uid
Definition: server.php:36
forward($actionName, $controllerName=NULL, $extensionName=NULL, array $arguments=NULL)
resolveController(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request)