Package ecar.pojo

Examples of ecar.pojo.PontoCriticoSisAtributoPtcSatb


      String nomeAtributoLivre = "a" + grupo.getCodSga().toString();
     
      if (acao != null && acao.equals(ConstantesECAR.ACAO_ALTERAR)){

        Set atributoLivres = pontoCritico.getPontoCriticoSisAtributoPtcSatbs()
        PontoCriticoSisAtributoPtcSatb atributoLivre= pontoCritico.buscarItemEstruturaSisAtributoLista(sisAtributo);
       
        ActionSisAtributo action = new ActionSisAtributo();
        TipoValor mascaraArmazenada = atributoLivre.obterTipoMascara();
       
        String sequencialGerado = action.obterSequencial(atributoLivre.getInformacao(), mascaraArmazenada.getConteudo());
       
        ret.append("if (!validaMascaraEditavel(document.getElementById('"+nomeAtributoLivre+"'),'"+sisAtributo.getMascara()+"','"+atributo.iGetLabel()+"','"+EcarCfg.getConfiguracao("caracter.mascara.mes")+"','"+EcarCfg.getConfiguracao("caracter.mascara.ano")+"','"+EcarCfg.getConfiguracao("caracter.mascara.sequencial")+"','"+sequencialGerado+"','"+mascaraArmazenada.getConteudo()+"')) {\n");
       
        ret.append("\t return false;\n");
          ret.append("} \n");     
View Full Code Here


           
            Iterator itPontoCriticoSisAtributos =  pontoCriticoOrigem.getPontoCriticoSisAtributoPtcSatbs().iterator();
                 
            while (itPontoCriticoSisAtributos.hasNext()){
             
              PontoCriticoSisAtributoPtcSatb pontoCriticoSisAtributoOrigem = (PontoCriticoSisAtributoPtcSatb) itPontoCriticoSisAtributos.next();
             
              PontoCriticoSisAtributoPtcSatb pontoCriticoSisAtributoNovo = new PontoCriticoSisAtributoPtcSatb();
                                     
              pontoCriticoSisAtributoNovo.setDataUltManutencao(Data.getDataAtual());
//              pontoCriticoSisAtributoNovo.setUsuarioUsu(usuarioLogado);
              pontoCriticoSisAtributoNovo.setPontoCriticoPtc(pontoCriticoNovo);           
              pontoCriticoSisAtributoNovo.setSisAtributoSatb(pontoCriticoSisAtributoOrigem.getSisAtributoSatb());
              pontoCriticoSisAtributoNovo.setUsuarioUsu(pontoCriticoSisAtributoOrigem.getUsuarioUsu());
                                   

              //Para atributos do tipo CAMPO_ID
               if (pontoCriticoSisAtributoOrigem.getInformacao() != null && pontoCriticoSisAtributoOrigem.getSisAtributoSatb().getAtribInfCompSatb() !=null
                   && (pontoCriticoSisAtributoOrigem.getSisAtributoSatb().isAtributoContemMascara() || pontoCriticoSisAtributoOrigem.getSisAtributoSatb().isAtributoAutoIcremental())){
                
                 if (!pontoCriticoSisAtributoOrigem.getSisAtributoSatb().isAtributoAutoIcremental()){
                   pontoCriticoSisAtributoNovo.setInformacao(action.geraConteudo(pontoCriticoSisAtributoOrigem.getSisAtributoSatb().getMascara()));
                 }
                 geraValorIncremental(pontoCriticoSisAtributoNovo, pontoCriticoSisAtributoNovo.getSisAtributoSatb(), funcaoPontoCritico, pontoCriticoSisAtributoNovo.getPontoCriticoPtc().getItemEstruturaIett().getEstruturaEtt(), null);
              

               //Para atributos do tipo TEXT, TEXTAREA, MULTITEXTO, IMAGEM e VALIDA��O
               } else if (pontoCriticoSisAtributoOrigem.getInformacao() != null){              
                pontoCriticoSisAtributoNovo.setInformacao(pontoCriticoSisAtributoOrigem.getInformacao());
              }
             
              pontoCriticoSisAtributoNovo.atribuirPKPai();
             
  //            atributosLivresPontosCriticos.add(pontoCriticoSisAtributoNovo);
             
              session.save(pontoCriticoSisAtributoNovo);
            }
View Full Code Here

      input.setClassLabel("label");
      List aributosLivresSelecionados = new ArrayList();
      if (getPontoCriticoPtc().getPontoCriticoSisAtributoPtcSatbs() != null) {
        Iterator itAtribLivres = getPontoCriticoPtc().getPontoCriticoSisAtributoPtcSatbs().iterator();
        while (itAtribLivres.hasNext()) {
          PontoCriticoSisAtributoPtcSatb atributo = (PontoCriticoSisAtributoPtcSatb) itAtribLivres.next();
          AtributoLivre atributoLivre = new AtributoLivre();
          atributoLivre.setInformacao(atributo.getInformacao());
          atributoLivre.setSisAtributoSatb(atributo.getSisAtributoSatb());
          aributosLivresSelecionados.add(atributoLivre);
        }
      }
      input.setSelecionados(aributosLivresSelecionados);
      input.setSisAtributo((SisAtributoSatb) grupoAtributo.getSisAtributoSatbs().iterator().next());
      //input.setSisAtributo((SisAtributoSatb) pontoCriticoPtc.getPontoCriticoSisAtributoPtcSatbs().iterator().next().getSisAtributoSatb());
      if (atributo.iGetDica() != null){
        input.setDica(atributo.iGetDica());
        input.setContexto(this.getContextPath());
      }
     
      input.doStartTag();
      Options options = new Options(writer);
      List opcoes = new ArrayList();
      String selectedCodSapadrao = "";
       if(grupoAtributo.getCodSga() != null && grupoAtributo.getCodSga().longValue() != 1){
         if(grupoAtributo.getSisTipoOrdenacaoSto() != null){
           //for (Object obj : grupoAtributo.)
           opcoes.addAll(grupoAtributo.getSisAtributoSatbs()) ;//new SisGrupoAtributoDao(null).getAtributosOrdenados(grupoAtributo);
         }
       }
      if (!opcoes.isEmpty()) {
        options.setOptions(opcoes);
        options.setValor("codSatb");
        options.setLabel("descricaoSatb");
       
            if(atributo.iGetDica() != null){
              options.setContexto(this.getContextPath());
              options.setDica(atributo.iGetDica());
            }
       
        // options.setImagem(getContextPath() + "/images/relAcomp/");
        options.setParent(input);
        options.setNome("a" + grupoAtributo.getCodSga().toString());
View Full Code Here

          List aributosLivresSelecionados = new ArrayList();

          if(getPontoCriticoPtc().getPontoCriticoSisAtributoPtcSatbs() != null){
            Iterator itAtribLivres = getPontoCriticoPtc().getPontoCriticoSisAtributoPtcSatbs().iterator();
            while(itAtribLivres.hasNext()){
              PontoCriticoSisAtributoPtcSatb atributo = (PontoCriticoSisAtributoPtcSatb) itAtribLivres.next();
              AtributoLivre atributoLivre = new AtributoLivre();
              atributoLivre.setInformacao(atributo.getInformacao());
              atributoLivre.setSisAtributoSatb(atributo.getSisAtributoSatb());
              aributosLivresSelecionados.add(atributoLivre);
            }
          }
         
          input.setSelecionados(aributosLivresSelecionados);
          input.setSisAtributo((SisAtributoSatb)grupoAtributo.getSisAtributoSatbs().iterator().next());
          input.setContexto(getContextPath());
          if(atributo.iGetDica() != null)
            input.setDica(atributo.iGetDica());
         
          input.doStartTag();
         
          Options options = new Options(writer);
         
        List opcoes = new ArrayList();
        String selectedCodSapadrao = "";
        if(grupoAtributo.getCodSga() != null && grupoAtributo.getCodSga().longValue() != 1){
          if(grupoAtributo.getSisTipoOrdenacaoSto() != null){
            List<SisAtributoSatb> innerList = new SisGrupoAtributoDao(null).getAtributosOrdenados(grupoAtributo);
            for (SisAtributoSatb sisAtributoSatb : innerList) {
            if (sisAtributoSatb.isAtivo()){
              opcoes.add(sisAtributoSatb);
            }
          }
          }
        }
         
        if(!opcoes.isEmpty()) {
            options.setOptions(opcoes);
            options.setValor("codSatb");
            options.setLabel("descricaoSatb");
            //options.setImagem(getContextPath() + "/images/relAcomp/");
            if(atributo.iGetDica() != null){
              options.setContexto(this.getContextPath());
              options.setDica(atributo.iGetDica());
            }
            options.setParent(input);
            options.setNome("a" + grupoAtributo.getCodSga().toString());
            options.doStartTag();
        }
View Full Code Here

      pontoCritico.setPontoCriticoCorPtccores(null);
      /* apaga os filhos para serem gravados novamente */
      if (pontoCritico.getPontoCriticoSisAtributoPtcSatbs() != null && !pontoCritico.getPontoCriticoSisAtributoPtcSatbs().isEmpty()) {
        Iterator itAtb = pontoCritico.getPontoCriticoSisAtributoPtcSatbs().iterator();
        while (itAtb.hasNext()) {
          PontoCriticoSisAtributoPtcSatb pontoCriticoSisAtributoPtcSatb = (PontoCriticoSisAtributoPtcSatb) itAtb.next();
         
                    if(pontoCriticoSisAtributoPtcSatb.getSisAtributoSatb().getSisGrupoAtributoSga().getSisTipoExibicGrupoSteg().getCodSteg() == Input.IMAGEM){
                     
                      String nomeCampo = request.getParameter("a" + pontoCriticoSisAtributoPtcSatb.getSisAtributoSatb().getSisGrupoAtributoSga().getCodSga().toString());
                     
                      if (nomeCampo != null && nomeCampo.equals("")){
                       
                  String fullFile = pontoCriticoSisAtributoPtcSatb.getInformacao();
                 
                  if (fullFile.lastIndexOf("=") != -1)    
                    fullFile = fullFile.substring(fullFile.lastIndexOf("=") + 1);
               
                  File f = new File(fullFile);
                  if( f.exists() )
                    FileUpload.apagarArquivo(fullFile);
                      }
                    }
         
          session.delete(pontoCriticoSisAtributoPtcSatb);
          objetos.add(pontoCriticoSisAtributoPtcSatb);
        }
      }
      else
        pontoCritico.setPontoCriticoSisAtributoPtcSatbs(new HashSet<PontoCriticoSisAtributoPtcSatb>());
      pontoCritico.setPontoCriticoSisAtributoPtcSatbs(null);
      this.setPontoCritico(request, pontoCritico);
      pontoCritico.setUsuarioUsuByCodUsuUltManutPtc(usuario);
      pontoCritico.setDataUltManutencaoPtc(Data.getDataAtual());
      List filhos = new ArrayList();
      if (pontoCritico.getPontoCriticoCorPtccores() != null) {
        filhos.addAll(pontoCritico.getPontoCriticoCorPtccores());
      }
      if (pontoCritico.getPontoCriticoSisAtributoPtcSatbs() != null) {
        for (Object object : pontoCritico.getPontoCriticoSisAtributoPtcSatbs()) {
          PontoCriticoSisAtributoPtcSatb ptcSatb = (PontoCriticoSisAtributoPtcSatb) object;
          ptcSatb.gerarTiposValores();
        }
        filhos.addAll(pontoCritico.getPontoCriticoSisAtributoPtcSatbs());
      }
      session.update(pontoCritico);
      objetos.add(pontoCritico);
View Full Code Here

        // filhos.addAll(pontoCritico.getPontoCriticoSisAtributoPtcSatbs());
        filhos.addAll(listaPtcSisAtributo);
        FuncaoDao funcaoDao = new FuncaoDao(request);
        FuncaoFun funcao = funcaoDao.getFuncaoPontosCriticos();
        for (Iterator it = listaPtcSisAtributo.iterator(); it.hasNext();) {
          PontoCriticoSisAtributoPtcSatb ptcSisAtributo = (PontoCriticoSisAtributoPtcSatb) it.next();
          SisAtributoSatb sisAtributo = ptcSisAtributo.getSisAtributoSatb();
          // Caso o tipo de valida��o seja uma das tr�s abaixo, ser�
          // gerado um c�digo incremental.
          if (sisAtributo != null && (sisAtributo.isAtributoAutoIcremental() || sisAtributo.isAtributoContemMascara())) {
            ItemEstruturaDao itemEstruturaDao = new ItemEstruturaDao(request, session);
            itemEstruturaDao.geraValorIncremental(ptcSisAtributo, sisAtributo, funcao, ptcSisAtributo.getPontoCriticoPtc().getItemEstruturaIett()
                    .getEstruturaEtt(), null);
          }
        }
      }
      Iterator it = filhos.iterator();
View Full Code Here

          numAtributos = contador;
        }
        for (int i = 0; i < numAtributos; i++) {
          // N�o seto todos os outros campos, pois eles ser�o setados
          // depois de gravar o item.
          PontoCriticoSisAtributoPtcSatb atributoLivre = new PontoCriticoSisAtributoPtcSatb();
          atributoLivre.setDataUltManutencao(Data.getDataAtual());
          atributoLivre.setUsuarioUsu(((ecar.login.SegurancaECAR) request.getSession().getAttribute("seguranca")).getUsuario());
          atributoLivre.setPontoCriticoPtc(pontoCriticoPtc);
          atributoLivre.setSisAtributoSatb((SisAtributoSatb) this.buscar(SisAtributoSatb.class, Long.valueOf(atributos[i])));
          atributoLivre.atribuirPKPai();
          if (pontoCriticoPtc.getPontoCriticoSisAtributoPtcSatbs() == null) {
            pontoCriticoPtc.setPontoCriticoSisAtributoPtcSatbs(new HashSet());
          }
          pontoCriticoPtc.getPontoCriticoSisAtributoPtcSatbs().add(atributoLivre);
        }
      }
      // Se for TEXT Field
      else
        if (tipoCampo.equals(SisTipoExibicGrupoDao.TEXT) || tipoCampo.equals(SisTipoExibicGrupoDao.TEXTAREA)
                || tipoCampo.equals(SisTipoExibicGrupoDao.IMAGEM) || tipoCampo.equals(SisTipoExibicGrupoDao.VALIDACAO)) {
          if (grupoAtributo.getSisAtributoSatbs() != null && !grupoAtributo.getSisAtributoSatbs().isEmpty()) {
            SisAtributoSatb sisAtributoSatb = (SisAtributoSatb) grupoAtributo.getSisAtributoSatbs().iterator().next();
            if (!(Pagina.getParamStr(request, nomeCampo).equals(Dominios.STRING_VAZIA)) || (sisAtributoSatb.isAtributoAutoIcremental())
                    || (sisAtributoSatb.isAtributoContemMascara())) {
              // N�o seto todos os outros campos, pois eles ser�o
              // setados depois de gravar o item.
              PontoCriticoSisAtributoPtcSatb atributoLivre = new PontoCriticoSisAtributoPtcSatb();
              atributoLivre.setDataUltManutencao(Data.getDataAtual());
              atributoLivre.setUsuarioUsu(((ecar.login.SegurancaECAR) request.getSession().getAttribute("seguranca")).getUsuario());
              atributoLivre.setPontoCriticoPtc(pontoCriticoPtc);
              atributoLivre.setSisAtributoSatb((SisAtributoSatb) grupoAtributo.getSisAtributoSatbs().iterator().next());
              atributoLivre.setInformacao(Pagina.getParamStr(request, nomeCampo));
              atributoLivre.setFuncao(funcao);
              atributoLivre.atribuirPKPai();
              if (pontoCriticoPtc.getPontoCriticoSisAtributoPtcSatbs() == null) {
                pontoCriticoPtc.setPontoCriticoSisAtributoPtcSatbs(new HashSet());
              }
             
              String pathRaiz = request.getContextPath();
             
              // tratamento imagem
              String caminhoAuxiliarImagem = Pagina.getParamStr(request, "hidImagem" + "a"
                  + grupoAtributo.getCodSga().toString());
              if (caminhoAuxiliarImagem!=null && caminhoAuxiliarImagem.length()>0) {
               
                  String chave = atributoLivre.getInformacao();
                  chave = chave.substring(chave.indexOf("RemoteFile=")+ "RemoteFile=".length());
                  UsuarioUsu usuario = ((ecar.login.SegurancaECAR)request.getSession().getAttribute("seguranca")).getUsuario();
                              if(usuario.getMapArquivosAtuaisUsuarios() != null && usuario.getMapArquivosAtuaisUsuarios().containsKey(chave)){
//                                atributoLivre.setInformacao(usuario.getMapArquivosAtuaisUsuarios().get(chave));
                               
                                caminhoAuxiliarImagem = usuario.getMapArquivosAtuaisUsuarios().get(chave);
                                caminhoAuxiliarImagem = pathRaiz +"/DownloadFile?RemoteFile=" + caminhoAuxiliarImagem;
                              }
//                              else{
               
                  // salvar a imagem fisicamente que tem o caminho real em "a" + codigo de grupo
                  try {                 
                    String nomeArquivoNovo = FileUpload.salvarArquivoSessaoFisicamente(request, "a" + grupoAtributo.getCodSga().toString(), caminhoAuxiliarImagem);
                    if(nomeArquivoNovo != null && !nomeArquivoNovo.equals(""))
                      atributoLivre.setInformacao(nomeArquivoNovo);
                  } catch (FileNotFoundException e) {
                    throw new ECARException("erro.arquivoUrl",e, new String[]{caminhoAuxiliarImagem});
                  } catch (Exception e) {
                    throw new ECARException("erro.upload",e, new String[]{caminhoAuxiliarImagem});
                  }
//                              }
              }
             
              pontoCriticoPtc.getPontoCriticoSisAtributoPtcSatbs().add(atributoLivre);
            }
          }
        }
        else
          if (tipoCampo.equals(SisTipoExibicGrupoDao.MULTITEXTO)) {
            Enumeration lAtrib = request.getParameterNames();
            while (lAtrib.hasMoreElements()) {
              String atrib = (String) lAtrib.nextElement();
              if (atrib.lastIndexOf('_') > 0) {
                // System.out.println("nomeatributo" + atrib);
                String nomeAtrib = atrib.substring(0, atrib.lastIndexOf('_'));
                String codSisAtrib = atrib.substring(atrib.lastIndexOf('_') + 1);
                nomeCampo = "a" + grupoAtributo.getCodSga().toString() + "_" + codSisAtrib;
                if (nomeAtrib.equals("a" + grupoAtributo.getCodSga().toString()) && !"".equals(Pagina.getParamStr(request, atrib))) {
                  PontoCriticoSisAtributoPtcSatb atributoLivre = new PontoCriticoSisAtributoPtcSatb();
                  atributoLivre.setDataUltManutencao(Data.getDataAtual());
                  atributoLivre.setUsuarioUsu(((ecar.login.SegurancaECAR) request.getSession().getAttribute("seguranca")).getUsuario());
                  atributoLivre.setPontoCriticoPtc(pontoCriticoPtc);
                  atributoLivre.setSisAtributoSatb((SisAtributoSatb) this.buscar(SisAtributoSatb.class, Long.valueOf(codSisAtrib)));
                  atributoLivre.setInformacao(Pagina.getParamStr(request, nomeCampo));
                  atributoLivre.atribuirPKPai();
                  if (pontoCriticoPtc.getPontoCriticoSisAtributoPtcSatbs() == null) {
                    pontoCriticoPtc.setPontoCriticoSisAtributoPtcSatbs(new HashSet());
                  }
                  pontoCriticoPtc.getPontoCriticoSisAtributoPtcSatbs().add(atributoLivre);
                }
View Full Code Here

TOP

Related Classes of ecar.pojo.PontoCriticoSisAtributoPtcSatb

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.