Rev 1872 | Rev 1892 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1872 | Rev 1889 | ||
---|---|---|---|
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" %> |
2 | <%@ page import="jomm.dao.impl.AbstractDao" %> |
3 | <%@ page import="pt.estgp.estgweb.domain.CourseImpl" %> |
3 | <%@ page import="pt.estgp.estgweb.domain.CourseImpl" %> |
4 | <%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %> |
4 | <%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %> |
5 | <%@ page import="pt.estgp.estgweb.utils.documentBuilder.TextComponent" %> |
5 | <%@ page import="pt.estgp.estgweb.utils.documentBuilder.TextComponent" %> |
6 | <%@ page import="pt.estgp.estgweb.utils.documentBuilder.ImageComponent" %> |
6 | <%@ page import="pt.estgp.estgweb.utils.documentBuilder.ImageComponent" %> |
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 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
10 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
11 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
11 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
12 | <%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
12 | <%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
13 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
13 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
14 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
14 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
15 | <%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
15 | <%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
16 | <%@taglib prefix="t" tagdir="/WEB-INF/tags" %> |
16 | <%@taglib prefix="t" tagdir="/WEB-INF/tags" %> |
17 | 17 | ||
18 | <link rel="stylesheet" href="<%=request.getContextPath()%>/js/jquery-ui-1.12.1/jquery-ui.css"> |
18 | <link rel="stylesheet" href="<%=request.getContextPath()%>/js/jquery-ui-1.12.1/jquery-ui.css"> |
19 | <script src="<%=request.getContextPath()%>/js/jquery-ui-1.12.1/jquery-ui.min.js"></script> |
19 | <script src="<%=request.getContextPath()%>/js/jquery-ui-1.12.1/jquery-ui.min.js"></script> |
20 | <link rel="stylesheet" href="<%=request.getContextPath()%>/css/flora-commons/flora.resizable.css"> |
20 | <link rel="stylesheet" href="<%=request.getContextPath()%>/css/flora-commons/flora.resizable.css"> |
21 | <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.2/jspdf.min.js"></script> |
21 | <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.2/jspdf.min.js"></script> |
22 | <script> |
22 | <script> |
23 | function demoFromHTML() { |
23 | function demoFromHTML() { |
24 | var pdf = new jsPDF('p', 'pt', 'letter'); |
24 | var pdf = new jsPDF('p', 'pt', 'letter'); |
25 | // source can be HTML-formatted string, or a reference |
25 | // source can be HTML-formatted string, or a reference |
26 | // to an actual DOM element from which the text will be scraped. |
26 | // to an actual DOM element from which the text will be scraped. |
27 | source = $('#courseReportApp')[0]; |
27 | source = $('#courseReportApp')[0]; |
28 | 28 | ||
29 | // we support special element handlers. Register them with jQuery-style |
29 | // we support special element handlers. Register them with jQuery-style |
30 | // ID selector for either ID or node name. ("#iAmID", "div", "span" etc.) |
30 | // ID selector for either ID or node name. ("#iAmID", "div", "span" etc.) |
31 | // There is no support for any other type of selectors |
31 | // There is no support for any other type of selectors |
32 | // (class, of compound) at this time. |
32 | // (class, of compound) at this time. |
33 | specialElementHandlers = { |
33 | specialElementHandlers = { |
34 | // element with id of "bypass" - jQuery style selector |
34 | // element with id of "bypass" - jQuery style selector |
35 | '#bypassme': function (element, renderer) { |
35 | '#bypassme': function (element, renderer) { |
36 | // true = "handled elsewhere, bypass text extraction" |
36 | // true = "handled elsewhere, bypass text extraction" |
37 | return true |
37 | return true |
38 | } |
38 | } |
39 | }; |
39 | }; |
40 | margins = { |
40 | margins = { |
41 | top: 80, |
41 | top: 80, |
42 | bottom: 60, |
42 | bottom: 60, |
43 | left: 40, |
43 | left: 40, |
44 | width: 522 |
44 | width: 522 |
45 | }; |
45 | }; |
46 | // all coords and widths are in jsPDF instance's declared units |
46 | // all coords and widths are in jsPDF instance's declared units |
47 | // 'inches' in this case |
47 | // 'inches' in this case |
48 | pdf.fromHTML( |
48 | pdf.fromHTML( |
49 | source, // HTML string or DOM elem ref. |
49 | source, // HTML string or DOM elem ref. |
50 | margins.left, // x coord |
50 | margins.left, // x coord |
51 | margins.top, { // y coord |
51 | margins.top, { // y coord |
52 | 'width': margins.width, // max width of content on PDF |
52 | 'width': margins.width, // max width of content on PDF |
53 | 'elementHandlers': specialElementHandlers |
53 | 'elementHandlers': specialElementHandlers |
54 | }, |
54 | }, |
55 | 55 | ||
56 | function (dispose) { |
56 | function (dispose) { |
57 | // dispose: object with X, Y of the last line add to the PDF |
57 | // dispose: object with X, Y of the last line add to the PDF |
58 | // this allow the insertion of new lines after html |
58 | // this allow the insertion of new lines after html |
59 | //var pdfDocument = pdf.save('Test.pdf'); |
59 | //var pdfDocument = pdf.save('Test.pdf'); |
60 | var pdfDocument = pdf.output(); |
60 | var pdfDocument = pdf.output(); |
61 | 61 | ||
62 | var boundary = '---------------------------'; |
62 | var boundary = '---------------------------'; |
63 | boundary += Math.floor(Math.random()*32768); |
63 | boundary += Math.floor(Math.random()*32768); |
64 | boundary += Math.floor(Math.random()*32768); |
64 | boundary += Math.floor(Math.random()*32768); |
65 | boundary += Math.floor(Math.random()*32768); |
65 | boundary += Math.floor(Math.random()*32768); |
66 | 66 | ||
67 | var body = ''; |
67 | var body = ''; |
68 | body += '--' + boundary + '\r\n' + |
68 | body += '--' + boundary + '\r\n' + |
69 | 'Content-Disposition: form-data; name="filesInputId-UPLOAD[]"; filename="20170530_210340.pdf"' + '\r\n'; |
69 | 'Content-Disposition: form-data; name="filesInputId-UPLOAD[]"; filename="20170530_210340.pdf"' + '\r\n'; |
70 | body += 'Content-Type: application/pdf'; |
70 | body += 'Content-Type: application/pdf'; |
71 | body += '\r\n\r\n'; |
71 | body += '\r\n\r\n'; |
72 | body += pdfDocument; |
72 | body += pdfDocument; |
73 | body += '\r\n' |
73 | body += '\r\n' |
74 | body += '--' + boundary + '--'; |
74 | body += '--' + boundary + '--'; |
75 | 75 | ||
76 | 76 | ||
77 | 77 | ||
78 | $.ajax({ |
78 | $.ajax({ |
79 | type: "POST", |
79 | type: "POST", |
80 | cache: false, |
80 | cache: false, |
81 | url: "<%=request.getContextPath()%>/filesUpload", |
81 | url: "<%=request.getContextPath()%>/filesUpload", |
82 | data: body , |
82 | data: body , |
83 | processData: false, |
83 | processData: false, |
84 | contentType : 'multipart/form-data; boundary=' + boundary, |
84 | contentType : 'multipart/form-data; boundary=' + boundary, |
85 | success: function (data) { |
85 | success: function (data) { |
86 | alert('success'); |
86 | alert('success'); |
87 | return false; |
87 | return false; |
88 | } |
88 | } |
89 | }); |
89 | }); |
90 | }, margins |
90 | }, margins |
91 | ); |
91 | ); |
92 | } |
92 | } |
93 | </script> |
93 | </script> |
94 | 94 | ||
95 | <% |
95 | <% |
96 | 96 | ||
97 | String courseCode = request.getParameter("courseCode"); |
97 | String courseCode = request.getParameter("courseCode"); |
98 | String year = request.getParameter("year"); |
98 | String year = request.getParameter("year"); |
99 | AbstractDao.getCurrentSession().beginTransaction(); |
99 | AbstractDao.getCurrentSession().beginTransaction(); |
100 | CourseImpl courseImpl = DaoFactory.getCourseDaoImpl().findCourseByCode(courseCode); |
100 | CourseImpl courseImpl = DaoFactory.getCourseDaoImpl().findCourseByCode(courseCode); |
101 | request.setAttribute("course",courseImpl); |
101 | request.setAttribute("course",courseImpl); |
102 | CourseReportDocument courseReport = null; |
102 | CourseReportDocument courseReport = null; |
103 | try { |
103 | try { |
104 | courseReport = new CourseReportServices().createNewCourseReportDocument(courseCode, year); |
104 | courseReport = new CourseReportServices().createNewCourseReportDocument(courseCode, year); |
105 | } catch (Throwable e) { |
105 | } catch (Throwable e) { |
106 | System.out.println(e); |
106 | System.out.println(e); |
107 | e.printStackTrace(); |
107 | e.printStackTrace(); |
108 | } |
108 | } |
109 | String courseReportJson = courseReport.toJson(); |
109 | String courseReportJson = courseReport.toJson(); |
110 | request.setAttribute("courseDocumentJson",courseReportJson); |
110 | request.setAttribute("courseDocumentJson",courseReportJson); |
111 | request.setAttribute("courseDocument",courseReport); |
111 | request.setAttribute("courseDocument",courseReport); |
112 | 112 | ||
113 | %> |
113 | %> |
114 | <%--<a href="javascript:demoFromHTML()" class="button">Run Code</a>--%> |
114 | <%--<a href="javascript:demoFromHTML()" class="button">Run Code</a>--%> |
115 | 115 | ||
116 | <div class="container-fluid"> |
116 | <div class="container-fluid"> |
117 | 117 | ||
118 | <style> |
118 | <style> |
119 | .separatorSection |
119 | .separatorSection |
120 | { |
120 | { |
121 | border: 1px solid #ddd; |
121 | border: 1px solid #ddd; |
122 | } |
122 | } |
123 | </style> |
123 | </style> |
124 | 124 | ||
125 | 125 | ||
126 | <!-- Apresentacao da Unidade --> |
126 | <!-- Apresentacao da Unidade --> |
127 | 127 | ||
128 | <div class="panel panel-default"> |
128 | <div class="panel panel-default"> |
129 | <div class="panel-heading"> |
129 | <div class="panel-heading"> |
130 | Relatório Anual do curso: ${course.name} |
130 | Relatório Anual do curso: ${course.name} |
131 | </div> |
131 | </div> |
132 | <div class="panel-body"> |
132 | <div class="panel-body"> |
133 | 133 | ||
134 | <p><b class="label-info">Tipo de Curso:</b> <bean:message key="course.${course.degree}"/></p> |
134 | <p><b class="label-info">Tipo de Curso:</b> <bean:message key="course.${course.degree}"/></p> |
135 | <p><b class="label-info">Ano Lectivo:</b> ${course.importYear}</p> |
135 | <p><b class="label-info">Ano Lectivo:</b> ${course.importYear}</p> |
136 | <p><b class="label-info">Departamento:</b> ${course.department.name}</p> |
136 | <p><b class="label-info">Departamento:</b> ${course.department.name}</p> |
137 | <p><b class="label-info">Escola:</b> ${course.department.courseSchool.name}</p> |
137 | <p><b class="label-info">Escola:</b> ${course.department.courseSchool.name}</p> |
138 | 138 | ||
139 | 139 | ||
140 | 140 | ||
141 | 141 | ||
142 | <script> |
142 | <script> |
143 | 143 | ||
144 | //Especifico da aplicacao |
144 | //Especifico da aplicacao |
145 | var courseReportApp = angular.module('courseReportApp', ['ui.tree']); |
145 | var courseReportApp = angular.module('courseReportApp', ['ui.tree']); |
146 | GLOBAL_BacoAngularAppDependencies.push('courseReportApp'); |
146 | GLOBAL_BacoAngularAppDependencies.push('courseReportApp'); |
147 | 147 | ||
148 | 148 | ||
149 | courseReportApp.directive('resizable', function () { |
149 | courseReportApp.directive('resizable', function () { |
150 | return { |
150 | return { |
151 | restrict: 'A', |
151 | restrict: 'A', |
152 | scope: { |
152 | scope: { |
153 | callback: '&onResize' |
153 | callback: '&onResize' |
154 | }, |
154 | }, |
155 | link: function postLink(scope, elem, attrs) { |
155 | link: function postLink(scope, elem, attrs) { |
156 | elem.resizable(); |
156 | elem.resizable(); |
157 | elem.on('resize', function (evt, ui, comp) { |
157 | elem.on('resize', function (evt, ui, comp) { |
158 | scope.$apply(function() { |
158 | scope.$apply(function() { |
159 | if (scope.callback) { |
159 | if (scope.callback) { |
160 | scope.callback({$evt: evt, $ui: ui, $comp: comp }); |
160 | scope.callback({$evt: evt, $ui: ui, $comp: comp }); |
161 | } |
161 | } |
162 | }) |
162 | }) |
163 | }); |
163 | }); |
164 | } |
164 | } |
165 | }; |
165 | }; |
166 | }); |
166 | }); |
167 | 167 | ||
168 | 168 | ||
169 | courseReportApp.controller('courseReportAppController', function($scope) |
169 | courseReportApp.controller('courseReportAppController', function($scope) |
170 | { |
170 | { |
171 | 171 | ||
172 | $scope.docAppSelector = "#courseReportApp"; |
172 | $scope.docAppSelector = "#courseReportApp"; |
173 | $scope.report = <%=courseReportJson%> |
173 | $scope.report = <%=courseReportJson%> |
174 | 174 | ||
175 | $scope.resize = function(evt,ui,comp) { |
175 | $scope.resize = function(evt,ui,comp) { |
176 | //console.log (evt,ui); |
176 | //console.log (evt,ui); |
177 | comp.width = ui.size.width; |
177 | comp.width = ui.size.width; |
178 | comp.height = ui.size.height; |
178 | comp.height = ui.size.height; |
179 | } |
179 | } |
180 | 180 | ||
181 | /** |
181 | /** |
182 | * @classe class to match |
182 | * @classe class to match |
183 | * @superClasses array of strings |
183 | * @superClasses array of strings |
184 | * */ |
184 | * */ |
185 | $scope.contains = function(obj,classe) |
185 | $scope.contains = function(obj,classe) |
186 | { |
186 | { |
187 | if(obj['@class'] && obj['@class'] == classe) |
187 | if(obj['@class'] && obj['@class'] == classe) |
188 | return true; |
188 | return true; |
189 | if(obj.allSuperClasses) |
189 | if(obj.allSuperClasses) |
190 | { |
190 | { |
191 | for(var i in obj.allSuperClasses) |
191 | for(var i in obj.allSuperClasses) |
192 | { |
192 | { |
193 | if(classe == obj.allSuperClasses[i]) |
193 | if(classe == obj.allSuperClasses[i]) |
194 | return true; |
194 | return true; |
195 | } |
195 | } |
196 | } |
196 | } |
197 | return false; |
197 | return false; |
198 | } |
198 | } |
199 | 199 | ||
200 | $scope.showSep = function(section,subSection) |
200 | $scope.showSep = function(section,subSection) |
201 | { |
201 | { |
202 | var s; |
202 | var s; |
203 | for(s in section.sections) |
203 | for(s in section.sections) |
204 | { |
204 | { |
205 | section.sections[s].active = false; |
205 | section.sections[s].active = false; |
206 | } |
206 | } |
207 | /*$(".separatorSectionNav").each(function() |
207 | /*$(".separatorSectionNav").each(function() |
208 | { |
208 | { |
209 | angular.element($(this)).scope().section.active = false; |
209 | angular.element($(this)).scope().section.active = false; |
210 | });*/ |
210 | });*/ |
211 | subSection.active = true; |
211 | subSection.active = true; |
212 | } |
212 | } |
213 | 213 | ||
214 | /** |
214 | /** |
215 | * Este metodo devolve o template mais profundo na hierarquia de classes |
215 | * Este metodo devolve o template mais profundo na hierarquia de classes |
216 | * permitindo emular o override, quanto mais especifica for a classe |
216 | * permitindo emular o override, quanto mais especifica for a classe |
217 | * e caso exista template é esse o template devolvido |
217 | * e caso exista template é esse o template devolvido |
218 | * procura um script com o id da classe e se nao existir |
218 | * procura um script com o id da classe e se nao existir |
219 | * vai subindo nas super classes |
219 | * vai subindo nas super classes |
220 | * @param obj |
220 | * @param obj |
221 | * @returns {*} |
221 | * @returns {*} |
222 | */ |
222 | */ |
223 | $scope.class2id = function(obj) |
223 | $scope.class2id = function(obj) |
224 | { |
224 | { |
225 | var objClassId = obj["@class"].replaceAll(".","_"); |
225 | var objClassId = obj["@class"].replaceAll(".","_"); |
226 | if($("script#" + objClassId).length > 0) |
226 | if($("script#" + objClassId).length > 0) |
227 | { |
227 | { |
228 | return objClassId; |
228 | return objClassId; |
229 | } |
229 | } |
230 | if(obj.allSuperClasses) |
230 | if(obj.allSuperClasses) |
231 | { |
231 | { |
232 | var s; |
232 | var s; |
233 | for(s in obj.allSuperClasses) |
233 | for(s in obj.allSuperClasses) |
234 | { |
234 | { |
235 | var superClass = obj.allSuperClasses[s]; |
235 | var superClass = obj.allSuperClasses[s]; |
236 | var superClassId = superClass.replaceAll(".","_"); |
236 | var superClassId = superClass.replaceAll(".","_"); |
237 | if($("script#" + superClassId).length > 0) |
237 | if($("script#" + superClassId).length > 0) |
238 | { |
238 | { |
239 | return superClassId; |
239 | return superClassId; |
240 | } |
240 | } |
241 | } |
241 | } |
242 | } |
242 | } |
243 | return obj["@class"].replaceAll(".","_"); |
243 | return obj["@class"].replaceAll(".","_"); |
244 | } |
244 | } |
245 | 245 | ||
246 | $scope.addText = function(parentCustomPane) |
246 | $scope.addText = function(parentCustomPane) |
247 | { |
247 | { |
248 | $scope.addSimpleDocComponent(parentCustomPane,"pt.estgp.estgweb.utils.documentBuilder.TextComponent") |
248 | $scope.addSimpleDocComponent(parentCustomPane,"pt.estgp.estgweb.utils.documentBuilder.TextComponent") |
249 | } |
249 | } |
250 | 250 | ||
251 | $scope.addImage = function(parentCustomPane) |
251 | $scope.addImage = function(parentCustomPane) |
252 | { |
252 | { |
253 | $scope.addSimpleDocComponent(parentCustomPane,"pt.estgp.estgweb.utils.documentBuilder.ImageComponent") |
253 | $scope.addSimpleDocComponent(parentCustomPane,"pt.estgp.estgweb.utils.documentBuilder.ImageComponent") |
254 | } |
254 | } |
255 | 255 | ||
256 | $scope.addSimpleDocComponent = function(parentCustomPane,classComponent) |
256 | $scope.addSimpleDocComponent = function(parentCustomPane,classComponent) |
257 | { |
257 | { |
258 | if(!parentCustomPane.components) |
258 | if(!parentCustomPane.components) |
259 | { |
259 | { |
260 | parentCustomPane.components = []; |
260 | parentCustomPane.components = []; |
261 | } |
261 | } |
262 | parentCustomPane.components.push( |
262 | parentCustomPane.components.push( |
263 | { |
263 | { |
264 | "@class" : classComponent |
264 | "@class" : classComponent |
265 | } |
265 | } |
266 | ); |
266 | ); |
267 | } |
267 | } |
268 | $scope.removeComponent = function(index,array) |
268 | $scope.removeComponent = function(index,array) |
269 | { |
269 | { |
270 | array.splice(index,1); |
270 | array.splice(index,1); |
271 | } |
271 | } |
272 | 272 | ||
273 | $scope.callbackUploadedFiles = function(filesUploadResult,token,targetElement) |
273 | $scope.callbackUploadedFiles = function(filesUploadResult,token,targetElement) |
274 | { |
274 | { |
275 | var modelObject = BacoAngularUtils.getAngularElementModel(targetElement); |
275 | var modelObject = BacoAngularUtils.getAngularElementModel(targetElement); |
276 | 276 | ||
277 | if(modelObject.image && modelObject.image.identifier) |
277 | if(modelObject.image && modelObject.image.identifier) |
278 | { |
278 | { |
279 | widgetCallWithActionParameters( |
279 | widgetCallWithActionParameters( |
280 | "<%=request.getContextPath()%>/user/json/repository.do", |
280 | "<%=request.getContextPath()%>/user/json/repository.do", |
281 | "replaceRepositoryFileFromTempPrivateDomain", |
281 | "replaceRepositoryFileFromTempPrivateDomain", |
282 | { |
282 | { |
283 | "identifier" : modelObject.image.identifier, |
283 | "identifier" : modelObject.image.identifier, |
284 | "fileUploaded" : BacoJS.stringifyOrdered(filesUploadResult.uploadedFiles[0]) |
284 | "fileUploaded" : BacoJS.stringifyOrdered(filesUploadResult.uploadedFiles[0]) |
285 | }, |
285 | }, |
286 | "#courseReportApp", |
286 | "#courseReportApp", |
287 | function(repositoryFile4JsonView) |
287 | function(repositoryFile4JsonView) |
288 | { |
288 | { |
289 | modelObject.image = repositoryFile4JsonView; |
289 | modelObject.image = repositoryFile4JsonView; |
290 | //image URL is generated on reimport just to avoid caching |
290 | //image URL is generated on reimport just to avoid caching |
291 | modelObject.imageUrl = "<%=request.getContextPath()%>/repositoryStream/" + modelObject.image.identifier + "?" + new Date().getTime(); |
291 | modelObject.imageUrl = "<%=request.getContextPath()%>/repositoryStream/" + modelObject.image.identifier + "?" + new Date().getTime(); |
292 | angular.element($("#courseReportApp")).scope().$apply(); |
292 | angular.element($("#courseReportApp")).scope().$apply(); |
293 | }, |
293 | }, |
294 | function(){} |
294 | function(){} |
295 | ); |
295 | ); |
296 | } |
296 | } |
297 | else |
297 | else |
298 | { |
298 | { |
299 | widgetCallWithActionParameters( |
299 | widgetCallWithActionParameters( |
300 | "<%=request.getContextPath()%>/user/json/repository.do", |
300 | "<%=request.getContextPath()%>/user/json/repository.do", |
301 | "saveRepositoryFileFromTempPrivateDomain", |
301 | "saveRepositoryFileFromTempPrivateDomain", |
302 | { |
302 | { |
303 | "fileUploaded" : BacoJS.stringifyOrdered(filesUploadResult.uploadedFiles[0]) |
303 | "fileUploaded" : BacoJS.stringifyOrdered(filesUploadResult.uploadedFiles[0]) |
304 | }, |
304 | }, |
305 | "#courseReportApp", |
305 | "#courseReportApp", |
306 | function(repositoryFile4JsonView) |
306 | function(repositoryFile4JsonView) |
307 | { |
307 | { |
308 | modelObject.image = repositoryFile4JsonView; |
308 | modelObject.image = repositoryFile4JsonView; |
309 | modelObject.imageUrl = "<%=request.getContextPath()%>/repositoryStream/" + modelObject.image.identifier + "?" + new Date().getTime(); |
309 | modelObject.imageUrl = "<%=request.getContextPath()%>/repositoryStream/" + modelObject.image.identifier + "?" + new Date().getTime(); |
310 | angular.element($("#courseReportApp")).scope().$apply(); |
310 | angular.element($("#courseReportApp")).scope().$apply(); |
311 | }, |
311 | }, |
312 | function(){} |
312 | function(){} |
313 | ); |
313 | ); |
314 | } |
314 | } |
315 | } |
315 | } |
316 | 316 | ||
317 | 317 | ||
318 | 318 | ||
319 | 319 | ||
320 | }); |
320 | }); |
321 | </script> |
321 | </script> |
322 | 322 | ||
323 | <!--TEMPLATES FOR DOCUMENT BUILDER--> |
323 | <!--TEMPLATES FOR DOCUMENT BUILDER--> |
324 | <jsp:include page="../utils/documentsBuilder.jsp"/> |
324 | <jsp:include page="../utils/documentsBuilder.jsp"/> |
325 | <jsp:include page="coursereport/templates.jsp"/> |
325 | <jsp:include page="coursereport/templates.jsp"/> |
326 | 326 | ||
327 | <div class="form-vertical"> |
327 | <div class="form-vertical"> |
328 | <div id="courseReportApp" ng-app="courseReportApp" ng-controller="courseReportAppController"> |
328 | <div id="courseReportApp" ng-app="courseReportApp" ng-controller="courseReportAppController"> |
329 | 329 | ||
330 | <div ng-init="section=report;" ng-include="'pt_estgp_estgweb_utils_documentBuilder_DocumentSection'"> |
330 | <div ng-init="section=report;" ng-include="'pt_estgp_estgweb_utils_documentBuilder_DocumentSection'"> |
331 | 331 | ||
332 | </div> |
332 | </div> |
333 | 333 | ||
334 | <!-- <pre class="code">{{ report | json }}</pre>--> |
334 | <pre class="code">{{ report | json }}</pre> |
335 | 335 | ||
336 | 336 | ||
337 | 337 | ||
338 | </div><!--App--> |
338 | </div><!--App--> |
339 | </div> <!--form--> |
339 | </div> <!--form--> |
340 | 340 | ||
341 | </div><!--Panel Body--> |
341 | </div><!--Panel Body--> |
342 | 342 | ||
343 | </div><!--Panel--> |
343 | </div><!--Panel--> |
344 | 344 | ||
345 | </div><!--container-fluid--> |
345 | </div><!--container-fluid--> |
346 | 346 | ||
347 | <% |
347 | <% |
348 | AbstractDao.getCurrentSession().getTransaction().commit(); |
348 | AbstractDao.getCurrentSession().getTransaction().commit(); |
349 | %> |
349 | %> |
350 | 350 | ||
351 | Generated by GNU Enscript 1.6.5.2. |
351 | Generated by GNU Enscript 1.6.5.2. |
352 | 352 | ||
353 | 353 |