Package ecar.pojo

Examples of ecar.pojo.SisGrupoAtributoSga


   
    List lAtributos;
    lAtributos =  new SisGrupoAtributoDao(request).getGruposAtributosCadastro("D");
        Iterator it = lAtributos.iterator();
        while (it.hasNext()) {
            SisGrupoAtributoSga grupoAtributo = (SisGrupoAtributoSga) it.next();          
            if (!"".equals(Pagina.getParamStr(request, "a" + grupoAtributo.getCodSga().toString())) || !"".equals(Pagina.getParamStr(request, "hidden_a" + grupoAtributo.getCodSga().toString()))) {
                DemAtributoDema demandaAtributo = new DemAtributoDema();
                demandaAtributo.setRegDemandaRegd(regDemanda);
                /*
                 * Caso o tipo de campo seja texto considera-se que o Grupo de
                 * Atributos possuir� apenas 1 atributo que o representa.
                 */
                if (SisTipoExibicGrupoDao.TEXT.equals(grupoAtributo.getSisTipoExibicGrupoSteg().getCodSteg().toString())
                     || SisTipoExibicGrupoDao.VALIDACAO.equals(grupoAtributo.getSisTipoExibicGrupoSteg().getCodSteg().toString())
                     || SisTipoExibicGrupoDao.TEXTAREA.equals(grupoAtributo.getSisTipoExibicGrupoSteg().getCodSteg().toString())
                  || SisTipoExibicGrupoDao.IMAGEM.equals(grupoAtributo.getSisTipoExibicGrupoSteg().getCodSteg().toString())) {
                    if (grupoAtributo.getSisAtributoSatbs() != null && grupoAtributo.getSisAtributoSatbs().size() > 0) {
                      if(Pagina.getParamStr(request,"a" + grupoAtributo.getCodSga().toString()) ==null || "".equals(Pagina.getParamStr(request,"a" + grupoAtributo.getCodSga().toString()))){
                        demandaAtributo.setInformacao(Pagina.getParamStr(request,"hidden_a" + grupoAtributo.getCodSga().toString()));
                      } else{
                        demandaAtributo.setInformacao(Pagina.getParamStr(request,"a" + grupoAtributo.getCodSga().toString()));
                      }
                      demandaAtributo.setSisAtributoSatb((SisAtributoSatb) grupoAtributo.getSisAtributoSatbs().iterator().next());
                      demandaAtributo.setDataInclusao(Data.getDataAtual());
                        if (regDemanda.getDemAtributoDemas() == null)
                          regDemanda.setDemAtributoDemas(new HashSet());
                        if (regDemanda.getDemAtributoDemas()!=null && !regDemanda.getDemAtributoDemas().contains(demandaAtributo)) {
                            regDemanda.getDemAtributoDemas().add(demandaAtributo);                         
                        }

                        String pathRaiz = request.getContextPath();
                       
                        // tratamento imagem
              String caminhoAuxiliarImagem = Pagina.getParamStr(request, "hidImagem" + "a"
                  + grupoAtributo.getCodSga().toString());
              if (caminhoAuxiliarImagem!=null && caminhoAuxiliarImagem.length()>0) {
               
                String chave = demandaAtributo.getInformacao();
                chave = chave.substring(chave.indexOf("RemoteFile=")+ "RemoteFile=".length());
                            UsuarioUsu usuario = ((ecar.login.SegurancaECAR)request.getSession().getAttribute("seguranca")).getUsuario();
                            if(usuario.getMapArquivosAtuaisUsuarios().containsKey(chave)){
//                              demandaAtributo.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 no campo "a" + codigo de grupo de atributo
                  try {                 
                    String nomeArquivoNovo = FileUpload.salvarArquivoSessaoFisicamente(request, "a" + grupoAtributo.getCodSga().toString(), caminhoAuxiliarImagem);
                    if(nomeArquivoNovo != null && !nomeArquivoNovo.equals(""))
                      demandaAtributo.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});
                  }
//                            }
              }

                    }
                } else {

                    String[] atributos = request.getParameterValues("a"
                            + grupoAtributo.getCodSga().toString());
                   
                    if(atributos == null || atributos.length == 0){
                      atributos = request.getParameterValues("hidden_a"
                                + grupoAtributo.getCodSga().toString());
                    }
                     
                    for (int i = 0; i < atributos.length; i++) {
                        /*
                         * Tenho que criar novamente o usu�rio atributo sen�o
                         * ele n�o � adicionado no set no final deste la�o
                         */
                      if(!"".equals(atributos[i])){
                        demandaAtributo = new DemAtributoDema();
                        demandaAtributo.setRegDemandaRegd(regDemanda);
                        demandaAtributo.setSisAtributoSatb((SisAtributoSatb) super.buscar(SisAtributoSatb.class, Long.valueOf(atributos[i])));
                        demandaAtributo.setDataInclusao(Data.getDataAtual());
                          if (regDemanda.getDemAtributoDemas() == null)
                            regDemanda.setDemAtributoDemas(new HashSet());
                          if (regDemanda.getDemAtributoDemas()!=null && !regDemanda.getDemAtributoDemas().contains(demandaAtributo)) {
                              regDemanda.getDemAtributoDemas().add(demandaAtributo);                         
                          }
                      }
                    }
                }
            }
            /* Foi necess�rio alterar o nome dos campos dos elementos multitexto, adicionando "-codSatb"
             * Assim, ficamos com o nome do campo no seguinte padr�o: "a + codSteg + _ + codSatb" (ex.: a12_38)
             * Isto foi feito visto a diferen�a existente entre um grupo com suporte a 1 campo texto
             * e este, que suporta v�rios campos texto.
             */
            else{
                if (SisTipoExibicGrupoDao.MULTITEXTO.equals(grupoAtributo.getSisTipoExibicGrupoSteg().getCodSteg().toString()))
                {
                  Enumeration lAtrib = request.getParameterNames();
                  while(lAtrib.hasMoreElements())
                  {
                    String atrib = (String)lAtrib.nextElement();
                    if (atrib.lastIndexOf('_') > 0)
                    {
                      String nomeAtrib = atrib.substring(0,atrib.lastIndexOf('_'));
                      String nomeCampo = atrib.substring(atrib.lastIndexOf('_')+1);
                      if ( (nomeAtrib.equals("a"+grupoAtributo.getCodSga().toString())
                             && !"".equals(Pagina.getParamStr(request, atrib))) || (nomeAtrib.equals("hidden_a"+grupoAtributo.getCodSga().toString())
                                     && !"".equals(Pagina.getParamStr(request, atrib))))
                      {
                        DemAtributoDema demandaAtributo = new DemAtributoDema();
                        demandaAtributo.setRegDemandaRegd(regDemanda);
                        demandaAtributo.setInformacao(Pagina.getParamStr(request, atrib));
View Full Code Here


           boolean filtrarAtributoLivre = true;
         Iterator itAtributos = atributosLivres.iterator();
         //Filtrar pelos atributos livres definidos como filtros
         while (itAtributos.hasNext() && filtrarAtributoLivre){
           ObjetoDemanda atributoDemanda = (ObjetoDemanda) itAtributos.next();
           SisGrupoAtributoSga grupoAtributo = atributoDemanda.iGetGrupoAtributosLivres();
                     
           String nomeCampo = "a" + (grupoAtributo!=null?grupoAtributo.getCodSga().toString():"");
             String tipoCampo = grupoAtributo!=null?grupoAtributo.getSisTipoExibicGrupoSteg().getCodSteg().toString():"";
            
             //Se for CheckBox ou RadioButton ou ListBox, nao procura em InformacaoIettSatb
             if(tipoCampo.equals(SisTipoExibicGrupoDao.CHECKBOX) || tipoCampo.equals(SisTipoExibicGrupoDao.LISTBOX)
                || ( tipoCampo.equals(SisTipoExibicGrupoDao.COMBOBOX) )|| tipoCampo.equals(SisTipoExibicGrupoDao.RADIO_BUTTON)){
               String[] atributos = null;
               if (parametrosFiltroDemanda.get(nomeCampo) instanceof String) {
                 atributos = new String[1];
                 atributos[0] = (String)parametrosFiltroDemanda.get(nomeCampo);
          } else {
            atributos = (String[])parametrosFiltroDemanda.get(nomeCampo);
          }
                             
               if (atributos== null || atributos.length==1) {
                 if(atributos!= null &&
                     !"".equals(atributos[0])){
                   if (!getSisAtributosRegDem(regDemandaRegd, grupoAtributo.getCodSga()).contains((SisAtributoSatb) this.buscar(SisAtributoSatb.class, Long.valueOf(Pagina.trocaNull(atributos[0]))))){

                     itRegDemandas.remove();
                           filtrarAtributoLivre = false;
                           retorno = true;
                           break;
                   }                
                 }
              
               } else {
                
                 boolean diferente = true;
                 boolean todosValoresVazio = true;
                 for (int i=0; i<atributos.length;i++) {
                  if (atributos[i]!=null && !"".equals(atributos[i])) {
                    if (diferente && !getSisAtributosRegDem(regDemandaRegd, grupoAtributo.getCodSga()).contains((SisAtributoSatb) this.buscar(SisAtributoSatb.class, Long.valueOf(atributos[i])))) {
                      diferente = true;
                    } else {
                      diferente = false;
                    }
                    todosValoresVazio = false;
               
                }
                if (diferente && !todosValoresVazio){
                  itRegDemandas.remove();
                  retorno = true;
                  }                
               }
              
             }
             //Se for TEXT Field ou TEXT AREA
             else if (tipoCampo.equals(SisTipoExibicGrupoDao.TEXT) || tipoCampo.equals(SisTipoExibicGrupoDao.TEXTAREA)) {              
               if(parametrosFiltroDemanda.get(nomeCampo) != null){
                 String[] valores = null;
                 if (parametrosFiltroDemanda.get(nomeCampo) instanceof String) {
                      valores = new String[1];
                      valores[0] = (String)parametrosFiltroDemanda.get(nomeCampo);
               } else {
                 valores = (String[])parametrosFiltroDemanda.get(nomeCampo);
               }
                 if (valores[0]!=null && !"".equals(Pagina.trocaNull(valores[0]))) {
                   List atributosTextTextArea = getRegDemandaSisAtributoRegdSatbsRegd(regDemandaRegd, grupoAtributo.getCodSga());
                      if (atributosTextTextArea.size() == 0){

                        itRegDemandas.remove();
                              filtrarAtributoLivre = false;
                              retorno = true;
                              break;
                      }
                     
                      Iterator itAtributosTextTextArea = atributosTextTextArea.iterator();

                      while (itAtributosTextTextArea.hasNext() && filtrarAtributoLivre){
                        DemAtributoDema demAtributoDema = (DemAtributoDema) itAtributosTextTextArea.next();
                        if (!demAtributoDema.getInformacao().toUpperCase().trim().contains((Pagina.trocaNull(valores[0])).toUpperCase().trim())){

                          itRegDemandas.remove();
                                filtrarAtributoLivre = false;
                                retorno = true;
                                break;
                        }
                       
                      } 
                 }
               }
             //Se for MULTITEXTO
             } else if (tipoCampo.equals(SisTipoExibicGrupoDao.MULTITEXTO)) {
                                                       
             List lAtrib = new ArrayList();
             if(parametrosFiltroDemanda.get("listaNomesAtributosRequest") != null)
               lAtrib = (ArrayList) parametrosFiltroDemanda.get("listaNomesAtributosRequest");
             Iterator lAtribIt = lAtrib.iterator();
            
             while (lAtribIt.hasNext() && filtrarAtributoLivre) {
               nomeCampo = Pagina.trocaNull(lAtribIt.next());
               if (nomeCampo.startsWith("a" + grupoAtributo.getCodSga().toString())){
                 String[] valores = null;
                 if (parametrosFiltroDemanda.get(nomeCampo) instanceof String) {
                   valores = new String[1];
                   valores[0] = (String)parametrosFiltroDemanda.get(nomeCampo);
                 } else {
                   valores = (String[])parametrosFiltroDemanda.get(nomeCampo);
                 }
                 if(parametrosFiltroDemanda.get(nomeCampo) != null && valores[0]!=null &&
                     !"".equals(Pagina.trocaNull(valores[0]))){
                   String codSisAtrib = nomeCampo.substring(nomeCampo.lastIndexOf("_") + 1);
                   SisAtributoSatb sisAtributoSatb = (SisAtributoSatb) this.buscar(SisAtributoSatb.class, Long.valueOf(codSisAtrib));
                   List atributosMultiText = getRegDemandaSisAtributoRegdSatbsRegd(regDemandaRegd, grupoAtributo.getCodSga());
                   if (atributosMultiText.size() == 0 || !getSisAtributosRegDem(regDemandaRegd, grupoAtributo.getCodSga()).contains(sisAtributoSatb)){

                     itRegDemandas.remove();
                               filtrarAtributoLivre = false;
                               retorno = true;
                               break;
                   }
                   Iterator itAtributosMultiTexto = atributosMultiText.iterator();
                  
                       while (itAtributosMultiTexto.hasNext() && filtrarAtributoLivre){
                         DemAtributoDema demAtributoDema = (DemAtributoDema) itAtributosMultiTexto.next();
                         if (demAtributoDema.getSisAtributoSatb().getCodSatb().toString().equals(codSisAtrib)){
                           if (!demAtributoDema.getInformacao().toUpperCase().trim().contains((Pagina.trocaNull(parametrosFiltroDemanda.get(nomeCampo))).toUpperCase().trim())){

                               itRegDemandas.remove();
                                       filtrarAtributoLivre = false;
                                       retorno = true;
                                       break;
                             }
                         }
                       }
                 }
               }
             }                                        
           //Se for VALIDACAO
           } else if (tipoCampo.equals(SisTipoExibicGrupoDao.VALIDACAO)) {

             nomeCampo = "a" + grupoAtributo.getCodSga() + "_Inicio";
             String filtroParametro = Pagina.trocaNull(parametrosFiltroDemanda.get(nomeCampo));
             if(parametrosFiltroDemanda.get(nomeCampo) != null &&
                 !"".equals(Pagina.trocaNull(parametrosFiltroDemanda.get(nomeCampo)))){
              
               List atributosValidacao = getRegDemandaSisAtributoRegdSatbsRegd(regDemandaRegd, grupoAtributo.getCodSga());
              
               if (atributosValidacao.size() == 0){

                 itRegDemandas.remove();
                         filtrarAtributoLivre = false;
                         retorno = true;
                         break;
               }
              
                 Iterator itAtributosValidacao = atributosValidacao.iterator();
                
                 while (itAtributosValidacao.hasNext() && filtrarAtributoLivre){
                   DemAtributoDema demAtributoDema = (DemAtributoDema) itAtributosValidacao.next();
                  
                   if (demAtributoDema.getSisAtributoSatb().getAtribInfCompSatb().equals("dataScript")){
                    
                     //Modifica as ordens de dia e m�s na data, para ficar no formato MM/DD/YYYY
                     filtroParametro =
                       filtroParametro.substring(3, filtroParametro.lastIndexOf("/")+1) +
                       filtroParametro.substring(0, filtroParametro.indexOf("/")+1) +
                       filtroParametro.substring(filtroParametro.lastIndexOf("/")+1);
                                    
                       Date dataFiltro = new Date(filtroParametro);
                      
                       String valorAtribLivre = demAtributoDema.getInformacao();
                    
                       //Modifica as ordens de dia e m�s na data, para ficar no formato MM/DD/YYYY
                       valorAtribLivre =
                         valorAtribLivre.substring(3, valorAtribLivre.lastIndexOf("/")+1) +
                         valorAtribLivre.substring(0, valorAtribLivre.indexOf("/")+1) +
                         valorAtribLivre.substring(valorAtribLivre.lastIndexOf("/")+1);
                                    
                       Date dataAtribLivre = new Date(valorAtribLivre);
                       //Remove da lista se a data estiver estiver fora do intervalo especificado no filtro                       
                       if (dataAtribLivre.compareTo(dataFiltro) < 0){
//                         itensRemovidos.add(regDemandaRegd.getCodRegd());
                         itRegDemandas.remove();
                               filtrarAtributoLivre = false;
                               retorno = true;
                               break;
                             }
                    
                    
                   } else if (demAtributoDema.getSisAtributoSatb().getAtribInfCompSatb().equals("numeroInteiroScript") ||
                       demAtributoDema.getSisAtributoSatb().getAtribInfCompSatb().equals("numeroRealScript") ||
                       demAtributoDema.getSisAtributoSatb().getAtribInfCompSatb().equals("valorMonetarioScript") ){
                      
                     filtroParametro = filtroParametro.replace(".", "");
                     filtroParametro = filtroParametro.replace(",", ".");
                    
                     BigDecimal valorFiltro = new BigDecimal(filtroParametro);
                                
                       BigDecimal valorAtribLivre = new BigDecimal(demAtributoDema.getInformacao().replace(".", "").replace(",", "."));
                                                  
                     //Remove da lista se a data estiver estiver fora do intervalo especificado no filtro
                       if (valorAtribLivre.doubleValue() < valorFiltro.doubleValue()){
//                         itensRemovidos.add(regDemandaRegd.getCodRegd());
                         itRegDemandas.remove();
                               filtrarAtributoLivre = false;
                               retorno = true;
                               break;
                             }
                     }
                 }
             }
            
             nomeCampo = "a" + grupoAtributo.getCodSga().toString() + "_Fim";
             filtroParametro = Pagina.trocaNull(parametrosFiltroDemanda.get(nomeCampo));
             if(parametrosFiltroDemanda.get(nomeCampo) != null &&
                 !"".equals(Pagina.trocaNull(parametrosFiltroDemanda.get(nomeCampo)))){
              
               List atributosValidacao = getRegDemandaSisAtributoRegdSatbsRegd(regDemandaRegd, grupoAtributo.getCodSga());
              
               if (atributosValidacao.size() == 0){

                 itRegDemandas.remove();
                         filtrarAtributoLivre = false;
                         retorno = true;
                         break;
               }
              
                 Iterator itAtributosValidacao = atributosValidacao.iterator();
                
                 while (itAtributosValidacao.hasNext() && filtrarAtributoLivre){
                   DemAtributoDema demAtributoDema = (DemAtributoDema) itAtributosValidacao.next();
                  
                   if (demAtributoDema.getSisAtributoSatb().getAtribInfCompSatb().equals("dataScript")){
                    
                     //Modifica as ordens de dia e m�s na data, para ficar no formato MM/DD/YYYY
                     filtroParametro =
                       filtroParametro.substring(3, filtroParametro.lastIndexOf("/")+1) +
                       filtroParametro.substring(0, filtroParametro.indexOf("/")+1) +
                       filtroParametro.substring(filtroParametro.lastIndexOf("/")+1);
                                    
                       Date dataFiltro = new Date(filtroParametro);
                      
                       String valorAtribLivre = demAtributoDema.getInformacao();
                    
                       //Modifica as ordens de dia e m�s na data, para ficar no formato MM/DD/YYYY
                       valorAtribLivre =
                         valorAtribLivre.substring(3, valorAtribLivre.lastIndexOf("/")+1) +
                         valorAtribLivre.substring(0, valorAtribLivre.indexOf("/")+1) +
                         valorAtribLivre.substring(valorAtribLivre.lastIndexOf("/")+1);
                                    
                       Date dataAtribLivre = new Date(valorAtribLivre);
                       //Remove da lista se a data estiver estiver fora do intervalo especificado no filtro                       
                       if (dataAtribLivre.compareTo(dataFiltro) > 0){
//                         itensRemovidos.add(regDemandaRegd.getCodRegd());
                         itRegDemandas.remove();
                               filtrarAtributoLivre = false;
                               retorno = true;
                               break;
                             }
                      
                   } else if (demAtributoDema.getSisAtributoSatb().getAtribInfCompSatb().equals("numeroInteiroScript") ||
                       demAtributoDema.getSisAtributoSatb().getAtribInfCompSatb().equals("numeroRealScript") ||
                       demAtributoDema.getSisAtributoSatb().getAtribInfCompSatb().equals("valorMonetarioScript") ){
                      
                     filtroParametro = filtroParametro.replace(".", "");
                     filtroParametro = filtroParametro.replace(",", ".");
                    
                     BigDecimal valorFiltro = new BigDecimal(filtroParametro);
                    
                       BigDecimal valorAtribLivre = new BigDecimal(demAtributoDema.getInformacao().replace(".", "").replace(",", "."));
                                                  
                     //Remove da lista se a data estiver estiver fora do intervalo especificado no filtro
                       if (valorAtribLivre.doubleValue() > valorFiltro.doubleValue()){
//                         itensRemovidos.add(regDemandaRegd.getCodRegd());
                         itRegDemandas.remove();
                               filtrarAtributoLivre = false;
                               retorno = true;
                               break;
                             }
                     }
                  
                 }
             }
            
               nomeCampo ="a" + grupoAtributo.getCodSga();
             String[] atributos = (String[]) parametrosFiltroDemanda.get(nomeCampo);
             if(parametrosFiltroDemanda.get(nomeCampo) != null){
                 String[] valores = (String[])parametrosFiltroDemanda.get(nomeCampo);
                 if (valores[0]!=null && !"".equals(Pagina.trocaNull(valores[0]))) {
                   List atributosValidacao = getRegDemandaSisAtributoRegdSatbsRegd(regDemandaRegd, grupoAtributo.getCodSga());
              
                   if (atributosValidacao.size() == 0){
                     itRegDemandas.remove();
                     filtrarAtributoLivre = false;
                     retorno = true;
View Full Code Here

           boolean demandaPossuiAlgumAtributoUsuario = false;
           while (itAtributos.hasNext() && filtrarAtributoLivre){
            
//             ObjetoDemanda atributoDemanda = (ObjetoDemanda) itAtributos.next();
             VisaoAtributoDemanda atributoVisao = (VisaoAtributoDemanda) itAtributos.next();
             SisGrupoAtributoSga grupoAtributo = atributoVisao.getVisaoAtributoDemandaPk().getAtributoDemanda().iGetGrupoAtributosLivres();          
            
             String nomeCampo = "a" + grupoAtributo.getCodSga().toString();// nome do campo na tela
               String tipoCampo = grupoAtributo.getSisTipoExibicGrupoSteg().getCodSteg().toString();// tipo do campo
               String tipoCampoCadastroUsuario = "";
              
               // se for tipo de cadastro de usuario
               if(grupoAtributo.getSisTipoExibicGrupoCadUsuSteg()!=null )
                 tipoCampoCadastroUsuario = grupoAtributo.getSisTipoExibicGrupoCadUsuSteg().getCodSteg().toString();
              
               //Se for CheckBox ou RadioButton ou ListBox, n�o procura em InformacaoDema
               if((tipoCampo.equals(SisTipoExibicGrupoDao.CHECKBOX) || tipoCampo.equals(SisTipoExibicGrupoDao.LISTBOX) ||
                   tipoCampo.equals(SisTipoExibicGrupoDao.RADIO_BUTTON) || tipoCampo.equals(SisTipoExibicGrupoDao.COMBOBOX))
                   && ( tipoCampoCadastroUsuario.equals(SisTipoExibicGrupoDao.CHECKBOX) || tipoCampoCadastroUsuario.equals(SisTipoExibicGrupoDao.LISTBOX) ||
                   tipoCampoCadastroUsuario.equals(SisTipoExibicGrupoDao.RADIO_BUTTON) || tipoCampoCadastroUsuario.equals(SisTipoExibicGrupoDao.COMBOBOX)) ){
                 List atributos = getSisAtributosRegDem(regDemandaRegd, grupoAtributo.getCodSga());
                 //retorno = false;
                   int numAtributos = 0;
                 if (atributos != null) {
                   numAtributos = atributos.size();
                 }
View Full Code Here

     * @throws ECARException
     */
    public List getGruposAtributosCadastro( String indTabelaUso )
                                    throws ECARException
    {
        SisGrupoAtributoSga sisGrupoAtributo = new SisGrupoAtributoSga(  );
        sisGrupoAtributo.setIndAtivoSga( "S" );
        sisGrupoAtributo.setIndSistemaSga( "N" );

        if ( "U".equals( indTabelaUso ) )
        {
            sisGrupoAtributo.setIndCadUsuSga( "S" );
        } else
        {
            sisGrupoAtributo.setIndTabelaUsoSga( indTabelaUso );
        }

        return this.pesquisar( sisGrupoAtributo,
                               new String[] { "seqApresentacaoSga", "asc" } );
    }
View Full Code Here

     * @throws ECARException
     */
    public List getGruposAtributosCadastroUsuarioSite(  )
                                               throws ECARException
    {
        SisGrupoAtributoSga sisGrupoAtributo = new SisGrupoAtributoSga(  );
        sisGrupoAtributo.setIndAtivoSga( "S" );
        sisGrupoAtributo.setIndSistemaSga( "N" );
        sisGrupoAtributo.setIndCadSiteSga( "S" );

        return this.pesquisar( sisGrupoAtributo,
                               new String[] { "seqApresentacaoSga", "asc" } );
    }
View Full Code Here

     * @throws ECARException
     */
    public Set getClassesDeAcesso(  )
                           throws ECARException
    {
        SisGrupoAtributoSga grupoAtributosClasseAcesso =
            new ConfiguracaoDao( request ).getConfiguracao(  ).getSisGrupoAtributoSgaByCodSgaGrAtrClAcesso(  );
        Set lAtributosClasseAcesso = grupoAtributosClasseAcesso.getSisAtributoSatbs(  );

        return lAtributosClasseAcesso;
    }
View Full Code Here

        StringBuilder script = new StringBuilder( "" );
        Iterator it = atributosObrigatorios.iterator(  );

        while ( it.hasNext(  ) )
        {
            SisGrupoAtributoSga grupoAtributo = (SisGrupoAtributoSga) it.next(  );
            script.append( this.getValidacaoAtributo( grupoAtributo, cadastroUsuario ) );
        }

        return script.toString(  );
    }
View Full Code Here

        StringBuilder script = new StringBuilder( "" );
        Iterator it = atributosObrigatorios.iterator(  );

        while ( it.hasNext(  ) )
        {
            SisGrupoAtributoSga grupoAtributo = (SisGrupoAtributoSga) it.next(  );
            script.append( this.getValidacaoAtributo( grupoAtributo, cadastroUsuario, labelNivelPlanejamentoNaEstrutura ) );
        }

        return script.toString(  );
    }
View Full Code Here

   * @since N/C
   * @version N/C
     * @param ObjetoEstrutura objetoEstrutura
     */
    private void geraValidacaoAtributoLivre(ObjetoEstrutura atributo){
    SisGrupoAtributoSga grupoAtributo = atributo.iGetGrupoAtributosLivres();
    if (grupoAtributo != null && grupoAtributo.getIndAtivoSga().equals("S") &&
        grupoAtributo.getSisAtributoSatbs() != null && grupoAtributo.getSisAtributoSatbs().size() > 0){
      if (grupoAtributo.getSisTipoExibicGrupoSteg().getCodSteg().intValue() == Input.VALIDACAO){
        if (grupoAtributo.getSisAtributoSatbs() != null && grupoAtributo.getSisAtributoSatbs().iterator().hasNext()){
            SisAtributoSatb sisAtributoSatb = (SisAtributoSatb) grupoAtributo.getSisAtributoSatbs().iterator().next();
            if (sisAtributoSatb.getAtribInfCompSatb().equals("dataScript")) {
              getValidacaoCampos().append(validacaoIntervaloDataAtributoLivre(atributo));
            } else if (sisAtributoSatb.getAtribInfCompSatb().equals("numeroInteiroScript") ||
                   sisAtributoSatb.getAtribInfCompSatb().equals("numeroRealScript") ||
                   sisAtributoSatb.getAtribInfCompSatb().equals("valorMonetarioScript")){
View Full Code Here

          && (atributo.iGetGrupoAtributosLivres().getIndAtivoSga()!=null
          &&  atributo.iGetGrupoAtributosLivres().getIndAtivoSga().equals("S")) ){
        if (atributo.iGetGrupoAtributosLivres().getSisTipoExibicGrupoSteg().getCodSteg().intValue() != Input.IMAGEM || !telaFiltro){         
            JspWriter writer = this.page.getOut();
 
            SisGrupoAtributoSga grupoAtributo = atributo.iGetGrupoAtributosLivres();
               
            Input input = new Input(writer);
            input.setRequest(request);
            input.setLabel(atributo.iGetLabel());
            input.setPage(page);
            //Caso o tipo do grupo seja combobox(1) deve ser trocado pelo tipo checkbox(2).
            // apenas se estiver em tela de pesquisa
            if (transformarComboBoxListaChecks.booleanValue()==true && grupoAtributo.getSisTipoExibicGrupoSteg().getCodSteg().equals(new Long(SisTipoExibicGrupoDao.COMBOBOX))){
              input.setTipo(new Long(SisTipoExibicGrupoDao.CHECKBOX).intValue());
            } else {
              input.setTipo(grupoAtributo.getSisTipoExibicGrupoSteg().getCodSteg().intValue())
            }
           
            input.setObrigatorio(!telaFiltro && atributo.iGetObrigatorio(Long.valueOf(codigoVisao)).booleanValue() ? "S" : "N"); //Obrigatoriedade est� no atributo
           
            input.setPathRaiz(this.getContextPath());
            input.setLabelObrigatorio("*");
            input.setSize(atributo.iGetTamanhoConteudoAtbdem().toString());
            if (telaFiltro){
              input.setTelaFiltro(new Boolean(true));
            } else {
              input.setTelaFiltro(new Boolean(false));
            }
           
           
            if (getBloquearCampo()) {
              input.setDisabled("S");
            }
            input.setNome("a" + grupoAtributo.getCodSga().toString());
            input.setClassLabel("label");
            input.setContexto(this.getContextPath());
           
            List aributosLivresSelecionados = new ArrayList();
           
            if(regDemanda.getDemAtributoDemas() != null){
              Iterator itAtribLivres = regDemanda.getDemAtributoDemas().iterator();
              while(itAtribLivres.hasNext()){
                DemAtributoDema atributo = (DemAtributoDema) 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());
            if(atributo.iGetDica(Long.valueOf(codigoVisao)) != null) {
              input.setDica(atributo.iGetDica(Long.valueOf(codigoVisao)));
            }
           
           
            input.setTransformarComboBoxListaChecks(transformarComboBoxListaChecks.booleanValue());
           
            input.doStartTag();
           
            Options options = new Options(writer);
           
            options.setTransformarComboBoxListaChecks(transformarComboBoxListaChecks.booleanValue());
            options.setTransformarRadioListaChecks(transformarRadioListaChecks.booleanValue());
           
          List opcoes = new ArrayList();
          String selectedCodSapadrao = "";
          if(grupoAtributo.getCodSga() != null && grupoAtributo.getCodSga().longValue() != 1){
            if(grupoAtributo.getSisTipoOrdenacaoSto() != null){
              opcoes = new SisGrupoAtributoDao(null).getAtributosOrdenados(grupoAtributo);
              if (!opcoes.isEmpty()){
                Iterator itOpcoes = opcoes.iterator();
                while (itOpcoes.hasNext()){
                  if (((SisAtributoSatb) itOpcoes.next()).getIndAtivoSatb().equals("N")){
                    itOpcoes.remove();
                  }
                }
              }
            }
          }
         
           
          if(!opcoes.isEmpty()) {
              options.setOptions(opcoes);
              options.setValor("codSatb");
              options.setLabel("descricaoSatb");
              options.setDica(atributo.iGetDica(Long.valueOf(codigoVisao)));
              options.setNome("a" + grupoAtributo.getCodSga().toString());
              options.setContexto(this.getContextPath());
              //options.setImagem(getContextPath() + "/images/relAcomp/");
              options.setParent(input);             
              options.doStartTag();
          }
View Full Code Here

TOP

Related Classes of ecar.pojo.SisGrupoAtributoSga

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.