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:
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
<c:if test="${message}">
|
<c:if test="${message}">
|
||||||
<fmt:message key="message"/>
|
<fmt:message key="message"/>
|
||||||
|
huhu
|
||||||
</c:if>
|
</c:if>
|
||||||
|
|
||||||
<form:form method="post" commandName="choosePreference">
|
<form:form method="post" commandName="choosePreference">
|
||||||
|
|||||||
@@ -6,11 +6,14 @@
|
|||||||
|
|
||||||
<c:forEach items="${listArticle}" var="article">
|
<c:forEach items="${listArticle}" var="article">
|
||||||
<ul class="article">
|
<ul class="article">
|
||||||
<li class="title">${article.title}</li>
|
<li class="title"><b>${article.title}</b></li>
|
||||||
<li class="author">Author: ${article.mainAuthor}</li>
|
<li class="author">Author: <b>${article.mainAuthor.firstName} ${article.mainAuthor.lastName}</b></li>
|
||||||
<li class="topic">Topic: ${article.topic}</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>
|
<li class="article_url"><a href="<c:url value="${article.URL_article}"/>">Download the article</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<br />
|
||||||
|
<hr />
|
||||||
|
<br />
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,9 +29,8 @@ function Supprimer(form) {
|
|||||||
<hr/> <br/>
|
<hr/> <br/>
|
||||||
|
|
||||||
<label for="listauthor"><fmt:message key="form.submission.listauthor" /></label> <br /><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" />
|
<form:label path="mainauthor"><fmt:message key="form.submission.mainauthor" /></form:label>: <b>${currentUser.firstName} ${currentUser.lastName}</b>
|
||||||
<font color="red"><form:errors path="mainauthor"/></font>
|
<br/> <br/>
|
||||||
<br/> <br/>
|
|
||||||
<form:label path="secondaryauthor"><fmt:message key="form.submission.secondaryauthor" /></form:label> <form:input path="secondaryauthor" />
|
<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 />
|
<input type="button" name="addSecondary" onClick="Ajouter(this.form)" value=<fmt:message key="button.add" />> <br/><br />
|
||||||
|
|
||||||
|
|||||||
@@ -25,9 +25,6 @@
|
|||||||
<prop key="/submissionArticleOK.htm">
|
<prop key="/submissionArticleOK.htm">
|
||||||
SArticleControllerOK
|
SArticleControllerOK
|
||||||
</prop>
|
</prop>
|
||||||
<prop key="/choosePreferenceOK.htm">
|
|
||||||
ChoosePreferenceControllerOK
|
|
||||||
</prop>
|
|
||||||
<prop key="/listArticle.htm">
|
<prop key="/listArticle.htm">
|
||||||
ListArticleController
|
ListArticleController
|
||||||
</prop>
|
</prop>
|
||||||
@@ -43,18 +40,6 @@
|
|||||||
<prop key="/dispatchArticle.htm">
|
<prop key="/dispatchArticle.htm">
|
||||||
DispatchArticleController
|
DispatchArticleController
|
||||||
</prop>
|
</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">
|
<prop key="/addConference.htm">
|
||||||
AddConferenceController
|
AddConferenceController
|
||||||
</prop>
|
</prop>
|
||||||
@@ -87,9 +72,6 @@
|
|||||||
<bean id="SArticleControllerOK"
|
<bean id="SArticleControllerOK"
|
||||||
class="org.yacos.web.author.controller.SArticleControllerOK" />
|
class="org.yacos.web.author.controller.SArticleControllerOK" />
|
||||||
|
|
||||||
<bean id="ChoosePreferenceControllerOK"
|
|
||||||
class="org.yacos.web.PCmember.controller.ChoosePreferenceControllerOK" />
|
|
||||||
|
|
||||||
<bean id="ListArticleController"
|
<bean id="ListArticleController"
|
||||||
class="org.yacos.web.PCmember.controller.ListArticleController">
|
class="org.yacos.web.PCmember.controller.ListArticleController">
|
||||||
<property name="articleManager" ref="articleManager" />
|
<property name="articleManager" ref="articleManager" />
|
||||||
|
|||||||
@@ -3,11 +3,13 @@ package org.yacos.web.PCmember.controller;
|
|||||||
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.springframework.validation.BindException;
|
import org.springframework.validation.BindException;
|
||||||
|
import org.springframework.validation.Errors;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
import org.springframework.web.servlet.mvc.SimpleFormController;
|
import org.springframework.web.servlet.mvc.SimpleFormController;
|
||||||
import org.springframework.web.servlet.view.RedirectView;
|
import org.springframework.web.servlet.view.RedirectView;
|
||||||
@@ -82,10 +84,9 @@ public class ChoosePreferenceController extends SimpleFormController {
|
|||||||
preference.getPreference());
|
preference.getPreference());
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, String> model = new HashMap<String, String>();
|
Map<String, String> model = new HashMap<String, String>();
|
||||||
model.put("message", "preference.ok");
|
model.put("message", "preference.ok");
|
||||||
return new ModelAndView(new RedirectView(getSuccessView()),model);
|
return new ModelAndView(new RedirectView(getSuccessView()), model);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IArticleManager getArticleManager() {
|
public IArticleManager getArticleManager() {
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ public class SArticleController extends SimpleFormController {
|
|||||||
|
|
||||||
String title = ((FormSubmission) command).getTitle();
|
String title = ((FormSubmission) command).getTitle();
|
||||||
String theme = ((FormSubmission) command).getTheme();
|
String theme = ((FormSubmission) command).getTheme();
|
||||||
String mainauthor = ((FormSubmission) command).getMainauthor();
|
//String mainauthor = ((FormSubmission) command).getMainauthor();
|
||||||
//String secondaryauthor = ((FormSubmission) command).getSecondaryauthor();
|
//String secondaryauthor = ((FormSubmission) command).getSecondaryauthor();
|
||||||
List<String> liste = ((FormSubmission) command).getListe();
|
List<String> listeSecondary = ((FormSubmission) command).getListe();
|
||||||
|
|
||||||
String nomFile="";
|
String nomFile="";
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ public class SArticleController extends SimpleFormController {
|
|||||||
System.out.println(e);
|
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()));
|
return new ModelAndView(new RedirectView(getSuccessView()));
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ public class SArticleController extends SimpleFormController {
|
|||||||
FormSubmission myArticle = new FormSubmission();
|
FormSubmission myArticle = new FormSubmission();
|
||||||
myArticle.setTitle("");
|
myArticle.setTitle("");
|
||||||
myArticle.setTheme("");
|
myArticle.setTheme("");
|
||||||
myArticle.setMainauthor("");
|
//myArticle.setMainauthor("");
|
||||||
myArticle.setSecondaryauthor("");
|
myArticle.setSecondaryauthor("");
|
||||||
return myArticle;
|
return myArticle;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class ValidateSubmission implements Validator {
|
|||||||
if (title== null || title.trim().length() == 0) {
|
if (title== null || title.trim().length() == 0) {
|
||||||
arg1.rejectValue("title",
|
arg1.rejectValue("title",
|
||||||
"submissionArticle.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");
|
arg1.rejectValue("mainauthor", "submissionArticle.mainauthor");
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
/* if (file==null|file.trim().length()==0)
|
/* if (file==null|file.trim().length()==0)
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package org.yacos.web.chairman.controller;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
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.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.springframework.validation.BindException;
|
import org.springframework.validation.BindException;
|
||||||
|
import org.springframework.validation.Errors;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
import org.springframework.web.servlet.mvc.SimpleFormController;
|
import org.springframework.web.servlet.mvc.SimpleFormController;
|
||||||
import org.yacos.core.article.Article;
|
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.Role.RoleType;
|
||||||
import org.yacos.core.users.User;
|
import org.yacos.core.users.User;
|
||||||
import org.yacos.web.PCmember.form.FormDispatcher;
|
import org.yacos.web.PCmember.form.FormDispatcher;
|
||||||
|
import org.yacos.web.system.session.SessionService;
|
||||||
|
|
||||||
public class DispatchArticleController extends SimpleFormController{
|
public class DispatchArticleController extends SimpleFormController{
|
||||||
|
|
||||||
@@ -58,22 +62,31 @@ public class DispatchArticleController extends SimpleFormController{
|
|||||||
Collection<User> members = userManager.getUsers(conf_id,RoleType.PCMEMBER);
|
Collection<User> members = userManager.getUsers(conf_id,RoleType.PCMEMBER);
|
||||||
|
|
||||||
request.getSession().setAttribute("members",members);
|
request.getSession().setAttribute("members",members);
|
||||||
request.getSession().setAttribute("articles",articleManager.getArticles(conf_id));
|
|
||||||
|
|
||||||
return new FormDispatcher();
|
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,
|
protected ModelAndView onSubmit(HttpServletRequest request,
|
||||||
HttpServletResponse response,
|
HttpServletResponse response,
|
||||||
Object formDispatcher, BindException errors) throws Exception {
|
Object command, BindException errors) throws Exception {
|
||||||
|
|
||||||
//on recupere l'id de conference
|
// Fetching conference
|
||||||
int conf_id = (Integer)request.getSession().getAttribute("idCurrentConference");
|
Conference conf = SessionService.getInstance().getCurrentConference();
|
||||||
|
|
||||||
FormDispatcher fd = (FormDispatcher)formDispatcher;
|
FormDispatcher fd = (FormDispatcher)command;
|
||||||
Article article = articleManager.getArticle(fd.getIdArticle());
|
Article article = articleManager.getArticle(fd.getIdArticle());
|
||||||
|
|
||||||
return new ModelAndView("dispatchArticle", "articles", articleManager.getArticles(conf_id));
|
return new ModelAndView("dispatchArticle", "articles", articleManager.getArticles(conf.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user