int parent = WebUtility.getOptionalIntRequestParameter(request, "parent", -1);
int type = WebUtility.getOptionalIntRequestParameter(request, "type", -1);
WebUser user = SessionUtils.getWebUser(request.getSession());
MeasurementPreferences preferences = user.getMeasurementPreferences();
MetricRangePreferences rangePreferences = preferences.getMetricRangePreferences();
Subject subject = user.getSubject();
// Get metric range defaults
long begin = rangePreferences.begin;
long end = rangePreferences.end;