Package br.gov.serpro.ouvidoria.dao.hibernate

Examples of br.gov.serpro.ouvidoria.dao.hibernate.HibernateDaoFactory


  protected void doGet(HttpServletRequest request,
      HttpServletResponse response) throws ServletException, IOException {

    try {

      final DaoFactory daoFactory = new HibernateDaoFactory();

      final Long funcionarioId = (Long) request.getSession()
          .getAttribute(Constants.PA_FUNCIONARIO);

      final FuncionarioCtrl funcionarioCtrl = new FuncionarioCtrl(
View Full Code Here


                .getAttribute(Constants.SR_FUNCIONALIDADE);

        if (funcionalidade != null && funcionalidade.trim().length() > 0) {

            HistoricoCtrl historico = new HistoricoCtrl(
                    new HibernateDaoFactory());

                       
            Long funcionarioId = (Long) request.getSession().getAttribute(Constants.PA_FUNCIONARIO);
           
            try {
View Full Code Here

                .getAttribute(Constants.SR_FUNCIONALIDADE);

        if (funcionalidade != null && funcionalidade.trim().length() > 0) {

          HistoricoCtrl historico = new HistoricoCtrl(
                    new HibernateDaoFactory());
         
          try {
         
              Long funcionarioId = (Long) request.getSession().getAttribute(Constants.PA_FUNCIONARIO);
             
View Full Code Here

            throws Exception {

        ActionMessages errors = new ActionMessages();

        try {
            DaoFactory daoFactory = new HibernateDaoFactory();

            request.setAttribute("txt_periodo_i", "");
            request.setAttribute("txt_periodo_f", "");

            request.setAttribute("sel_ouvidoria", "");
            request.setAttribute("sel_assunto", "");
            request.setAttribute("sel_tipo_mensagem", "");
            request.setAttribute("sel_situacao", "");

            request.setAttribute("txt_protocolo", "");
            request.setAttribute("txt_palavra_chave", "");

            Long funcionarioId = (Long) request.getSession().getAttribute(Constants.PA_FUNCIONARIO);
           
          FuncionarioCtrl funcionarioCtrl = new FuncionarioCtrl(getDaoFactory());
         
          Funcionario funcionario = (Funcionario) funcionarioCtrl.get(funcionarioId)

            Orgao orgao = getOrgao(request);

            Collection assuntos = null;
            if ( funcionario.getNivelAtuacao() == Funcionario.NA_ORGAO) {
                assuntos = orgao.getListaAssuntosSubOrgaos()
            } else {
                Comparator ordem = new Comparator() {
                    public int compare(Object obj1, Object obj2) {
                        PersistentObject pobj1 = (PersistentObject) obj1;
                        PersistentObject pobj2 = (PersistentObject) obj2;
                        if (pobj1 != null && pobj1.getDescricao() != null) {
                            return pobj1.getDescricao().compareTo(pobj2.getDescricao());
                        }
                        return 0;
                    }
                };

                assuntos = new TreeSet(ordem);
                for(Iterator iter=funcionario.getListaSubOrgaosAtivos().iterator(); iter.hasNext(); ) {
                    SubOrgao subOrgao = (SubOrgao) iter.next();
                    assuntos.addAll(subOrgao.getListaAssunto(Assunto.ATIVO));
                }
            }
           
            Collection tipoMsg = orgao.getListaTipoMensagem();

            // Qual classe representa ouvidorias ?
            request.setAttribute("cas_ouvidorias", daoFactory.create(
                    Instituicao.class).list());

            request.setAttribute("cas_assuntos", assuntos);

            request.setAttribute("cas_tipos_mensagem", tipoMsg);

            request.setAttribute("cas_protocolos", daoFactory.create(
                    Protocolo.class).list());
           
            request.setAttribute("cas_situacao_mensagem", daoFactory.create(
                    EstadoAcionamento.class).list());

        } catch (Throwable t) {
            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(
                    "error.solucao.excecao"));
View Full Code Here

        /* Tratamento dos arquivos anexos */
        if (((arquivoAnexo != null) && (arquivoAnexo.getFileName().length() > 0))
        || ((mensagemDigitalizada != null) && (mensagemDigitalizada
                .getFileName().length() > 0))) {
            EnviarMensagemWebCtrl controlador = new EnviarMensagemWebCtrl(
                    new HibernateDaoFactory());
            String lista = "";
            StringTokenizer st = null;
            String extensao = "";
           
            /* Valida tamanho do arquivo anexo */
 
View Full Code Here

  }

  public static List getComboList(HttpServletRequest request)
      throws SQLException {

    final DaoFactory daoFactory = new HibernateDaoFactory();

    String sIndex = request.getParameter(ReportKit.SEL_TABELA);
    if (sIndex == null || sIndex.length() == 0) {
      sIndex = "-1";
    }
View Full Code Here

  public static String getComboListsAsArray(HttpServletRequest request)
      throws SQLException {

    // obter o órgão atual
    final DaoFactory daoFactory = new HibernateDaoFactory();
    OrgaoCtrl orgaoCtrl = new OrgaoCtrl(daoFactory);
    String idSessaoOrgao = (String) request.getSession().getAttribute(
        Constants.ID_SESSAO_ORGAO);
    Orgao orgao = (Orgao) orgaoCtrl.get(idSessaoOrgao);
View Full Code Here

  }

  public static String getQuery(HttpServletRequest request) {

    boolean table_on_x_axis = false;
    final DaoFactory daoFactory = new HibernateDaoFactory();

    if ("0".equalsIgnoreCase(request.getParameter("r_base_x")))
      table_on_x_axis = true;

    boolean detail = false;
View Full Code Here

  private final static Perl5Util p5Util = new Perl5Util();

  public static String getNoOutrosQuery(HttpServletRequest request) {

    boolean table_on_x_axis = false;
    final DaoFactory daoFactory = new HibernateDaoFactory();

    if ("0".equalsIgnoreCase(request.getParameter("r_base_x")))
      table_on_x_axis = true;

    boolean detail = false;
View Full Code Here

  }

  public static String getQuery(HttpServletRequest request) {

    boolean detail = false;
    final DaoFactory daoFactory = new HibernateDaoFactory();

    if ("d".equalsIgnoreCase(request.getParameter("r_modo_exibicao")))
      detail = true;

    OrgaoCtrl orgaoCtrl = new OrgaoCtrl(daoFactory);
View Full Code Here

TOP

Related Classes of br.gov.serpro.ouvidoria.dao.hibernate.HibernateDaoFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.