Commit e419289b authored by Tifenn Guillas's avatar Tifenn Guillas
Browse files

Merge branch '56-update-config-for-metamodel' into 'develop'

Resolve "Update config for metamodel"

Closes #56

See merge request !49
parents 9fd45fc1 0f2825d2
Pipeline #3140 failed with stages
in 53 seconds
......@@ -4,7 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [3.3.0]
## [3.4.0]
### Added
- #56: Added config attribute to Instance entity
## [3.3.0]
### Added
- #54: Added search by cone-search
......
......@@ -8,7 +8,7 @@ set -e
curl -d '{"label":"Test","dbname":"anis_test","dbtype":"pdo_pgsql","dbhost":"db","dbport":5432,"dblogin":"anis","dbpassword":"anis"}' -H "Content-Type: application/json" -X POST http://localhost/database
# Add default instance
curl -d '{"name":"default","label":"Default instance","client_url":"http://localhost:4200"}' -H "Content-Type: application/json" -X POST http://localhost/instance
curl -d '{"name":"default","label":"Default instance","client_url":"http://localhost:4200","config":{"search":true,"search_multiple":true}}' -H "Content-Type: application/json" -X POST http://localhost/instance
# Add ANIS, SVOM and COLIBRI projects
curl -d '{"name":"anis_project","label":"Anis Project Test","description":"Project used for testing","link":"http://project.com","manager":"M. Durand","id_database":1}' -H "Content-Type: application/json" -X POST http://localhost/project
......@@ -17,10 +17,10 @@ curl -d '{"name":"colibri","label":"Colibri Project Test","description":"Project
# Add default dataset family and ANIS datasets
curl -d '{"label":"Default dataset family","display":10}' -H "Content-Type: application/json" -X POST http://localhost/instance/default/dataset-family
curl -d '{"name":"obs_cat","table_ref":"obs_cat","label":"ObsCat dataset","description":"ObsCat","display":10,"count":10000,"vo":false,"data_path":"/mnt/mount","selectable_row":true,"config":{"cone_search":{"enabled":true,"column_ra":2,"column_dec":3}},"project_name":"anis_project"}' -H "Content-Type: application/json" -X POST http://localhost/dataset-family/1/dataset
curl -d '{"name":"observations","table_ref":"observations_info","label":"Observations dataset","description":"Observations","display":20,"count":177454,"vo":false,"data_path":"/mnt/mount","selectable_row":false,"config":{},"project_name":"anis_project"}' -H "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":30,"count":1000,"vo":false,"data_path":"/mnt/mount","selectable_row":false,"config":{},"project_name":"anis_project"}' -H "Content-Type: application/json" -X POST http://localhost/dataset-family/1/dataset
curl -d '{"name":"gama_g02_dr3","table_ref":"aspic_gama_g02","label":"GAMA G02 (DR3)","description":"GAMA G02 dataset","display":40,"count":8,"vo":false,"data_path":"/mnt/mount","selectable_row":false,"config":{},"project_name":"anis_project"}' -H "Content-Type: application/json" -X POST http://localhost/dataset-family/1/dataset
curl -d '{"name":"obs_cat","table_ref":"obs_cat","label":"ObsCat dataset","description":"ObsCat","display":10,"count":10000,"vo":false,"data_path":"/mnt/mount","config":{"cone_search":{"enabled":true,"column_ra":2,"column_dec":3},"selectable_row":true},"project_name":"anis_project"}' -H "Content-Type: application/json" -X POST http://localhost/dataset-family/1/dataset
curl -d '{"name":"observations","table_ref":"observations_info","label":"Observations dataset","description":"Observations","display":20,"count":177454,"vo":false,"data_path":"/mnt/mount","config":{"selectable_row":false},"project_name":"anis_project"}' -H "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":30,"count":1000,"vo":false,"data_path":"/mnt/mount","config":{"selectable_row":false},"project_name":"anis_project"}' -H "Content-Type: application/json" -X POST http://localhost/dataset-family/1/dataset
curl -d '{"name":"gama_g02_dr3","table_ref":"aspic_gama_g02","label":"GAMA G02 (DR3)","description":"GAMA G02 dataset","display":40,"count":8,"vo":false,"data_path":"/mnt/mount","config":{"selectable_row":false},"project_name":"anis_project"}' -H "Content-Type: application/json" -X POST http://localhost/dataset-family/1/dataset
# Add ANIS obs_cat default criteria family, default output family and default output category
curl -d '{"label":"Default criteria family","display":10}' -H "Content-Type: application/json" -X POST http://localhost/dataset/obs_cat/criteria-family
......@@ -29,9 +29,9 @@ curl -d '{"label":"Default output category","display":10}' -H "Content-Type: app
# Add SVOM dataset family and SVOM datasets
curl -d '{"label":"Svom dataset family","display":20}' -H "Content-Type: application/json" -X POST http://localhost/instance/default/dataset-family
curl -d '{"name":"l1","table_ref":"public.v_rawproducts","label":"L0 & L1","description":"L0 & L1 products list","display":10,"count":0,"vo":false,"data_path":"/mnt/mount","selectable_row":false,"config":{"results_server_link":{"enabled":true}},"project_name":"svom"}' -H "Content-Type: application/json" -X POST http://localhost/dataset-family/2/dataset
curl -d '{"name":"products","table_ref":"public.v_products","label":"Scientific Products","description":"SR3 & SR4 products list","display":20,"count":0,"vo":false,"data_path":"/mnt/mount","selectable_row":false,"config":{"results_server_link":{"enabled":true}},"project_name":"svom"}' -H "Content-Type: application/json" -X POST http://localhost/dataset-family/2/dataset
curl -d '{"name":"sp_cards","table_ref":"sp_cards","label":"SP Metadata","description":"Contains metadata of scientific products (Core Program & General Program)","display":30,"count":100,"vo":false,"data_path":"/mnt/mount","selectable_row":false,"config":{"results_server_link":{"enabled":true}},"project_name":"svom"}' -H "Content-Type: application/json" -X POST http://localhost/dataset-family/2/dataset
curl -d '{"name":"l1","table_ref":"public.v_rawproducts","label":"L0 & L1","description":"L0 & L1 products list","display":10,"count":0,"vo":false,"data_path":"/mnt/mount","config":{"results_server_link":{"enabled":true},"selectable_row":false},"project_name":"svom"}' -H "Content-Type: application/json" -X POST http://localhost/dataset-family/2/dataset
curl -d '{"name":"products","table_ref":"public.v_products","label":"Scientific Products","description":"SR3 & SR4 products list","display":20,"count":0,"vo":false,"data_path":"/mnt/mount","config":{"results_server_link":{"enabled":true},"selectable_row":false},"project_name":"svom"}' -H "Content-Type: application/json" -X POST http://localhost/dataset-family/2/dataset
curl -d '{"name":"sp_cards","table_ref":"sp_cards","label":"SP Metadata","description":"Contains metadata of scientific products (Core Program & General Program)","display":30,"count":100,"vo":false,"data_path":"/mnt/mount","config":{"results_server_link":{"enabled":true},"selectable_row":false},"project_name":"svom"}' -H "Content-Type: application/json" -X POST http://localhost/dataset-family/2/dataset
# Add SVOM l1 criteria families, default output family and default output category
curl -d '{"label":"Obs","display":10}' -H "Content-Type: application/json" -X POST http://localhost/dataset/l1/criteria-family
......@@ -100,7 +100,7 @@ curl -d '{"id":9,"name":"json_schema_uploaded","table_name":"sp_cards","label":"
# Add COLIBRI dataset family and COLIBRI dataset
curl -d '{"label":"Colibri dataset family","display":30}' -H "Content-Type: application/json" -X POST http://localhost/instance/default/dataset-family
curl -d '{"name":"anis_observation","table_ref":"anis_observation","label":"COLIBRI OBS","description":"colibri observations","display":10,"count":0,"vo":true,"data_path":"/mnt/mount","selectable_row":true,"config":{"cone_search":{"enabled":true,"column_ra":2,"column_dec":3}},"project_name":"colibri"}' -H "Content-Type: application/json" -X POST http://localhost/dataset-family/3/dataset
curl -d '{"name":"anis_observation","table_ref":"anis_observation","label":"COLIBRI OBS","description":"colibri observations","display":10,"count":0,"vo":true,"data_path":"/mnt/mount","config":{"cone_search":{"enabled":true,"column_ra":2,"column_dec":3},"selectable_row":true},"project_name":"colibri"}' -H "Content-Type: application/json" -X POST http://localhost/dataset-family/3/dataset
# Add COLIBRI anis_observation default criteria family, output families and output categories
curl -d '{"label":"Default criteria family","display":10}' -H "Content-Type: application/json" -X POST http://localhost/dataset/anis_observation/criteria-family
......@@ -127,11 +127,8 @@ curl -d '{"id":13,"name":"pack_calib","table_name":"anis_observation","label":"p
curl -d '{"id":14,"name":"readme_calib","table_name":"anis_observation","label":"readme_calib","form_label":"Calibration Readme (zip)","description":"Calibration Readme (zip)","output_display":140,"criteria_display":140,"search_flag":null,"search_type":null,"type":"string","operator":null,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"uri_action":null,"renderer":"download","display_detail":140,"selected":false,"order_by":false,"order_display":140,"detail":false,"renderer_detail":null,"options":null,"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":null,"id_output_category":7}' -H "Content-Type: application/json" -X PUT http://localhost/dataset/anis_observation/attribute/14
# Add ANIS vipers_dr2_w1 default criteria family, default output family and default output category
# id 8
curl -d '{"label":"Default criteria family","display":10}' -H "Content-Type: application/json" -X POST http://localhost/dataset/vipers_dr2_w1/criteria-family
# id 7
curl -d '{"label":"Default output family","display":10}' -H "Content-Type: application/json" -X POST http://localhost/dataset/vipers_dr2_w1/output-family
# id 8
curl -d '{"label":"Default output category","display":10}' -H "Content-Type: application/json" -X POST http://localhost/output-family/7/output-category
# Edit ANIS vipers_dr2_w1 attributes
......
......@@ -64,7 +64,6 @@ final class DatasetAction extends AbstractAction
'count',
'vo',
'data_path',
'selectable_row',
'config',
'id_dataset_family'
);
......@@ -117,7 +116,6 @@ final class DatasetAction extends AbstractAction
$dataset->setCount($parsedBody['count']);
$dataset->setVo($parsedBody['vo']);
$dataset->setDataPath($parsedBody['data_path']);
$dataset->setSelectableRow($parsedBody['selectable_row']);
$dataset->setConfig($parsedBody['config']);
$this->em->flush();
}
......
......@@ -83,7 +83,6 @@ final class DatasetListAction extends AbstractAction
'count',
'vo',
'data_path',
'selectable_row',
'config',
'project_name'
);
......@@ -136,7 +135,6 @@ final class DatasetListAction extends AbstractAction
$dataset->setCount($parsedBody['count']);
$dataset->setVo($parsedBody['vo']);
$dataset->setDataPath($parsedBody['data_path']);
$dataset->setSelectableRow($parsedBody['selectable_row']);
$dataset->setConfig($parsedBody['config']);
$dataset->setProject($project);
$dataset->setDatasetFamily($datasetFamily);
......
......@@ -94,6 +94,7 @@ final class InstanceAction extends AbstractAction
} else {
$instance->setClientUrl(null);
}
$instance->setConfig($parsedBody['config']);
$this->em->flush();
}
}
......@@ -74,6 +74,7 @@ final class InstanceListAction extends AbstractAction
if (!$this->isEmptyField('client_url', $parsedBody)) {
$instance->setClientUrl($parsedBody['client_url']);
}
$instance->setConfig($parsedBody['config']);
$this->em->persist($instance);
$this->em->flush();
......
......@@ -77,13 +77,6 @@ class Dataset implements \JsonSerializable
*/
protected $dataPath;
/**
* @var bool
*
* @Column(type="boolean", name="selectable_row", nullable=false)
*/
protected $selectableRow;
/**
* @var string
*
......@@ -195,16 +188,6 @@ class Dataset implements \JsonSerializable
$this->dataPath = $dataPath;
}
public function getSelectableRow()
{
return $this->selectableRow;
}
public function setSelectableRow($selectableRow)
{
$this->selectableRow = $selectableRow;
}
public function getConfig()
{
return $this->config;
......@@ -251,7 +234,6 @@ class Dataset implements \JsonSerializable
'count' => $this->getCount(),
'vo' => $this->getVo(),
'data_path' => $this->getDataPath(),
'selectable_row' => $this->getSelectableRow(),
'config' => $this->getConfig(),
'project_name' => $this->getProject()->getName(),
'id_dataset_family' => $this->getDatasetFamily()->getId()
......
......@@ -42,6 +42,13 @@ class Instance implements \JsonSerializable
*/
protected $clientUrl;
/**
* @var string
*
* @Column(type="json", nullable=true)
*/
protected $config;
/**
* @var Anis\Entity\DatasetFamily[]
*
......@@ -81,6 +88,16 @@ class Instance implements \JsonSerializable
$this->clientUrl = $clientUrl;
}
public function getConfig()
{
return $this->config;
}
public function setConfig($config)
{
$this->config = $config;
}
public function getDatasetFamilies()
{
return $this->datasetFamilies;
......@@ -101,6 +118,7 @@ class Instance implements \JsonSerializable
'name' => $this->getName(),
'label' => $this->getLabel(),
'client_url' => $this->getClientUrl(),
'config' => $this->getConfig(),
'nb_dataset_families' => $this->getDatasetFamilies()->count(),
'nb_datasets' => $this->getNbDatasets()
];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment