getSession()->getUserUri(); if (is_null($userId)) { throw new common_exception_Error('No user is logged in'); } $lang = $this->getSession()->getDataLanguage(); if ($this->hasRequestParameter('serviceCallId')) { $serviceCallId = $this->getRequestParameter('serviceCallId'); $variableData = $this->getServiceLocator()->get(StateStorage::SERVICE_ID)->get($userId, $serviceCallId); $this->setData('storageData', [ 'serial' => $serviceCallId, 'data' => is_null($variableData) ? [] : $variableData ]); } $directory = $this->getDirectory($this->getRequestParameter('itemPath')); if (!$directory->has($lang) && $directory->has(DEFAULT_LANG)) { $lang = DEFAULT_LANG; } $this->setData('itemPath', $directory->getPublicAccessUrl() . $lang . '/index.html'); $this->setData('itemId', $this->getRequestParameter('itemUri')); $this->setData('resultServerEndpoint', $this->getResultServerEndpoint()); $this->setData('resultServerParams', $this->getResultServerParams()); $this->setData('client_timeout', $this->getClientTimeout()); $this->setData('client_config_url', $this->getClientConfigUrl()); $this->selectView(); } /** * The implementation of this method calls ItemRunner::setView in order to * select the view to be displayed. */ protected function selectView() { $this->setView('runtime/item_runner.tpl', 'taoItems'); } /** * Get the URL of the result server * @return string */ protected function getResultServerEndpoint() { return _url('', 'ResultServerStateFull', 'taoResultServer'); } /** * Get extra parameters to give the result server * @return array an assoc array of additional parameters */ protected function getResultServerParams() { return []; } }