Commit 46d7b3d8 authored by François Agneray's avatar François Agneray
Browse files

#72 => done

parent 3b294442
Pipeline #5320 passed with stages
in 2 minutes and 32 seconds
......@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- #64: Data management system
### Changed
- #72: Change entity name project by survey
- #71: Update metamodel database
- #68: Deleting property table_name from attribute entity
- #67: Body Parsing and Content Length slim's middlewares
......
......@@ -92,12 +92,12 @@ $container->set('App\Action\AdminFileExplorerAction', function (ContainerInterfa
return new App\Action\AdminFileExplorerAction($c->get('settings')['data_path']);
});
$container->set('App\Action\ProjectListAction', function (ContainerInterface $c) {
return new App\Action\ProjectListAction($c->get('em'));
$container->set('App\Action\SurveyListAction', function (ContainerInterface $c) {
return new App\Action\SurveyListAction($c->get('em'));
});
$container->set('App\Action\ProjectAction', function (ContainerInterface $c) {
return new App\Action\ProjectAction($c->get('em'));
$container->set('App\Action\SurveyAction', function (ContainerInterface $c) {
return new App\Action\SurveyAction($c->get('em'));
});
$container->set('App\Action\GroupListAction', function (ContainerInterface $c) {
......
......@@ -30,8 +30,8 @@ $app->group('', function (RouteCollectorProxy $group) {
));
$app->group('', function (RouteCollectorProxy $group) {
$group->map([OPTIONS, GET, POST], '/project', App\Action\ProjectListAction::class);
$group->map([OPTIONS, GET, PUT, DELETE], '/project/{name}', App\Action\ProjectAction::class);
$group->map([OPTIONS, GET, POST], '/survey', App\Action\SurveyListAction::class);
$group->map([OPTIONS, GET, PUT, DELETE], '/survey/{name}', App\Action\SurveyAction::class);
$group->map([OPTIONS, GET, POST], '/instance', App\Action\InstanceListAction::class);
$group->map([OPTIONS, GET, PUT, DELETE], '/instance/{name}', App\Action\InstanceAction::class);
$group->map([OPTIONS, GET, POST], '/instance/{name}/group', App\Action\GroupListAction::class);
......
......@@ -61,10 +61,10 @@ curl -d '{"label":"Test","dbname":"anis_test","dbtype":"pdo_pgsql","dbhost":"db"
# Add default instance
curl -d '{"name":"default","label":"Default instance","client_url":"http://localhost:4200","config":{"authentication":{"allowed":false},"search":{"allowed":true},"search_multiple":{"allowed":false},"documentation":{"allowed":false}}}' --header 'Content-Type: application/json' -X POST http://localhost/instance
# Add ANIS, SVOM and IRIS projects
curl -d '{"name":"anis_project","label":"ANIS Project","description":"Project used for testing","link":"https://anis.lam.fr","manager":"F. Agneray","id_database":1}' --header 'Content-Type: application/json' -X POST http://localhost/project
curl -d '{"name":"svom","label":"SVOM","description":"Project used for testing","link":"https://www.svom.eu","manager":"S. Basa","id_database":1}' --header 'Content-Type: application/json' -X POST http://localhost/project
curl -d '{"name":"iris","label":"IRiS","description":"Project used for testing","link":"http://iris.lam.fr","manager":"S. Basa","id_database":1}' --header 'Content-Type: application/json' -X POST http://localhost/project
# Add ANIS, SVOM and IRIS surveys
curl -d '{"name":"anis_survey","label":"ANIS survey","description":"Survey used for testing","link":"https://anis.lam.fr","manager":"F. Agneray","id_database":1}' --header 'Content-Type: application/json' -X POST http://localhost/survey
curl -d '{"name":"svom","label":"SVOM","description":"Survey used for testing","link":"https://www.svom.eu","manager":"S. Basa","id_database":1}' --header 'Content-Type: application/json' -X POST http://localhost/survey
curl -d '{"name":"iris","label":"IRiS","description":"Survey used for testing","link":"http://iris.lam.fr","manager":"S. Basa","id_database":1}' --header 'Content-Type: application/json' -X POST http://localhost/survey
# Add dataset families
curl -d '{"label":"Default dataset family","display":10}' --header 'Content-Type: application/json' -X POST http://localhost/instance/default/dataset-family
......@@ -72,10 +72,10 @@ curl -d '{"label":"SVOM dataset family","display":20}' --header 'Content-Type: a
curl -d '{"label":"IRiS dataset family","display":30}' --header 'Content-Type: application/json' -X POST http://localhost/instance/default/dataset-family
# Add datasets
curl -d '{"name":"vipers_dr2_w1","table_ref":"aspic_vipers_dr2_w1","label":"VIPERS-W1 (DR2)","description":"VIPERS W1 dataset","display":10,"data_path":"\/ASPIC\/VIPERS_DR2","config":{"cone_search":{"enabled":false,"column_ra":null,"column_dec":null},"result_page_modules":{"results_server_link":false,"opened_datatable":false,"selectable_row":false},"results_format":{"csv":false,"ascii":false,"vo":false}},"public":true,"project_name":"anis_project"}' --header 'Content-Type: application/json' -X POST http://localhost/dataset-family/1/dataset
curl -d '{"name":"sp_cards","table_ref":"sp_cards","label":"SP Metadata","description":"Contains metadata of scientific products (Core Program & General Program)","display":20,"data_path":"","config":{"cone_search":{"enabled":false,"column_ra":null,"column_dec":null},"result_page_modules":{"results_server_link":false,"opened_datatable":false,"selectable_row":false},"results_format":{"csv":false,"ascii":false,"vo":false}},"public":true,"project_name":"svom"}' --header 'Content-Type: application/json' -X POST http://localhost/dataset-family/2/dataset
curl -d '{"name":"observations","table_ref":"v_observation","label":"IRiS obs","description":"IRiS observations","display":10,"data_path":"\/IRIS\/observations","config":{"cone_search":{"enabled":false,"column_ra":null,"column_dec":null},"result_page_modules":{"results_server_link":false,"opened_datatable":false,"selectable_row":false},"results_format":{"csv":false,"ascii":false,"vo":false}},"public":true,"project_name":"iris"}' --header 'Content-Type: application/json' -X POST http://localhost/dataset-family/3/dataset
curl -d '{"name":"vvds_f02_udeep","table_ref":"aspic_vvds_f02_udeep","label":"VVDS2h Ultra Deep","description":"VVDS2h Ultra Deep","display":20,"data_path":"","config":{"cone_search":{"enabled":false,"column_ra":null,"column_dec":null},"result_page_modules":{"results_server_link":false,"opened_datatable":false,"selectable_row":false},"results_format":{"csv":false,"ascii":false,"vo":false}},"public":true,"project_name":"anis_project"}' --header 'Content-Type: application/json' -X POST http://localhost/dataset-family/1/dataset
curl -d '{"name":"vipers_dr2_w1","table_ref":"aspic_vipers_dr2_w1","label":"VIPERS-W1 (DR2)","description":"VIPERS W1 dataset","display":10,"data_path":"\/ASPIC\/VIPERS_DR2","config":{"cone_search":{"enabled":false,"column_ra":null,"column_dec":null},"result_page_modules":{"results_server_link":false,"opened_datatable":false,"selectable_row":false},"results_format":{"csv":false,"ascii":false,"vo":false}},"public":true,"survey_name":"anis_survey"}' --header 'Content-Type: application/json' -X POST http://localhost/dataset-family/1/dataset
curl -d '{"name":"sp_cards","table_ref":"sp_cards","label":"SP Metadata","description":"Contains metadata of scientific products (Core Program & General Program)","display":20,"data_path":"","config":{"cone_search":{"enabled":false,"column_ra":null,"column_dec":null},"result_page_modules":{"results_server_link":false,"opened_datatable":false,"selectable_row":false},"results_format":{"csv":false,"ascii":false,"vo":false}},"public":true,"survey_name":"svom"}' --header 'Content-Type: application/json' -X POST http://localhost/dataset-family/2/dataset
curl -d '{"name":"observations","table_ref":"v_observation","label":"IRiS obs","description":"IRiS observations","display":10,"data_path":"\/IRIS\/observations","config":{"cone_search":{"enabled":false,"column_ra":null,"column_dec":null},"result_page_modules":{"results_server_link":false,"opened_datatable":false,"selectable_row":false},"results_format":{"csv":false,"ascii":false,"vo":false}},"public":true,"survey_name":"iris"}' --header 'Content-Type: application/json' -X POST http://localhost/dataset-family/3/dataset
curl -d '{"name":"vvds_f02_udeep","table_ref":"aspic_vvds_f02_udeep","label":"VVDS2h Ultra Deep","description":"VVDS2h Ultra Deep","display":20,"data_path":"","config":{"cone_search":{"enabled":false,"column_ra":null,"column_dec":null},"result_page_modules":{"results_server_link":false,"opened_datatable":false,"selectable_row":false},"results_format":{"csv":false,"ascii":false,"vo":false}},"public":true,"survey_name":"anis_survey"}' --header 'Content-Type: application/json' -X POST http://localhost/dataset-family/1/dataset
# Add vipers_dr2_w1 attributes
curl -d '{"label":"Default","display":10}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vipers_dr2_w1/criteria-family
......
......@@ -66,10 +66,10 @@ class Attribute extends \App\Entity\Attribute implements \Doctrine\ORM\Proxy\Pro
public function __sleep()
{
if ($this->__isInitialized__) {
return ['__isInitialized__', 'id', 'dataset', 'name', 'label', 'formLabel', 'description', 'outputDisplay', 'criteriaDisplay', 'searchFlag', 'searchType', 'operator', 'type', 'min', 'max', 'placeholderMin', 'placeholderMax', 'renderer', 'rendererConfig', 'displayDetail', 'selected', 'orderBy', 'orderDisplay', 'detail', 'rendererDetail', 'options', 'voUtype', 'voUcd', 'voUnit', 'voDescription', 'voDatatype', 'voSize', 'criteriaFamily', 'outputCategory'];
return ['__isInitialized__', 'id', 'dataset', 'name', 'label', 'formLabel', 'description', 'outputDisplay', 'criteriaDisplay', 'searchFlag', 'searchType', 'operator', 'type', 'min', 'max', 'placeholderMin', 'placeholderMax', 'renderer', 'rendererConfig', 'selected', 'orderBy', 'orderDisplay', 'detail', 'displayDetail', 'rendererDetail', 'rendererDetailConfig', 'options', 'voUtype', 'voUcd', 'voUnit', 'voDescription', 'voDatatype', 'voSize', 'criteriaFamily', 'outputCategory'];
}
return ['__isInitialized__', 'id', 'dataset', 'name', 'label', 'formLabel', 'description', 'outputDisplay', 'criteriaDisplay', 'searchFlag', 'searchType', 'operator', 'type', 'min', 'max', 'placeholderMin', 'placeholderMax', 'renderer', 'rendererConfig', 'displayDetail', 'selected', 'orderBy', 'orderDisplay', 'detail', 'rendererDetail', 'options', 'voUtype', 'voUcd', 'voUnit', 'voDescription', 'voDatatype', 'voSize', 'criteriaFamily', 'outputCategory'];
return ['__isInitialized__', 'id', 'dataset', 'name', 'label', 'formLabel', 'description', 'outputDisplay', 'criteriaDisplay', 'searchFlag', 'searchType', 'operator', 'type', 'min', 'max', 'placeholderMin', 'placeholderMax', 'renderer', 'rendererConfig', 'selected', 'orderBy', 'orderDisplay', 'detail', 'displayDetail', 'rendererDetail', 'rendererDetailConfig', 'options', 'voUtype', 'voUcd', 'voUnit', 'voDescription', 'voDatatype', 'voSize', 'criteriaFamily', 'outputCategory'];
}
/**
......@@ -191,6 +191,17 @@ class Attribute extends \App\Entity\Attribute implements \Doctrine\ORM\Proxy\Pro
return parent::getId();
}
/**
* {@inheritDoc}
*/
public function setId($id)
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'setId', [$id]);
return parent::setId($id);
}
/**
* {@inheritDoc}
*/
......@@ -818,6 +829,28 @@ class Attribute extends \App\Entity\Attribute implements \Doctrine\ORM\Proxy\Pro
return parent::setRendererDetail($rendererDetail);
}
/**
* {@inheritDoc}
*/
public function getRendererDetailConfig()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getRendererDetailConfig', []);
return parent::getRendererDetailConfig();
}
/**
* {@inheritDoc}
*/
public function setRendererDetailConfig($rendererDetailConfig)
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'setRendererDetailConfig', [$rendererDetailConfig]);
return parent::setRendererDetailConfig($rendererDetailConfig);
}
/**
* {@inheritDoc}
*/
......
......@@ -66,10 +66,10 @@ class Dataset extends \App\Entity\Dataset implements \Doctrine\ORM\Proxy\Proxy
public function __sleep()
{
if ($this->__isInitialized__) {
return ['__isInitialized__', 'name', 'tableRef', 'label', 'description', 'display', 'count', 'vo', 'dataPath', 'config', 'public', 'project', 'datasetFamily', 'attributes'];
return ['__isInitialized__', 'name', 'tableRef', 'label', 'description', 'display', 'dataPath', 'config', 'public', 'survey', 'datasetFamily', 'attributes'];
}
return ['__isInitialized__', 'name', 'tableRef', 'label', 'description', 'display', 'count', 'vo', 'dataPath', 'config', 'public', 'project', 'datasetFamily', 'attributes'];
return ['__isInitialized__', 'name', 'tableRef', 'label', 'description', 'display', 'dataPath', 'config', 'public', 'survey', 'datasetFamily', 'attributes'];
}
/**
......@@ -279,50 +279,6 @@ class Dataset extends \App\Entity\Dataset implements \Doctrine\ORM\Proxy\Proxy
return parent::setDisplay($display);
}
/**
* {@inheritDoc}
*/
public function getCount()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getCount', []);
return parent::getCount();
}
/**
* {@inheritDoc}
*/
public function setCount($count)
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'setCount', [$count]);
return parent::setCount($count);
}
/**
* {@inheritDoc}
*/
public function getVo()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getVo', []);
return parent::getVo();
}
/**
* {@inheritDoc}
*/
public function setVo($vo)
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'setVo', [$vo]);
return parent::setVo($vo);
}
/**
* {@inheritDoc}
*/
......@@ -392,23 +348,23 @@ class Dataset extends \App\Entity\Dataset implements \Doctrine\ORM\Proxy\Proxy
/**
* {@inheritDoc}
*/
public function getProject()
public function getSurvey()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getProject', []);
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getSurvey', []);
return parent::getProject();
return parent::getSurvey();
}
/**
* {@inheritDoc}
*/
public function setProject($project)
public function setSurvey($survey)
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'setProject', [$project]);
$this->__initializer__ && $this->__initializer__->__invoke($this, 'setSurvey', [$survey]);
return parent::setProject($project);
return parent::setSurvey($survey);
}
/**
......
<?php
namespace DoctrineProxies\__CG__\App\Entity;
/**
* DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR
*/
class DatasetPrivileges extends \App\Entity\DatasetPrivileges implements \Doctrine\ORM\Proxy\Proxy
{
/**
* @var \Closure the callback responsible for loading properties in the proxy object. This callback is called with
* three parameters, being respectively the proxy object to be initialized, the method that triggered the
* initialization process and an array of ordered parameters that were passed to that method.
*
* @see \Doctrine\Common\Proxy\Proxy::__setInitializer
*/
public $__initializer__;
/**
* @var \Closure the callback responsible of loading properties that need to be copied in the cloned object
*
* @see \Doctrine\Common\Proxy\Proxy::__setCloner
*/
public $__cloner__;
/**
* @var boolean flag indicating if this object was already initialized
*
* @see \Doctrine\Common\Persistence\Proxy::__isInitialized
*/
public $__isInitialized__ = false;
/**
* @var array properties to be lazy loaded, with keys being the property
* names and values being their default values
*
* @see \Doctrine\Common\Proxy\Proxy::__getLazyProperties
*/
public static $lazyPropertiesDefaults = [];
/**
* @param \Closure $initializer
* @param \Closure $cloner
*/
public function __construct($initializer = null, $cloner = null)
{
$this->__initializer__ = $initializer;
$this->__cloner__ = $cloner;
}
/**
*
* @return array
*/
public function __sleep()
{
if ($this->__isInitialized__) {
return ['__isInitialized__', 'dataset', 'group'];
}
return ['__isInitialized__', 'dataset', 'group'];
}
/**
*
*/
public function __wakeup()
{
if ( ! $this->__isInitialized__) {
$this->__initializer__ = function (DatasetPrivileges $proxy) {
$proxy->__setInitializer(null);
$proxy->__setCloner(null);
$existingProperties = get_object_vars($proxy);
foreach ($proxy->__getLazyProperties() as $property => $defaultValue) {
if ( ! array_key_exists($property, $existingProperties)) {
$proxy->$property = $defaultValue;
}
}
};
}
}
/**
*
*/
public function __clone()
{
$this->__cloner__ && $this->__cloner__->__invoke($this, '__clone', []);
}
/**
* Forces initialization of the proxy
*/
public function __load()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);
}
/**
* {@inheritDoc}
* @internal generated method: use only when explicitly handling proxy specific loading logic
*/
public function __isInitialized()
{
return $this->__isInitialized__;
}
/**
* {@inheritDoc}
* @internal generated method: use only when explicitly handling proxy specific loading logic
*/
public function __setInitialized($initialized)
{
$this->__isInitialized__ = $initialized;
}
/**
* {@inheritDoc}
* @internal generated method: use only when explicitly handling proxy specific loading logic
*/
public function __setInitializer(\Closure $initializer = null)
{
$this->__initializer__ = $initializer;
}
/**
* {@inheritDoc}
* @internal generated method: use only when explicitly handling proxy specific loading logic
*/
public function __getInitializer()
{
return $this->__initializer__;
}
/**
* {@inheritDoc}
* @internal generated method: use only when explicitly handling proxy specific loading logic
*/
public function __setCloner(\Closure $cloner = null)
{
$this->__cloner__ = $cloner;
}
/**
* {@inheritDoc}
* @internal generated method: use only when explicitly handling proxy specific cloning logic
*/
public function __getCloner()
{
return $this->__cloner__;
}
/**
* {@inheritDoc}
* @internal generated method: use only when explicitly handling proxy specific loading logic
* @static
*/
public function __getLazyProperties()
{
return self::$lazyPropertiesDefaults;
}
/**
* {@inheritDoc}
*/
public function getDataset()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getDataset', []);
return parent::getDataset();
}
/**
* {@inheritDoc}
*/
public function getGroup()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getGroup', []);
return parent::getGroup();
}
}
......@@ -179,7 +179,7 @@ class Option extends \App\Entity\Option implements \Doctrine\ORM\Proxy\Proxy
/**
* {@inheritDoc}
*/
public function getId(): int
public function getId()
{
if ($this->__isInitialized__ === false) {
return (int) parent::getId();
......
......@@ -5,7 +5,7 @@ namespace DoctrineProxies\__CG__\App\Entity;
/**
* DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR
*/
class Project extends \App\Entity\Project implements \Doctrine\ORM\Proxy\Proxy
class Survey extends \App\Entity\Survey implements \Doctrine\ORM\Proxy\Proxy
{
/**
* @var \Closure the callback responsible for loading properties in the proxy object. This callback is called with
......@@ -78,7 +78,7 @@ class Project extends \App\Entity\Project implements \Doctrine\ORM\Proxy\Proxy
public function __wakeup()
{
if ( ! $this->__isInitialized__) {
$this->__initializer__ = function (Project $proxy) {
$this->__initializer__ = function (Survey $proxy) {
$proxy->__setInitializer(null);
$proxy->__setCloner(null);
......
<?php
namespace DoctrineProxies\__CG__\App\Entity;
/**
* DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR
*/
class User extends \App\Entity\User implements \Doctrine\ORM\Proxy\Proxy
{
/**
* @var \Closure the callback responsible for loading properties in the proxy object. This callback is called with
* three parameters, being respectively the proxy object to be initialized, the method that triggered the
* initialization process and an array of ordered parameters that were passed to that method.
*
* @see \Doctrine\Common\Proxy\Proxy::__setInitializer
*/
public $__initializer__;
/**
* @var \Closure the callback responsible of loading properties that need to be copied in the cloned object
*
* @see \Doctrine\Common\Proxy\Proxy::__setCloner
*/
public $__cloner__;
/**
* @var boolean flag indicating if this object was already initialized
*
* @see \Doctrine\Common\Persistence\Proxy::__isInitialized
*/
public $__isInitialized__ = false;
/**
* @var array properties to be lazy loaded, with keys being the property
* names and values being their default values
*
* @see \Doctrine\Common\Proxy\Proxy::__getLazyProperties
*/
public static $lazyPropertiesDefaults = [];
/**
* @param \Closure $initializer
* @param \Closure $cloner
*/
public function __construct($initializer = null, $cloner = null)
{
$this->__initializer__ = $initializer;
$this->__cloner__ = $cloner;
}
/**
*
* @return array
*/
public function __sleep()
{
if ($this->__isInitialized__) {
return ['__isInitialized__', 'email', 'group'];
}
return ['__isInitialized__', 'email', 'group'];
}
/**
*
*/
public function __wakeup()
{
if ( ! $this->__isInitialized__) {
$this->__initializer__ = function (User $proxy) {
$proxy->__setInitializer(null);
$proxy->__setCloner(null);
$existingProperties = get_object_vars($proxy);
foreach ($proxy->__getLazyProperties() as $property => $defaultValue) {
if ( ! array_key_exists($property, $existingProperties)) {
$proxy->$property = $defaultValue;
}
}
};
}
}
/**
*
*/
public function __clone()
{
$this->__cloner__ && $this->__cloner__->__invoke($this, '__clone', []);
}
/**
* Forces initialization of the proxy
*/
public function __load()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);
}
/**
* {@inheritDoc}
* @internal generated method: use only when explicitly handling proxy specific loading logic
*/
public function __isInitialized()
{
return $this->__isInitialized__;
}
/**
* {@inheritDoc}
* @internal generated method: use only when explicitly handling proxy specific loading logic
*/
public function __setInitialized($initialized)
{
$this->__isInitialized__ = $initialized;
}
/**
* {@inheritDoc}
* @internal generated method: use only when explicitly handling proxy specific loading logic
*/
public function __setInitializer(\Closure $initializer = null)
{
$this->__initializer__ = $initializer;
}
/**
* {@inheritDoc}
* @internal generated method: use only when explicitly handling proxy specific loading logic
*/
public function __getInitializer()
{
return $this->__initializer__;
}
/**