Rev 1929 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1929 | Rev 1930 | ||
---|---|---|---|
Line 482... | Line 482... | ||
482 | return view.toJson(); |
482 | return view.toJson(); |
483 | } |
483 | } |
484 | 484 | ||
485 | public 1.5.0/docs/api/java/lang/String.html">String generateGenerateGlobalLearningResultsChartSem(1.5.0/docs/api/java/lang/String.html">String reportDocumentJson, 1.5.0/docs/api/java/lang/String.html">String semesterCode, UserSession session) throws 1.5.0/docs/api/java/io/IOException.html">IOException { |
485 | public 1.5.0/docs/api/java/lang/String.html">String generateGenerateGlobalLearningResultsChartSem(1.5.0/docs/api/java/lang/String.html">String reportDocumentJson, 1.5.0/docs/api/java/lang/String.html">String semesterCode, UserSession session) throws 1.5.0/docs/api/java/io/IOException.html">IOException { |
486 | 486 | ||
487 | CourseReportDocument reportDocument = CourseReportDocument.fromJson(reportDocumentJson); |
487 | CourseReportDocument reportDocument = CourseReportDocument.fromJson(reportDocumentJson); |
- | 488 | LearningResultsSection learningResultsSection = (LearningResultsSection) reportDocument.findDocumentSection(LearningResultsSection.class); |
|
- | 489 | LearningAnalysisSection learningAnalysisSection = (LearningAnalysisSection) learningResultsSection.findSection(LearningAnalysisSection.class); |
|
- | 490 | LearningResultsChartSem chartImg = (LearningResultsChartSem) learningAnalysisSection.findDocComponent(LearningResultsChartSem.class, semesterCode); |
|
488 | 491 | ||
489 | LearningResultsSection learningResultsSection = (LearningResultsSection) reportDocument.findDocumentSection(LearningResultsSection.class); |
492 | UnitsLearningResultsTable table = (UnitsLearningResultsTable) learningResultsSection.findDocComponent(UnitsLearningResultsTable.class); |
490 | 493 | ||
491 | LearningAnalysisSection learningAnalysisSection = (LearningAnalysisSection) learningResultsSection.findSection(LearningAnalysisSection.class); |
- | |
492 | 494 | ||
493 | LearningResultsChartSem chartImg = (LearningResultsChartSem) learningAnalysisSection.findDocComponent(LearningResultsChartSem.class, semesterCode); |
- | |
494 | UnitsLearningResultsTable table = (UnitsLearningResultsTable) learningResultsSection.findDocComponent(UnitsLearningResultsTable.class); |
495 | FileUploaded fileUploaded = chartImg.generateChart2tmp(table,reportDocument); |
495 | 496 | ||
- | 497 | RepositoryService repositoryService = new RepositoryService(); |
|
496 | 498 | ||
- | 499 | boolean imageInitialized = chartImg.getImage() != null |
|
- | 500 | && |
|
- | 501 | chartImg.getImage().getIdentifier() != null; |
|
497 | 502 | ||
498 | FileUploaded fileUploaded = chartImg.generateChart2tmp(table,reportDocument); |
- | |
499 | - | ||
500 | - | ||
501 | - | ||
502 | RepositoryService repositoryService = new RepositoryService(); |
- | |
503 | - | ||
504 | - | ||
505 | boolean imageInitialized = chartImg.getImage() != null |
- | |
506 | && |
- | |
507 | chartImg.getImage().getIdentifier() != null; |
- | |
508 | - | ||
509 | - | ||
510 | RepositoryFile4JsonView view; |
503 | RepositoryFile4JsonView view; |
511 | - | ||
512 | if(imageInitialized) |
504 | if(imageInitialized) |
513 | { |
505 | { |
514 | 1.5.0/docs/api/java/lang/String.html">String identifier = chartImg.getImage().getIdentifier(); |
506 | 1.5.0/docs/api/java/lang/String.html">String identifier = chartImg.getImage().getIdentifier(); |
515 | view = repositoryService.replaceRepositoryFileFromFileUpload(identifier, fileUploaded, ResourceAccessControlEnum.publicDomain, session); |
507 | view = repositoryService.replaceRepositoryFileFromFileUpload(identifier, fileUploaded, ResourceAccessControlEnum.publicDomain, session); |
516 | } |
508 | } |
517 | else |
509 | else |
518 | { |
510 | { |
519 | view = repositoryService.storeRepositoryFileFromFileUpload(fileUploaded,ResourceAccessControlEnum.publicDomain,session); |
511 | view = repositoryService.storeRepositoryFileFromFileUpload(fileUploaded,ResourceAccessControlEnum.publicDomain,session); |
520 | } |
512 | } |
521 | chartImg.setImage(view); |
513 | chartImg.setImage(view); |
522 | //TODO FALTA GUARDAR O JSON NO CURSO |
514 | //TODO FALTA GUARDAR O JSON NO CURSO |
523 | return view.toJson(); |
515 | return view.toJson(); |
524 | } |
516 | } |
Line 549... | Line 541... | ||
549 | courseReportJson = cy.getCourseReportDocument(); |
541 | courseReportJson = cy.getCourseReportDocument(); |
550 | } |
542 | } |
551 | 543 | ||
552 | if (courseReportJson == null) { |
544 | if (courseReportJson == null) { |
553 | try { |
545 | try { |
554 | CourseReportDocument courseReport = new CourseReportServices().createNewCourseReportDocument(courseCode, year); |
546 | CourseReportDocument courseReport = createNewCourseReportDocument(courseCode, year); |
555 | courseReportJson = courseReport.toJson(); |
547 | courseReportJson = courseReport.toJson(); |
556 | saveCourseReportDocument(courseReportJson, session); |
548 | saveCourseReportDocument(courseReportJson, session); |
557 | } catch (1.5.0/docs/api/java/lang/Throwable.html">Throwable e) { |
549 | } catch (1.5.0/docs/api/java/lang/Throwable.html">Throwable e) { |
558 | 1.5.0/docs/api/java/lang/System.html">System.out.println(e); |
550 | 1.5.0/docs/api/java/lang/System.html">System.out.println(e); |
559 | e.printStackTrace(); |
551 | e.printStackTrace(); |