Search in sources :

Example 36 with CoreException

use of com.tomasio.projects.trainning.exeption.CoreException in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method findCapituloApostila.

@Override
@Transactional(readOnly = true)
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public CapituloApostilaDTO findCapituloApostila(Long id) {
    CapituloApostilaDAO dao = factory.getCapituloApostilaDAO();
    CapituloApostila capitulo = null;
    try {
        capitulo = dao.find(id);
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    } catch (Exception ex) {
        throw new CoreException("Erro de sistema: " + ex.getMessage());
    }
    if (capitulo != null) {
        return capitulo.createDTO();
    } else {
        return null;
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) CapituloApostila(com.tomasio.projects.trainning.model.CapituloApostila) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 37 with CoreException

use of com.tomasio.projects.trainning.exeption.CoreException in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method updateConceituacao.

@Override
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
@Transactional
public void updateConceituacao(ConceituacaoDTO conceituacao) {
    ConceituacaoDAO dao = factory.getConceituacaoDAO();
    Conceituacao model = new Conceituacao(conceituacao);
    try {
        dao.update(model);
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    } catch (Exception ex) {
        throw new CoreException("Erro de sistema: " + ex.getMessage());
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) Conceituacao(com.tomasio.projects.trainning.model.Conceituacao) CoreException(com.tomasio.projects.trainning.exeption.CoreException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 38 with CoreException

use of com.tomasio.projects.trainning.exeption.CoreException in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method updateAtividadeAvaliativa.

@Override
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
@Transactional
public void updateAtividadeAvaliativa(AtividadeAvaliativaDTO atividade) {
    AtividadeAvaliativaDAO dao = factory.getAtividadeAvaliativaDAO();
    AtividadeAvaliativa model = new AtividadeAvaliativa(atividade);
    try {
        dao.update(model);
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    } catch (Exception ex) {
        throw new CoreException("Erro de sistema: " + ex.getMessage());
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) AtividadeAvaliativa(com.tomasio.projects.trainning.model.AtividadeAvaliativa) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 39 with CoreException

use of com.tomasio.projects.trainning.exeption.CoreException in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method createAnexoApostila.

@Override
@Transactional
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public Long createAnexoApostila(AnexoApostilaDTO anexo) {
    AnexoApostilaDAO dao = factory.getAnexoApostilaDAO();
    AnexoApostila model = new AnexoApostila(anexo);
    Long id = null;
    try {
        id = dao.create(model);
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    } catch (Exception ex) {
        throw new CoreException("Erro de sistema: " + ex.getMessage());
    }
    return id;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) AnexoApostila(com.tomasio.projects.trainning.model.AnexoApostila) CoreException(com.tomasio.projects.trainning.exeption.CoreException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 40 with CoreException

use of com.tomasio.projects.trainning.exeption.CoreException in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method createSecaoApostila.

@Override
@Transactional
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public Long createSecaoApostila(SecaoApostilaDTO secao) {
    SecaoApostilaDAO dao = factory.getSecaoApostilaDAO();
    ContentDAO contentDAO = factory.getContentDAO();
    CapituloApostilaDAO capituloDAO = factory.getCapituloApostilaDAO();
    ApostilaDAO apostilaDAO = factory.getApostilaDAO();
    SecaoApostila model = new SecaoApostila(secao);
    Long id = null;
    try {
        id = dao.create(model);
        model = dao.find(id);
        String folderName = String.valueOf(model.getId());
        CapituloApostila capitulo = capituloDAO.find(model.getCapituloApostila().getId());
        Apostila apostila = apostilaDAO.find(capitulo.getApostila().getId());
        FolderDTO folder = new FolderDTO();
        folder.setName(folderName);
        String assetsFolderId = contentDAO.createFolderWithUUIDParent(folder, apostila.getAssetsFolderId());
        model.setAssetsFolderId(assetsFolderId);
        dao.update(model);
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    } catch (Exception ex) {
        throw new CoreException("Erro de sistema: " + ex.getMessage());
    }
    return id;
}
Also used : SecaoApostila(com.tomasio.projects.trainning.model.SecaoApostila) CapituloApostila(com.tomasio.projects.trainning.model.CapituloApostila) AnexoApostila(com.tomasio.projects.trainning.model.AnexoApostila) Apostila(com.tomasio.projects.trainning.model.Apostila) CapituloApostila(com.tomasio.projects.trainning.model.CapituloApostila) SecaoApostila(com.tomasio.projects.trainning.model.SecaoApostila) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) DAOException(com.tomasio.projects.trainning.exception.DAOException) FolderDTO(com.tomasio.projects.trainning.dto.FolderDTO) CoreException(com.tomasio.projects.trainning.exeption.CoreException) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

CoreException (com.tomasio.projects.trainning.exeption.CoreException)435 DAOException (com.tomasio.projects.trainning.exception.DAOException)388 Transactional (org.springframework.transaction.annotation.Transactional)372 ParseException (java.text.ParseException)91 OrganizacaoDTO (com.tomasio.projects.trainning.dto.OrganizacaoDTO)53 Organizacao (com.tomasio.projects.trainning.model.Organizacao)41 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)40 IndicacaoDAO (com.tomasio.projects.trainning.dao.IndicacaoDAO)30 PreMatriculaDAO (com.tomasio.projects.trainning.dao.PreMatriculaDAO)27 IndicacaoAlunoDTO (com.tomasio.projects.trainning.dto.IndicacaoAlunoDTO)25 PreMatricula (com.tomasio.projects.trainning.model.PreMatricula)25 PessoaDTO (com.tomasio.projects.trainning.dto.PessoaDTO)23 PreMatriculaDTO (com.tomasio.projects.trainning.dto.PreMatriculaDTO)21 CancelamentoMatriculaDAO (com.tomasio.projects.trainning.dao.CancelamentoMatriculaDAO)20 NotificacaoMatriculaDAO (com.tomasio.projects.trainning.dao.NotificacaoMatriculaDAO)20 Date (java.util.Date)20 MatriculaDAO (com.tomasio.projects.trainning.dao.MatriculaDAO)19 TurmaDAO (com.tomasio.projects.trainning.dao.TurmaDAO)19 CancelamentoMatricula (com.tomasio.projects.trainning.model.CancelamentoMatricula)18 Indicacao (com.tomasio.projects.trainning.model.Indicacao)18