Rev 1925 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1925 | Rev 1934 | ||
---|---|---|---|
Line 5... | Line 5... | ||
5 | import org.apache.struts.action.ActionForward; |
5 | import org.apache.struts.action.ActionForward; |
6 | import org.apache.struts.action.ActionMapping; |
6 | import org.apache.struts.action.ActionMapping; |
7 | import org.json.JSONObject; |
7 | import org.json.JSONObject; |
8 | import pt.estgp.estgweb.domain.CourseImpl; |
8 | import pt.estgp.estgweb.domain.CourseImpl; |
9 | import pt.estgp.estgweb.domain.dao.DaoFactory; |
9 | import pt.estgp.estgweb.domain.dao.DaoFactory; |
- | 10 | import pt.estgp.estgweb.services.courses.coursereport.documentmodel.CourseReportDocument; |
|
10 | import pt.estgp.estgweb.web.controllers.utils.AbstractWidgetAjaxController; |
11 | import pt.estgp.estgweb.web.controllers.utils.AbstractWidgetAjaxController; |
11 | import pt.estgp.estgweb.web.exceptions.NoCookiesException; |
12 | import pt.estgp.estgweb.web.exceptions.NoCookiesException; |
12 | import pt.estgp.estgweb.web.utils.RequestUtils; |
13 | import pt.estgp.estgweb.web.utils.RequestUtils; |
13 | import pt.utl.ist.berserk.logic.serviceManager.IServiceManager; |
14 | import pt.utl.ist.berserk.logic.serviceManager.IServiceManager; |
14 | import pt.utl.ist.berserk.logic.serviceManager.ServiceManager; |
15 | import pt.utl.ist.berserk.logic.serviceManager.ServiceManager; |
Line 34... | Line 35... | ||
34 | * @throws Throwable |
35 | * @throws Throwable |
35 | */ |
36 | */ |
36 | 37 | ||
37 | public JSONObject generateGlobalLearningResultsChartImg(ActionForm form, HttpServletRequest request, HttpServletResponse response) throws 1.5.0/docs/api/java/lang/Throwable.html">Throwable { |
38 | public JSONObject generateGlobalLearningResultsChartImg(ActionForm form, HttpServletRequest request, HttpServletResponse response) throws 1.5.0/docs/api/java/lang/Throwable.html">Throwable { |
38 | 1.5.0/docs/api/java/lang/String.html">String courseReportDocument = request.getParameter("courseReportDocument"); |
39 | 1.5.0/docs/api/java/lang/String.html">String courseReportDocument = request.getParameter("courseReportDocument"); |
- | 40 | CourseReportDocument reportDocument = CourseReportDocument.fromJson(courseReportDocument); |
|
39 | 41 | ||
40 | IServiceManager sm = ServiceManager.getInstance(); |
42 | IServiceManager sm = ServiceManager.getInstance(); |
41 | 1.5.0/docs/api/java/lang/String.html">String json = (1.5.0/docs/api/java/lang/String.html">String) sm.execute(RequestUtils.getRequester(request, response), |
43 | 1.5.0/docs/api/java/lang/String.html">String json = (1.5.0/docs/api/java/lang/String.html">String) sm.execute(RequestUtils.getRequester(request, response), |
42 | "CourseReportGenerateGlobalLearningResultsChartImg", |
44 | "CourseReportGenerateGlobalLearningResultsChartImg", |
43 | new 5+0%2Fdocs%2Fapi+Object">Object[]{courseReportDocument}); |
45 | new 5+0%2Fdocs%2Fapi+Object">Object[]{reportDocument}, |
- | 46 | new 1.5.0/docs/api/java/lang/String.html">String[]{"reportDocument"}); |
|
44 | return new JSONObject(json); |
47 | return new JSONObject(json); |
45 | } |
48 | } |
46 | 49 | ||
47 | public JSONObject generateGlobalLearningResultsChartYearImg(ActionForm form, HttpServletRequest request, HttpServletResponse response) throws 1.5.0/docs/api/java/lang/Throwable.html">Throwable { |
50 | public JSONObject generateGlobalLearningResultsChartYearImg(ActionForm form, HttpServletRequest request, HttpServletResponse response) throws 1.5.0/docs/api/java/lang/Throwable.html">Throwable { |
48 | 1.5.0/docs/api/java/lang/String.html">String courseReportDocument = request.getParameter("courseReportDocument"); |
51 | 1.5.0/docs/api/java/lang/String.html">String courseReportDocument = request.getParameter("courseReportDocument"); |
- | 52 | CourseReportDocument reportDocument = CourseReportDocument.fromJson(courseReportDocument); |
|
49 | 53 | ||
50 | IServiceManager sm = ServiceManager.getInstance(); |
54 | IServiceManager sm = ServiceManager.getInstance(); |
51 | 1.5.0/docs/api/java/lang/String.html">String json = (1.5.0/docs/api/java/lang/String.html">String) sm.execute(RequestUtils.getRequester(request, response), |
55 | 1.5.0/docs/api/java/lang/String.html">String json = (1.5.0/docs/api/java/lang/String.html">String) sm.execute(RequestUtils.getRequester(request, response), |
52 | "CourseReportGenerateGlobalLearningResultsChartYearImg", |
56 | "CourseReportGenerateGlobalLearningResultsChartYearImg", |
53 | new 5+0%2Fdocs%2Fapi+Object">Object[]{courseReportDocument}); |
57 | new 5+0%2Fdocs%2Fapi+Object">Object[]{reportDocument}, |
- | 58 | new 1.5.0/docs/api/java/lang/String.html">String[]{"reportDocument"}); |
|
54 | return new JSONObject(json); |
59 | return new JSONObject(json); |
55 | } |
60 | } |
56 | 61 | ||
57 | public JSONObject generateGenerateGlobalLearningResultsChartSem(ActionForm form, HttpServletRequest request, HttpServletResponse response) throws 1.5.0/docs/api/java/lang/Throwable.html">Throwable { |
62 | public JSONObject generateGenerateGlobalLearningResultsChartSem(ActionForm form, HttpServletRequest request, HttpServletResponse response) throws 1.5.0/docs/api/java/lang/Throwable.html">Throwable { |
58 | 1.5.0/docs/api/java/lang/String.html">String courseReportDocument = request.getParameter("courseReportDocument"); |
63 | 1.5.0/docs/api/java/lang/String.html">String courseReportDocument = request.getParameter("courseReportDocument"); |
- | 64 | CourseReportDocument reportDocument = CourseReportDocument.fromJson(courseReportDocument); |
|
59 | 1.5.0/docs/api/java/lang/String.html">String semesterCode = request.getParameter("semesterCode"); |
65 | 1.5.0/docs/api/java/lang/String.html">String semesterCode = request.getParameter("semesterCode"); |
60 | 66 | ||
61 | IServiceManager sm = ServiceManager.getInstance(); |
67 | IServiceManager sm = ServiceManager.getInstance(); |
62 | 1.5.0/docs/api/java/lang/String.html">String json = (1.5.0/docs/api/java/lang/String.html">String) sm.execute(RequestUtils.getRequester(request, response), |
68 | 1.5.0/docs/api/java/lang/String.html">String json = (1.5.0/docs/api/java/lang/String.html">String) sm.execute(RequestUtils.getRequester(request, response), |
63 | "CourseReportGenerateLearningResultsChartSem", |
69 | "CourseReportGenerateLearningResultsChartSem", |
64 | new 5+0%2Fdocs%2Fapi+Object">Object[]{courseReportDocument, semesterCode}); |
70 | new 5+0%2Fdocs%2Fapi+Object">Object[]{reportDocument, semesterCode}, |
- | 71 | new 1.5.0/docs/api/java/lang/String.html">String[]{"reportDocument", "semesterCode"}); |
|
65 | return new JSONObject(json); |
72 | return new JSONObject(json); |
66 | } |
73 | } |
67 | 74 | ||
68 | public JSONObject saveCourseReportDocument(ActionForm form, HttpServletRequest request, HttpServletResponse response) throws 1.5.0/docs/api/java/lang/Throwable.html">Throwable { |
75 | public JSONObject saveCourseReportDocument(ActionForm form, HttpServletRequest request, HttpServletResponse response) throws 1.5.0/docs/api/java/lang/Throwable.html">Throwable { |
69 | 1.5.0/docs/api/java/lang/String.html">String courseReportDocument = request.getParameter("courseReportDocument"); |
76 | 1.5.0/docs/api/java/lang/String.html">String courseReportDocument = request.getParameter("courseReportDocument"); |
- | 77 | CourseReportDocument reportDocument = CourseReportDocument.fromJson(courseReportDocument); |
|
70 | 78 | ||
71 | IServiceManager sm = ServiceManager.getInstance(); |
79 | IServiceManager sm = ServiceManager.getInstance(); |
72 | 1.5.0/docs/api/java/lang/String.html">String json = (1.5.0/docs/api/java/lang/String.html">String) sm.execute(RequestUtils.getRequester(request, response), |
80 | 1.5.0/docs/api/java/lang/String.html">String json = (1.5.0/docs/api/java/lang/String.html">String) sm.execute(RequestUtils.getRequester(request, response), |
73 | "SaveCourseReportDocument", |
81 | "SaveCourseReportDocument", |
74 | new 5+0%2Fdocs%2Fapi+Object">Object[]{courseReportDocument}); |
82 | new 5+0%2Fdocs%2Fapi+Object">Object[]{reportDocument}, |
- | 83 | new 1.5.0/docs/api/java/lang/String.html">String[]{"reportDocument"}); |
|
75 | return new JSONObject(json); |
84 | return new JSONObject(json); |
76 | } |
85 | } |
77 | 86 | ||
78 | public ActionForward startEdit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws 1.5.0/docs/api/java/lang/Throwable.html">Throwable { |
87 | public ActionForward startEdit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws 1.5.0/docs/api/java/lang/Throwable.html">Throwable { |
79 | 1.5.0/docs/api/java/lang/String.html">String courseCode = request.getParameter("courseCode"); |
88 | 1.5.0/docs/api/java/lang/String.html">String courseCode = request.getParameter("courseCode"); |
Line 91... | Line 100... | ||
91 | request.setAttribute("course", courseImpl); |
100 | request.setAttribute("course", courseImpl); |
92 | AbstractDao.getCurrentSession().getTransaction().commit(); |
101 | AbstractDao.getCurrentSession().getTransaction().commit(); |
93 | 102 | ||
94 | return mapping.findForward("editCourseReport"); |
103 | return mapping.findForward("editCourseReport"); |
95 | } |
104 | } |
- | 105 | ||
- | 106 | public ActionForward startFormatted(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws 1.5.0/docs/api/java/lang/Throwable.html">Throwable { |
|
- | 107 | 1.5.0/docs/api/java/lang/String.html">String courseCode = request.getParameter("courseCode"); |
|
- | 108 | 1.5.0/docs/api/java/lang/String.html">String year = request.getParameter("year"); |
|
- | 109 | ||
- | 110 | IServiceManager sm = ServiceManager.getInstance(); |
|
- | 111 | 1.5.0/docs/api/java/lang/String.html">String courseReportJson = (1.5.0/docs/api/java/lang/String.html">String) sm.execute(RequestUtils.getRequester(request, response), |
|
- | 112 | "LoadCourseReportDocument", |
|
- | 113 | new 5+0%2Fdocs%2Fapi+Object">Object[]{courseCode, year}, |
|
- | 114 | new 1.5.0/docs/api/java/lang/String.html">String[]{"courseCode", "year"}); |
|
- | 115 | request.setAttribute("courseReportJson", courseReportJson); |
|
- | 116 | ||
- | 117 | AbstractDao.getCurrentSession().beginTransaction(); |
|
- | 118 | CourseImpl courseImpl = DaoFactory.getCourseDaoImpl().findCourseByCode(courseCode); |
|
- | 119 | request.setAttribute("course", courseImpl); |
|
- | 120 | AbstractDao.getCurrentSession().getTransaction().commit(); |
|
- | 121 | ||
- | 122 | return mapping.findForward("formatedCourseReport"); |
|
- | 123 | } |
|
96 | } |
124 | } |