Rev 1327 | Rev 1336 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1327 | jmachado | 1 | package pt.estgp.estgweb.web.controllers.questionarios; |
2 | |||
3 | import org.apache.log4j.Logger; |
||
4 | import org.apache.struts.action.ActionForm; |
||
5 | import org.apache.struts.action.ActionForward; |
||
6 | import org.apache.struts.action.ActionMapping; |
||
7 | import pt.estgp.estgweb.domain.QuestionarioImpl; |
||
8 | import pt.estgp.estgweb.web.form.questionarios.QuestionarioForm; |
||
9 | import pt.estgp.estgweb.web.utils.RequestUtils; |
||
10 | import pt.utl.ist.berserk.logic.serviceManager.IServiceManager; |
||
11 | import pt.utl.ist.berserk.logic.serviceManager.ServiceManager; |
||
12 | |||
13 | import javax.servlet.http.HttpServletRequest; |
||
14 | import javax.servlet.http.HttpServletResponse; |
||
15 | |||
16 | /** |
||
17 | * Created by jorgemachado on 21/03/16. |
||
18 | */ |
||
19 | public class QuestionarioCourseSelectionController extends QuestionarioController |
||
20 | { |
||
21 | |||
22 | private static final 1.5.0/docs/api/java/util/logging/Logger.html">Logger logger = 1.5.0/docs/api/java/util/logging/Logger.html">Logger.getLogger(QuestionarioCourseSelectionController.class); |
||
23 | |||
24 | public ActionForward selectCourses(ActionMapping mapping, |
||
25 | ActionForm form, |
||
26 | HttpServletRequest request, |
||
27 | HttpServletResponse response) |
||
28 | throws 1.5.0/docs/api/java/lang/Throwable.html">Throwable |
||
29 | { |
||
30 | QuestionarioForm frm = (QuestionarioForm) form; |
||
31 | |||
32 | if(frm.getCoursesSelectedIds() == null) |
||
33 | { |
||
34 | addError(request,"questionario.no.courses.selected"); |
||
35 | return mapping.findForward("coursesSelection"); |
||
36 | } |
||
37 | |||
38 | |||
39 | |||
40 | IServiceManager sm = ServiceManager.getInstance(); |
||
41 | 1.5.0/docs/api/java/lang/String.html">String[] names = {"questionarioId","selectedCourses"}; |
||
42 | 5+0%2Fdocs%2Fapi+Object">Object[] args = {frm.getQuestionario().getId(),frm.getCoursesSelectedIds()}; |
||
43 | |||
44 | QuestionarioImpl q = (QuestionarioImpl) sm.execute(RequestUtils.getRequester(request, response),"RunJobSelectCourses",args,names); |
||
45 | |||
46 | frm.setQuestionario(q); |
||
47 | |||
48 | addMessage(request,"questionarios.courses.start"); |
||
1328 | jmachado | 49 | return mapping.findForward("coursesSelection"); |
1327 | jmachado | 50 | } |
51 | |||
52 | |||
53 | } |