Package br.com.boardnaveia.dao.bean

Examples of br.com.boardnaveia.dao.bean.Noticia


  }
 
  public String retroceder(){
   
    getIndice().diminuir();
    Noticia noticia = carregarNoticiaIndice();
    setCodigo(noticia.getCodigo().toString());
    setTitulo(noticia.getTitulo());
   
    return div();
   
  }
View Full Code Here


   
  }
 
  public String carregar(){
    if(isEmpty(getCodigo())){
      Noticia noticia = carregarNoticiaIndice();
      if(noticia != null){
        setCodigo(noticia.getCodigo().toString());
        setTitulo(noticia.getTitulo());
      }
    }
    return SUCCESS;
  }
View Full Code Here

 
  public String div(){

    if(isEmpty(getCodigo())){
      indice.aumentar();
      Noticia noticia = carregarNoticiaIndice();
      if(noticia != null) {
        setCodigo(noticia.getCodigo().toString());
        setTitulo(noticia.getTitulo());
      }
    }
    return "div";
  }
View Full Code Here

    return INPUT;
  }
 
  private Noticia carregarNoticiaIndice(){
   
    Noticia noticia = noticiaDAO.pesquisarIndice(getIndice().getPosicao());
   
    if(noticia == null && getIndice().getPosicao().compareTo(0) > 0) {
      getIndice().zerar();
      return carregarNoticiaIndice();
    }
View Full Code Here

    if(validacao())
      return INPUT;
   
    InputStream inputStream = IOUtils.toInputStream(getArquivo(), "ISO-8859-1");
   
    Noticia noticia = new Noticia(IOUtils.toByteArray(inputStream));
    noticia.setTitulo(getTitulo());
    noticia.setDescricao(getDescricao());
    noticia.setLogin(getUsuario().getEmail());
    noticia.setCanal(CanalNoticia.getCanal(getCanalNoticia()));
   
    noticiaDAO.gravar(noticia);
   
    setCodigo(noticia.getCodigo().toString());
   
    return SUCCESS;
  }
View Full Code Here

    return SUCCESS;
  }

  public String detalhe(){
   
    Noticia noticia = noticiaDAO.pesquisar(Noticia.class, Long.parseLong(getCodigo()));
    setCodigo(noticia.getCodigo().toString());
    setTitulo(noticia.getTitulo());
    setDescricao(noticia.getDescricao());
   
    return "detalhe";
  }
View Full Code Here

    return "detalhe";
  }
 
  public String arquivo(){
   
    Noticia  noticia = noticiaDAO.pesquisar(Noticia.class, Long.parseLong(getCodigo()));
   
    setStream(noticia.getInputStream());
       
    return "arquivo";
  }
View Full Code Here

  }
 
  public String avancar(){
   
    getIndice().aumentar();
    Noticia noticia = carregarNoticiaIndice();
    setCodigo(noticia.getCodigo().toString());
    setTitulo(noticia.getTitulo());
   
    return div();
  }
View Full Code Here

TOP

Related Classes of br.com.boardnaveia.dao.bean.Noticia

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.