Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ManagedBean(name="FrontPageMB")
- @RequestScoped
- public class FrontPageMB implements FrontPage {
- private Collection<Noticia> noticiasPortada = new ArrayList<Noticia>();
- @ManagedProperty("#{param.idSeccion}")
- private int idSeccion;
- @ManagedProperty("#{param.id}")
- private int id;
- @ManagedProperty(value="#{servicioNoticiasBean}")
- private ServicioNoticia servicioNoticia;
- @ManagedProperty(value="#{servicioBannersBean}")
- private ServicioBanner servicioBanner;
- @ManagedProperty(value="#{servicioFrasesBean}")
- private ServicioFrase servicioFrase;
- @ManagedProperty(value="#{servicioSeccionesBean}")
- private ServicioSeccion servicioSeccion;
- public void setServicioNoticia(ServicioNoticia servicioNoticia) {
- this.servicioNoticia = servicioNoticia;
- }
- public void setServicioSeccion(ServicioSeccion servicioSeccion) {
- this.servicioSeccion = servicioSeccion;
- }
- public void setServicioBanner(ServicioBanner servicioBanner) {
- this.servicioBanner = servicioBanner;
- }
- public void setServicioFrase(ServicioFrase servicioFrase) {
- this.servicioFrase = servicioFrase;
- }
- /*
- * Getters y Setters
- */
- @Override
- public Collection<Noticia> getNoticiasByPortada(int portada) {
- this.noticiasPortada = (Collection<Noticia>) this.servicioNoticia.getNoticiasByPortada(portada);
- return this.noticiasPortada;
- }
- public int getId() {
- return id;
- }
- public void setId(int id) {
- this.id = id;
- }
- public int getIdSeccion() {
- return idSeccion;
- }
- public void setIdSeccion(int idSeccion) {
- this.idSeccion = idSeccion;
- }
- public Noticia getNoticia() {
- return this.servicioNoticia.getNoticiaById(440);
- }
- @Override
- public List<Noticia> getLatestNews() {
- return (List<Noticia>) this.servicioNoticia.getNoticiasLatest(10);
- }
- @Override
- public List<Noticia> getNoticiasBySeccion() {
- return (List<Noticia>) this.servicioNoticia.getNoticiasBySeccion(this.idSeccion);
- }
- @Override
- public Banner getRandomBanner() {
- return this.servicioBanner.getRandomBanner();
- }
- @Override
- public Frase getFraseDia() {
- return this.servicioFrase.getFraseDia();
- }
- public Collection<Seccion> getSecciones(){
- return (Collection<Seccion>) this.servicioSeccion.getSecciones();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement