#!/bin/sh
set -e

# Create the settings database (only tables)
./vendor/bin/doctrine orm:schema-tool:create

# Add anis_test database
curl -d '{"label":"Test","dbname":"anis_test","dbtype":"pdo_pgsql","dbhost":"db","dbport":5432,"dblogin":"anis","dbpassword":"anis"}' --header 'Content-Type: application/json' -X POST http://localhost/database

# Add default instance
curl -d '{"name":"default","label":"Default instance","description":"Instance for the test","scientific_manager":"M. Durand","instrument":"Multiple","wavelength_domain":"Visible imaging / Spectroscopy","display":10,"data_path":"\/DEFAULT","files_path":"\/INSTANCE_FILES","public":true,"portal_logo":"","design_color":"#7AC29A","design_background_color":"#ffffff","design_logo":"/logo.png","design_favicon":"/favicon.ico","navbar_background_color":"#F8F9FA","navbar_border_bottom_color":"#DEE2E6","navbar_color_href":"#000000","navbar_font_family":"Roboto, sans-serif","navbar_sign_in_btn_color":"#28A745","navbar_user_btn_color":"#7AC29A","footer_background_color":"#F8F9FA","footer_border_top_color":"#DEE2E6","footer_text_color":"#000000","footer_logos":[{"href":"http:\/\/lam.fr","title":"Laboratoire d'\''Astrophysique de Marseille","file":"\/logo_lam_s.png","display":20},{"href":"http:\/\/www.univ-amu.fr","title":"Aix*Marseille Universit\u00e9","file":"\/logo_amu_s.png","display":30},{"href":"http:\/\/anis.lam.fr","title":"AstroNomical Information System","file":"\/cesam_anis40.png","display":50},{"href":"http:\/\/cesam.lam.fr","title":"Centre de donn\u00e9es Astrophysique de Marseille","file":"\/logo_cesam_s.png","display":10},{"href":"http:\/\/www.insu.cnrs.fr","title":"Institut National des Sciences de l'\''Univers","file":"\/logo_insu_s.png","display":40}],"family_border_color":"#DFDFDF","family_header_background_color":"#F7F7F7","family_title_color":"#007BFF","family_title_bold":false,"family_background_color":"#FFFFFF","family_color":"#212529","progress_bar_title":"Dataset search","progress_bar_title_color":"#000000","progress_bar_subtitle":"Select a dataset, add criteria, select output columns and display the result.","progress_bar_subtitle_color":"#6C757D","progress_bar_step_dataset_title":"Dataset selection","progress_bar_step_criteria_title":"Search criteria","progress_bar_step_output_title":"Output columns","progress_bar_step_result_title":"Result table","progress_bar_color":"#E9ECEF","progress_bar_active_color":"#7AC29A","progress_bar_circle_color":"#FFFFFF","progress_bar_circle_icon_color":"#CCCCCC","progress_bar_circle_icon_active_color":"#FFFFFF","progress_bar_text_color":"#91B2BF","result_header_background_color":"#E9ECEF","result_header_text_color":"#000000","result_header_btn_color":"#007BFF","result_header_btn_hover_color":"#0069D9","result_header_btn_text_color":"#FFFFFF","result_datatable_bordered":true,"result_datatable_border_color":"#DEE2E6","result_datatable_header_background_color":"#FFFFFF","result_datatable_header_text_color":"#000000","result_datatable_rows_background_color":"#FFFFFF","result_datatable_rows_text_color":"#000000","result_datatable_sorted_color":"#C5C5C5","result_datatable_sorted_active_color":"#000000","result_datatable_link_color":"#007BFF","result_datatable_link_hover_color":"#0056B3","result_datatable_rows_selected_color":"#7AC29A","samp_enabled":true,"back_to_portal":true,"user_menu_enabled":true,"search_by_criteria_allowed":true,"search_by_criteria_label":"Search","search_multiple_allowed":false,"search_multiple_label":"Search multiple","search_multiple_all_datasets_selected":false,"documentation_allowed":false,"documentation_label":"Documentation"}' --header 'Content-Type: application/json' -X POST http://localhost/instance

# Add dataset families
curl -d '{"label":"Default dataset family","display":10,"opened":true}' --header 'Content-Type: application/json' -X POST http://localhost/instance/default/dataset-family
curl -d '{"label":"SVOM dataset family","display":20,"opened":true}' --header 'Content-Type: application/json' -X POST http://localhost/instance/default/dataset-family
curl -d '{"label":"IRiS dataset family","display":30,"opened":true}' --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","public":true,"download_json":true,"download_csv":true,"download_ascii":true,"download_vo":false,"server_link_enabled":false,"datatable_enabled":true,"datatable_selectable_rows":false,"id_database":1}' --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":30,"data_path":"","public":true,"download_json":true,"download_csv":true,"download_ascii":true,"download_vo":false,"server_link_enabled":false,"datatable_enabled":true,"datatable_selectable_rows":false,"id_database":1}' --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","public":true,"download_json":true,"download_csv":true,"download_ascii":true,"download_vo":false,"server_link_enabled":false,"datatable_enabled":true,"datatable_selectable_rows":false,"id_database":1}' --header 'Content-Type: application/json' -X POST http://localhost/dataset-family/3/dataset
curl -d '{"name":"iris_obspack","table_ref":"obs_pack","label":"Observation Run","description":"Contains the list of observation runs","display":20,"data_path":"","public":true,"id_database":1,"id_dataset_family":3,"download_json":true,"download_csv":true,"download_ascii":true,"download_vo":false,"server_link_enabled":false,"datatable_enabled":true,"datatable_selectable_rows":false}' --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":"\/ASPIC\/VVDS_F02_UDEEP","public":true,"download_json":true,"download_csv":true,"download_ascii":true,"download_vo":false,"server_link_enabled":false,"datatable_enabled":true,"datatable_selectable_rows":false,"id_database":1}' --header 'Content-Type: application/json' -X POST http://localhost/dataset-family/1/dataset
curl -d '{"name":"products","table_ref":"products","label":"Scientific Products","description":"SR3 & SR4 products list","display":20,"data_path":"","public":true,"download_json":true,"download_csv":true,"download_ascii":true,"download_vo":false,"server_link_enabled":false,"datatable_enabled":true,"datatable_selectable_rows":false,"id_database":1}' --header 'Content-Type: application/json' -X POST http://localhost/dataset-family/2/dataset

# Add vipers_dr2_w1 attributes
curl -d '{"label":"Default","display":10,"opened":true}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vipers_dr2_w1/criteria-family
curl -d '{"label":"Default","display":10,"opened":true}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vipers_dr2_w1/output-family
curl -d '{"label":"Default","display":10}' --header 'Content-Type: application/json' -X POST http://localhost/output-family/1/output-category

curl -d '{"id":1,"name":"num","label":"num","form_label":"num","description":null,"primary_key":true,"output_display":10,"criteria_display":10,"search_type":"field","type":"decimal","operator":"eq","dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":"detail-link","renderer_config":{"display":"text"},"detail_display":10,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"options":null,"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":1,"id_output_category":1,"id_detail_output_category":1}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vipers_dr2_w1/attribute
curl -d '{"id":2,"name":"alpha","label":"alpha","form_label":"alpha","description":null,"primary_key":false,"output_display":20,"criteria_display":20,"search_type":null,"type":"decimal","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":20,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"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":1,"id_detail_output_category":1}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vipers_dr2_w1/attribute
curl -d '{"id":3,"name":"delta","label":"delta","form_label":"delta","description":null,"primary_key":false,"output_display":30,"criteria_display":30,"search_type":null,"type":"decimal","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":30,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"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":1,"id_detail_output_category":1}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vipers_dr2_w1/attribute
curl -d '{"id":4,"name":"selmag","label":"selmag","form_label":"selmag","description":null,"primary_key":false,"output_display":40,"criteria_display":40,"search_type":null,"type":"decimal","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":40,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"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":1,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vipers_dr2_w1/attribute
curl -d '{"id":5,"name":"errselmag","label":"errselmag","form_label":"errselmag","description":null,"primary_key":false,"output_display":50,"criteria_display":50,"search_type":null,"type":"decimal","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":50,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"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":1,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vipers_dr2_w1/attribute
curl -d '{"id":6,"name":"pointing","label":"pointing","form_label":"pointing","description":null,"primary_key":false,"output_display":60,"criteria_display":60,"search_type":null,"type":"string","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":60,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"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":1,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vipers_dr2_w1/attribute
curl -d '{"id":7,"name":"quadrant","label":"quadrant","form_label":"quadrant","description":null,"primary_key":false,"output_display":70,"criteria_display":70,"search_type":null,"type":"decimal","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":70,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"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":1,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vipers_dr2_w1/attribute
curl -d '{"id":8,"name":"zspec","label":"zspec","form_label":"zspec","description":null,"primary_key":false,"output_display":80,"criteria_display":80,"search_type":"between","type":"decimal","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":80,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"options":null,"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":1,"id_output_category":1,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vipers_dr2_w1/attribute
curl -d '{"id":9,"name":"zflg","label":"zflg","form_label":"zflg","description":null,"primary_key":false,"output_display":90,"criteria_display":90,"search_type":"datalist","type":"decimal","operator":"in","dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":90,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"options":[{"label":"1,2,3,4,9","value":"1,2,3,4,9","display":10},{"label":"2,3,4,9","value":"2,3,4,9","display":20},{"label":"3,4","value":"3,4","display":30},{"label":"1,2,3,4,9,21,22,23,24,29","value":"1,2,3,4,9,21,22,23,24,29","display":40},{"label":"2,3,4,9,22,23,24,29","value":"2,3,4,9,22,23,24,29","display":50}],"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":1,"id_output_category":1,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vipers_dr2_w1/attribute
curl -d '{"id":10,"name":"norm","label":"norm","form_label":"norm","description":null,"primary_key":false,"output_display":100,"criteria_display":100,"search_type":null,"type":"decimal","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":100,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"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":1,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vipers_dr2_w1/attribute
curl -d '{"id":11,"name":"epoch","label":"epoch","form_label":"epoch","description":null,"primary_key":false,"output_display":110,"criteria_display":110,"search_type":null,"type":"decimal","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":110,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"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":null,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vipers_dr2_w1/attribute
curl -d '{"id":12,"name":"photomask","label":"photomask","form_label":"photomask","description":null,"primary_key":false,"output_display":120,"criteria_display":120,"search_type":null,"type":"decimal","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":120,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"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":null,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vipers_dr2_w1/attribute
curl -d '{"id":56,"name":"spec1d","label":"spec1d","form_label":"spec1d","description":null,"primary_key":false,"output_display":560,"criteria_display":560,"search_type":null,"type":"text","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":"download","renderer_config":{"display":"icon-button","text":"DOWNLOAD","icon":"fas fa-download"},"detail_display":560,"detail_renderer":"download","detail_renderer_config":{"display":"icon-button","text":"DOWNLOAD","icon":"fas fa-download"},"selected":true,"order_by":false,"archive":false,"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":1,"id_detail_output_category":1}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vipers_dr2_w1/attribute
curl -d '{"id":57,"name":"spec1dnoise","label":"spec1dnoise","form_label":"spec1dnoise","description":null,"primary_key":false,"output_display":570,"criteria_display":570,"search_type":null,"type":"text","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":"download","renderer_config":{"display":"icon-button","text":"DOWNLOAD","icon":"fas fa-download"},"detail_display":570,"detail_renderer":"download","detail_renderer_config":{"display":"icon-button","text":"DOWNLOAD","icon":"fas fa-download"},"selected":true,"order_by":false,"archive":false,"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":1,"id_detail_output_category":1}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vipers_dr2_w1/attribute
curl -d '{"id":58,"name":"spec1dsky","label":"spec1dsky","form_label":"spec1dsky","description":null,"primary_key":false,"output_display":580,"criteria_display":580,"search_type":null,"type":"text","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":"download","renderer_config":{"display":"icon-button","text":"DOWNLOAD","icon":"fas fa-download"},"detail_display":580,"detail_renderer":"download","detail_renderer_config":{"display":"icon-button","text":"DOWNLOAD","icon":"fas fa-download"},"selected":true,"order_by":false,"archive":false,"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":1,"id_detail_output_category":1}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vipers_dr2_w1/attribute

# Add vipers_dr2_w1 detail config
curl -d '{"content":"<div class=\"row\">\n    <div class=\"col-md-8 col-sm-12\">\n        <app-display-spectra\n            [object]=\"context.object\"\n            [datasetName]=\"context.dataset.name\"\n            [attributeList]=\"context.attributeList\"\n            [attributeSpectraId]=\"56\"\n            [attributeZId]=\"8\">\n        </app-display-spectra>\n    </div>\n    <div class=\"col-md-4 col-sm-12\">\n        <app-display-ra-dec\n            [object]=\"context.object\"\n            [attributeList]=\"context.attributeList\"\n            [attributeRaId]=\"2\"\n            [attributeDecId]=\"3\">\n        </app-display-ra-dec>\n        <app-display-object \n            [object]=\"context.object\"\n            [dataset]=\"context.dataset\"\n            [instance]=\"context.instance\"\n            [attributeList]=\"context.attributeList\"\n            [outputFamilyList]=\"context.outputFamilyList\"\n           [outputCategoryList]=\"context.outputCategoryList\"\n            [queryParams]=\"context.queryParams\">\n        </app-display-object>\n    </div>\n</div>\n","style_sheet":""}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vipers_dr2_w1/detail-config

# Add sp_cards attributes
curl -d '{"label":"Card","display":10,"opened":true}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/sp_cards/criteria-family
curl -d '{"label":"Default","display":10,"opened":true}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/sp_cards/output-family
curl -d '{"label":"Default","display":10}' --header 'Content-Type: application/json' -X POST http://localhost/output-family/2/output-category

curl -d '{"id":1,"name":"acronym","label":"acronym","form_label":"Product Acronym","description":null,"primary_key":true,"output_display":10,"criteria_display":10,"search_type":"select","type":"string","operator":"eq","dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":[],"detail_display":10,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"options":[{"label":"LAMTEST","value":"LAMTEST","display":10},{"label":"LAMTEST_DC1","value":"LAMTEST_DC1","display":20},{"label":"MXT-EVT-CAL","value":"MXT-EVT-CAL","display":30},{"label":"OBLC_ECL","value":"OBLC_ECL","display":40}],"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":2,"id_output_category":2,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/sp_cards/attribute
curl -d '{"id":2,"name":"sp_id","label":"sp_id","form_label":"SP IAP ID","description":null,"primary_key":false,"output_display":20,"criteria_display":20,"search_type":null,"type":"integer","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":20,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"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":2,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/sp_cards/attribute
curl -d '{"id":3,"name":"version","label":"version","form_label":"Version","description":null,"primary_key":false,"output_display":30,"criteria_display":30,"search_type":null,"type":"float","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":30,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"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":2,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/sp_cards/attribute
curl -d '{"id":4,"name":"program","label":"program","form_label":"Program","description":null,"primary_key":false,"output_display":40,"criteria_display":40,"search_type":"select","type":"string","operator":"eq","dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":40,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"options":[{"label":"CP","value":"CP","display":10},{"label":"GP","value":"GP","display":20}],"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":2,"id_output_category":2,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/sp_cards/attribute
curl -d '{"id":5,"name":"instrument","label":"instrument","form_label":"Instrument","description":null,"primary_key":false,"output_display":50,"criteria_display":50,"search_type":"select","type":"string","operator":"eq","dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":50,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"options":[{"label":"ALL","value":"ALL","display":10},{"label":"MXT","value":"MXT","display":20}],"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":2,"id_output_category":2,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/sp_cards/attribute
curl -d '{"id":6,"name":"type","label":"type","form_label":"Type","description":null,"primary_key":false,"output_display":60,"criteria_display":60,"search_type":null,"type":"string","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":60,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"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":2,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/sp_cards/attribute
curl -d '{"id":7,"name":"json_schema","label":"json_schema","form_label":"JSON Schema (original)","description":null,"primary_key":false,"output_display":70,"criteria_display":70,"search_type":null,"type":"json","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":"json","renderer_config":[],"detail_display":70,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"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":2,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/sp_cards/attribute
curl -d '{"id":8,"name":"search_kw","label":"search_kw","form_label":"KWs searchable","description":null,"primary_key":false,"output_display":80,"criteria_display":80,"search_type":null,"type":"json","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":"json","renderer_config":[],"detail_display":80,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"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":2,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/sp_cards/attribute
curl -d '{"id":9,"name":"json_schema_uploaded","label":"json_schema_uploaded","form_label":"json_schema_uploaded","description":null,"primary_key":false,"output_display":90,"criteria_display":90,"search_type":null,"type":"json","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":90,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"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":null,"id_detail_output_category":null,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/sp_cards/attribute

# Add observations attributes
curl -d '{"label":"Default","display":10,"opened":true}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/observations/criteria-family
curl -d '{"label":"Default parameters","display":10,"opened":true}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/observations/output-family
curl -d '{"label":"Astrometry","display":10}' --header 'Content-Type: application/json' -X POST http://localhost/output-family/3/output-category
curl -d '{"label":"Observation","display":10}' --header 'Content-Type: application/json' -X POST http://localhost/output-family/3/output-category

curl -d '{"id":1,"name":"id","label":"id","form_label":"id","description":"Observation Ident","primary_key":true,"output_display":10,"criteria_display":10,"search_type":null,"type":"integer","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":"detail-link","renderer_config":{"display":"text"},"detail_display":10,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"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":3,"id_detail_output_category":4}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/observations/attribute
curl -d '{"id":2,"name":"ra","label":"ra","form_label":"Alpha J2000","description":"Alpha J2000","primary_key":false,"output_display":20,"criteria_display":20,"search_type":null,"type":"float","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":20,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"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":3,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/observations/attribute
curl -d '{"id":3,"name":"dec","label":"dec","form_label":"Delta J2000","description":"Delta J2000","primary_key":false,"output_display":30,"criteria_display":30,"search_type":null,"type":"float","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":30,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"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":3,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/observations/attribute
curl -d '{"id":4,"name":"date_time","label":"date_time","form_label":"Date Time","description":"Date Time","primary_key":false,"output_display":40,"criteria_display":40,"search_type":"between-date","type":"datetime","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":40,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"options":null,"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":3,"id_output_category":4,"id_detail_output_category":4}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/observations/attribute
curl -d '{"id":5,"name":"exposure_time","label":"exposure_time","form_label":"Exposure Time","description":"Exposure Time","primary_key":false,"output_display":50,"criteria_display":50,"search_type":"between","type":"integer","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":50,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"options":null,"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":3,"id_output_category":4,"id_detail_output_category":4}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/observations/attribute
curl -d '{"id":6,"name":"filter","label":"filter","form_label":"Filter","description":"Filter","primary_key":false,"output_display":60,"criteria_display":60,"search_type":"select","type":"string","operator":"eq","dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":60,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"options":[{"label":"Halpha","value":"Halpha","display":10},{"label":"SDSS g","value":"SDSS g","display":20}],"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":3,"id_output_category":4,"id_detail_output_category":4}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/observations/attribute
curl -d '{"id":7,"name":"object_name","label":"object_name","form_label":"Object name","description":"Object name","primary_key":false,"output_display":70,"criteria_display":70,"search_type":"field","type":"string","operator":"lk","dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":"link","renderer_config":{"href":"http:\/\/cdsportal.u-strasbg.fr\/?target=$value","display":"text","text":"$value","icon":"fas fa-link","blank":true},"detail_display":70,"detail_renderer":"link","detail_renderer_config":{"href":"http:\/\/cdsportal.u-strasbg.fr\/?target=$value","display":"text","text":"$value","icon":"fas fa-link","blank":true},"selected":true,"order_by":true,"archive":false,"detail":false,"options":null,"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":3,"id_output_category":4,"id_detail_output_category":4}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/observations/attribute
curl -d '{"id":8,"name":"fits_file","label":"fits_file","form_label":"fits_file","description":null,"primary_key":false,"output_display":80,"criteria_display":80,"search_type":null,"type":"string","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":"download","renderer_config":{"display":"icon-button","text":"DOWNLOAD","icon":"fas fa-download"},"detail_display":80,"detail_renderer":"download","detail_renderer_config":{"display":"icon-button","text":"DOWNLOAD","icon":"fas fa-download"},"selected":true,"order_by":false,"archive":false,"detail":false,"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":4,"id_detail_output_category":4}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/observations/attribute
curl -d '{"id":9,"name":"fits_png","label":"fits_png","form_label":"fits_png","description":null,"primary_key":false,"output_display":90,"criteria_display":90,"search_type":null,"type":"string","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":"image","renderer_config":{"type":"fits","display":"modal","width":"50","height":"50"},"detail_display":90,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":false,"archive":false,"detail":false,"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":4,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/observations/attribute
curl -d '{"id":10,"name":"id_obspack","label":"id_obspack","form_label":"id_obspack","description":null,"primary_key":false,"type":"integer","search_type":null,"operator":null,"dynamic_operator":null,"min":null,"max":null,"options":null,"placeholder_min":null,"placeholder_max":null,"criteria_display":100,"output_display":100,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"renderer":"link","renderer_config":{"href":"/instance/default/search/result/iris_obspack?s=100&a=1;2;3&c=1::eq::$value","display":"text","text":"$value","icon":"fas fa-link","blank":false},"order_by":true,"archive":false,"detail_display":100,"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":4,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/observations/attribute

# Add observations detail config
curl -d '{"content":"<h1 class=\"text-center\">\n    <app-display-value-by-attribute\n        [object]=\"context.object\"\n        [attributeList]=\"context.attributeList\"\n        [attributeId]=\"7\">\n    </app-display-value-by-attribute>\n</h1>\n<div class=\"row\">\n    <div class=\"col-md-8 col-sm-12 col-xs-12\">\n        <app-display-image\n            [object]=\"context.object\"\n            [attributeList]=\"context.attributeList\"\n            [dataset]=\"context.dataset\"\n            [attributeImageId]=\"9\"\n            [type]=\"'\''fits'\''\">\n        </app-display-image>\n    </div>\n    <div class=\"col-md-4 col-sm-12 col-xs-12\">\n        <app-display-ra-dec\n            [object]=\"context.object\"\n            [attributeList]=\"context.attributeList\"\n            [attributeRaId]=\"2\"\n            [attributeDecId]=\"3\">\n        </app-display-ra-dec>\n        <app-display-object-by-output-category\n            [object]=\"context.object\"\n            [dataset]=\"context.dataset\"\n            [instance]=\"context.instance\"\n            [attributeList]=\"context.attributeList\"\n            [outputCategoryList]=\"context.outputCategoryList\"\n            [queryParams]=\"context.queryParams\"\n            [outputCategoryId]=\"4\">\n        </app-display-object-by-output-category>\n    </div>\n</div>\n","style_sheet":"h1 {\n    color: red;\n}\n\n.panel-heading.card-header {\n    background-color: #dee2ff;\n}\n\n.panel .btn.btn-link .text-primary {\n    color: red !important;\n}\n"}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/observations/detail-config

# Add vvds_f02_udeep attributes
curl -d '{"label":"Default","display":10,"opened":true}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vvds_f02_udeep/criteria-family
curl -d '{"label":"Default","display":10,"opened":true}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vvds_f02_udeep/output-family
curl -d '{"label":"Default","display":10}' --header 'Content-Type: application/json' -X POST http://localhost/output-family/4/output-category

curl -d '{"id":1,"name":"vvds_ident","label":"vvds_ident","form_label":"vvds_ident","description":null,"primary_key":true,"output_display":10,"criteria_display":10,"search_type":null,"type":"decimal","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":10,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"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":5,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vvds_f02_udeep/attribute
curl -d '{"id":2,"name":"id_iau","label":"id_iau","form_label":"id_iau","description":null,"primary_key":false,"output_display":20,"criteria_display":20,"search_type":null,"type":"string","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":20,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"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":5,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vvds_f02_udeep/attribute
curl -d '{"id":3,"name":"alpha","label":"alpha","form_label":"alpha","description":null,"primary_key":false,"output_display":30,"criteria_display":30,"search_type":null,"type":"decimal","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":30,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"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":5,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vvds_f02_udeep/attribute
curl -d '{"id":4,"name":"delta","label":"delta","form_label":"delta","description":null,"primary_key":false,"output_display":40,"criteria_display":40,"search_type":null,"type":"decimal","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":40,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"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":5,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vvds_f02_udeep/attribute
curl -d '{"id":5,"name":"z_spec","label":"z_spec","form_label":"z_spec","description":null,"primary_key":false,"output_display":50,"criteria_display":50,"search_type":"between","type":"decimal","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":50,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"options":null,"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":4,"id_output_category":5,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vvds_f02_udeep/attribute
curl -d '{"id":6,"name":"zflag","label":"zflag","form_label":"zflag","description":null,"primary_key":false,"output_display":60,"criteria_display":60,"search_type":null,"type":"decimal","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":60,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"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":5,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vvds_f02_udeep/attribute
curl -d '{"id":7,"name":"sel_mag","label":"sel_mag","form_label":"sel_mag","description":null,"primary_key":false,"output_display":70,"criteria_display":70,"search_type":"between","type":"decimal","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_display":70,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"options":null,"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":4,"id_output_category":5,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vvds_f02_udeep/attribute

# Add vvds_f02_udeep cone search
curl -d '{"enabled":true,"opened":false,"column_ra":3,"column_dec":4,"resolver_enabled":true,"default_ra":null,"default_dec":null,"default_radius":2.0,"default_ra_dec_unit":"degree","plot_enabled":true}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vvds_f02_udeep/cone-search-config

# Add vvds_f02_udeep image
curl -d '{"label":"Mag i","file_path":"/IMAGES/CFHTLS_D-85_i_022559-042940_T0007_MEDIAN.fits","file_size":1498320000,"ra_min":35.994643451078,"ra_max":36.99765934121,"dec_min":-3.9943006310031,"dec_max":-4.9941936740893,"stretch":"linear","pmin":0.2,"pmax":99}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/vvds_f02_udeep/image

# Add products attributes
curl -d '{"label":"Obs","display":10,"opened":true}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/products/criteria-family
curl -d '{"label":"Card","display":20,"opened":true}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/products/criteria-family
curl -d '{"label":"Default","display":10,"opened":true}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/products/output-family
curl -d '{"label":"Default","display":10}' --header 'Content-Type: application/json' -X POST http://localhost/output-family/5/output-category
curl -d '{"label":"Additionnal","display":20}' --header 'Content-Type: application/json' -X POST http://localhost/output-family/5/output-category

curl -d '{"id":1,"name":"product_id","label":"product_id","form_label":"Product ID","description":null,"primary_key":true,"output_display":10,"criteria_display":10,"search_type":"field","type":"integer","operator":"eq","dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":[],"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"detail_display":10,"options":[],"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":5,"id_output_category":6,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/products/attribute
curl -d '{"id":2,"name":"obs_id","label":"obs_id","form_label":"Observation ID","description":null,"primary_key":false,"output_display":20,"criteria_display":20,"search_type":"field","type":"bigint","operator":"eq","dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"detail_display":20,"options":[],"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":5,"id_output_category":6,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/products/attribute
curl -d '{"id":3,"name":"acronym","label":"acronym","form_label":"Product Acronym","description":null,"primary_key":false,"output_display":30,"criteria_display":30,"search_type":"select","type":"string","operator":"eq","dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"detail_display":30,"options":[{"label":"ECL-DET-UBC","value":"ECL-DET-UBC","display":10},{"label":"OBLC_ECL","value":"OBLC_ECL","display":20}],"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":6,"id_output_category":6,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/products/attribute
curl -d '{"id":4,"name":"url","label":"url","form_label":"Product URL","description":null,"primary_key":false,"output_display":40,"criteria_display":40,"search_type":null,"type":"text","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":"link","renderer_config":{"href":"$value","display":"text","text":"$value","icon":"fas fa-link","blank":true},"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"detail_display":40,"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":6,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/products/attribute
curl -d '{"id":5,"name":"criteria","label":"criteria","form_label":"Product criteria (based on KWs searchables)","description":null,"primary_key":false,"output_display":50,"criteria_display":50,"search_type":"svom_json_kw","type":"json","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":"json","renderer_config":[],"detail_renderer":null,"detail_renderer_config":null,"selected":false,"order_by":true,"archive":false,"detail":false,"detail_display":50,"options":[],"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":6,"id_output_category":7,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/products/attribute
curl -d '{"id":6,"name":"added_at","label":"added_at","form_label":"Added at","description":null,"primary_key":false,"output_display":60,"criteria_display":60,"search_type":"between-date","type":"datetime","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"detail_display":60,"options":[],"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":5,"id_output_category":6,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/products/attribute
curl -d '{"id":7,"name":"product_version","label":"product_version","form_label":"Version","description":null,"primary_key":false,"output_display":70,"criteria_display":70,"search_type":null,"type":"integer","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"detail_display":70,"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":6,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/products/attribute
curl -d '{"id":8,"name":"program","label":"program","form_label":"Program","description":null,"primary_key":false,"output_display":80,"criteria_display":80,"search_type":"select","type":"string","operator":"eq","dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_renderer":null,"detail_renderer_config":null,"selected":false,"order_by":true,"archive":false,"detail":false,"detail_display":80,"options":[{"label":"CoreProgram","value":"CoreProgram","display":10},{"label":"GeneralProgram","value":"GeneralProgram","display":20}],"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":6,"id_output_category":7,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/products/attribute
curl -d '{"id":9,"name":"instrument","label":"instrument","form_label":"Instrument","description":null,"primary_key":false,"output_display":90,"criteria_display":90,"search_type":"select","type":"string","operator":"eq","dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_renderer":null,"detail_renderer_config":null,"selected":false,"order_by":true,"archive":false,"detail":false,"detail_display":90,"options":[{"label":"ECL","value":"ECL","display":10}],"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":6,"id_output_category":7,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/products/attribute
curl -d '{"id":10,"name":"type","label":"type","form_label":"Type","description":null,"primary_key":false,"output_display":100,"criteria_display":100,"search_type":null,"type":"string","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_renderer":null,"detail_renderer_config":null,"selected":false,"order_by":true,"archive":false,"detail":false,"detail_display":100,"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,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/products/attribute
curl -d '{"id":11,"name":"upload_filename","label":"upload_filename","form_label":"Filename","description":null,"primary_key":false,"output_display":110,"criteria_display":110,"search_type":null,"type":"string","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"detail_display":110,"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":6,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/products/attribute
curl -d '{"id":12,"name":"burst_id","label":"burst_id","form_label":"Burst ID","description":null,"primary_key":false,"output_display":120,"criteria_display":120,"search_type":"field","type":"string","operator":"eq","dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"order_by":true,"archive":false,"detail":false,"detail_display":120,"options":[],"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":5,"id_output_category":6,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/products/attribute
curl -d '{"id":13,"name":"pipeline_version","label":"pipeline_version","form_label":"Pipeline version","description":null,"primary_key":false,"output_display":130,"criteria_display":130,"search_type":null,"type":"float","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_renderer":null,"detail_renderer_config":null,"selected":false,"order_by":true,"archive":false,"detail":false,"detail_display":130,"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,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/products/attribute
curl -d '{"id":14,"name":"schema_version","label":"schema_version","form_label":"Schema version","description":null,"primary_key":false,"output_display":140,"criteria_display":140,"search_type":null,"type":"float","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_renderer":null,"detail_renderer_config":null,"selected":false,"order_by":true,"archive":false,"detail":false,"detail_display":140,"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,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/products/attribute
curl -d '{"id":15,"name":"src_id","label":"src_id","form_label":"SRC ID","description":null,"primary_key":false,"output_display":150,"criteria_display":150,"search_type":null,"type":"integer","operator":null,"dynamic_operator":true,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"renderer":null,"renderer_config":null,"detail_renderer":null,"detail_renderer_config":null,"selected":false,"order_by":true,"archive":false,"detail":false,"detail_display":150,"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,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/products/attribute

# Add iris_obspack attributes
curl -d '{"label":"Default","display":10,"opened":true}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/iris_obspack/criteria-family

curl -d '{"label":"Default","display":10,"opened":true}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/iris_obspack/output-family
curl -d '{"label":"Default","display":10}' --header 'Content-Type: application/json' -X POST http://localhost/output-family/6/output-category

curl -d '{"id":1,"name":"id","label":"id","form_label":"id","description":null,"primary_key":true,"type":"integer","search_type":"field","operator":"eq","dynamic_operator":null,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"criteria_display":10,"output_display":10,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"renderer":null,"renderer_config":null,"order_by":true,"archive":false,"detail_display":10,"options":null,"vo_utype":null,"vo_ucd":null,"vo_unit":null,"vo_description":null,"vo_datatype":null,"vo_size":null,"id_criteria_family":7,"id_output_category":8,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/iris_obspack/attribute
curl -d '{"id":2,"name":"date","label":"date","form_label":"date","description":null,"primary_key":false,"type":"datetime","search_type":null,"operator":null,"dynamic_operator":null,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"criteria_display":20,"output_display":20,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"renderer":null,"renderer_config":null,"order_by":true,"archive":false,"detail_display":20,"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":8,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/iris_obspack/attribute
curl -d '{"id":3,"name":"observer","label":"observer","form_label":"observer","description":null,"primary_key":false,"type":"string","search_type":null,"operator":null,"dynamic_operator":null,"min":null,"max":null,"placeholder_min":null,"placeholder_max":null,"criteria_display":30,"output_display":30,"detail_renderer":null,"detail_renderer_config":null,"selected":true,"renderer":null,"renderer_config":null,"order_by":true,"archive":false,"detail_display":30,"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":8,"id_detail_output_category":null}' --header 'Content-Type: application/json' -X POST http://localhost/dataset/iris_obspack/attribute

# Add webpages
curl -d '{"label":"Default","icon":null,"display":10}' --header 'Content-Type: application/json' -X POST http://localhost/instance/default/webpage-family
curl -d '{"name":"home","label":"Home","icon":"fas fa-home","display":10,"title":"Home","content":"<div class=\"row align-items-center jumbotron\">\n    <div class=\"col-6 col-md-4 order-md-2 mx-auto text-center\">\n        <img class=\"img-fluid mb-3 mb-md-0\" src=\"http://localhost:8080/instance/default/file-explorer/home_component_logo.png\" alt=\"Instance logo\">\n   </div>\n   <div class=\"col-md-8 order-md-1 text-justify pr-md-5\">\n       <h2 class=\"mb-3\">Welcome to the ANIS default instance</h2>\n       <p class=\"lead\">\n           This service provides several sub-services to interact with the database.<br>\n           Here is a brief presentation of these sub-services:\n       </p>\n       <ul class=\"lead\">\n           <li>\n               <a href=\"https://drf-gitlab.cea.fr/svom/sdb/api-import/-/wikis/home\">\n                   /import/\n               </a> =&gt; This sub-service allows you to import data L0, L1 or SR3/SR4\n           </li>\n           <li>\n               /export-rest =&gt; =&gt; This sub-service allows you to request and export data \n               from the database in json format with a specific URL. To build this URL you could \n               <a class=\"btn btn-warning\" href=\"/instance/default/search/dataset\">\n                   Go to search form\n               </a>\n           </li>\n       </ul>\n   </div>\n</div>\n<app-dataset-sample\n    [datasetName]=\"'\''observations'\''\"\n    [sortingColumn]=\"1\"\n    [sortingDirection]=\"'\''d'\''\"\n    [nbItems]=\"5\">\n</app-dataset-sample>","style_sheet":".lead {\n    color: #b60707;\n}"}' --header 'Content-Type: application/json' -X POST http://localhost/webpage-family/1/webpage
