Policy failures:   
Code warning
- failed on resource EvaluationController.java. Reason: ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized, line 83
- failed on resource Criterions.java. Reason: HashSet is a raw type. References to generic type HashSet<E> should be parameterized, line 11
- failed on resource AddConferenceController.java. Reason: HashSet is a raw type. References to generic type HashSet<E> should be parameterized, line 45
- failed on resource AddConferenceController.java. Reason: Map is a raw type. References to generic type Map<K,V> should be parameterized, line 103
- failed on resource Criterions.java. Reason: Set is a raw type. References to generic type Set<E> should be parameterized, line 11
... and more.  
Override reason:   
DWR
This commit is contained in:
Frederic Debuire
2008-01-24 16:23:39 +00:00
parent a4916a56e2
commit 28c3aaabba
10 changed files with 4488 additions and 12 deletions

View File

@@ -1,3 +0,0 @@
#Thu Jan 17 16:46:41 CET 2008
eclipse.preferences.version=1
encoding//WebContent/stylesheets/calendar.js=UTF-8

View File

@@ -3,7 +3,7 @@
<html>
<head>
<link rel="stylesheet" href="./stylesheets/calendar.css" type="text/css" />
<script src="./stylesheets/calendar.js"></script>
<script src="./javascripts/calendar.js"></script>
</head>
<body>

View File

@@ -1,7 +1,87 @@
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<html>
<head></head>
<head>
<script type='text/javascript' src='./dwr/engine.js'></script>
<script type='text/javascript' src='./dwr/util.js'></script>
<script type='text/javascript' src='./dwr/interface/AddCriteriaJS.js'></script>
<script type='text/javascript' src='./javascripts/prototype.js'></script>
<script type='text/javascript'>
function addCriteria() {
var criteria = new Array();
var myString = "" + $F("monForm.labelCriteria") + " - Notation : Between " + $F("monForm.minCriteria") + " and " + $F("monForm.maxCriteria");
criteria.push(myString);
dwr.util.addOptions("listCriteria", criteria);
$("divCriteria").style.display = "";
}
function init() {
fillTable();
}
var peopleCache = { };
var viewed = -1;
function fillTable() {
AddCriteriaJS.getAllCriteria(function(criteria) {
// Delete all the rows except for the "pattern" row
dwr.util.removeAllRows("criteriabody", { filter:function(tr) {
return (tr.id != "pattern");
}});
// Create a new set cloned from the pattern row
var person, id;
criteria.sort(function(p1, p2) { return p1.label.localeCompare(p2.label); });
for (var i = 0; i < criteria.length; i++) {
person = criteria[i];
id = person.id;
dwr.util.cloneNode("pattern", { idSuffix:id });
dwr.util.setValue("tableCriterion" + id, person.label);
dwr.util.setValue("tableCriterionMin" + id, person.min);
dwr.util.setValue("tableCriterionMax" + id, person.max);
$("pattern" + id).style.display = "table-row";
peopleCache[id] = person;
}
});
}
function editClicked(eleid) {
// we were an id of the form "edit{id}", eg "edit42". We lookup the "42"
var person = peopleCache[eleid.substring(4)];
dwr.util.setValues(person);
}
function deleteClicked(eleid) {
// we were an id of the form "delete{id}", eg "delete42". We lookup the "42"
var person = peopleCache[eleid.substring(6)];
if (confirm("Are you sure you want to delete " + person.label + "?")) {
dwr.engine.beginBatch();
AddCriteriaJS.deleteCriterion({ id:id });
fillTable();
dwr.engine.endBatch();
}
}
function writePerson() {
var person = { id:viewed, label:null, min:null, max:null };
dwr.util.getValues(person);
dwr.engine.beginBatch();
AddCriteriaJS.setCriterion(person);
fillTable();
dwr.engine.endBatch();
}
function clearPerson() {
viewed = -1;
dwr.util.setValues({ id:-1, label:null, min:null, max:null });
}
</script>
</head>
<body>
@@ -10,18 +90,71 @@
<form:form commandName="formConference" name="monForm">
<fieldset><legend>Criteria</legend> Label : <input
type="text"> Notation : Between <input type="text">
and <input type="text"></fieldset>
id="monForm.labelCriteria" name="labelCriteria" type="text"> <br />
<br />
Notation : Between <input id="monForm.minCriteria" name="minCriteria"
type="text"> and <input id="monForm.maxCriteria"
name="maxCriteria" type="text"></fieldset>
<br />
<input type="button" value="Add criteria" onclick="addCriteria()">
<input type="button" value="Add criteria">
<!--<div id="divCriteria" style="display:none;">
<ul id="listCriteria">
<br /><br />
</ul>
</div>-->
<h3>Edit Person</h3>
<table class="plain">
<tr>
<td>Label:</td>
<td><input id="label" type="text" size="30" /></td>
</tr>
<tr>
<td>Min:</td>
<td><input id="min" type="text" size="20" /></td>
</tr>
<tr>
<td>Max:</td>
<td><input id="max" type="text" size="40" /></td>
</tr>
<tr>
<td colspan="2" align="right"><small>(ID=<span id="id">-1</span>)</small>
<input type="button" value="Save" onclick="writePerson()" /> <input
type="button" value="Clear" onclick="clearPerson()" /></td>
</tr>
</table>
<table border="1">
<thead>
<tr>
<th>Criterion</th>
<th>Min</th>
<th>Max</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="criteriabody">
<tr id="pattern" style="display: none;">
<td><span id="tableCriterion">Criterion</span></td>
<td><span id="tableCriterionMin">Min</span></td>
<td><span id="tableCriterionMax">Max</span></td>
<td><input id="edit" type="button" value="Edit"
onclick="editClicked(this.id)" /> <input id="delete" type="button"
value="Delete" onclick="deleteClicked(this.id)" /></td>
</tr>
</tbody>
</table>
<br />
<br />
<input type="submit" align="middle" name="_target2" value="Back">
<input type="submit" align="middle" name="_target4" value="Next" />
</form:form> <br />
</form:form>
<br />
<a href="<c:url value="main.htm"/>">Home</a>
</body>

View File

@@ -161,12 +161,24 @@
</property>
</bean>
<dwr:controller id="dwrController" debug="true"></dwr:controller>
<dwr:configuration>
<dwr:convert type="bean"
class="org.yacos.web.chairman.form.FormConference">
</dwr:convert>
<dwr:convert type="bean"
class="org.yacos.web.chairman.controller.CriterionBean">
</dwr:convert>
<!-- <dwr:convert type="bean"
class="iConfWeb.bean.viewPaper.DetailPaper">
</dwr:convert>

File diff suppressed because it is too large Load Diff

View File

@@ -38,7 +38,7 @@ public class EvaluationController extends SimpleFormController {
@Override
protected Object formBackingObject(HttpServletRequest request)
throws Exception {
//mock object: criterionList en attendant criterionManager
// FIXME mock object: criterionList en attendant criterionManager
conferenceManager.addConference("myTitre", "myDescirption", "myInfoComplementray", new Date(1/1/2008), new Date(1/1/2008), new Date(1/1/2008), new Date(1/1/2008), new Date(1/1/2008));
Conference conf=conferenceManager.getConference(1);
ArrayList<Criterion> criterionList = new ArrayList<Criterion>();

View File

@@ -1,8 +1,11 @@
package org.yacos.web.chairman.controller;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import javax.naming.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -14,6 +17,7 @@ import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.ModelAndViewDefiningException;
import org.springframework.web.servlet.mvc.AbstractWizardFormController;
import org.yacos.core.conferences.IConferenceManager;
import org.yacos.core.evaluation.Criterion;
import org.yacos.web.chairman.form.FormConference;
public class AddConferenceController extends AbstractWizardFormController {
@@ -29,6 +33,50 @@ public class AddConferenceController extends AbstractWizardFormController {
this.conferenceManager = conferenceManager;
}
// ###########################################################
private static int nextId = 1;
private Set criteria = new HashSet();
public Set getAllCriteria() {
return criteria;
}
public void setCriterion(CriterionBean c) {
if (c.getId() == -1) {
c.setId(getNextId());
}
criteria.remove(c);
criteria.add(c);
}
public void deleteCriterion(CriterionBean c) {
criteria.remove(c);
}
private static synchronized int getNextId()
{
return nextId++;
}
// ###########################################################
public AddConferenceController() {
setCommandName("formConference");
setPages(new String[] {"addConference", "addConference2", "addConference3", "addConference4", "addConference5"});

View File

@@ -0,0 +1,67 @@
package org.yacos.web.chairman.controller;
public class CriterionBean {
private int id;
private String label;
private int min;
private int max;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public int getMin() {
return min;
}
public void setMin(int min) {
this.min = min;
}
public int getMax() {
return max;
}
public void setMax(int max) {
this.max = max;
}
public int hashCode()
{
return 5924 + id;
}
public boolean equals(Object obj)
{
if (obj == null)
{
return false;
}
if (obj == this)
{
return true;
}
if (!this.getClass().equals(obj.getClass()))
{
return false;
}
CriterionBean that = (CriterionBean) obj;
if (this.id != that.id)
{
return false;
}
return true;
}
}

View File

@@ -0,0 +1,35 @@
package org.yacos.web.chairman.controller;
import java.util.HashSet;
import java.util.Set;
public class Criterions {
private static int nextId = 1;
private Set criteria = new HashSet();
public Set getAllCriteria() {
return criteria;
}
public void setCriterion(CriterionBean c) {
if (c.getId() == -1) {
c.setId(getNextId());
}
criteria.remove(c);
criteria.add(c);
}
public void deleteCriterion(CriterionBean c) {
criteria.remove(c);
}
private static synchronized int getNextId()
{
return nextId++;
}
}