Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. @ManagedBean(name="FrontPageMB")
  2. @RequestScoped
  3.  
  4. public class FrontPageMB implements FrontPage {
  5.  
  6. private Collection<Noticia> noticiasPortada = new ArrayList<Noticia>();
  7.  
  8. @ManagedProperty("#{param.idSeccion}")
  9. private int idSeccion;
  10.  
  11. @ManagedProperty("#{param.id}")
  12. private int id;
  13.  
  14. @ManagedProperty(value="#{servicioNoticiasBean}")
  15. private ServicioNoticia servicioNoticia;
  16.  
  17. @ManagedProperty(value="#{servicioBannersBean}")
  18. private ServicioBanner servicioBanner;
  19.  
  20. @ManagedProperty(value="#{servicioFrasesBean}")
  21. private ServicioFrase servicioFrase;
  22.  
  23. @ManagedProperty(value="#{servicioSeccionesBean}")
  24. private ServicioSeccion servicioSeccion;
  25.  
  26. public void setServicioNoticia(ServicioNoticia servicioNoticia) {
  27. this.servicioNoticia = servicioNoticia;
  28. }
  29.  
  30. public void setServicioSeccion(ServicioSeccion servicioSeccion) {
  31. this.servicioSeccion = servicioSeccion;
  32. }
  33.  
  34. public void setServicioBanner(ServicioBanner servicioBanner) {
  35. this.servicioBanner = servicioBanner;
  36. }
  37.  
  38. public void setServicioFrase(ServicioFrase servicioFrase) {
  39. this.servicioFrase = servicioFrase;
  40. }
  41.  
  42. /*
  43. * Getters y Setters
  44. */
  45.  
  46. @Override
  47. public Collection<Noticia> getNoticiasByPortada(int portada) {
  48. this.noticiasPortada = (Collection<Noticia>) this.servicioNoticia.getNoticiasByPortada(portada);
  49. return this.noticiasPortada;
  50. }
  51.  
  52. public int getId() {
  53. return id;
  54. }
  55.  
  56. public void setId(int id) {
  57. this.id = id;
  58. }
  59.  
  60. public int getIdSeccion() {
  61. return idSeccion;
  62. }
  63.  
  64. public void setIdSeccion(int idSeccion) {
  65. this.idSeccion = idSeccion;
  66. }
  67.  
  68. public Noticia getNoticia() {
  69. return this.servicioNoticia.getNoticiaById(440);
  70. }
  71.  
  72. @Override
  73. public List<Noticia> getLatestNews() {
  74. return (List<Noticia>) this.servicioNoticia.getNoticiasLatest(10);
  75. }
  76.  
  77. @Override
  78. public List<Noticia> getNoticiasBySeccion() {
  79. return (List<Noticia>) this.servicioNoticia.getNoticiasBySeccion(this.idSeccion);
  80. }
  81.  
  82. @Override
  83. public Banner getRandomBanner() {
  84. return this.servicioBanner.getRandomBanner();
  85. }
  86.  
  87. @Override
  88. public Frase getFraseDia() {
  89. return this.servicioFrase.getFraseDia();
  90. }
  91.  
  92. public Collection<Seccion> getSecciones(){
  93. return (Collection<Seccion>) this.servicioSeccion.getSecciones();
  94. }
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement