Package org.encuestame.persistence.domain.dashboard

Examples of org.encuestame.persistence.domain.dashboard.Dashboard


    /*
     * (non-Javadoc)
     * @see org.encuestame.business.service.imp.IDashboardService#getGadgetsbyDashboard(java.lang.Long, java.lang.String)
     */
    public List<Gadget> getGadgetsbyDashboard(final Long dashboardId) throws EnMeNoResultsFoundException{
        final Dashboard board = this.getDashboardById(dashboardId);
        List<Gadget> gadgets = new ArrayList<Gadget>();
        if(board==null){
            throw new EnMeDashboardNotFoundException("dashboard not found");
        }
        else{
View Full Code Here


    /*
     * (non-Javadoc)
     * @see org.encuestame.business.service.imp.IDashboardService#getAllGadgetsAvailable()
     */
    public List<GadgetBean> getAllGadgetsAvailable(final Long boardId) throws EnMeNoResultsFoundException{
            final Dashboard dashboard = this.getDashboardById(boardId);
            List<GadgetBean> gadgetBean = new ArrayList<GadgetBean>();
            final List<Gadget> gadgets = getDashboardDao().retrieveGadgets(dashboard);
            gadgetBean.addAll(ConvertDomainBean.convertListGadgetToBean(gadgets));
        return gadgetBean;
    }
View Full Code Here

            log.debug("Moving gadgetId "+gadgetId);
            log.debug("boardId "+boardId);
            log.debug("position "+position);
            log.debug("column "+column);
        }
        final Dashboard board = this.getDashboardById(boardId);
        final Gadget gadget = this.getGadget(gadgetId, board);
        gadget.setGadgetPosition(position);
        gadget.setGadgetColumn(column);
        getDashboardDao().saveOrUpdate(gadget);
    }
View Full Code Here

     * @see org.encuestame.core.service.imp.IDashboardService#markAsSelectedDasboard(java.lang.Long)
     */
    public Dashboard markAsSelectedDasboard(
            final  Long dashBoardId)
            throws EnMeNoResultsFoundException {
         final Dashboard board = this.getDashboardById(dashBoardId);
         final List<Dashboard> listDashboard = this.getAllDasboardByLoggedUsername(null, null);
         for (Dashboard dashboard : listDashboard) {
            dashboard.setSelectedByDefault(Boolean.FALSE);
            getDashboardDao().saveOrUpdate(dashboard);
         }
         board.setSelectedByDefault(Boolean.TRUE);
         getDashboardDao().saveOrUpdate(board);
         return board;
    }
View Full Code Here

    /*
     * (non-Javadoc)
     * @see org.encuestame.core.service.imp.IDashboardService#updateDashboard(org.encuestame.utils.web.DashboardBean)
     */
    public Dashboard updateDashboard(final DashboardBean boardBean) throws EnMeNoResultsFoundException{
        final Dashboard board = this.getDashboardById(boardBean.getDashboardId());
        Assert.notNull(board);
        if (board == null) {
            throw new EnMeDashboardNotFoundException("dashboard not found");
        }
       board.setPageBoardName(boardBean.getDashboardName());
       board.setBoardSequence(boardBean.getSequence());
       board.setPageLayout(LayoutEnum.getDashboardLayout(boardBean.getLayout()) == null ? LayoutEnum.BB_BLOCK : LayoutEnum.getDashboardLayout(boardBean.getLayout()));
       board.setDescription(boardBean.getDashboardDesc());
       if (boardBean.getSelected()){
           this.markAsSelectedDasboard(board.getBoardId());
       }
       board.setFavorite(boardBean.getFavorite());
       getDashboardDao().saveOrUpdate(board);
       return board;
    }
View Full Code Here

     }

     /** Dashboard domain. **/
     @Test
     public void testDashboard(){
        final Dashboard board = new Dashboard();
        board.setPageBoardName("First dashboard");
        board.setDescription("My first dashboard");
        board.setFavorite(Boolean.TRUE);
        board.setFavoriteCounter(1);
        board.setPageLayout(LayoutEnum.BA_BLOCK_COLUMN);
        board.setBoardSequence(1);
        board.setUserBoard(createUserAccount("juan carlos", createAccount()));
        board.setSelectedByDefault(Boolean.TRUE);
        getDashboardDao().saveOrUpdate(board);
      }
View Full Code Here

     /** Gadget Properties **/
     @Test
     public void testGadgetProperties(){
         final UserAccount user = createUserAccount("diana paola", createAccount());
         final Dashboard board = createDashboardDefault(user);
         final GadgetProperties gadgetProp = new GadgetProperties();
         gadgetProp.setGadgetPropName("maxResults");
         gadgetProp.setGadgetPropValue("10");
         gadgetProp.setUserAccount(user);
         gadgetProp.setGadget(createGadgetDefault(board));
View Full Code Here

    /**
     * Test retrieve dashboard by id.
     */
    @Test
    public void testGetDashboardbyId(){
        final Dashboard dashboard = getDashboardDao().getDashboardbyId(this.board.getBoardId());
        assertNotNull(dashboard);
        assertEquals("Should be equals", dashboard.getBoardId(), this.board.getBoardId());
    }
View Full Code Here

    /**
     * Test get dashboard by id and user.
     */
    @Test
    public void testGetDashboardbyIdandUser(){
        final Dashboard board = getDashboardDao().getDashboardbyIdandUser(this.board.getBoardId(), this.userAccount);
        assertNotNull(board);
    }
View Full Code Here

TOP

Related Classes of org.encuestame.persistence.domain.dashboard.Dashboard

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.