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;
}
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;
}
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);
}
}
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;
}
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;
}
Aggregations