Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 15 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| Api | |
0.00% |
0 / 15 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getParametersAliases | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
2 | |||
| getParametersRequirements | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2013 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); |
| 19 | * |
| 20 | * @author "Patrick Plichart, <patrick@taotesting.com>" |
| 21 | * |
| 22 | */ |
| 23 | |
| 24 | namespace oat\taoTestTaker\actions; |
| 25 | |
| 26 | use oat\generis\model\GenerisRdf; |
| 27 | use oat\generis\model\OntologyRdf; |
| 28 | use oat\tao\model\routing\AnnotationReader\security; |
| 29 | use oat\taoTestTaker\models\CrudService; |
| 30 | |
| 31 | /** |
| 32 | * @deprecated |
| 33 | * @see RestTestTakers |
| 34 | */ |
| 35 | class Api extends \tao_actions_CommonRestModule |
| 36 | { |
| 37 | /** |
| 38 | * Api constructor. |
| 39 | * @security("hide"); |
| 40 | */ |
| 41 | public function __construct() |
| 42 | { |
| 43 | parent::__construct(); |
| 44 | $this->service = CrudService::singleton(); |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Optionnaly a specific rest controller may declare |
| 49 | * aliases for parameters used for the rest communication |
| 50 | */ |
| 51 | protected function getParametersAliases() |
| 52 | { |
| 53 | return array_merge(parent::getParametersAliases(), [ |
| 54 | "login" => GenerisRdf::PROPERTY_USER_LOGIN, |
| 55 | "password" => GenerisRdf::PROPERTY_USER_PASSWORD, |
| 56 | "guiLg" => GenerisRdf::PROPERTY_USER_UILG, |
| 57 | "dataLg" => GenerisRdf::PROPERTY_USER_DEFLG, |
| 58 | "firstName" => GenerisRdf::PROPERTY_USER_FIRSTNAME, |
| 59 | "lastName" => GenerisRdf::PROPERTY_USER_LASTNAME, |
| 60 | "mail" => GenerisRdf::PROPERTY_USER_MAIL, |
| 61 | "type" => OntologyRdf::RDF_TYPE |
| 62 | ]); |
| 63 | } |
| 64 | /** |
| 65 | * Optionnal Requirements for parameters to be sent on every service |
| 66 | * |
| 67 | */ |
| 68 | protected function getParametersRequirements() |
| 69 | { |
| 70 | return [ |
| 71 | /** you may use either the alias or the uri, if the parameter identifier |
| 72 | * is set it will become mandatory for the operation in $key |
| 73 | * Default Parameters Requirents are applied |
| 74 | * type by default is not required and the root class type is applied |
| 75 | */ |
| 76 | "post" => ["login", "password"] |
| 77 | ]; |
| 78 | } |
| 79 | } |