Quelques corrections
AddConference marche
This commit is contained in:
@@ -74,15 +74,6 @@ function clearPerson() {
|
||||
dwr.util.setValues({ id:-1, label:null, min:null, max:null });
|
||||
}
|
||||
|
||||
function submitIfNotEnter(theForm){
|
||||
if(theForm.elements["submit"] || theForm.elements["submit"]){
|
||||
return true;
|
||||
} else {
|
||||
writePerson();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
@@ -114,6 +105,7 @@ function submitIfNotEnter(theForm){
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<br />
|
||||
@@ -141,8 +133,8 @@ function submitIfNotEnter(theForm){
|
||||
|
||||
<br />
|
||||
|
||||
<input type="submit" align="middle" name="_target2" value="Back" onclick="this.form.elements['submit']=true">
|
||||
<input type="submit" align="middle" name="_target4" value="Next" onclick="this.form.elements['submit']=true" />
|
||||
<input type="submit" align="middle" name="_target2" value="Back">
|
||||
<input type="submit" align="middle" name="_target4" value="Next"/>
|
||||
|
||||
|
||||
</form:form>
|
||||
|
||||
@@ -72,6 +72,15 @@ function addPerson(eleid) {
|
||||
dwr.engine.endBatch();
|
||||
}
|
||||
|
||||
function addInvitation() {
|
||||
var email = $("emailAddress").value;
|
||||
dwr.engine.beginBatch();
|
||||
AddCriteriaJS.addInvitation(email);
|
||||
fillTable();
|
||||
fillTable2();
|
||||
dwr.engine.endBatch();
|
||||
}
|
||||
|
||||
function deletePerson(eleid) {
|
||||
var person = peopleCache[eleid.substring(11)];
|
||||
if (confirm("Are you sure you want to delete " + person.name + "?")) {
|
||||
@@ -114,8 +123,8 @@ function filterUser(el, value) {
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Add a new member <br />
|
||||
Mail: <input id="mail" type="text" />
|
||||
<fmt:message key="pcmember.invitation.promptMessage"/> <br/>
|
||||
Mail: <input id="emailAddress" type="text"/> <input type="button" name="invitationEmail" onclick="addInvitation()"/>
|
||||
|
||||
|
||||
<br />
|
||||
|
||||
@@ -52,9 +52,8 @@ public class EvaluationController extends SimpleFormController {
|
||||
@Override
|
||||
protected Object formBackingObject(HttpServletRequest request)
|
||||
throws Exception {
|
||||
// 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);
|
||||
// FIXME mock object: criterionList en attendant criterionManager
|
||||
Conference conf=SessionService.getInstance().getCurrentConference();
|
||||
ArrayList<Criterion> criterionList = new ArrayList<Criterion>();
|
||||
Criterion c1=new Criterion("respect du theme",new Integer(1),new Integer(5),conf );
|
||||
|
||||
@@ -81,7 +80,6 @@ public class EvaluationController extends SimpleFormController {
|
||||
liste.add(sc);
|
||||
|
||||
}
|
||||
if (liste!=null){System.out.println("liste n'est pas null");}
|
||||
fe.setSimpleRatings(liste);
|
||||
fe.setCommentAuthor("no comment by author");
|
||||
fe.setCommentPCMember("no comment by pc member");
|
||||
|
||||
@@ -35,9 +35,9 @@ public class ValideOrRejectController extends SimpleFormController {
|
||||
{
|
||||
art.setState(State.ACCEPTED);
|
||||
}
|
||||
else if (value.equals("reject"))
|
||||
{art.setState(State.REJECTED);
|
||||
}
|
||||
else if (value.equals("reject")){
|
||||
art.setState(State.REJECTED);
|
||||
}
|
||||
articleManager.updateArticle(art);
|
||||
|
||||
|
||||
|
||||
@@ -18,9 +18,6 @@ public class MainController extends SimpleFormController {
|
||||
|
||||
logger.info("Returning main view");
|
||||
|
||||
// FIXME : this is no longer necessary
|
||||
request.getSession().setAttribute("user","toto");
|
||||
request.getSession().setAttribute("idCurrentConference",1);
|
||||
//FIXME
|
||||
return new ModelAndView("main");
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package org.yacos.web.chairman.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -16,11 +13,13 @@ import org.springframework.validation.Errors;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import org.springframework.web.servlet.ModelAndViewDefiningException;
|
||||
import org.springframework.web.servlet.mvc.AbstractWizardFormController;
|
||||
import org.yacos.core.conferences.Conference;
|
||||
import org.yacos.core.conferences.IConferenceManager;
|
||||
import org.yacos.core.users.IUserManager;
|
||||
import org.yacos.core.users.User;
|
||||
import org.yacos.web.chairman.form.FormConference;
|
||||
import org.yacos.web.chairman.validation.ConferenceValidator;
|
||||
import org.yacos.web.system.session.SessionService;
|
||||
|
||||
|
||||
//TODO : Clean this class
|
||||
@@ -58,9 +57,7 @@ public class AddConferenceController extends AbstractWizardFormController {
|
||||
listPersonAdded = new ArrayList<PersonBean>();
|
||||
listPersonFiltered = new ArrayList<PersonBean>();
|
||||
List<User> listUsers = userManager.getUsers();
|
||||
for (Iterator i = listUsers.iterator(); i.hasNext();) {
|
||||
User user = (User) i.next();
|
||||
|
||||
for (User user : listUsers) {
|
||||
PersonBean pb = new PersonBean();
|
||||
pb.setId(getNextPerson());
|
||||
pb.setName(user.getFirstName());
|
||||
@@ -74,11 +71,10 @@ public class AddConferenceController extends AbstractWizardFormController {
|
||||
listPersonFiltered = new ArrayList<PersonBean>();
|
||||
else {
|
||||
listPersonFiltered = new ArrayList<PersonBean>();
|
||||
for (Iterator i = listPersonBean.iterator(); i.hasNext();) {
|
||||
PersonBean b = (PersonBean) i.next();
|
||||
|
||||
if (b.getName().toLowerCase().contains(text.toLowerCase()))
|
||||
for (PersonBean b : listPersonBean) {
|
||||
if (b.getName().toLowerCase().contains(text.toLowerCase())){
|
||||
listPersonFiltered.add(b);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,18 +107,16 @@ public class AddConferenceController extends AbstractWizardFormController {
|
||||
}
|
||||
|
||||
public PersonBean getTruePerson(String login) {
|
||||
for (Iterator i = listPersonBean.iterator(); i.hasNext();) {
|
||||
PersonBean b = (PersonBean) i.next();
|
||||
|
||||
if (b.getLogin().equals(login))
|
||||
for (PersonBean b : listPersonBean) {
|
||||
if (b.getLogin().equals(login)){
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
for (Iterator i = listPersonAdded.iterator(); i.hasNext();) {
|
||||
PersonBean b = (PersonBean) i.next();
|
||||
|
||||
if (b.getLogin().equals(login))
|
||||
for (PersonBean b : listPersonAdded) {
|
||||
if (b.getLogin().equals(login)){
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -152,9 +146,9 @@ public class AddConferenceController extends AbstractWizardFormController {
|
||||
|
||||
private static int nextId = 1;
|
||||
|
||||
private Set criteria = new HashSet();;
|
||||
private Set<CriterionBean> criteria = new HashSet<CriterionBean>();;
|
||||
|
||||
public Set getAllCriteria() {
|
||||
public Set<CriterionBean> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
@@ -216,11 +210,34 @@ public class AddConferenceController extends AbstractWizardFormController {
|
||||
HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) {
|
||||
FormConference conference = (FormConference) command;
|
||||
|
||||
/*this.petStore.insertOrder(orderForm.getOrder());
|
||||
request.getSession().removeAttribute("sessionCart");
|
||||
Map model = new HashMap();
|
||||
model.put("order", orderForm.getOrder());
|
||||
model.put("message", "Thank you, your order has been submitted.");*/
|
||||
|
||||
Conference conf = conferenceManager.addConference(
|
||||
conference.getTitle(),
|
||||
conference.getDescription(),
|
||||
conference.getOtherInformations(),
|
||||
conference.getDateArticleParsed(),
|
||||
conference.getDateArticleParsed(),
|
||||
conference.getDateEvaluationParsed(),
|
||||
conference.getDateStartParsed(),
|
||||
conference.getDateEndParsed());
|
||||
|
||||
conference.setConferenceId(conf.getId());
|
||||
SessionService.getInstance().setCurrentConference(conf);
|
||||
|
||||
for(CriterionBean criterion : criteria){
|
||||
conferenceManager.addCriterionToConference(
|
||||
conf.getId(),
|
||||
criterion.getLabel(),
|
||||
criterion.getMin(),
|
||||
criterion.getMax());
|
||||
}
|
||||
|
||||
for(PersonBean personBean : listPersonAdded){
|
||||
conferenceManager.addPCMemberToConference(
|
||||
conf.getId(),
|
||||
personBean.getLogin());
|
||||
}
|
||||
|
||||
return new ModelAndView("main"/*, model*/);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package org.yacos.web.chairman.form;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class FormConference {
|
||||
|
||||
private Integer id;
|
||||
@@ -8,14 +10,20 @@ public class FormConference {
|
||||
private String otherInformations;
|
||||
|
||||
private String dateArticle;
|
||||
private Date dateArticleParsed;
|
||||
private String dateEvaluation;
|
||||
private Date dateEvaluationParsed;
|
||||
private String dateStart;
|
||||
private Date dateStartParsed;
|
||||
private String dateEnd;
|
||||
private Date dateEndParsed;
|
||||
|
||||
private int pageNumber;
|
||||
private String fileType;
|
||||
private String sendInfo;
|
||||
|
||||
private Integer conferenceId;
|
||||
|
||||
public FormConference () {}
|
||||
|
||||
public Integer getId() {
|
||||
@@ -105,4 +113,68 @@ public class FormConference {
|
||||
public void setDateEnd(String dateEnd) {
|
||||
this.dateEnd = dateEnd;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the dateArticleParsed
|
||||
*/
|
||||
public Date getDateArticleParsed() {
|
||||
return dateArticleParsed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dateArticleParsed the dateArticleParsed to set
|
||||
*/
|
||||
public void setDateArticleParsed(Date dateArticleParsed) {
|
||||
this.dateArticleParsed = dateArticleParsed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the dateEvaluationParsed
|
||||
*/
|
||||
public Date getDateEvaluationParsed() {
|
||||
return dateEvaluationParsed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dateEvaluationParsed the dateEvaluationParsed to set
|
||||
*/
|
||||
public void setDateEvaluationParsed(Date dateEvaluationParsed) {
|
||||
this.dateEvaluationParsed = dateEvaluationParsed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the dateStartParsed
|
||||
*/
|
||||
public Date getDateStartParsed() {
|
||||
return dateStartParsed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dateStartParsed the dateStartParsed to set
|
||||
*/
|
||||
public void setDateStartParsed(Date dateStartParsed) {
|
||||
this.dateStartParsed = dateStartParsed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the dateEndParsed
|
||||
*/
|
||||
public Date getDateEndParsed() {
|
||||
return dateEndParsed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dateEndParsed the dateEndParsed to set
|
||||
*/
|
||||
public void setDateEndParsed(Date dateEndParsed) {
|
||||
this.dateEndParsed = dateEndParsed;
|
||||
}
|
||||
|
||||
public void setConferenceId(Integer conferenceId) {
|
||||
this.conferenceId = conferenceId;
|
||||
}
|
||||
|
||||
public Integer getConferenceId() {
|
||||
return conferenceId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
package org.yacos.web.chairman.validation;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.validation.Errors;
|
||||
import org.springframework.validation.ValidationUtils;
|
||||
import org.springframework.validation.Validator;
|
||||
@@ -27,10 +32,36 @@ public class ConferenceValidator implements Validator {
|
||||
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "dateEnd", "DATE_REQUIRED", "A date is required");
|
||||
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "dateArticle", "DATE_REQUIRED", "A date is required");
|
||||
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "dateEvaluation", "DATE_REQUIRED", "A date is required");
|
||||
|
||||
DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
try {
|
||||
Date dateStart = format.parse(conference.getDateStart());
|
||||
conference.setDateStartParsed(dateStart);
|
||||
} catch (ParseException e) {
|
||||
errors.reject("dateStart");
|
||||
}
|
||||
try {
|
||||
Date dateEnd = format.parse(conference.getDateEnd());
|
||||
conference.setDateEndParsed(dateEnd);
|
||||
} catch (ParseException e) {
|
||||
errors.reject("dateEnd");
|
||||
}
|
||||
try {
|
||||
Date dateArticle = format.parse(conference.getDateArticle());
|
||||
conference.setDateArticleParsed(dateArticle);
|
||||
} catch (ParseException e) {
|
||||
errors.reject("dateArticle");
|
||||
}
|
||||
try {
|
||||
Date dateEvaluation = format.parse(conference.getDateEvaluation());
|
||||
conference.setDateEvaluationParsed(dateEvaluation);
|
||||
} catch (ParseException e) {
|
||||
errors.reject("dateEvaluation");
|
||||
}
|
||||
}
|
||||
|
||||
public void validateThirdPage(FormConference conference, Errors errors) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import org.acegisecurity.context.SecurityContextHolder;
|
||||
import org.acegisecurity.providers.UsernamePasswordAuthenticationToken;
|
||||
import org.acegisecurity.providers.dao.DaoAuthenticationProvider;
|
||||
import org.acegisecurity.providers.encoding.ShaPasswordEncoder;
|
||||
import org.acegisecurity.userdetails.UserDetails;
|
||||
import org.springframework.web.util.WebUtils;
|
||||
import org.yacos.auth.UserDetailsService;
|
||||
import org.yacos.core.conferences.Conference;
|
||||
|
||||
Reference in New Issue
Block a user