Package ecar.pojo

Examples of ecar.pojo.LocAtributoLoca


        if (excluir) {
          List objs = new ArrayList();               
                if (localItem.getLocAtributoLocas() != null) {
                    Iterator itAtb = localItem.getLocAtributoLocas().iterator();
                    while (itAtb.hasNext()) {
                      LocAtributoLoca localAtrib = (LocAtributoLoca) itAtb.next();
                        objs.add(localAtrib);
                    }
                }
                localItem.setLocAtributoLocas(null);
                objs.add(localItem);                  
View Full Code Here


      tx = session.beginTransaction();
     
      if (local.getLocAtributoLocas() != null) {
        Iterator itAtt = local.getLocAtributoLocas().iterator();
        while (itAtt.hasNext()) {
          LocAtributoLoca localAtributo = (LocAtributoLoca) itAtt.next();
         
                    if(localAtributo.getSisAtributoSatb().getSisGrupoAtributoSga().getSisTipoExibicGrupoSteg().getCodSteg() == Input.IMAGEM){
                     
                      String nomeCampo = request.getParameter("a" + localAtributo.getSisAtributoSatb().getSisGrupoAtributoSga().getCodSga().toString());
                     
                      if (nomeCampo != null && nomeCampo.equals("")){
                       
                  String fullFile = localAtributo.getInformacao();
                 
                  if (fullFile.lastIndexOf("=") != -1)    
                    fullFile = fullFile.substring(fullFile.lastIndexOf("=") + 1);
               
                File f = new File(fullFile);
View Full Code Here

    Set result = local.getLocAtributoLocas();
        if (result != null) {
            if (result.size() > 0) {
                Iterator it = result.iterator();
                while (it.hasNext()) {
                  LocAtributoLoca localAtributo = (LocAtributoLoca) it.next();
                  if (localAtributo.getSisAtributoSatb().getSisGrupoAtributoSga().equals(grupoAtributo))
                    retorno.add(localAtributo);
                }
            }
        }
   
View Full Code Here

    lAtributos =  new SisGrupoAtributoDao(request).getGruposAtributosCadastro("L");
        Iterator it = lAtributos.iterator();
        while (it.hasNext()) {
            SisGrupoAtributoSga grupoAtributo = (SisGrupoAtributoSga) it.next();          
            if (!"".equals(Pagina.getParamStr(request, "a" + grupoAtributo.getCodSga().toString()))) {
                LocAtributoLoca localAtributo = new LocAtributoLoca();
                localAtributo.setLocalItemLit(localItem);
                /*
                 * 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) {
                        localAtributo.setInformacao(Pagina.getParamStr(request,"a" + grupoAtributo.getCodSga().toString()));
                        localAtributo.setSisAtributoSatb((SisAtributoSatb) grupoAtributo.getSisAtributoSatbs().iterator().next());
                        localAtributo.setDataInclusao(Data.getDataAtual());
                        if (localItem.getLocAtributoLocas() == null)
                            localItem.setLocAtributoLocas(new HashSet());
                        localItem.getLocAtributoLocas().add(localAtributo);
                       
                        String pathRaiz = request.getContextPath();
                       
                        // tratamento imagem
              String caminhoAuxiliarImagem = Pagina.getParamStr(request, "hidImagem" + "a"
                  + grupoAtributo.getCodSga().toString());
              if (caminhoAuxiliarImagem!=null && caminhoAuxiliarImagem.length()>0) {
               
                String chave = localAtributo.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)){
//                              localAtributo.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(""))
                      localAtributo.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());
                    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
                         */
                        localAtributo = new LocAtributoLoca();
                        localAtributo.setLocalItemLit(localItem);
                        localAtributo.setSisAtributoSatb((SisAtributoSatb) super.buscar(SisAtributoSatb.class, Long.valueOf(atributos[i])));
                        localAtributo.setDataInclusao(Data.getDataAtual());
                        if (localItem.getLocAtributoLocas() == null)
                            localItem.setLocAtributoLocas(new HashSet());
                        localItem.getLocAtributoLocas().add(localAtributo);
                    }
                }
            }
            /* 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)))
                      {
                                LocAtributoLoca localAtributo = new LocAtributoLoca();
                                localAtributo.setLocalItemLit(localItem);
                                localAtributo.setInformacao(Pagina.getParamStr(request, atrib));
                                localAtributo.setSisAtributoSatb((SisAtributoSatb) super.buscar(SisAtributoSatb.class, Long.valueOf(nomeCampo)));
                                localAtributo.setDataInclusao(Data.getDataAtual());
                                if (localItem.getLocAtributoLocas() == null)
                                    localItem.setLocAtributoLocas(new HashSet());
                                localItem.getLocAtributoLocas().add(localAtributo);
                      }
                    }
View Full Code Here

  public List pesquisar(LocalItemLit local) throws ECARException{         
      // classes marcadas na tela como filtro
      List listFiltro = new ArrayList();
      if(local.getLocAtributoLocas() != null && local.getLocAtributoLocas().size() > 0) {
        Iterator itAtr = local.getLocAtributoLocas().iterator();
        LocAtributoLoca localAtributo;
        while(itAtr.hasNext()) {
          localAtributo = (LocAtributoLoca) itAtr.next();
          listFiltro.add(localAtributo);
        }
      }

       List pesquisa = super.pesquisar(local, new String[] {"identificacaoLit","asc"});
      
       Iterator it = pesquisa.iterator();
       while (it.hasNext()) {
         LocalItemLit localAux = (LocalItemLit) it.next();

         //verifica��es se foi marcado classes de acesso como filtro da pesquisa
          boolean ignorar = false;
          List listVerificacoes = new ArrayList();
        
          if (listFiltro.size() > 0) {
           if (localAux.getLocAtributoLocas() != null && localAux.getLocAtributoLocas().size() > 0) {
            
             Iterator itAtr = localAux.getLocAtributoLocas().iterator();
             LocAtributoLoca locAtrAux;
             while (itAtr.hasNext()) {
               locAtrAux = (LocAtributoLoca) itAtr.next();
               listVerificacoes.add(locAtrAux);
             }
            
                Iterator itClassesTela = listFiltro.iterator();
                   List listIgnorar = new ArrayList();
                   String ignorarItem = "";
                   LocAtributoLoca locaisTela;
                  
                   while (itClassesTela.hasNext()) {
                     locaisTela = (LocAtributoLoca) itClassesTela.next();
                  Iterator itVerificacoes = listVerificacoes.iterator();               
                  ignorarItem = "SIM";
                  LocAtributoLoca atributos;
                  while (itVerificacoes.hasNext()) {
                    atributos = (LocAtributoLoca) itVerificacoes.next();
                    SisGrupoAtributoSga tipo = (SisGrupoAtributoSga) locaisTela.getSisAtributoSatb().getSisGrupoAtributoSga();
                    if (SisTipoExibicGrupoDao.TEXT.equals(tipo.getSisTipoExibicGrupoSteg().getCodSteg().toString())) {
                      if (atributos.getInformacao() != null && atributos.getInformacao().length() > 0) {
                        if (atributos.getInformacao().indexOf(atributos.getInformacao()) > -1) {
                          ignorarItem = "NAO";
                          break;
                        }
                      }
                    }
                    else {
                      if (atributos.getSisAtributoSatb().getCodSatb().longValue() == locaisTela.getSisAtributoSatb().getCodSatb().longValue()) {
                        ignorarItem = "NAO";
                        break;
                      }
                    }
                  }
View Full Code Here

TOP

Related Classes of ecar.pojo.LocAtributoLoca

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.