Search in sources :

Example 1 with DisciplinaCMForm

use of com.tomasio.projects.trainning.form.cm.DisciplinaCMForm in project trainning by fernandotomasio.

the class CurriculosMinimosController method loadDisciplina.

public DisciplinaCMForm loadDisciplina(Integer index) {
    RequestContext requestContext = RequestContextHolder.getRequestContext();
    List disciplinas = (List) requestContext.getFlowScope().getCollection("disciplinasDataList");
    return (DisciplinaCMForm) disciplinas.get(index);
}
Also used : DisciplinaCMForm(com.tomasio.projects.trainning.form.cm.DisciplinaCMForm) ArrayList(java.util.ArrayList) List(java.util.List) RequestContext(org.springframework.webflow.execution.RequestContext)

Example 2 with DisciplinaCMForm

use of com.tomasio.projects.trainning.form.cm.DisciplinaCMForm in project trainning by fernandotomasio.

the class CurriculosMinimosController method saveDisciplina.

public void saveDisciplina(DisciplinaCMForm disciplinaCMForm) {
    RequestContext requestContext = RequestContextHolder.getRequestContext();
    CurriculoMinimoForm cmForm = requestContext.getFlowScope().get("cMForm", CurriculoMinimoForm.class);
    CurriculoMinimoDTO curriculoMinimo = teachingDocumentsService.findCurriculoMinimo(cmForm.getId());
    DisciplinaDTO disciplina = new DisciplinaDTO();
    disciplina.setNumeroDisciplina(disciplinaCMForm.getNumero());
    disciplina.setId(disciplinaCMForm.getId());
    disciplina.setDescricao(disciplinaCMForm.getDescricao());
    disciplina.setQuantidadeTemposAula(disciplinaCMForm.getCargaHorariaInstrucao());
    disciplina.setQuantidadeTemposAvaliacao(disciplinaCMForm.getCargaHorariaAvaliacao());
    disciplina.setCurriculoMinimo(curriculoMinimo);
    AreaEnsinoDTO area = teachingDocumentsService.findAreaConhecimento(disciplinaCMForm.getAreaEnsinoId());
    disciplina.setAreaEnsino(area);
    CampoDTO campo = teachingDocumentsService.findCampo(disciplinaCMForm.getCampoId());
    disciplina.setCampo(campo);
    disciplinaCMForm.setCampoLabel(campo.getDescricao());
    disciplinaCMForm.setAreaEnsinoLabel(area.getNome());
    if (disciplina.getId() == null) {
        Long id = teachingDocumentsService.createDisciplina(disciplina);
        disciplinaCMForm.setId(id);
        List<DisciplinaCMForm> disciplinasDataList = cmForm.getDisciplinasDataList();
        disciplinasDataList.add(disciplinaCMForm);
    } else {
        teachingDocumentsService.updateDisciplina(disciplina);
    }
}
Also used : DisciplinaDTO(com.tomasio.projects.trainning.dto.DisciplinaDTO) ObjetivoDisciplinaDTO(com.tomasio.projects.trainning.dto.ObjetivoDisciplinaDTO) CampoDTO(com.tomasio.projects.trainning.dto.CampoDTO) DisciplinaCMForm(com.tomasio.projects.trainning.form.cm.DisciplinaCMForm) CurriculoMinimoDTO(com.tomasio.projects.trainning.dto.CurriculoMinimoDTO) RequestContext(org.springframework.webflow.execution.RequestContext) CurriculoMinimoForm(com.tomasio.projects.trainning.form.cm.CurriculoMinimoForm) AreaEnsinoDTO(com.tomasio.projects.trainning.dto.AreaEnsinoDTO)

Example 3 with DisciplinaCMForm

use of com.tomasio.projects.trainning.form.cm.DisciplinaCMForm in project trainning by fernandotomasio.

the class CurriculosMinimosController method saveUnidade.

public void saveUnidade(UnidadeForm unidadeForm) {
    RequestContext requestContext = RequestContextHolder.getRequestContext();
    DisciplinaCMForm disciplinaCMForm = requestContext.getFlowScope().get("disciplinaCMForm", DisciplinaCMForm.class);
    DisciplinaDTO disciplina = teachingDocumentsService.findDisciplina(disciplinaCMForm.getId());
    UnidadeDidaticaDTO unidade = new UnidadeDidaticaDTO();
    unidade.setId(unidadeForm.getId());
    unidade.setNumero(unidadeForm.getNumero());
    unidade.setDescricao(unidadeForm.getDescricao());
    unidade.setDisciplina(disciplina);
    unidade.setQuantidadeTemposAula(unidadeForm.getQuantidadeTemposAula());
    if (unidade.getId() == null) {
        Long id = teachingDocumentsService.createUnidadeDidatica(unidade);
        unidadeForm.setId(id);
        List<UnidadeForm> unidadesDataList = disciplinaCMForm.getUnidadesDataList();
        unidadesDataList.add(unidadeForm);
    } else {
        teachingDocumentsService.updateUnidadeDidatica(unidade);
    }
}
Also used : UnidadeForm(com.tomasio.projects.trainning.form.cm.UnidadeForm) DisciplinaDTO(com.tomasio.projects.trainning.dto.DisciplinaDTO) ObjetivoDisciplinaDTO(com.tomasio.projects.trainning.dto.ObjetivoDisciplinaDTO) DisciplinaCMForm(com.tomasio.projects.trainning.form.cm.DisciplinaCMForm) RequestContext(org.springframework.webflow.execution.RequestContext) UnidadeDidaticaDTO(com.tomasio.projects.trainning.dto.UnidadeDidaticaDTO)

Example 4 with DisciplinaCMForm

use of com.tomasio.projects.trainning.form.cm.DisciplinaCMForm in project trainning by fernandotomasio.

the class CurriculosMinimosController method saveObjetivo.

public void saveObjetivo(ObjetivoForm objetivoForm) {
    RequestContext requestContext = RequestContextHolder.getRequestContext();
    DisciplinaCMForm disciplinaCMForm = requestContext.getFlowScope().get("disciplinaCMForm", DisciplinaCMForm.class);
    DisciplinaDTO disciplina = teachingDocumentsService.findDisciplina(disciplinaCMForm.getId());
    ObjetivoDisciplinaDTO objetivo = new ObjetivoDisciplinaDTO();
    objetivo.setId(objetivoForm.getId());
    objetivo.setDescricao(objetivoForm.getDescricao());
    objetivo.setDisciplina(disciplina);
    NivelAprendizagemDTO nivelAprendizagem = teachingDocumentsService.findNivelAprendizagem(objetivoForm.getNivelId());
    objetivo.setNivelAprendizagem(nivelAprendizagem);
    if (objetivo.getId() == null) {
        Long id = teachingDocumentsService.createObjetivoDisciplina(objetivo);
        objetivoForm.setId(id);
        List<ObjetivoForm> objetivosDataList = disciplinaCMForm.getObjetivosDataList();
        objetivosDataList.add(objetivoForm);
    } else {
        teachingDocumentsService.updateObjetivoDisciplina(objetivo);
    }
    objetivoForm.setLabel(objetivo.getDescricao() + " (" + objetivo.getNivelAprendizagem().getCodigo() + ")");
}
Also used : NivelAprendizagemDTO(com.tomasio.projects.trainning.dto.NivelAprendizagemDTO) ObjetivoForm(com.tomasio.projects.trainning.form.cm.ObjetivoForm) DisciplinaDTO(com.tomasio.projects.trainning.dto.DisciplinaDTO) ObjetivoDisciplinaDTO(com.tomasio.projects.trainning.dto.ObjetivoDisciplinaDTO) DisciplinaCMForm(com.tomasio.projects.trainning.form.cm.DisciplinaCMForm) RequestContext(org.springframework.webflow.execution.RequestContext) ObjetivoDisciplinaDTO(com.tomasio.projects.trainning.dto.ObjetivoDisciplinaDTO)

Example 5 with DisciplinaCMForm

use of com.tomasio.projects.trainning.form.cm.DisciplinaCMForm in project trainning by fernandotomasio.

the class CurriculosMinimosController method updateOrderDisciplina.

public void updateOrderDisciplina(List disciplinasDataList) {
    for (int i = 0; i < disciplinasDataList.size(); i++) {
        DisciplinaCMForm disciplinaCMForm = (DisciplinaCMForm) disciplinasDataList.get(i);
        disciplinaCMForm.setNumero(i + 1);
        saveDisciplina(disciplinaCMForm);
    }
}
Also used : DisciplinaCMForm(com.tomasio.projects.trainning.form.cm.DisciplinaCMForm)

Aggregations

DisciplinaCMForm (com.tomasio.projects.trainning.form.cm.DisciplinaCMForm)8 RequestContext (org.springframework.webflow.execution.RequestContext)5 DisciplinaDTO (com.tomasio.projects.trainning.dto.DisciplinaDTO)4 ObjetivoDisciplinaDTO (com.tomasio.projects.trainning.dto.ObjetivoDisciplinaDTO)4 ArrayList (java.util.ArrayList)3 CurriculoMinimoDTO (com.tomasio.projects.trainning.dto.CurriculoMinimoDTO)2 UnidadeDidaticaDTO (com.tomasio.projects.trainning.dto.UnidadeDidaticaDTO)2 CurriculoMinimoForm (com.tomasio.projects.trainning.form.cm.CurriculoMinimoForm)2 ObjetivoForm (com.tomasio.projects.trainning.form.cm.ObjetivoForm)2 UnidadeForm (com.tomasio.projects.trainning.form.cm.UnidadeForm)2 List (java.util.List)2 AreaEnsinoDTO (com.tomasio.projects.trainning.dto.AreaEnsinoDTO)1 CampoDTO (com.tomasio.projects.trainning.dto.CampoDTO)1 NivelAprendizagemDTO (com.tomasio.projects.trainning.dto.NivelAprendizagemDTO)1 SubunidadeDidaticaDTO (com.tomasio.projects.trainning.dto.SubunidadeDidaticaDTO)1 CMFormStep1 (com.tomasio.projects.trainning.form.cm.CMFormStep1)1 CMFormStep2 (com.tomasio.projects.trainning.form.cm.CMFormStep2)1 CMFormStep3 (com.tomasio.projects.trainning.form.cm.CMFormStep3)1 CMFormStep4 (com.tomasio.projects.trainning.form.cm.CMFormStep4)1 CMFormStep6 (com.tomasio.projects.trainning.form.cm.CMFormStep6)1