Rev 1856 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1856 | Rev 1869 | ||
---|---|---|---|
Line 98... | Line 98... | ||
98 | AbstractDao.getCurrentSession().beginTransaction(); |
98 | AbstractDao.getCurrentSession().beginTransaction(); |
99 | CourseImpl courseImpl = DaoFactory.getCourseDaoImpl().findCourseByCode(courseCode); |
99 | CourseImpl courseImpl = DaoFactory.getCourseDaoImpl().findCourseByCode(courseCode); |
100 | request.setAttribute("course",courseImpl); |
100 | request.setAttribute("course",courseImpl); |
101 | CourseReportDocument courseReport = null; |
101 | CourseReportDocument courseReport = null; |
102 | try { |
102 | try { |
103 | courseReport = new CourseReportServices().createNewCourseReportDocument("44", "201617"); |
103 | courseReport = new CourseReportServices().createNewCourseReportDocument(courseCode, "201617"); |
104 | } catch (Throwable e) { |
104 | } catch (Throwable e) { |
105 | System.out.println(e); |
105 | System.out.println(e); |
106 | e.printStackTrace(); |
106 | e.printStackTrace(); |
107 | } |
107 | } |
108 | String courseReportJson = courseReport.toJson(); |
108 | String courseReportJson = courseReport.toJson(); |
Line 194... | Line 194... | ||
194 | } |
194 | } |
195 | } |
195 | } |
196 | return false; |
196 | return false; |
197 | } |
197 | } |
198 | 198 | ||
199 | $scope.showSep = function(section) |
199 | $scope.showSep = function(section,subSection) |
200 | { |
200 | { |
- | 201 | var s; |
|
- | 202 | for(s in section.sections) |
|
- | 203 | { |
|
- | 204 | section.sections[s].active = false; |
|
- | 205 | } |
|
201 | $(".separatorSectionNav").each(function() |
206 | /*$(".separatorSectionNav").each(function() |
202 | { |
207 | { |
203 | angular.element($(this)).scope().section.active = false; |
208 | angular.element($(this)).scope().section.active = false; |
204 | }); |
209 | });*/ |
205 | section.active = true; |
210 | subSection.active = true; |
206 | - | ||
207 | } |
211 | } |
208 | 212 | ||
- | 213 | /** |
|
- | 214 | * Este metodo devolve o template mais profundo na hierarquia de classes |
|
- | 215 | * permitindo emular o override, quanto mais especifica for a classe |
|
- | 216 | * e caso exista template é esse o template devolvido |
|
- | 217 | * procura um script com o id da classe e se nao existir |
|
- | 218 | * vai subindo nas super classes |
|
- | 219 | * @param obj |
|
- | 220 | * @returns {*} |
|
- | 221 | */ |
|
209 | $scope.class2id = function(obj) |
222 | $scope.class2id = function(obj) |
210 | { |
223 | { |
- | 224 | var objClassId = obj["@class"].replaceAll(".","_"); |
|
- | 225 | if($("script#" + objClassId).length > 0) |
|
- | 226 | { |
|
- | 227 | return objClassId; |
|
- | 228 | } |
|
- | 229 | if(obj.allSuperClasses) |
|
- | 230 | { |
|
- | 231 | var s; |
|
- | 232 | for(s in obj.allSuperClasses) |
|
- | 233 | { |
|
- | 234 | var superClass = obj.allSuperClasses[s]; |
|
- | 235 | var superClassId = superClass.replaceAll(".","_"); |
|
- | 236 | if($("script#" + superClassId).length > 0) |
|
- | 237 | { |
|
- | 238 | return superClassId; |
|
- | 239 | } |
|
- | 240 | } |
|
- | 241 | } |
|
211 | return obj["@class"].replaceAll(".","_"); |
242 | return obj["@class"].replaceAll(".","_"); |
212 | } |
243 | } |
213 | 244 | ||
214 | $scope.addText = function(parentCustomPane) |
245 | $scope.addText = function(parentCustomPane) |
215 | { |
246 | { |
Line 292... | Line 323... | ||
292 | <jsp:include page="../utils/documentsBuilder.jsp"/> |
323 | <jsp:include page="../utils/documentsBuilder.jsp"/> |
293 | 324 | ||
294 | <div class="form-vertical"> |
325 | <div class="form-vertical"> |
295 | <div id="courseReportApp" ng-app="courseReportApp" ng-controller="courseReportAppController"> |
326 | <div id="courseReportApp" ng-app="courseReportApp" ng-controller="courseReportAppController"> |
296 | 327 | ||
297 | - | ||
298 | <ul class="nav nav-tabs"> |
- | |
299 | <li ng-model="section" class="separatorSectionNav" ng-class="{ active: section.active}" ng-repeat="section in report.sections"> |
328 | <div ng-init="section=report;" ng-include="'pt_estgp_estgweb_utils_documentBuilder_DocumentSection'"> |
300 | <a ng-click="showSep(section)">{{section.title}}</a> |
- | |
301 | </li> |
- | |
302 | </ul> |
- | |
303 | - | ||
304 | - | ||
305 | - | ||
306 | <!--DocumentSection--> |
- | |
307 | <div ng-model="section" ng-class="{ hidden: !section.active}" ng-repeat="section in report.sections" class="separatorSection clearfix"> |
- | |
308 | - | ||
309 | <div ng-repeat="comp in section.components" ng-include="class2id(comp)"> |
- | |
310 | - | ||
311 | </div> |
- | |
312 | - | ||
313 | 329 | ||
314 | </div> |
330 | </div> |
315 | <!--/DocumentSection--> |
- | |
316 | 331 | ||
317 | <%-- |
- | |
318 | <pre class="code">{{ report | json }}</pre> |
332 | <pre class="code">{{ report | json }}</pre> |
319 | --%> |
333 | |
320 | 334 | ||
321 | 335 | ||
322 | </div><!--App--> |
336 | </div><!--App--> |
323 | </div> <!--form--> |
337 | </div> <!--form--> |
324 | 338 |