Subversion Repositories bacoAlunos

Rev

Rev 1905 | Rev 1912 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1905 Rev 1906
Line 410... Line 410...
410
        chartImg.setImage(view);
410
        chartImg.setImage(view);
411
        //TODO FALTA GUARDAR O JSON NO CURSO
411
        //TODO FALTA GUARDAR O JSON NO CURSO
412
        return view.toJson();
412
        return view.toJson();
413
    }
413
    }
414
 
414
 
-
 
415
 
-
 
416
    public 1.5.0/docs/api/java/lang/String.html">String generateGlobalLearningResultsChartYearImg(1.5.0/docs/api/java/lang/String.html">String reportDocumentJson,
-
 
417
                                                        UserSession session) throws 1.5.0/docs/api/java/io/IOException.html">IOException {
-
 
418
 
-
 
419
        CourseReportDocument reportDocument = CourseReportDocument.fromJson(reportDocumentJson);
-
 
420
        LearningResultsSection learningResultsSection = (LearningResultsSection) reportDocument.findDocumentSection(LearningResultsSection.class);
-
 
421
        LearningGlobalAnalysisSection learningGlobalAnalysisSection = (LearningGlobalAnalysisSection) learningResultsSection.findSection(LearningGlobalAnalysisSection.class);
-
 
422
        GlobalLearningResultsChartYearImg chartImg = (GlobalLearningResultsChartYearImg) learningGlobalAnalysisSection.findDocComponent(GlobalLearningResultsChartYearImg.class);
-
 
423
 
-
 
424
 
-
 
425
        UnitsLearningResultsTable table = (UnitsLearningResultsTable) learningResultsSection.findDocComponent(UnitsLearningResultsTable.class);
-
 
426
 
-
 
427
 
-
 
428
        FileUploaded fileUploaded = chartImg.generateChart2tmp(table, reportDocument);
-
 
429
 
-
 
430
        RepositoryService repositoryService = new RepositoryService();
-
 
431
 
-
 
432
        boolean imageInitialized = chartImg.getImage() != null
-
 
433
                &&
-
 
434
                chartImg.getImage().getIdentifier() != null;
-
 
435
 
-
 
436
        RepositoryFile4JsonView view;
-
 
437
        if (imageInitialized) {
-
 
438
            1.5.0/docs/api/java/lang/String.html">String identifier = chartImg.getImage().getIdentifier();
-
 
439
            view = repositoryService.replaceRepositoryFileFromFileUpload(identifier, fileUploaded, ResourceAccessControlEnum.privateDomain, session);
-
 
440
        } else {
-
 
441
            view = repositoryService.storeRepositoryFileFromFileUpload(fileUploaded, ResourceAccessControlEnum.privateDomain, session);
-
 
442
        }
-
 
443
        chartImg.setImage(view);
-
 
444
        //TODO FALTA GUARDAR O JSON NO CURSO
-
 
445
        return view.toJson();
-
 
446
    }
-
 
447
 
415
    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 {
448
    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 {
416
 
449
 
417
        CourseReportDocument reportDocument = CourseReportDocument.fromJson(reportDocumentJson);
450
        CourseReportDocument reportDocument = CourseReportDocument.fromJson(reportDocumentJson);
418
 
451
 
419
        Course c = DaoFactory.getCourseDaoImpl().findCourseByCode(reportDocument.getCourseCode());
452
        Course c = DaoFactory.getCourseDaoImpl().findCourseByCode(reportDocument.getCourseCode());