Search in sources :

Example 1 with AreaEnsinoDTO

use of com.tomasio.projects.trainning.dto.AreaEnsinoDTO in project trainning by fernandotomasio.

the class AreaEnsino method createDTOMinimal.

public AreaEnsinoDTO createDTOMinimal() {
    AreaEnsinoDTO dto = new AreaEnsinoDTO();
    dto.setId(id);
    dto.setNome(nome);
    if (grupoAreaConhecimento != null) {
        dto.setGrupoAreaConhecimento(grupoAreaConhecimento.createDTO());
    }
    return dto;
}
Also used : AreaEnsinoDTO(com.tomasio.projects.trainning.dto.AreaEnsinoDTO)

Example 2 with AreaEnsinoDTO

use of com.tomasio.projects.trainning.dto.AreaEnsinoDTO in project trainning by fernandotomasio.

the class CurriculosMinimosController method initializeSelectableAreas.

public Map<String, List<Map<Object, Object>>> initializeSelectableAreas() {
    Map<String, List<Map<Object, Object>>> selectableAreas = new HashMap<String, List<Map<Object, Object>>>();
    AreaEnsinoDTO[] areas = teachingDocumentsService.findAllAreasConhecimento();
    for (AreaEnsinoDTO area : areas) {
        List<Map<Object, Object>> lista = selectableAreas.get(area.getGrupoAreaConhecimento().getDescricao());
        if (lista != null) {
            Map<Object, Object> item = new HashMap<>();
            item.put("id", area.getId());
            item.put("descricao", area.getNome());
            lista.add(item);
        } else {
            lista = new ArrayList<Map<Object, Object>>();
            Map<Object, Object> item = new HashMap<Object, Object>();
            item.put("id", area.getId());
            item.put("descricao", area.getNome());
            lista.add(item);
            selectableAreas.put(area.getGrupoAreaConhecimento().getDescricao(), lista);
        }
    }
    return selectableAreas;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) List(java.util.List) HashMap(java.util.HashMap) Map(java.util.Map) AreaEnsinoDTO(com.tomasio.projects.trainning.dto.AreaEnsinoDTO)

Example 3 with AreaEnsinoDTO

use of com.tomasio.projects.trainning.dto.AreaEnsinoDTO 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 4 with AreaEnsinoDTO

use of com.tomasio.projects.trainning.dto.AreaEnsinoDTO in project trainning by fernandotomasio.

the class PudsController method initializeSelectableAreas.

public Map<String, List<Map<Object, Object>>> initializeSelectableAreas() {
    Map<String, List<Map<Object, Object>>> selectableAreas = new HashMap<String, List<Map<Object, Object>>>();
    AreaEnsinoDTO[] areas = teachingDocumentsService.findAllAreasConhecimento();
    for (AreaEnsinoDTO area : areas) {
        List<Map<Object, Object>> lista = selectableAreas.get(area.getGrupoAreaConhecimento().getDescricao());
        if (lista != null) {
            Map<Object, Object> item = new HashMap<Object, Object>();
            item.put("id", area.getId());
            item.put("descricao", area.getNome());
            lista.add(item);
        } else {
            lista = new ArrayList<Map<Object, Object>>();
            Map<Object, Object> item = new HashMap<Object, Object>();
            item.put("id", area.getId());
            item.put("descricao", area.getNome());
            lista.add(item);
            selectableAreas.put(area.getGrupoAreaConhecimento().getDescricao(), lista);
        }
    }
    return selectableAreas;
}
Also used : HashMap(java.util.HashMap) List(java.util.List) ArrayList(java.util.ArrayList) Map(java.util.Map) HashMap(java.util.HashMap) AreaEnsinoDTO(com.tomasio.projects.trainning.dto.AreaEnsinoDTO)

Example 5 with AreaEnsinoDTO

use of com.tomasio.projects.trainning.dto.AreaEnsinoDTO in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method findAllAreasConhecimento.

@Override
@Transactional(readOnly = true)
public AreaEnsinoDTO[] findAllAreasConhecimento() {
    AreaConhecimentoDAO dao = factory.getAreaConhecimentoDAO();
    AreaEnsinoDTO[] areasArray = null;
    try {
        List<AreaEnsino> areas = dao.findAllAreasConhecimento();
        if (areas != null) {
            areasArray = new AreaEnsinoDTO[areas.size()];
            for (int i = 0; i < areas.size(); i++) {
                areasArray[i] = areas.get(i).createDTO();
            }
        }
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
    return areasArray;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) AreaEnsino(com.tomasio.projects.trainning.model.AreaEnsino) AreaEnsinoDTO(com.tomasio.projects.trainning.dto.AreaEnsinoDTO) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

AreaEnsinoDTO (com.tomasio.projects.trainning.dto.AreaEnsinoDTO)6 HashMap (java.util.HashMap)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Map (java.util.Map)2 CampoDTO (com.tomasio.projects.trainning.dto.CampoDTO)1 CurriculoMinimoDTO (com.tomasio.projects.trainning.dto.CurriculoMinimoDTO)1 DisciplinaDTO (com.tomasio.projects.trainning.dto.DisciplinaDTO)1 GrupoAreaConhecimentoDTO (com.tomasio.projects.trainning.dto.GrupoAreaConhecimentoDTO)1 ObjetivoDisciplinaDTO (com.tomasio.projects.trainning.dto.ObjetivoDisciplinaDTO)1 DAOException (com.tomasio.projects.trainning.exception.DAOException)1 CoreException (com.tomasio.projects.trainning.exeption.CoreException)1 CurriculoMinimoForm (com.tomasio.projects.trainning.form.cm.CurriculoMinimoForm)1 DisciplinaCMForm (com.tomasio.projects.trainning.form.cm.DisciplinaCMForm)1 AreaEnsino (com.tomasio.projects.trainning.model.AreaEnsino)1 BufferedReader (java.io.BufferedReader)1 FileNotFoundException (java.io.FileNotFoundException)1 FileReader (java.io.FileReader)1 IOException (java.io.IOException)1 ClassPathResource (org.springframework.core.io.ClassPathResource)1