Diverse modif

Policy failures:   
Code warning
- failed on resource ValidateSubmission.java. Reason: Class is a raw type. References to generic type Class<T> should be parameterized, line 10
- failed on resource DispatchArticleController.java. Reason: HashMap is a raw type. References to generic type HashMap<K,V> should be parameterized, line 72
- failed on resource DispatchArticleController.java. Reason: Map is a raw type. References to generic type Map<K,V> should be parameterized, line 70
- failed on resource DispatchArticleController.java. Reason: Map is a raw type. References to generic type Map<K,V> should be parameterized, line 72
- failed on resource DispatchArticleController.java. Reason: The import java.util.ArrayList is never used, line 3
... and more.  
Override reason:   
hu
This commit is contained in:
Frederic Debuire
2008-02-04 16:55:43 +00:00
parent 3872d95b37
commit 21842924fd
8 changed files with 42 additions and 43 deletions

View File

@@ -9,6 +9,7 @@
<c:if test="${message}">
<fmt:message key="message"/>
huhu
</c:if>
<form:form method="post" commandName="choosePreference">

View File

@@ -6,11 +6,14 @@
<c:forEach items="${listArticle}" var="article">
<ul class="article">
<li class="title">${article.title}</li>
<li class="author">Author: ${article.mainAuthor}</li>
<li class="topic">Topic: ${article.topic}</li>
<li class="title"><b>${article.title}</b></li>
<li class="author">Author: <b>${article.mainAuthor.firstName} ${article.mainAuthor.lastName}</b></li>
<li class="topic">Topic: <b>${article.topic}</b></li>
<li class="article_url"><a href="<c:url value="${article.URL_article}"/>">Download the article</a></li>
</ul>
<br />
<hr />
<br />
</c:forEach>

View File

@@ -29,9 +29,8 @@ function Supprimer(form) {
<hr/> <br/>
<label for="listauthor"><fmt:message key="form.submission.listauthor" /></label> <br /><br />
<form:label path="mainauthor"><fmt:message key="form.submission.mainauthor" /></form:label> <form:input path="mainauthor" />
<font color="red"><form:errors path="mainauthor"/></font>
<br/> <br/>
<form:label path="mainauthor"><fmt:message key="form.submission.mainauthor" /></form:label>: <b>${currentUser.firstName} ${currentUser.lastName}</b>
<br/> <br/>
<form:label path="secondaryauthor"><fmt:message key="form.submission.secondaryauthor" /></form:label> <form:input path="secondaryauthor" />
<input type="button" name="addSecondary" onClick="Ajouter(this.form)" value=<fmt:message key="button.add" />> <br/><br />

View File

@@ -25,9 +25,6 @@
<prop key="/submissionArticleOK.htm">
SArticleControllerOK
</prop>
<prop key="/choosePreferenceOK.htm">
ChoosePreferenceControllerOK
</prop>
<prop key="/listArticle.htm">
ListArticleController
</prop>
@@ -43,18 +40,6 @@
<prop key="/dispatchArticle.htm">
DispatchArticleController
</prop>
<!-- <prop key="/addConference5.htm">
AddConferenceController5
</prop>
<prop key="/addConference4.htm">
AddConferenceController4
</prop>
<prop key="/addConference3.htm">
AddConferenceController3
</prop>
<prop key="/addConference2.htm">
AddConferenceController2
</prop> -->
<prop key="/addConference.htm">
AddConferenceController
</prop>
@@ -87,9 +72,6 @@
<bean id="SArticleControllerOK"
class="org.yacos.web.author.controller.SArticleControllerOK" />
<bean id="ChoosePreferenceControllerOK"
class="org.yacos.web.PCmember.controller.ChoosePreferenceControllerOK" />
<bean id="ListArticleController"
class="org.yacos.web.PCmember.controller.ListArticleController">
<property name="articleManager" ref="articleManager" />

View File

@@ -3,11 +3,13 @@ package org.yacos.web.PCmember.controller;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.validation.BindException;
import org.springframework.validation.Errors;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;
import org.springframework.web.servlet.view.RedirectView;
@@ -82,10 +84,9 @@ public class ChoosePreferenceController extends SimpleFormController {
preference.getPreference());
}
Map<String, String> model = new HashMap<String, String>();
Map<String, String> model = new HashMap<String, String>();
model.put("message", "preference.ok");
return new ModelAndView(new RedirectView(getSuccessView()),model);
return new ModelAndView(new RedirectView(getSuccessView()), model);
}
public IArticleManager getArticleManager() {

View File

@@ -41,9 +41,9 @@ public class SArticleController extends SimpleFormController {
String title = ((FormSubmission) command).getTitle();
String theme = ((FormSubmission) command).getTheme();
String mainauthor = ((FormSubmission) command).getMainauthor();
//String mainauthor = ((FormSubmission) command).getMainauthor();
//String secondaryauthor = ((FormSubmission) command).getSecondaryauthor();
List<String> liste = ((FormSubmission) command).getListe();
List<String> listeSecondary = ((FormSubmission) command).getListe();
String nomFile="";
@@ -73,7 +73,7 @@ public class SArticleController extends SimpleFormController {
System.out.println(e);
}
articleManager.addArticle(title, theme, nomFile, mainauthor, liste, Article.State.SUMMARY, conf.getId());
articleManager.addArticle(title, theme, nomFile, user.getLogin(), listeSecondary, Article.State.SUMMARY, conf.getId());
return new ModelAndView(new RedirectView(getSuccessView()));
}
@@ -82,7 +82,7 @@ public class SArticleController extends SimpleFormController {
FormSubmission myArticle = new FormSubmission();
myArticle.setTitle("");
myArticle.setTheme("");
myArticle.setMainauthor("");
//myArticle.setMainauthor("");
myArticle.setSecondaryauthor("");
return myArticle;
}

View File

@@ -24,7 +24,7 @@ public class ValidateSubmission implements Validator {
if (title== null || title.trim().length() == 0) {
arg1.rejectValue("title",
"submissionArticle.title",
"Le title est n<><6E>cessaire !");
"Le title est n<><6E>cessaire !");
}
@@ -42,11 +42,11 @@ public class ValidateSubmission implements Validator {
}
if (mainauthor==null|mainauthor.trim().length()==0)
/*if (mainauthor==null|mainauthor.trim().length()==0)
{
arg1.rejectValue("mainauthor", "submissionArticle.mainauthor");
}
}*/
/* if (file==null|file.trim().length()==0)

View File

@@ -2,6 +2,8 @@ package org.yacos.web.chairman.controller;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -9,6 +11,7 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.validation.BindException;
import org.springframework.validation.Errors;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;
import org.yacos.core.article.Article;
@@ -20,6 +23,7 @@ import org.yacos.core.users.IUserManager;
import org.yacos.core.users.Role.RoleType;
import org.yacos.core.users.User;
import org.yacos.web.PCmember.form.FormDispatcher;
import org.yacos.web.system.session.SessionService;
public class DispatchArticleController extends SimpleFormController{
@@ -58,22 +62,31 @@ public class DispatchArticleController extends SimpleFormController{
Collection<User> members = userManager.getUsers(conf_id,RoleType.PCMEMBER);
request.getSession().setAttribute("members",members);
request.getSession().setAttribute("articles",articleManager.getArticles(conf_id));
return new FormDispatcher();
}
@Override
protected Map referenceData(HttpServletRequest request, Object command,
Errors errors) throws Exception {
Map model = new HashMap();
// Fetching conference
Conference conf = SessionService.getInstance().getCurrentConference();
model.put("articles", articleManager.getArticles(conf.getId()));
return model;
}
protected ModelAndView onSubmit(HttpServletRequest request,
HttpServletResponse response,
Object formDispatcher, BindException errors) throws Exception {
Object command, BindException errors) throws Exception {
//on recupere l'id de conference
int conf_id = (Integer)request.getSession().getAttribute("idCurrentConference");
// Fetching conference
Conference conf = SessionService.getInstance().getCurrentConference();
FormDispatcher fd = (FormDispatcher)formDispatcher;
FormDispatcher fd = (FormDispatcher)command;
Article article = articleManager.getArticle(fd.getIdArticle());
return new ModelAndView("dispatchArticle", "articles", articleManager.getArticles(conf_id));
return new ModelAndView("dispatchArticle", "articles", articleManager.getArticles(conf.getId()));
}
}