Search in sources :

Example 1 with AreaDTO

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

the class Area method createDTOMinimal.

public AreaDTO createDTOMinimal() {
    AreaDTO dto = new AreaDTO();
    dto.setId(this.id);
    dto.setSigla(this.sigla);
    dto.setNome(this.nome);
    return dto;
}
Also used : AreaDTO(com.tomasio.projects.trainning.dto.AreaDTO)

Example 2 with AreaDTO

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

the class PlanejamentosController method detailSolicitacao.

@RequestMapping("/detail_planejamento")
public String detailSolicitacao(Model model, WebRequest request) {
    PlanejamentoDTO planejamento = planningService.findPlanejamento(Long.parseLong(request.getParameter("planejamentoId")));
    CursoDTO[] cursos = trainningService.findAllCursos(null, null, null, null);
    AreaDTO[] areas = trainningService.findAllAreas();
    OrganizacaoDTO[] organizacoes = organizationalService.findAllOrganizacoes();
    model.addAttribute("planejamento", planejamento);
    model.addAttribute("areas", areas);
    model.addAttribute("organizacoes", organizacoes);
    model.addAttribute("cursos", cursos);
    return "detail_planejamento";
}
Also used : CursoDTO(com.tomasio.projects.trainning.dto.CursoDTO) AreaDTO(com.tomasio.projects.trainning.dto.AreaDTO) ResponsavelAreaDTO(com.tomasio.projects.trainning.dto.ResponsavelAreaDTO) OrganizacaoDTO(com.tomasio.projects.trainning.dto.OrganizacaoDTO) PlanejamentoDTO(com.tomasio.projects.trainning.dto.PlanejamentoDTO) ItemPlanejamentoDTO(com.tomasio.projects.trainning.dto.ItemPlanejamentoDTO) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 3 with AreaDTO

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

the class CommonsController method getAreaData.

public Map<Object, Object> getAreaData(SelectAreaForm form) {
    Map<Object, Object> result = new HashMap<>();
    AreaDTO area = trainningService.findArea(form.getAreaId());
    result.put("nome", area.getNome());
    result.put("id", area.getId());
    return result;
}
Also used : AreaDTO(com.tomasio.projects.trainning.dto.AreaDTO)

Example 4 with AreaDTO

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

the class TrainningServiceSimpleImpl method findAllAreas.

@Override
@Transactional(readOnly = true)
public AreaDTO[] findAllAreas() {
    AreaDAO dao = factory.getAreaDAO();
    AreaDTO[] areasArray = null;
    try {
        List<Area> areas = dao.findAll();
        if (areas != null) {
            areasArray = new AreaDTO[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) Area(com.tomasio.projects.trainning.model.Area) CoreException(com.tomasio.projects.trainning.exeption.CoreException) AreaDTO(com.tomasio.projects.trainning.dto.AreaDTO) AreaDAO(com.tomasio.projects.trainning.dao.AreaDAO) Transactional(org.springframework.transaction.annotation.Transactional)

Example 5 with AreaDTO

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

the class AreasController method editArea.

@RequestMapping("/edit")
public String editArea(Model model, WebRequest request) {
    String areaId = request.getParameter("areaId");
    AreaDTO[] areas = trainningService.findAllAreasExcept(Long.parseLong(areaId));
    AreaDTO dto = trainningService.findArea(Long.parseLong(areaId));
    AreaForm areaForm = new AreaForm();
    areaForm.setId(dto.getId());
    areaForm.setSigla(dto.getSigla());
    areaForm.setNome(dto.getNome());
    areaForm.setParentId(dto.getParentId());
    model.addAttribute("areas", areas);
    model.addAttribute(areaForm);
    return "areas/form";
}
Also used : AreaForm(com.tomasio.projects.trainning.form.AreaForm) AreaDTO(com.tomasio.projects.trainning.dto.AreaDTO) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

AreaDTO (com.tomasio.projects.trainning.dto.AreaDTO)17 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)8 CoreException (com.tomasio.projects.trainning.exeption.CoreException)7 AreaDAO (com.tomasio.projects.trainning.dao.AreaDAO)4 ItemPlanejamentoDTO (com.tomasio.projects.trainning.dto.ItemPlanejamentoDTO)4 PlanejamentoDTO (com.tomasio.projects.trainning.dto.PlanejamentoDTO)4 ResponsavelAreaDTO (com.tomasio.projects.trainning.dto.ResponsavelAreaDTO)4 DAOException (com.tomasio.projects.trainning.exception.DAOException)4 Area (com.tomasio.projects.trainning.model.Area)4 ArrayList (java.util.ArrayList)4 Transactional (org.springframework.transaction.annotation.Transactional)4 OrganizacaoDTO (com.tomasio.projects.trainning.dto.OrganizacaoDTO)3 CursoDTO (com.tomasio.projects.trainning.dto.CursoDTO)2 StripItemPlanejamentoDTO (com.tomasio.projects.trainning.dto.StripItemPlanejamentoDTO)2 AreaForm (com.tomasio.projects.trainning.form.AreaForm)2 ParseException (java.text.ParseException)2 SimpleDateFormat (java.text.SimpleDateFormat)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 AcaoDTO (com.tomasio.projects.trainning.dto.AcaoDTO)1