Package org.apache.rave.portal.model.impl

Examples of org.apache.rave.portal.model.impl.PageUserImpl


        }
        return page;
    }

    public PageUserImpl convert(PageUser sourceUser) {
        PageUserImpl user = sourceUser instanceof PageUserImpl ? (PageUserImpl) sourceUser : new PageUserImpl();
        user.setId(sourceUser.getId() == null ? generateId() : sourceUser.getId());
        user.setUserId(sourceUser.getUserId());
        user.setEditor(sourceUser.isEditor());
        user.setPageStatus(sourceUser.getPageStatus());
        user.setRenderSequence(sourceUser.getRenderSequence());
        user.setPage(null);
        return user;
    }
View Full Code Here


        request = new MockHttpServletRequest();

        validUser = new UserImpl(USER_ID);
        validPageLayout = new PageLayoutImpl();
        validPageLayout.setCode(VALID_PAGE_LAYOUT_CODE);
        defaultPageUser = new PageUserImpl(USER_ID, defaultPage, 1L);
        defaultPageUser.setPageStatus(PageInvitationStatus.OWNER);

        validUser.setDefaultPageLayout(validPageLayout);

        defaultPage = new PageImpl(DEFAULT_PAGE_ID, USER_ID);
        defaultPage.setPageLayout(validPageLayout);

        List<PageUser> members = new ArrayList<PageUser>();
        members.add(defaultPageUser);
        defaultPage.setMembers(members);

        otherPage = new PageImpl(OTHER_PAGE_ID, USER_ID);
        otherPage.setPageLayout(validPageLayout);
        otherPageUser = new PageUserImpl(USER_ID, otherPage, 2L);
        otherPageUser.setPageStatus(PageInvitationStatus.OWNER);

        List<PageUser> members2 = new ArrayList<PageUser>();
        members2.add(otherPageUser);
        otherPage.setMembers(members2);
View Full Code Here

                                             pageLayoutRepository, userService, defaultPageName);

        validWidget = new WidgetImpl("1", "http://dummy.apache.org/widgets/widget.xml");

        page = new PageImpl(PAGE_ID, user.getId());
        pageUser = new PageUserImpl(user.getId(), page, 1L);
        page.setMembers(new ArrayList<PageUser>());
        page.getMembers().add(pageUser);

        page2 = new PageImpl(PAGE_ID2, user.getId());
        pageUser2 = new PageUserImpl(user.getId(), page2, 2L);
        page2.setMembers(new ArrayList<PageUser>());
        page2.getMembers().add(pageUser2);

        targetRegion = new RegionImpl("2");
        targetRegion.setLocked(false);
View Full Code Here

        expectedPage.setName(PAGE_NAME);
        expectedPage.setOwnerId(user.getId());
        expectedPage.setPageLayout(pageLayout);
        expectedPage.setRegions(createEmptyRegionList(pageLayout.getNumberOfRegions()));
        expectedPage.setPageType(PageType.USER.toString());
        PageUser lPageUser = new PageUserImpl(user.getId(), expectedPage, EXPECTED_RENDER_SEQUENCE);
        List<PageUser> members = new ArrayList<PageUser>();
        members.add(lPageUser);
        expectedPage.setMembers(members);

        expect(userService.getAuthenticatedUser()).andReturn(user);
View Full Code Here

        expectedPage.setName(PAGE_NAME);
        expectedPage.setOwnerId(user.getId());
        expectedPage.setPageLayout(pageLayout);
        expectedPage.setRegions(createEmptyRegionList(pageLayout.getNumberOfRegions()));
        expectedPage.setPageType(PageType.USER.toString());
        PageUser lPageUser = new PageUserImpl(user.getId(), expectedPage, EXPECTED_RENDER_SEQUENCE);
        List<PageUser> members = new ArrayList<PageUser>();
        members.add(lPageUser);
        userPage.setMembers(members);

        expect(userService.getAuthenticatedUser()).andReturn(user);
View Full Code Here

        Page expectedPage = new PageImpl();
        expectedPage.setName(PAGE_NAME);
        expectedPage.setOwnerId(user.getId());
        expectedPage.setPageLayout(pageLayout);
        expectedPage.setRegions(createEmptyRegionList(pageLayout.getNumberOfRegions()));
        PageUser lPageUser = new PageUserImpl(user.getId(), expectedPage, EXPECTED_RENDER_SEQUENCE);
        List<PageUser> members = new ArrayList<PageUser>();
        members.add(lPageUser);
        expectedPage.setMembers(members);

        expect(userService.getAuthenticatedUser()).andReturn(user);
View Full Code Here

        Page expectedPage = new PageImpl();
        expectedPage.setName(defaultPageName);
        expectedPage.setOwnerId(user.getId());
        expectedPage.setPageLayout(pageLayout);
        expectedPage.setRegions(createEmptyRegionList(pageLayout.getNumberOfRegions()));
        PageUser lPageUser = new PageUserImpl(user.getId(), expectedPage, EXPECTED_RENDER_SEQUENCE);
        List<PageUser> members = new ArrayList<PageUser>();
        members.add(lPageUser);
        expectedPage.setMembers(members);

        expect(userService.getUserById(user.getId())).andReturn(user);
View Full Code Here

        }
        return page;
    }

    public PageUserImpl convert(PageUser sourceUser) {
        PageUserImpl user = sourceUser instanceof PageUserImpl ? (PageUserImpl) sourceUser : new PageUserImpl();
        user.setId(sourceUser.getId() == null ? generateId() : sourceUser.getId());
        user.setUserId(sourceUser.getUserId());
        user.setEditor(sourceUser.isEditor());
        user.setPageStatus(sourceUser.getPageStatus());
        user.setRenderSequence(sourceUser.getRenderSequence());
        user.setPage(null);
        return user;
    }
View Full Code Here

    @Test
    public void convertPage_valid() {

        MongoDbPage results;
        PageUser pageUser = new PageUserImpl(USER1ID);
        Page sourcePage = new PageImpl();
        pageUser.setUserId(USER2ID);

        List<PageUser> pageMembers = Lists.newArrayList();
        pageMembers.add(pageUser);
        sourcePage.setMembers(pageMembers);
View Full Code Here

    //Convert user test
    @Test
    public void convertUser_valid() {

        PageUserImpl mongoUser;
        PageUser sourceUser = new PageUserImpl(USER1ID);
        sourceUser.setUserId(USER2ID);
        sourceUser.setEditor(true);
        sourceUser.setPageStatus(PageInvitationStatus.OWNER);
        sourceUser.setRenderSequence(1234L);

        mongoUser = converter.convert(sourceUser);
        assertThat(mongoUser.getId(), is(equalTo(USER1ID)));
        assertThat(mongoUser.getUserId(), is(equalTo(USER2ID)));
        assertTrue(mongoUser.isEditor());
View Full Code Here

TOP

Related Classes of org.apache.rave.portal.model.impl.PageUserImpl

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.