Skip to content
Snippets Groups Projects
Commit 480ae8c8 authored by Robert Butora's avatar Robert Butora
Browse files

modifies API recognition: VLKB-legacy only if 'l'&'b' params present in query...

modifies API recognition: VLKB-legacy only if 'l'&'b' params present in query string and synchronizes it with cutout/merge URL generation (VLKB-legacy or VO-Siav2)
parent 7734a622
No related branches found
No related tags found
No related merge requests found
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
......
......@@ -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();
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment