diff --git a/data-discovery/config/formatresponsefilter.properties b/data-discovery/config/formatresponsefilter.properties index f36192baf46147621eb78793a51c985726e89a48..a4a55a2e11871a2bf00806b1acb02b6b5dc783e6 100644 --- a/data-discovery/config/formatresponsefilter.properties +++ b/data-discovery/config/formatresponsefilter.properties @@ -1,6 +1,6 @@ -response_format=application/x-votable+xml -# response_format=application/x-vlkb+xml +#response_format=application/x-votable+xml +response_format=application/x-vlkb+xml # used to retrieve extraCards to add to FITS_header (VLKB-only) surveys_metadata_abs_pathname=/srv/vlkb/surveys/survey_populate.csv diff --git a/data-discovery/src/main/java/vlkb/common/Coord.java b/data-discovery/src/main/java/vlkb/common/Coord.java index 2e2db1f026c635a2995d0d0a28647eb6653824f6..73843040e4be191976336f4a33942eb3ca254266 100644 --- a/data-discovery/src/main/java/vlkb/common/Coord.java +++ b/data-discovery/src/main/java/vlkb/common/Coord.java @@ -23,16 +23,19 @@ class Coord double vel_up; double vel_low; - // constructors + private boolean API_VLKB_legacy = false; + Coord(Map<String, String[]> params) { - String id = getFirstValue(params, "ID"); - String pubdid = getFirstValue(params, "pubdid"); + String api_l = getFirstValue(params, "l"); + String api_b = getFirstValue(params, "b"); - if(id != null) - parseSoda(params); - else + API_VLKB_legacy = ((api_l != null) && (api_b != null)); + + if(API_VLKB_legacy) parseVlkb(params); + else + parseSoda(params); LOGGER.info("Parse result: " + toQueryString()); } @@ -157,7 +160,7 @@ class Coord throw new IllegalArgumentException("parameter " + key + " has no value."); } - +/* Coord(String lon, String lat, String radius, String velLow, String velUp) { try @@ -218,7 +221,7 @@ class Coord this.shape = "RECT"; this.vel_valid = false; } - +*/ void setSkySystem(String skySystem) { this.skySystem = skySystem; } void setSpecSystem(String velType) { this.vel_type = velType; } @@ -278,10 +281,17 @@ class Coord } + String toQueryString() + { + if(API_VLKB_legacy) + return toVlkbLegacyQueryString(); + else + return toVoQueryString(); + } // FIXME separate keywords into dictionary key-string (LON->"l" LAT->"b" SKYSYSTEM->"skysystem") // to be part of api/QueryStringParams.java - String toQueryString() + String toVlkbLegacyQueryString() { StringBuilder sb = new StringBuilder(); diff --git a/data-discovery/src/main/java/vlkb/webapi/FormatResponseFilter.java b/data-discovery/src/main/java/vlkb/webapi/FormatResponseFilter.java index c470f1e586a1b6c7d6f9f3d5597381078b1b9437..1cbdf4f01486aa32df099193751419ce19aafb35 100644 --- a/data-discovery/src/main/java/vlkb/webapi/FormatResponseFilter.java +++ b/data-discovery/src/main/java/vlkb/webapi/FormatResponseFilter.java @@ -104,13 +104,13 @@ public class FormatResponseFilter implements Filter Dataset[] datasetArr = convert(obsCoreArr, coord, // VLKB: calc overlap-code for velocity settings.serviceUrls.cutoutUrl(), - coord.toVoQueryString()); + coord.toQueryString()); SearchOutputData searchOutputData = SearchOutputData.marshall(datasetArr, subsurveyId, dbSubsurveyArr, settings.serviceUrls.mergeUrl(), - coord.toVoQueryString()); + coord.toQueryString()); final String respFormat = settings.serviceUrls.responseFormat(); LOGGER.info("responseFormat: " + respFormat);