Subversion Repositories bacoAlunos

Rev

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

Rev 1876 Rev 1918
Line 75... Line 75...
75
 
75
 
76
        //FIRST SERVICE TO CALL TO OBTAIN UNITS AND EVALUATIONS
76
        //FIRST SERVICE TO CALL TO OBTAIN UNITS AND EVALUATIONS
77
        //THIS IS THE BASE FOR THE REMAIN SERVICE CALLS
77
        //THIS IS THE BASE FOR THE REMAIN SERVICE CALLS
78
        List<DocumentSection> courseUnitSections = updateCleanCourseUnitSections(courseCode, year, reportCourseDocument);
78
        List<DocumentSection> courseUnitSections = updateCleanCourseUnitSections(courseCode, year, reportCourseDocument);
79
 
79
 
80
        //A tabela de resultados globais não vai ser utilizada
80
        //A tabela de resultados globais não vai ser utilizada
81
        //PARA CORRER ESTE SERVICO A PARTIR DA INTERFACE É PRECISO
81
        //PARA CORRER ESTE SERVICO A PARTIR DA INTERFACE É PRECISO
82
        //PERCEBER QUE DEPENDE DO SERVICO DE UPDATE DAS SECOES DAS COURSEUNITS
82
        //PERCEBER QUE DEPENDE DO SERVICO DE UPDATE DAS SECOES DAS COURSEUNITS
83
        UnitsLearningResultsTable unitsLearningResultsTable = updateCleanLearningResultsFromCourseUnitsSections(reportCourseDocument);
83
        UnitsLearningResultsTable unitsLearningResultsTable = updateCleanLearningResultsFromCourseUnitsSections(reportCourseDocument);
84
 
84
 
85
 
85
 
86
        //Atualiza no DOC a tabela de analise DTP
86
        //Atualiza no DOC a tabela de analise DTP
87
        UnitsDtpTable unitsDtpTable = updateDtpStatsTable4Course(reportCourseDocument, courseCode, year);
87
        UnitsDtpTable unitsDtpTable = updateDtpStatsTable4Course(reportCourseDocument, courseCode, year);
88
 
88
 
89
 
89
 
90
        //Atualiza as tabelas dos Quesitonários pedagogicos
90
        //Atualiza as tabelas dos Quesitonários pedagogicos
91
        SurveysResultsSection surveysResultsSection = updateSurveysDataTables(courseCode, year, reportCourseDocument);
91
        SurveysResultsSection surveysResultsSection = updateSurveysDataTables(courseCode, year, reportCourseDocument);
92
 
92
 
93
 
93
 
94
        return reportCourseDocument;
94
        return reportCourseDocument;
95
    }
95
    }
Line 109... Line 109...
109
        dataTableComponentS2.setDataTable(dataTableS2);
109
        dataTableComponentS2.setDataTable(dataTableS2);
110
        return surveysResultsSection;
110
        return surveysResultsSection;
111
    }
111
    }
112
 
112
 
113
    /**
113
    /**
114
     * Este serviço atualiza a tabela de resultados de aprendizagem com base nas courseunitssections
114
     * Este serviço atualiza a tabela de resultados de aprendizagem com base nas courseunitssections
115
     * @param reportCourseDocument
115
     * @param reportCourseDocument
116
     * @return UnitsLearningResultsTable
116
     * @return UnitsLearningResultsTable
117
     */
117
     */
118
    public UnitsLearningResultsTable updateCleanLearningResultsFromCourseUnitsSections(CourseReportDocument reportCourseDocument)
118
    public UnitsLearningResultsTable updateCleanLearningResultsFromCourseUnitsSections(CourseReportDocument reportCourseDocument)
119
    {
119
    {
Line 296... Line 296...
296
    }
296
    }
297
 
297
 
298
 
298
 
299
    /**
299
    /**
300
     * Gera uma tabela de estatisticas dos DTP recorrendo ao servico WS de
300
     * Gera uma tabela de estatisticas dos DTP recorrendo ao servico WS de
301
     * load de tabelas DTP, caso o serviço nao devolva unidades são criadas novas
301
     * load de tabelas DTP, caso o serviço nao devolva unidades são criadas novas
302
     * com os valores a falso.
302
     * com os valores a falso.
303
     *
303
     *
304
     * @param courseCode
304
     * @param courseCode
305
     * @param year
305
     * @param year
306
     * @return UnitsDtpTable
306
     * @return UnitsDtpTable
Line 379... Line 379...
379
            logger.error(e,e);
379
            logger.error(e,e);
380
            courseUnitSections = new CourseUnitSection[0];
380
            courseUnitSections = new CourseUnitSection[0];
381
        }
381
        }
382
 
382
 
383
 
383
 
384
        List<DocumentSection> subSections = new ArrayList<DocumentSection>();
384
        ArrayList<DocumentSection> subSections = new ArrayList<DocumentSection>();
385
        unitReportsSection.setSections(subSections);
385
        unitReportsSection.setSections(subSections);
386
        for(CourseUnit cu :units)
386
        for(CourseUnit cu :units)
387
        {
387
        {
388
            CourseUnitSection sectionFound = CourseReportUtils.findCourseUnitSection(courseUnitSections, (CourseUnitImpl) cu);
388
            CourseUnitSection sectionFound = CourseReportUtils.findCourseUnitSection(courseUnitSections, (CourseUnitImpl) cu);
389
            if(sectionFound == null)
389
            if(sectionFound == null)
Line 412... Line 412...
412
     * @param reportDocumentJson
412
     * @param reportDocumentJson
413
     * @param session
413
     * @param session
414
     * @return
414
     * @return
415
     * @throws IOException
415
     * @throws IOException
416
     */
416
     */
417
    public 1.5.0/docs/api/java/lang/String.html">String generateGlobalLearningResultsChartImg(1.5.0/docs/api/java/lang/String.html">String reportDocumentJson,UserSession session) throws 1.5.0/docs/api/java/io/IOException.html">IOException {
417
    public 1.5.0/docs/api/java/lang/String.html">String generateGlobalLearningResultsChartImg(1.5.0/docs/api/java/lang/String.html">String reportDocumentJson,
-
 
418
                                                        UserSession session) throws 1.5.0/docs/api/java/io/IOException.html">IOException {
418
 
419
 
419
        CourseReportDocument reportDocument =  CourseReportDocument.fromJson(reportDocumentJson);
420
        CourseReportDocument reportDocument =  CourseReportDocument.fromJson(reportDocumentJson);
420
        LearningResultsSection learningResultsSection = (LearningResultsSection) reportDocument.findDocumentSection(LearningResultsSection.class);
421
        LearningResultsSection learningResultsSection = (LearningResultsSection) reportDocument.findDocumentSection(LearningResultsSection.class);
421
        LearningGlobalAnalysisSection learningGlobalAnalysisSection = (LearningGlobalAnalysisSection) learningResultsSection.findSection(LearningGlobalAnalysisSection.class);
422
        LearningGlobalAnalysisSection learningGlobalAnalysisSection = (LearningGlobalAnalysisSection) learningResultsSection.findSection(LearningGlobalAnalysisSection.class);
422
        GlobalLearningResultsChartImg chartImg = (GlobalLearningResultsChartImg) learningGlobalAnalysisSection.findDocComponent(GlobalLearningResultsChartImg.class);
423
        GlobalLearningResultsChartImg chartImg = (GlobalLearningResultsChartImg) learningGlobalAnalysisSection.findDocComponent(GlobalLearningResultsChartImg.class);
423
 
424
 
-
 
425
 
424
        UnitsLearningResultsTable table = (UnitsLearningResultsTable) learningResultsSection.findDocComponent(UnitsLearningResultsTable.class);
426
        UnitsLearningResultsTable table = (UnitsLearningResultsTable) learningResultsSection.findDocComponent(UnitsLearningResultsTable.class);
425
 
427
 
-
 
428
 
426
        FileUploaded fileUploaded = chartImg.generateChart2tmp(table,reportDocument);
429
        FileUploaded fileUploaded = chartImg.generateChart2tmp(table,reportDocument);
427
 
430
 
428
        RepositoryService repositoryService = new RepositoryService();
431
        RepositoryService repositoryService = new RepositoryService();
429
 
432
 
430
        boolean imageInitialized = chartImg.getImage() != null
433
        boolean imageInitialized = chartImg.getImage() != null
Line 520... Line 523...
520
 
523
 
521
 
524
 
522
 
525
 
523
    /**
526
    /**
524
     *
527
     *
525
     * Para um determinado curso e ano o serviço faz uma listagem de todas as suas unidades curriculares
528
     * Para um determinado curso e ano o serviço faz uma listagem de todas as suas unidades curriculares
526
     * e lista a sua informação básica juntamente com o relatório de avaliação disponivel
529
     * e lista a sua informação básica juntamente com o relatório de avaliação disponivel
527
     * O serviço adiciona ainda o Ano de cada unidade por inspeção do Plano de Estudos
530
     * O serviço adiciona ainda o Ano de cada unidade por inspeção do Plano de Estudos
528
     * caso a unidade não seja encontrada no Plano de estudos o ano irá ser preenchido com -1
531
     * caso a unidade não seja encontrada no Plano de estudos o ano irá ser preenchido com -1
529
     *
532
     *
530
     * @param courseCode codigo Siges na base de dados
533
     * @param courseCode codigo Siges na base de dados
531
     * @param year  201617, 201718
534
     * @param year  201617, 201718
532
     * @return String JSONObject with a JSON ARRAY of List<CourseUnitSection>
535
     * @return String JSONObject with a JSON ARRAY of List<CourseUnitSection>
533
     */
536
     */
Line 592... Line 595...
592
     *
595
     *
593
     *
596
     *
594
     * @param courseCode codigo Siges na base de dados
597
     * @param courseCode codigo Siges na base de dados
595
     * @param unitCode
598
     * @param unitCode
596
     * @return Json com o ano do plano exemplo: { year : 1 }
599
     * @return Json com o ano do plano exemplo: { year : 1 }
597
     * ou -1 se não for encontrado
600
     * ou -1 se não for encontrado
598
     */
601
     */
599
    public 1.5.0/docs/api/java/lang/String.html">String loadPlanYearForCourseUnitCode(1.5.0/docs/api/java/lang/String.html">String courseCode,1.5.0/docs/api/java/lang/String.html">String unitCode,1.5.0/docs/api/java/lang/String.html">String period) throws JSONException, 1.5.0/docs/api/java/io/IOException.html">IOException {
602
    public 1.5.0/docs/api/java/lang/String.html">String loadPlanYearForCourseUnitCode(1.5.0/docs/api/java/lang/String.html">String courseCode,1.5.0/docs/api/java/lang/String.html">String unitCode,1.5.0/docs/api/java/lang/String.html">String period) throws JSONException, 1.5.0/docs/api/java/io/IOException.html">IOException {
600
 
603
 
601
 
604
 
602
        if(Globals.SYSTEM_WSJSON_SERVICE_COURSE_UNIT_PLAN_YEAR.indexOf("localhost")>=0)
605
        if(Globals.SYSTEM_WSJSON_SERVICE_COURSE_UNIT_PLAN_YEAR.indexOf("localhost")>=0)
Line 678... Line 681...
678
    // E NO BROWSER SUBSTITUI-SE ESSES ELEMENTOS NOS ANTIGOS a seccao das unidades
681
    // E NO BROWSER SUBSTITUI-SE ESSES ELEMENTOS NOS ANTIGOS a seccao das unidades
679
    // e as as tabelas
682
    // e as as tabelas
680
 
683
 
681
 
684
 
682
 
685
 
683
}
-
 
684
686
}
-
 
687