Rev 1974 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1974 | Rev 1992 | ||
---|---|---|---|
Line 7... | Line 7... | ||
7 | <%@ page import="pt.estgp.estgweb.services.courses.CourseReportServices" %> |
7 | <%@ page import="pt.estgp.estgweb.services.courses.CourseReportServices" %> |
8 | <%@ page import="pt.estgp.estgweb.services.courses.coursereport.documentmodel.CourseReportDocument" %> |
8 | <%@ page import="pt.estgp.estgweb.services.courses.coursereport.documentmodel.CourseReportDocument" %> |
9 | <%@ page import="org.json.JSONException" %> |
9 | <%@ page import="org.json.JSONException" %> |
10 | <%@ page import="pt.estgp.estgweb.services.sigesimports.ImportCourseService" %> |
10 | <%@ page import="pt.estgp.estgweb.services.sigesimports.ImportCourseService" %> |
11 | <%@ page import="pt.estgp.estgweb.domain.UserSession" %> |
11 | <%@ page import="pt.estgp.estgweb.domain.UserSession" %> |
- | 12 | <%@ page import="pt.estgp.estgweb.domain.Course" %> |
|
- | 13 | <%@ page import="pt.estgp.estgweb.utils.documentBuilder.Document" %> |
|
12 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
14 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
13 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
15 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
14 | <%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
16 | <%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
15 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
17 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
16 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
18 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
17 | <%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
19 | <%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
18 | <%@taglib prefix="t" tagdir="/WEB-INF/tags" %> |
20 | <%@taglib prefix="t" tagdir="/WEB-INF/tags" %> |
19 | <jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSessionImpl" scope="request"/> |
21 | <jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSessionImpl" scope="request"/> |
20 | 22 | ||
- | 23 | <jsp:useBean id="courseReportJson" type="java.lang.String" scope="request"/> |
|
- | 24 | ||
21 | <link rel="stylesheet" href="<%=request.getContextPath()%>/js/jquery-ui-1.12.1/jquery-ui.css"> |
25 | <link rel="stylesheet" href="<%=request.getContextPath()%>/js/jquery-ui-1.12.1/jquery-ui.css"> |
22 | <script src="<%=request.getContextPath()%>/js/jquery-ui-1.12.1/jquery-ui.min.js"></script> |
26 | <script src="<%=request.getContextPath()%>/js/jquery-ui-1.12.1/jquery-ui.min.js"></script> |
23 | <link rel="stylesheet" href="<%=request.getContextPath()%>/css/flora-commons/flora.resizable.css"> |
27 | <link rel="stylesheet" href="<%=request.getContextPath()%>/css/flora-commons/flora.resizable.css"> |
24 | <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.2/jspdf.min.js"></script> |
28 | <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.2/jspdf.min.js"></script> |
25 | <script> |
29 | <script> |
Line 94... | Line 98... | ||
94 | ); |
98 | ); |
95 | } |
99 | } |
96 | </script> |
100 | </script> |
97 | 101 | ||
98 | <% |
102 | <% |
- | 103 | AbstractDao.getCurrentSession().beginTransaction(); |
|
- | 104 | ||
- | 105 | CourseReportDocument courseReportJson1; |
|
- | 106 | courseReportJson1 = Document.fromJson(courseReportJson); |
|
- | 107 | ||
- | 108 | CourseImpl courseImpl = DaoFactory.getCourseDaoImpl().findCourseByCode(courseReportJson1.getCourseCode()); |
|
- | 109 | request.setAttribute("course",courseImpl); |
|
99 | 110 | ||
- | 111 | ||
- | 112 | /*String courseCode = request.getParameter("courseCode"); |
|
- | 113 | AbstractDao.getCurrentSession().beginTransaction(); |
|
- | 114 | CourseImpl courseImpl = DaoFactory.getCourseDaoImpl().findCourseByCode(courseCode); |
|
- | 115 | request.setAttribute("course",courseImpl);*/ |
|
- | 116 | /* |
|
100 | String courseCode = request.getParameter("courseCode"); |
117 | String courseCode = request.getParameter("courseCode"); |
101 | String year = request.getParameter("year"); |
118 | String year = request.getParameter("year"); |
102 | 119 | ||
103 | AbstractDao.getCurrentSession().beginTransaction(); |
120 | AbstractDao.getCurrentSession().beginTransaction(); |
104 | CourseImpl courseImpl = DaoFactory.getCourseDaoImpl().findCourseByCode(courseCode); |
121 | CourseImpl courseImpl = DaoFactory.getCourseDaoImpl().findCourseByCode(courseCode); |
105 | request.setAttribute("course",courseImpl); |
122 | request.setAttribute("course",courseImpl); |
106 | 123 | ||
107 | CourseReportDocument courseReportDocument = new CourseReportDocument(); |
124 | CourseReportDocument courseReportDocument = new CourseReportDocument(); |
108 | 125 | ||
109 | String auxCourseReportDocument; |
126 | //String auxCourseReportDocument; |
110 | auxCourseReportDocument = new CourseReportServices().loadCourseReportDocument(courseCode,year,UserSession); |
127 | //auxCourseReportDocument = new CourseReportServices().loadCourseReportDocument(courseCode,year,UserSession); |
111 | 128 | ||
112 | try { |
129 | try { |
113 | //courseReportDocument = courseReportDocument.fromJson(auxCourseReportDocument); |
130 | //courseReportDocument = courseReportDocument.fromJson(auxCourseReportDocument); |
114 | courseReportDocument = new CourseReportServices().createNewCourseReportDocument(courseCode, year); |
131 | courseReportDocument = new CourseReportServices().createNewCourseReportDocument(courseCode, year); |
115 | }catch (Throwable e) { |
132 | }catch (Throwable e) { |
116 | System.out.println(e); |
133 | System.out.println(e); |
117 | e.printStackTrace(); |
134 | e.printStackTrace(); |
118 | } |
135 | } |
119 | 136 | ||
- | 137 | String courseReportJson = courseReportDocument.toJson(); |
|
- | 138 | request.setAttribute("courseDocumentJson",courseReportJson); |
|
- | 139 | request.setAttribute("courseDocument",courseReportDocument); |
|
120 | 140 | ||
121 | /*try { |
141 | /*try { |
122 | 142 | ||
123 | } catch (Throwable e) { |
143 | } catch (Throwable e) { |
124 | courseReportDocument = new CourseReportServices().createNewCourseReportDocument(courseCode, year); |
144 | courseReportDocument = new CourseReportServices().createNewCourseReportDocument(courseCode, year); |
125 | System.out.println(e); |
145 | System.out.println(e); |
126 | e.printStackTrace(); |
146 | e.printStackTrace(); |
127 | }*/ |
147 | }*/ |
- | 148 | %> |
|
- | 149 | ||
128 | 150 | ||
129 | String courseReportJson = courseReportDocument.toJson(); |
- | |
130 | request.setAttribute("courseDocumentJson",courseReportJson); |
- | |
131 | request.setAttribute("courseDocument",courseReportDocument); |
- | |
132 | 151 | ||
133 | %> |
- | |
134 | <%--<a href="javascript:demoFromHTML()" class="button">Run Code</a>--%> |
152 | <%--<a href="javascript:demoFromHTML()" class="button">Run Code</a>--%> |
135 | 153 | ||
136 | <div class="container-fluid"> |
154 | <div class="container-fluid"> |
137 | 155 | ||
138 | <style> |
156 | <style> |
Line 188... | Line 206... | ||
188 | 206 | ||
189 | courseReportApp.controller('courseReportAppController', function($scope) |
207 | courseReportApp.controller('courseReportAppController', function($scope) |
190 | { |
208 | { |
191 | 209 | ||
192 | $scope.docAppSelector = "#courseReportApp"; |
210 | $scope.docAppSelector = "#courseReportApp"; |
193 | $scope.report = <%=courseReportJson%> |
211 | $scope.report = ${courseReportJson} |
194 | 212 | ||
195 | $scope.resize = function(evt,ui,comp) { |
213 | $scope.resize = function(evt,ui,comp) { |
196 | //console.log (evt,ui); |
214 | //console.log (evt,ui); |
197 | comp.width = ui.size.width; |
215 | comp.width = ui.size.width; |
198 | comp.height = ui.size.height; |
216 | comp.height = ui.size.height; |
Line 377... | Line 395... | ||
377 | </div><!--Panel--> |
395 | </div><!--Panel--> |
378 | 396 | ||
379 | </div><!--container-fluid--> |
397 | </div><!--container-fluid--> |
380 | 398 | ||
381 | <% |
399 | <% |
382 | AbstractDao.getCurrentSession().getTransaction().commit(); |
- | |
- | 400 | ||
383 | %> |
401 | %> |
384 | 402 |