WIP remove orgId references from reporting

This commit is contained in:
John Woodlock
2012-05-15 23:06:13 +10:00
parent 3fe1fe761e
commit 29ab498e39
@@ -156,7 +156,6 @@ public class ReadExtraDataAndReportingServiceImpl implements
* String orgId = currentUser.getOrganisation().getId().toString(); put * String orgId = currentUser.getOrganisation().getId().toString(); put
* back in later * back in later
*/ */
String orgId = "1";
String sql; String sql;
if (name.equals(".")) { if (name.equals(".")) {
@@ -168,7 +167,7 @@ public class ReadExtraDataAndReportingServiceImpl implements
" order by r.report_name, rp.parameter_id"; " order by r.report_name, rp.parameter_id";
} else { } else {
try { try {
sql = getSQLtoRun(name, type, orgId, queryParams); sql = getSQLtoRun(name, type, queryParams);
} catch (SQLException e) { } catch (SQLException e) {
logger.info(name + ": Failed in getSQLtoRun"); logger.info(name + ": Failed in getSQLtoRun");
throw new WebApplicationException(Response throw new WebApplicationException(Response
@@ -238,7 +237,7 @@ public class ReadExtraDataAndReportingServiceImpl implements
} }
private String getSQLtoRun(final String name, final String type, private String getSQLtoRun(final String name, final String type,
final String orgId, final Map<String, String> queryParams) final Map<String, String> queryParams)
throws SQLException { throws SQLException {
String sql = null; String sql = null;
String rptDB = queryParams.get("${rptDB}"); String rptDB = queryParams.get("${rptDB}");
@@ -249,13 +248,9 @@ public class ReadExtraDataAndReportingServiceImpl implements
if (type.equals("report")) { if (type.equals("report")) {
sql = getReportSql(rptDB, name); sql = getReportSql(rptDB, name);
} else { } else {
// todo - dont need to check for orgID if special parameter sql (but
// prob need to check restrictions
sql = getParameterSql(rptDB, name); sql = getParameterSql(rptDB, name);
} }
sql = replace(sql, "${orgId}", orgId);
Set<String> keys = queryParams.keySet(); Set<String> keys = queryParams.keySet();
for (String key : keys) { for (String key : keys) {
String pValue = queryParams.get(key); String pValue = queryParams.get(key);