setLogger($wfsLogger); $this->reqDBG($request); // /wfs-data.php/default_db/?... : $request->segments = ['default_db'] // /wfs-data.php/filtr_proces_5040/default_db/?... : $request->segments = ['filtr_proces_5040', 'default_db'] // /wfs-data.php?... : $request->segments = [] // /wfs-data.php/filtr_proces_5040/?... : $request->segments = ['filtr_proces_5040'] // /wfs-data.php/wsdl : $request->segments = ['wsdl'] $serverClass = 'Api_WfsDataServer'; if (!empty($request->segments) && 'wsdl' == $request->segments[0]) { $serverClass = 'Api_WsdlServer'; } $idFiltrProces = null; foreach ($request->segments as $pathPart) { if ('filtr_proces_' == substr($pathPart, 0, 13)) { $idFiltrProces = (int)substr($pathPart, 13); if (!$idFiltrProces) throw new Api_WfsException("Wrong filtr process number"); $this->DBG("filtr procesu({$idProcesFiltr})", __LINE__, __FUNCTION__, __CLASS__); } // if ('default_db' == $pathPart) continue;// skip 'default_db' // throw new Api_WfsException("Not implemented '{$pathPart}'", 501);// skip all - wsdl work on segments } try { $this->DBG("Api_WfsData->execute() START", __LINE__); //$userAcl = User::getAcl(); IF(V::get('DBG','',$_GET)){echo'
user (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($this->_apiUser);echo'
';} $userAcl = new UserAcl($this->_apiUser->getID(), $use_cache = true); $userAcl->fetchGroups(); if ($idFiltrProces) { if (!$userAcl->canExecuteProcesInit($idFiltrProces)) { throw new Api_WfsException("Access Denied for given process"); } $userAcl->fetchProcesPerms($idFiltrProces); } else { $userAcl->fetchAllPerms(); } User::getAcl($userAcl);// force set acl IF(V::get('DBG','',$_GET)){echo'
$userAcl (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($userAcl);echo'
';} $this->DBG("usr:" . $this->_apiUser->getID(), __LINE__, __FUNCTION__, __CLASS__); $wfsServer = new $serverClass($userAcl); $wfsServer->setLogger($this->_logger); $wfsServer->setBaseUri($this->_apiBaseUri); $wfsServer->run($request); exit;// TODO:? return $document; } catch (Api_WfsException $e) { DBG::logAuth($e); $e->sendResponseXml(); } catch (Exception $e) { DBG::logAuth($e); $wfsException = new Api_WfsException($e->getMessage(), $e->getCode(), $e); $wfsException->sendResponseXml(); } $this->DBG("Api_WfsData->execute() END", __LINE__); exit; // return document tree - array of arrays } public function wfsServerAction($request) { } public function mainWpsAction($request) { return array('TODO:'=>'TODO: Show main WPS GetCapabilities'); } }