Rev 1901 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1901 | Rev 1916 | ||
---|---|---|---|
Line 451... | Line 451... | ||
451 | public 1.5.0/docs/api/java/lang/String.html">String generateGenerateGlobalLearningResultsChartYearImg(1.5.0/docs/api/java/lang/String.html">String reportDocumentJson,UserSession session) throws 1.5.0/docs/api/java/io/IOException.html">IOException { |
451 | public 1.5.0/docs/api/java/lang/String.html">String generateGenerateGlobalLearningResultsChartYearImg(1.5.0/docs/api/java/lang/String.html">String reportDocumentJson,UserSession session) throws 1.5.0/docs/api/java/io/IOException.html">IOException { |
452 | 452 | ||
453 | CourseReportDocument reportDocument = CourseReportDocument.fromJson(reportDocumentJson); |
453 | CourseReportDocument reportDocument = CourseReportDocument.fromJson(reportDocumentJson); |
454 | LearningResultsSection learningResultsSection = (LearningResultsSection) reportDocument.findDocumentSection(LearningResultsSection.class); |
454 | LearningResultsSection learningResultsSection = (LearningResultsSection) reportDocument.findDocumentSection(LearningResultsSection.class); |
455 | LearningGlobalAnalysisSection learningGlobalAnalysisSection = (LearningGlobalAnalysisSection) learningResultsSection.findSection(LearningGlobalAnalysisSection.class); |
455 | LearningGlobalAnalysisSection learningGlobalAnalysisSection = (LearningGlobalAnalysisSection) learningResultsSection.findSection(LearningGlobalAnalysisSection.class); |
456 | GlobalLearningResultsChartImg chartImg = (GlobalLearningResultsChartImg) learningGlobalAnalysisSection.findDocComponent(GlobalLearningResultsChartImg.class); |
456 | GlobalLearningResultsChartYearImg chartImg = (GlobalLearningResultsChartYearImg) learningGlobalAnalysisSection.findDocComponent(GlobalLearningResultsChartYearImg.class); |
457 | 457 | ||
458 | UnitsLearningResultsTable table = (UnitsLearningResultsTable) learningResultsSection.findDocComponent(UnitsLearningResultsTable.class); |
458 | UnitsLearningResultsTable table = (UnitsLearningResultsTable) learningResultsSection.findDocComponent(UnitsLearningResultsTable.class); |
459 | 459 | ||
460 | 460 | ||
461 | FileUploaded fileUploaded = chartImg.generateChart2tmp(table,reportDocument); |
461 | FileUploaded fileUploaded = chartImg.generateChart2tmp(table,reportDocument); |
Line 479... | Line 479... | ||
479 | chartImg.setImage(view); |
479 | chartImg.setImage(view); |
480 | //TODO FALTA GUARDAR O JSON NO CURSO |
480 | //TODO FALTA GUARDAR O JSON NO CURSO |
481 | return view.toJson(); |
481 | return view.toJson(); |
482 | } |
482 | } |
483 | 483 | ||
- | 484 | public 1.5.0/docs/api/java/lang/String.html">String saveCourseReportDocument(1.5.0/docs/api/java/lang/String.html">String reportDocumentJson,UserSession session) { |
|
- | 485 | CourseReportDocument reportDocument = CourseReportDocument.fromJson(reportDocumentJson); |
|
- | 486 | ||
- | 487 | Course c = DaoFactory.getCourseDaoImpl().findCourseByCode(reportDocument.getCourseCode()); |
|
- | 488 | CourseYear cy = DaoFactory.getCourseYearDaoImpl().findCourseYearU(reportDocument.getCourseCode(), reportDocument.getYear()); |
|
- | 489 | ||
- | 490 | if (cy == null) { |
|
- | 491 | cy = DomainObjectFactory.createCourseYearImpl(); |
|
- | 492 | cy.setCourse(c); |
|
- | 493 | c.getCourseYears().add(cy); |
|
- | 494 | cy.setImportYear(reportDocument.getYear()); |
|
- | 495 | DaoFactory.getCourseYearDaoImpl().save(cy); |
|
- | 496 | } |
|
- | 497 | cy.setCourseReportDocument(reportDocumentJson); |
|
- | 498 | ||
- | 499 | return reportDocument.toJson(); |
|
- | 500 | } |
|
- | 501 | ||
- | 502 | public 1.5.0/docs/api/java/lang/String.html">String loadCourseReportDocument(1.5.0/docs/api/java/lang/String.html">String courseCode,1.5.0/docs/api/java/lang/String.html">String year,UserSession session) { |
|
- | 503 | CourseYear cy = DaoFactory.getCourseYearDaoImpl().findCourseYearU(courseCode, year); |
|
- | 504 | ||
- | 505 | 1.5.0/docs/api/java/lang/String.html">String courseReportJson = null; |
|
- | 506 | if (cy != null) { |
|
- | 507 | courseReportJson = cy.getCourseReportDocument(); |
|
- | 508 | } |
|
- | 509 | ||
- | 510 | if (courseReportJson == null) { |
|
- | 511 | CourseReportDocument courseReport = null; |
|
- | 512 | ||
- | 513 | try { |
|
- | 514 | courseReport = new CourseReportServices().createNewCourseReportDocument(courseCode, year); |
|
- | 515 | courseReportJson = courseReport.toJson(); |
|
- | 516 | } catch (1.5.0/docs/api/java/lang/Throwable.html">Throwable e) { |
|
- | 517 | 1.5.0/docs/api/java/lang/System.html">System.out.println(e); |
|
- | 518 | e.printStackTrace(); |
|
- | 519 | } |
|
- | 520 | } |
|
- | 521 | ||
- | 522 | return courseReportJson; |
|
- | 523 | } |
|
484 | 524 | ||
485 | 525 | ||
486 | /****************************************************************************/ |
526 | /****************************************************************************/ |
487 | /* |
527 | /* |
488 | 528 |