/*
* (non-Javadoc)
* @see org.encuestame.business.service.imp.IDashboardService#createDashboard(org.encuestame.utils.web.DashboardBean, org.encuestame.persistence.domain.security.UserAccount)
*/
public Dashboard createDashboard(final DashboardBean dashboardBean) throws EnMeNoResultsFoundException{
final Dashboard board = new Dashboard();
board.setPageBoardName(dashboardBean.getDashboardName());
board.setDescription(dashboardBean.getDashboardDesc());
final List<Dashboard> dashboards = this.getAllDasboardByLoggedUsername(null, 0);
for (Dashboard dashboard : dashboards) {
dashboard.setFavorite(Boolean.FALSE);
getDashboardDao().saveOrUpdate(dashboard);
}
board.setFavorite(Boolean.TRUE);
board.setBoardSequence(dashboardBean.getSequence());
board.setFavoriteCounter(dashboardBean.getFavoriteCounter());
board.setPageLayout(LayoutEnum.getDashboardLayout(dashboardBean.getLayout()));
board.setUserBoard(getUserAccount(getUserPrincipalUsername()));
getDashboardDao().saveOrUpdate(board);
return board;
}