Rev 1984 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1984 | Rev 1996 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
2 | <%@ page import="jomm.dao.impl.AbstractDao" %> |
- | |
3 | <%@ page import="pt.estgp.estgweb.domain.CourseImpl" %> |
- | |
4 | <%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %> |
- | |
5 | <%@ page import="pt.estgp.estgweb.utils.documentBuilder.TextComponent" %> |
- | |
6 | <%@ page import="pt.estgp.estgweb.utils.documentBuilder.ImageComponent" %> |
- | |
7 | <%@ page import="pt.estgp.estgweb.services.courses.CourseReportServices" %> |
- | |
8 | <%@ page import="pt.estgp.estgweb.services.courses.coursereport.documentmodel.CourseReportDocument" %> |
- | |
9 | <%@ page import="org.json.JSONException" %> |
- | |
10 | <%@ page import="pt.estgp.estgweb.domain.UserSession" %> |
- | |
11 | <%@ page import="pt.estgp.estgweb.domain.User" %> |
- | |
12 | 2 | ||
13 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
3 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
14 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
4 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
15 | <%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
5 | <%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
16 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
6 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
Line 93... | Line 83... | ||
93 | }, margins |
83 | }, margins |
94 | ); |
84 | ); |
95 | } |
85 | } |
96 | </script> |
86 | </script> |
97 | 87 | ||
98 | <% |
- | |
99 | - | ||
100 | String courseCode = request.getParameter("courseCode"); |
- | |
101 | String year = request.getParameter("year"); |
- | |
102 | String relatas = null; |
- | |
103 | AbstractDao.getCurrentSession().beginTransaction(); |
- | |
104 | CourseImpl courseImpl = DaoFactory.getCourseDaoImpl().findCourseByCode(courseCode); |
- | |
105 | request.setAttribute("course",courseImpl); |
- | |
106 | CourseReportDocument courseReport = null; |
- | |
107 | try { |
- | |
108 | //eu |
- | |
109 | //relatas = new CourseReportServices().loadCourseReportDoc(,year,courseCode); |
- | |
110 | //if (relatas.isEmpty()) |
- | |
111 | courseReport = new CourseReportServices().createNewCourseReportDocument(courseCode, year); |
- | |
112 | //eu |
- | |
113 | courseReport = courseReport.fromJson(relatas); |
- | |
114 | } catch (Throwable e) { |
- | |
115 | System.out.println(e); |
- | |
116 | e.printStackTrace(); |
- | |
117 | } |
- | |
118 | - | ||
119 | - | ||
120 | String courseReportJson = courseReport.toJson(); |
- | |
121 | request.setAttribute("courseDocumentJson",courseReportJson); |
- | |
122 | request.setAttribute("courseDocument",courseReport); |
- | |
123 | - | ||
124 | %> |
- | |
125 | <%--<a href="javascript:demoFromHTML()" class="button">Run Code</a>--%> |
88 | <%--<a href="javascript:demoFromHTML()" class="button">Run Code</a>--%> |
126 | 89 | ||
127 | <div class="container-fluid"> |
90 | <div class="container-fluid"> |
128 | 91 | ||
129 | <style> |
92 | <style> |
Line 146... | Line 109... | ||
146 | <p><b class="label-info">Ano Lectivo:</b> ${course.importYear}</p> |
109 | <p><b class="label-info">Ano Lectivo:</b> ${course.importYear}</p> |
147 | <p><b class="label-info">Departamento:</b> ${course.department.name}</p> |
110 | <p><b class="label-info">Departamento:</b> ${course.department.name}</p> |
148 | <p><b class="label-info">Escola:</b> ${course.department.courseSchool.name}</p> |
111 | <p><b class="label-info">Escola:</b> ${course.department.courseSchool.name}</p> |
149 | 112 | ||
150 | 113 | ||
151 | - | ||
152 | - | ||
153 | <script> |
114 | <script> |
154 | 115 | ||
155 | //Especifico da aplicacao |
116 | //Especifico da aplicacao |
156 | var courseReportApp = angular.module('courseReportApp', ['ui.tree']); |
117 | var courseReportApp = angular.module('courseReportApp', ['ui.tree']); |
157 | GLOBAL_BacoAngularAppDependencies.push('courseReportApp'); |
118 | GLOBAL_BacoAngularAppDependencies.push('courseReportApp'); |
Line 179... | Line 140... | ||
179 | 140 | ||
180 | courseReportApp.controller('courseReportAppController', function($scope) |
141 | courseReportApp.controller('courseReportAppController', function($scope) |
181 | { |
142 | { |
182 | 143 | ||
183 | $scope.docAppSelector = "#courseReportApp"; |
144 | $scope.docAppSelector = "#courseReportApp"; |
184 | $scope.report = <%=courseReportJson%> |
145 | $scope.report = ${courseReportJson} |
185 | 146 | ||
186 | $scope.resize = function(evt,ui,comp) { |
147 | $scope.resize = function(evt,ui,comp) { |
187 | //console.log (evt,ui); |
148 | //console.log (evt,ui); |
188 | comp.width = ui.size.width; |
149 | comp.width = ui.size.width; |
189 | comp.height = ui.size.height; |
150 | comp.height = ui.size.height; |
Line 353... | Line 314... | ||
353 | <jsp:include page="../utils/documentsBuilder.jsp"/> |
314 | <jsp:include page="../utils/documentsBuilder.jsp"/> |
354 | 315 | ||
355 | <div class="form-vertical"> |
316 | <div class="form-vertical"> |
356 | <div id="courseReportApp" ng-app="courseReportApp" ng-controller="courseReportAppController"> |
317 | <div id="courseReportApp" ng-app="courseReportApp" ng-controller="courseReportAppController"> |
357 | <div class="web-mensages"></div> |
318 | <div class="web-mensages"></div> |
358 | <button class="btn " ng-click="saveCourseReportDoc()">Save</button> |
319 | <button class="btn" ng-click="saveCourseReportDoc()">Save</button> |
359 | 320 | ||
360 | <div ng-init="section=report;" ng-include="'pt_estgp_estgweb_utils_documentBuilder_DocumentSection'"> |
321 | <div ng-init="section=report;" ng-include="'pt_estgp_estgweb_utils_documentBuilder_DocumentSection'"> |
361 | 322 | ||
362 | </div> |
323 | </div> |
363 | 324 | ||
Line 370... | Line 331... | ||
370 | 331 | ||
371 | </div><!--Panel Body--> |
332 | </div><!--Panel Body--> |
372 | 333 | ||
373 | </div><!--Panel--> |
334 | </div><!--Panel--> |
374 | 335 | ||
375 | </div><!--container-fluid--> |
- | |
376 | - | ||
377 | <% |
- | |
378 | AbstractDao.getCurrentSession().getTransaction().commit(); |
- | |
379 | %> |
- | |
380 | 336 | </div><!--container-fluid--> |
|
- | 337 | ||
381 | Generated by GNU Enscript 1.6.5.2. |
338 | Generated by GNU Enscript 1.6.5.2. |