Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/ADF-660/ParamConverter #3148

Draft
wants to merge 22 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0a20a06
feat: ParamConverter
shpran Sep 29, 2021
3cbfd86
refactor: remove unnecessary code
shpran Sep 29, 2021
06a9814
refactor: replace with import
shpran Sep 29, 2021
9bb2662
refactor: prettify code
shpran Sep 29, 2021
c05733d
refactor: add missed DockBlocks, remove unnecessary code
shpran Sep 29, 2021
30c3797
refactor: use interfaces, create converted object via reflection
shpran Sep 29, 2021
a3b69fc
refactor: add DockBlocks, remove unnecessary use-statements
shpran Sep 29, 2021
96839ca
refactor: apply dependency inversion principle, prettify code
shpran Sep 29, 2021
65e48a8
refactor: apply php-cs-fixer on manifest
shpran Sep 29, 2021
0961acb
refactor: remove commented lines
shpran Sep 29, 2021
9046d66
refactor: group use statements and separate with a line
shpran Sep 29, 2021
acf7b8e
refactor: register event, ignore 'requiresRight' annotation
shpran Sep 30, 2021
09f10f2
feat: implement serializer, use serializer to deserialize param conve…
shpran Oct 13, 2021
78dc40e
Merge branch 'develop' of https://github.com/oat-sa/tao-core into fea…
shpran Oct 13, 2021
d4138c0
refactor: add missed dockblocks
shpran Oct 13, 2021
73bfb1e
Merge branch 'develop' of https://github.com/oat-sa/tao-core into fea…
shpran Nov 9, 2021
b1d01ee
tests: add classes and test action for perfomance testing
shpran Nov 15, 2021
eeb886d
refactor: remove author and change year
shpran Nov 20, 2021
1f13082
Merge branch 'develop' of https://github.com/oat-sa/tao-core into fea…
shpran Dec 3, 2021
43c14bb
refactor: use method instead of passing ParamConverters through the …
shpran Dec 3, 2021
e8909b3
Merge branch 'develop' of https://github.com/oat-sa/tao-core into fea…
shpran Feb 1, 2022
2f40a90
Merge branch 'develop' of https://github.com/oat-sa/tao-core into fea…
shpran Mar 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 46 additions & 42 deletions manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,55 +19,55 @@
* 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung (under the project TAO-TRANSFER);
* 2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV);
* 2013- (update and modification) Open Assessment Technologies SA;
*
*/

use oat\tao\model\user\TaoRoles;
use oat\tao\controller\api\Users;
use oat\tao\install\services\SetupSettingsStorage;
use oat\tao\model\accessControl\func\AccessRule;
use oat\tao\model\routing\ApiRoute;
use oat\tao\model\routing\LegacyRoute;
use oat\tao\model\user\TaoRoles;
use oat\tao\scripts\install\AddArchiveService;
use oat\tao\scripts\update\Updater;
use oat\tao\scripts\install\AddLogFs;
use oat\tao\model\routing\LegacyRoute;
use oat\tao\scripts\install\RegisterEvents;
use oat\tao\scripts\install\SetServiceState;
use oat\tao\scripts\install\SetUpQueueTasks;
use oat\tao\scripts\install\AddTmpFsHandlers;
use oat\tao\scripts\install\AddArchiveService;
use oat\tao\scripts\install\CreateRdsListStore;
use oat\tao\scripts\install\CreateWebhookEventLogTable;
use oat\tao\scripts\install\InstallNotificationTable;
use oat\tao\scripts\install\RegisterActionService;
use oat\tao\scripts\install\RegisterActionAccessControl;
use oat\tao\scripts\install\RegisterClassMetadataServices;
use oat\tao\scripts\install\RegisterClassPropertiesChangedEvent;
use oat\tao\scripts\install\RegisterClassPropertiesChangedEventListener;
use oat\tao\scripts\install\RegisterClassPropertyRemovedEvent;
use oat\tao\scripts\install\RegisterClassPropertyRemovedListener;
use oat\tao\scripts\install\RegisterDataAccessControlChangedEvent;
use oat\tao\scripts\install\RegisterDataAccessControlChangedListener;
use oat\tao\scripts\install\RegisterEvents;
use oat\tao\scripts\install\RegisterResourceEvents;
use oat\tao\scripts\install\RegisterResourceRelationService;
use oat\tao\scripts\install\RegisterResourceWatcherService;
use oat\tao\scripts\install\RegisterRtlLocales;
use oat\tao\scripts\install\RegisterSearchServices;
use oat\tao\scripts\install\RegisterSessionCookieService;
use oat\tao\scripts\install\RegisterSignatureGenerator;
use oat\tao\scripts\install\RegisterTaoUpdateEventListener;
use oat\tao\scripts\install\RegisterTaskQueueServices;
use oat\tao\scripts\install\RegisterUserLockoutsEventListeners;
use oat\tao\model\accessControl\func\AccessRule;
use oat\tao\scripts\install\RegisterUserService;
use oat\tao\scripts\install\RegisterValidationRules;
use oat\tao\scripts\install\RegisterValueCollectionServices;
use oat\tao\scripts\install\SetClientLoggerConfig;
use oat\tao\scripts\install\SetContainerService;
use oat\tao\scripts\install\SetDefaultCSPHeader;
use oat\tao\install\services\SetupSettingsStorage;
use oat\tao\scripts\install\RegisterActionService;
use oat\tao\scripts\install\SetClientLoggerConfig;
use oat\tao\scripts\install\SetServiceFileStorage;
use oat\tao\scripts\install\RegisterResourceEvents;
use oat\tao\scripts\install\RegisterSearchServices;
use oat\tao\scripts\install\SetImageAligmentConfig;
use oat\tao\scripts\install\SetLocaleNumbersConfig;
use oat\tao\scripts\install\SetServiceFileStorage;
use oat\tao\scripts\install\SetServiceState;
use oat\tao\scripts\install\RegisterValidationRules;
use oat\tao\scripts\install\SetupMaintenanceService;
use oat\tao\scripts\install\SetUpQueueTasks;
use oat\tao\scripts\tools\AddRtlLocale;
use oat\tao\scripts\update\Updater;
use oat\tao\scripts\install\InstallNotificationTable;
use oat\tao\scripts\install\RegisterTaskQueueServices;
use oat\tao\scripts\install\CreateWebhookEventLogTable;
use oat\tao\scripts\install\RegisterSignatureGenerator;
use oat\tao\scripts\install\RegisterActionAccessControl;
use oat\tao\scripts\install\RegisterSessionCookieService;
use oat\tao\scripts\install\RegisterClassMetadataServices;
use oat\tao\scripts\install\RegisterResourceWatcherService;
use oat\tao\scripts\install\RegisterTaoUpdateEventListener;
use oat\tao\scripts\install\RegisterResourceRelationService;
use oat\tao\scripts\install\RegisterValueCollectionServices;
use oat\tao\scripts\install\RegisterClassPropertyRemovedEvent;
use oat\tao\scripts\install\RegisterUserLockoutsEventListeners;
use oat\tao\scripts\install\RegisterClassPropertiesChangedEvent;
use oat\tao\scripts\install\RegisterClassPropertyRemovedListener;
use oat\tao\scripts\install\RegisterDataAccessControlChangedEvent;
use oat\tao\scripts\install\RegisterDataAccessControlChangedListener;
use oat\tao\scripts\install\RegisterClassPropertiesChangedEventListener;
use oat\tao\model\HttpFoundation\ServiceProvider\HttpFoundationServiceProvider;
use oat\tao\model\ParamConverter\ServiceProvider\ParamConverterServiceProvider;

$extpath = __DIR__ . DIRECTORY_SEPARATOR;

Expand All @@ -79,7 +79,7 @@
'author' => 'Open Assessment Technologies, CRP Henri Tudor',
'models' => [
'http://www.tao.lu/Ontologies/TAO.rdf',
'http://www.tao.lu/middleware/wfEngine.rdf'
'http://www.tao.lu/middleware/wfEngine.rdf',
],
'install' => [
'rdf' => [
Expand All @@ -93,7 +93,7 @@
__DIR__ . '/models/ontology/widgetdefinitions.rdf',
__DIR__ . '/models/ontology/requiredaction.rdf',
__DIR__ . '/models/ontology/auth/basicauth.rdf',
__DIR__ . '/models/ontology/userlocks.rdf'
__DIR__ . '/models/ontology/userlocks.rdf',
],
'checks' => [
['type' => 'CheckPHPRuntime', 'value' => ['id' => 'tao_php_runtime', 'min' => '5.4']],
Expand All @@ -113,8 +113,8 @@
['type' => 'CheckPHPINIValue', 'value' => ['id' => 'tao_ini_suhosin_request_max_varname_length', 'name' => 'suhosin.request.max_varname_length', 'value' => '128', 'dependsOn' => ['tao_extension_suhosin']]],
['type' => 'CheckFileSystemComponent', 'value' => ['id' => 'fs_generis_common_conf', 'location' => 'config', 'rights' => 'rw', 'recursive' => true]],
['type' => 'CheckFileSystemComponent', 'value' => ['id' => 'fs_tao_client_locales', 'location' => 'tao/views/locales', 'rights' => 'rw']],
['type' => 'CheckCustom', 'value' => ['id' => 'tao_custom_not_nginx', 'name' => 'not_nginx', 'extension' => 'tao', "optional" => true, 'dependsOn' => ['tao_extension_curl']]],
['type' => 'CheckCustom', 'value' => ['id' => 'tao_custom_allowoverride', 'name' => 'allow_override', 'extension' => 'tao', "optional" => true, 'dependsOn' => ['tao_custom_not_nginx']]],
['type' => 'CheckCustom', 'value' => ['id' => 'tao_custom_not_nginx', 'name' => 'not_nginx', 'extension' => 'tao', 'optional' => true, 'dependsOn' => ['tao_extension_curl']]],
['type' => 'CheckCustom', 'value' => ['id' => 'tao_custom_allowoverride', 'name' => 'allow_override', 'extension' => 'tao', 'optional' => true, 'dependsOn' => ['tao_custom_not_nginx']]],
['type' => 'CheckCustom', 'value' => ['id' => 'tao_custom_mod_rewrite', 'name' => 'mod_rewrite', 'extension' => 'tao', 'dependsOn' => ['tao_custom_allowoverride']]],
['type' => 'CheckCustom', 'value' => ['id' => 'tao_custom_database_drivers', 'name' => 'database_drivers', 'extension' => 'tao']],
],
Expand Down Expand Up @@ -161,13 +161,13 @@
RegisterActionAccessControl::class,
RegisterRtlLocales::class,
RegisterSearchServices::class,
SetImageAligmentConfig::class
SetImageAligmentConfig::class,
],
],
'update' => Updater::class,
'optimizableClasses' => [
'http://www.tao.lu/Ontologies/TAO.rdf#Languages',
'http://www.tao.lu/Ontologies/TAO.rdf#LanguageUsages'
'http://www.tao.lu/Ontologies/TAO.rdf#LanguageUsages',
],
'managementRole' => TaoRoles::TAO_MANAGER,
'acl' => [
Expand Down Expand Up @@ -265,5 +265,9 @@
],
'extra' => [
'structures' => $extpath . 'actions' . DIRECTORY_SEPARATOR . 'structures.xml',
]
],
'containerServiceProviders' => [
HttpFoundationServiceProvider::class,
ParamConverterServiceProvider::class,
],
];
46 changes: 46 additions & 0 deletions models/classes/HttpFoundation/Factory/HttpFoundationFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; under version 2
* of the License (non-upgradable).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (c) 2021 (original work) Open Assessment Technologies SA;
*/

declare(strict_types=1);

namespace oat\tao\model\HttpFoundation\Factory;

use Psr\Http\Message\ServerRequestInterface;
use oat\tao\model\HttpFoundation\Request\Request;
use oat\tao\model\HttpFoundation\Request\RequestInterface;
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory as SymfonyHttpFoundationFactory;

class HttpFoundationFactory implements HttpFoundationFactoryInterface
{
/** @var SymfonyHttpFoundationFactory */
private $httpFoundationFactory;

public function __construct()
{
$this->httpFoundationFactory = new SymfonyHttpFoundationFactory();
}

public function createRequest(ServerRequestInterface $psrRequest, bool $streamed = false): RequestInterface
{
$request = $this->httpFoundationFactory->createRequest($psrRequest, $streamed);

return new Request($request);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; under version 2
* of the License (non-upgradable).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (c) 2021 (original work) Open Assessment Technologies SA;
*/

declare(strict_types=1);

namespace oat\tao\model\HttpFoundation\Factory;

use Psr\Http\Message\ServerRequestInterface;
use oat\tao\model\HttpFoundation\Request\RequestInterface;

interface HttpFoundationFactoryInterface
{
public function createRequest(ServerRequestInterface $psrRequest, bool $streamed = false): RequestInterface;
}
Loading