Choose conference BLINDE
bug choose conf regle
This commit is contained in:
@@ -79,6 +79,13 @@ form.register.error.passwordEmpty=The password can't be empty
|
|||||||
form.register.error.alreadyExists=A user with this login already exists. Please check you haven't already registered or change your login.
|
form.register.error.alreadyExists=A user with this login already exists. Please check you haven't already registered or change your login.
|
||||||
|
|
||||||
|
|
||||||
|
###################
|
||||||
|
# MESSAGE ERROR
|
||||||
|
message.error.noconferenceforthisid=This conference doesn't exist. Pease try again
|
||||||
|
message.error.noconferenceid=No conference selectionned
|
||||||
|
message.error.conferenceerror=Error. Try again.
|
||||||
|
|
||||||
|
|
||||||
submission.title=Article's submission
|
submission.title=Article's submission
|
||||||
|
|
||||||
form.submission.article.title=Article's title
|
form.submission.article.title=Article's title
|
||||||
|
|||||||
@@ -6,12 +6,23 @@
|
|||||||
|
|
||||||
<h2 align="center">Choose a conference</h2>
|
<h2 align="center">Choose a conference</h2>
|
||||||
|
|
||||||
|
<c:if test="${errorMessage != null}">
|
||||||
|
<span class="formError">
|
||||||
|
<c:choose>
|
||||||
|
<c:when test="${errorMessage == 1}"><fmt:message key="message.error.noconferenceforthisid" /></c:when>
|
||||||
|
<c:when test="${errorMessage == 2}"><fmt:message key="message.error.noconferenceid" /></c:when>
|
||||||
|
<c:otherwise><fmt:message key="message.error.conferenceerror" /></c:otherwise>
|
||||||
|
</c:choose>
|
||||||
|
</span><br />
|
||||||
|
</c:if>
|
||||||
|
|
||||||
|
|
||||||
Choix de la conference <br /><br />
|
Choix de la conference <br /><br />
|
||||||
|
|
||||||
<c:if test="${idCurrentConference!=null}">
|
<c:if test="${currentConferenceId!=null}">
|
||||||
La conf<6E>rence courante est : ${idCurrentConference}.<br /><br />
|
La conf<6E>rence courante est : ${currentConference.title}.<br /><br />
|
||||||
</c:if>
|
</c:if>
|
||||||
<c:if test="${idCurrentConference==null}">
|
<c:if test="${currentConferenceId==null}">
|
||||||
Il n'y a pas de conf<6E>rence s<>lectionn<6E>.<br /><br />
|
Il n'y a pas de conf<6E>rence s<>lectionn<6E>.<br /><br />
|
||||||
</c:if>
|
</c:if>
|
||||||
|
|
||||||
|
|||||||
@@ -210,6 +210,7 @@
|
|||||||
<!-- Get chosen conference in session context -->
|
<!-- Get chosen conference in session context -->
|
||||||
<bean id="ChooseConferenceController"
|
<bean id="ChooseConferenceController"
|
||||||
class="org.yacos.web.system.controller.ChooseConferenceController">
|
class="org.yacos.web.system.controller.ChooseConferenceController">
|
||||||
|
<property name="conferenceManager" ref="conferenceManager" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,64 @@
|
|||||||
package org.yacos.web.system.controller;
|
package org.yacos.web.system.controller;
|
||||||
|
|
||||||
|
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;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
import org.springframework.web.servlet.mvc.Controller;
|
import org.springframework.web.servlet.mvc.Controller;
|
||||||
|
import org.springframework.web.servlet.view.RedirectView;
|
||||||
|
import org.yacos.core.conferences.IConferenceManager;
|
||||||
import org.yacos.web.system.session.SessionService;
|
import org.yacos.web.system.session.SessionService;
|
||||||
|
|
||||||
public class ChooseConferenceController implements Controller {
|
public class ChooseConferenceController implements Controller {
|
||||||
|
|
||||||
|
private IConferenceManager conferenceManager;
|
||||||
|
|
||||||
|
public IConferenceManager getConferenceManager() {
|
||||||
|
return conferenceManager;
|
||||||
|
}
|
||||||
|
public void setConferenceManager(IConferenceManager conferenceManager) {
|
||||||
|
this.conferenceManager = conferenceManager;
|
||||||
|
}
|
||||||
|
|
||||||
public ModelAndView handleRequest(HttpServletRequest request,
|
public ModelAndView handleRequest(HttpServletRequest request,
|
||||||
HttpServletResponse response) throws Exception {
|
HttpServletResponse response) throws Exception {
|
||||||
|
|
||||||
// get IDConf
|
Map<String, Object> model = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
// get IDConf if exist
|
||||||
|
if (request.getParameter("idConf") != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
int idConf = Integer.parseInt(request.getParameter("idConf"));
|
int idConf = Integer.parseInt(request.getParameter("idConf"));
|
||||||
|
|
||||||
|
if(conferenceManager.exists(idConf))
|
||||||
|
{
|
||||||
// Set idConf in session context
|
// Set idConf in session context
|
||||||
SessionService.getInstance().setCurrentConferenceId(idConf);
|
SessionService.getInstance().setCurrentConferenceId(idConf);
|
||||||
|
|
||||||
return new ModelAndView("main");
|
return new ModelAndView("main");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
model.put("error", "1");
|
||||||
|
return new ModelAndView(new RedirectView("listConference.htm"), model);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(NumberFormatException e)
|
||||||
|
{
|
||||||
|
model.put("error", "3");
|
||||||
|
return new ModelAndView(new RedirectView("listConference.htm"), model);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
model.put("error", "2");
|
||||||
|
return new ModelAndView(new RedirectView("listConference.htm"), model);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,14 @@ public class ListConferenceController implements Controller{
|
|||||||
Map<String, Object> model = new HashMap<String, Object>();
|
Map<String, Object> model = new HashMap<String, Object>();
|
||||||
model.put("listConference", conferenceManager.getConferences());
|
model.put("listConference", conferenceManager.getConferences());
|
||||||
|
|
||||||
|
// Error choose conference
|
||||||
|
String msgCode = request.getParameter("error");
|
||||||
|
if (msgCode != null)
|
||||||
|
{
|
||||||
|
model.put("errorMessage", msgCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ModelAndView("listConference", model);
|
return new ModelAndView("listConference", model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user