Rev 1904 | Rev 1921 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1904 | Rev 1917 | ||
---|---|---|---|
Line 446... | Line 446... | ||
446 | chartImg.setImage(view); |
446 | chartImg.setImage(view); |
447 | //TODO FALTA GUARDAR O JSON NO CURSO |
447 | //TODO FALTA GUARDAR O JSON NO CURSO |
448 | return view.toJson(); |
448 | return view.toJson(); |
449 | } |
449 | } |
450 | 450 | ||
- | 451 | /* Grafico 2*/ |
|
- | 452 | public 1.5.0/docs/api/java/lang/String.html">String generateGlobalLearningResultsChartYearImg(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 | 453 | ||
- | 454 | CourseReportDocument reportDocument = CourseReportDocument.fromJson(reportDocumentJson); |
|
- | 455 | LearningResultsSection learningResultsSection = (LearningResultsSection) reportDocument.findDocumentSection(LearningResultsSection.class); |
|
- | 456 | LearningGlobalAnalysisSection learningGlobalAnalysisSection = (LearningGlobalAnalysisSection) learningResultsSection.findSection(LearningGlobalAnalysisSection.class); |
|
- | 457 | GlobalLearningResultsChartYearImg chartImg = (GlobalLearningResultsChartYearImg) learningGlobalAnalysisSection.findDocComponent(GlobalLearningResultsChartYearImg.class); |
|
- | 458 | ||
- | 459 | UnitsLearningResultsTable table = (UnitsLearningResultsTable) learningResultsSection.findDocComponent(UnitsLearningResultsTable.class); |
|
- | 460 | ||
- | 461 | ||
- | 462 | FileUploaded fileUploaded = chartImg.generateChart2tmp(table,reportDocument); |
|
- | 463 | ||
- | 464 | RepositoryService repositoryService = new RepositoryService(); |
|
- | 465 | ||
- | 466 | boolean imageInitialized = chartImg.getImage() != null |
|
- | 467 | && |
|
- | 468 | chartImg.getImage().getIdentifier() != null; |
|
- | 469 | ||
- | 470 | RepositoryFile4JsonView view; |
|
- | 471 | if(imageInitialized) |
|
- | 472 | { |
|
- | 473 | 1.5.0/docs/api/java/lang/String.html">String identifier = chartImg.getImage().getIdentifier(); |
|
- | 474 | view = repositoryService.replaceRepositoryFileFromFileUpload(identifier, fileUploaded, ResourceAccessControlEnum.privateDomain, session); |
|
- | 475 | } |
|
- | 476 | else |
|
- | 477 | { |
|
- | 478 | view = repositoryService.storeRepositoryFileFromFileUpload(fileUploaded,ResourceAccessControlEnum.privateDomain,session); |
|
- | 479 | } |
|
- | 480 | chartImg.setImage(view); |
|
- | 481 | //TODO FALTA GUARDAR O JSON NO CURSO |
|
- | 482 | return view.toJson(); |
|
- | 483 | } |
|
- | 484 | ||
- | 485 | ||
452 | /* AA 7/12/2017 */ |
486 | /* Guardar report 7/12/2017 */ |
453 | 487 | ||
454 | public 1.5.0/docs/api/java/lang/String.html">String save(1.5.0/docs/api/java/lang/String.html">String reportDocumentJson,UserSession session) throws 1.5.0/docs/api/java/io/IOException.html">IOException { |
488 | public 1.5.0/docs/api/java/lang/String.html">String saveCourseReportDoc(1.5.0/docs/api/java/lang/String.html">String reportDocumentJson,UserSession session) throws 1.5.0/docs/api/java/io/IOException.html">IOException { |
455 | 489 | ||
456 | CourseReportDocument reportDocument = CourseReportDocument.fromJson(reportDocumentJson); |
490 | CourseReportDocument reportDocument = CourseReportDocument.fromJson(reportDocumentJson); |
457 | 491 | ||
458 | DaoFactory.getCourseDaoImpl().findCourseByCode(reportDocument.getCourseCode()); |
492 | Course course = DaoFactory.getCourseDaoImpl().findCourseByCode(reportDocument.getCourseCode()); |
459 | 493 | ||
460 | 494 | ||
461 | 495 | ||
462 | return reportDocument.toJson(); |
496 | return reportDocument.toJson(); |
463 | } |
497 | } |