Package org.encuestame.persistence.domain.dashboard

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


     * Test get dashboard by id and user.
     * @throws EnMeNoResultsFoundException
     */
    @Test
    public void testGetDashboardbyIdandUser() throws EnMeNoResultsFoundException{
        final Dashboard board = dashboardService.getDashboardbyId(this.dashboard.getBoardId());
        assertNotNull(board);
        assertEquals("Should be equals", this.dashboard.getBoardId(), board.getBoardId());
    }
View Full Code Here


     * Test create dashboard.
     * @throws EnMeNoResultsFoundException
     */
    @Test
    public void testCreateDashboard() throws EnMeNoResultsFoundException{
        final Dashboard board = dashboardService.createDashboard(this.boardBean);
        assertNotNull(board.getBoardId());
    }
View Full Code Here

     */
    @Test
    public void testUpdateDashboard() throws EnMeNoResultsFoundException{
        final String newName = "Notifications2";
        this.boardBean.setDashboardName(newName);
        final Dashboard boardUpdate = getDashboardService().updateDashboard(boardBean);
        assertEquals("Should be equals", newName, boardUpdate.getPageBoardName());
    }
View Full Code Here

     *
     * @throws EnMeNoResultsFoundException
     */
    @Test
    public void testMarkAsSelectedDasboard() throws EnMeNoResultsFoundException{
      final Dashboard board1 = createDashboard("Selected dashboard", Boolean.TRUE, this.userAccount);
        final List<DashboardBean> dashes = getDashboardService().getAllDashboards(this.MAX_RESULTS, this.START);
        final Dashboard board = getDashboardService().markAsSelectedDasboard(board1.getBoardId());
    }
View Full Code Here

    /*
     * (non-Javadoc)
     * @see org.encuestame.business.service.imp.IDashboardService#getAllDashboardbyId(java.lang.Long, java.lang.String)
     */
    public Dashboard getDashboardbyId(final Long boardId) throws EnMeNoResultsFoundException {
        Dashboard dashboard = getDashboardDao().getDashboardbyIdandUser(
                boardId, getUserAccount(getUserPrincipalUsername()));
        if ((dashboard == null)) {
            throw new EnMeDashboardNotFoundException("dashboard id is missing");
        }
        return dashboard;
View Full Code Here

    /*
     * (non-Javadoc)
     * @see org.encuestame.business.service.imp.IDashboardService#getAllDashboardbyId(java.lang.Long, java.lang.String)
     */
    public Dashboard getAllDashboardbyId(final Long boardId) throws EnMeNoResultsFoundException{
        Dashboard dashboard = null;
            if (boardId == null) {
                  throw new EnMeDashboardNotFoundException("dashboard Id poll is missing "+boardId);
            } else {
                 dashboard = this.getDashboardById(boardId);
            }
View Full Code Here

    /*
     * (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;
    }
View Full Code Here

     * @see org.encuestame.business.service.imp.IDashboardService#addGadgetOnDashboard(java.lang.Long, java.lang.Long)
     */
    public Gadget addGadgetOnDashboard(final Long boardId, final String gadgetId) throws EnMeNoResultsFoundException{
        final Properties gProperties = GadgetsLoader.getDirectoy(gadgetId);
        if (gProperties != null) {
            final Dashboard dashboard = getDashboardDao().getDashboardbyId(boardId);
            final Gadget gadget = createNewGadget(gProperties, dashboard);
            if (gadget.getGadgetType().equals(GadgetType.ACTIVITY_STREAM)) {
                createProperty(gadget, "permissions", gProperties.getProperty("permissions"));
            } else if (gadget.getGadgetType().equals(GadgetType.COMMENTS)) {
                createProperty(gadget, "permissions", gProperties.getProperty("permissions"));
View Full Code Here

    /*
     * (non-Javadoc)
     * @see org.encuestame.core.service.imp.IDashboardService#deleteDasbboard(org.encuestame.utils.web.DashboardBean)
     */
    public void deleteDasbboard(final DashboardBean dashboardBean) throws EnMeNoResultsFoundException {
        final Dashboard board = this.getDashboardById(dashboardBean.getDashboardId());
        getDashboardDao().delete(board);
    }
View Full Code Here

    /*
     * (non-Javadoc)
     * @see org.encuestame.business.service.imp.IDashboardService#removeGadget(java.lang.Long)
     */
    public void removeGadget(final Long gadgetId, final Long dashboardId) throws EnMeNoResultsFoundException {
        final Dashboard board = this.getDashboardById(dashboardId);
        final Gadget gadget= this.getGadget(gadgetId, board);
        final List<GadgetProperties> prop = getDashboardDao().retrievePropertiesbyGadget(gadget.getGadgetId());
        if(prop.size() > 0){
            for (GadgetProperties gadgetProperties : prop) {
                getDashboardDao().delete(gadgetProperties);
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.