Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | espaco | 1 | package br.edu.cesmac.sic.controller.beans; |
| 2 | |||
| 3 | import java.io.Serializable; |
||
| 4 | |||
| 5 | import javax.inject.Inject; |
||
| 6 | import javax.inject.Named; |
||
| 7 | |||
| 8 | import org.springframework.context.annotation.Scope; |
||
| 9 | |||
| 10 | import br.edu.cesmac.core.generic.GenericService; |
||
| 11 | import br.edu.cesmac.sic.core.domain.model.dto.DashboardDTO; |
||
| 12 | import br.edu.cesmac.sic.core.domain.service.DashboardService; |
||
| 13 | import br.edu.cesmac.web.generic.AbstractBean; |
||
| 14 | |||
| 15 | @Named |
||
| 16 | @Scope("view") |
||
| 17 | public class DashboardBean extends AbstractBean<DashboardDTO> implements Serializable { |
||
| 18 | |||
| 19 | private static final long serialVersionUID = 1L; |
||
| 20 | |||
| 21 | private DashboardService dashboardService; |
||
| 22 | |||
| 23 | @Inject |
||
| 24 | public DashboardBean(DashboardService dashboardService) { |
||
| 25 | this.dashboardService = dashboardService; |
||
| 26 | } |
||
| 27 | |||
| 28 | @Override |
||
| 29 | public GenericService<DashboardDTO> getService() { |
||
| 30 | return dashboardService; |
||
| 31 | } |
||
| 32 | |||
| 33 | @Override |
||
| 34 | public DashboardDTO getId() { |
||
| 35 | return getEntidade(); |
||
| 36 | } |
||
| 37 | |||
| 38 | @Override |
||
| 39 | public void limparEntidade() { |
||
| 40 | setEntidade(new DashboardDTO()); |
||
| 41 | } |
||
| 42 | |||
| 43 | @Override |
||
| 44 | public void preCarregamento() { |
||
| 45 | setEntidade(dashboardService.montarDashboard()); |
||
| 46 | } |
||
| 47 | |||
| 48 | } |