private static final Logger log = Logger.getLogger(ManageMetric.class.getName());
@Get
public String represent() {
Metric metric = getMetric();
StringBuffer sb = new StringBuffer("");
sb.append("Metric Name: " + metric.getName());
sb.append(System.getProperty("line.separator"));
sb.append("Metric Date\t\t\t");
sb.append("Metric Value\t");
sb.append("Goal Name\t");
sb.append("Goal Value\t");
sb.append("Goal Met?\t");
sb.append("% to Goal\t");
sb.append(System.getProperty("line.separator"));
MetricValueDao valueDao = new MetricValueDao();
MetricGoalDao goalDao = new MetricGoalDao();
List<MetricGoal> metricGoals = goalDao.listByProperty("metricKey", metric.getKey());
Iterator<MetricValue> values = valueDao.listByProperty("metricKey", metric.getKey()).iterator();
while (values.hasNext()) {
MetricValue value = values.next();
for (int i=0; i< metricGoals.size(); i++) {
String isGoalMet = "N";
MetricGoal goal = metricGoals.get(i);