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

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


        user.setId(VALID_USER_ID);
        user2 = new UserImpl();
        user2.setUsername(VALID_USERNAME2);
        user2.setId(VALID_USER_ID2);

        page = new PageImpl();
        page.setId(VALID_PAGE_ID);
        page.setOwnerId(user.getId());
        page.setPageType(PageType.USER);

        pageSubPage = new PageImpl();
        pageSubPage.setId(VALID_PAGE_ID4);
        pageSubPage.setOwnerId(user.getId());
        pageSubPage.setPageType(PageType.SUB_PAGE);
        pageSubPage.setParentPage(page);

        personProfilePage = new PageImpl();
        personProfilePage.setId(VALID_PAGE_ID2);
        personProfilePage.setOwnerId(user.getId());
        personProfilePage.setPageType(PageType.PERSON_PROFILE);
        personProfileSubPage = new PageImpl();
        personProfileSubPage.setId(VALID_PAGE_ID3);
        personProfileSubPage.setOwnerId(user.getId());
        personProfileSubPage.setPageType(PageType.PERSON_PROFILE);
        personProfileSubPage.setParentPage(personProfilePage);
View Full Code Here


        user.setUsername(VALID_USERNAME);
        user.setId(VALID_USER_ID);
        user2 = new UserImpl();
        user2.setUsername(VALID_USERNAME2);
        user2.setId(VALID_USER_ID2);
        page = new PageImpl();
        page.setId(VALID_PAGE_ID);
        page.setOwnerId(user.getId());
        widget = new WidgetImpl(VALID_WIDGET_ID);
        widget.setOwnerId(VALID_USER_ID);
        widget.setWidgetStatus(WidgetStatus.PUBLISHED);
View Full Code Here

        user.setUsername(VALID_USERNAME);
        user.setId(VALID_USER_ID);
        user2 = new UserImpl();
        user2.setUsername(VALID_USERNAME2);
        user2.setId(VALID_USER_ID2);
        page = new PageImpl();
        page.setId(VALID_PAGE_ID);
        page.setOwnerId(user.getId());
        region = new RegionImpl(VALID_REGION_ID);
        region.setPage(page);
        grantedAuthoritiesList = new ArrayList<GrantedAuthority>();
View Full Code Here

            regions.add(region);
        }

        // Create a Page object and register it.
        long renderSequence = (parentPage.getSubPages() != null) ? parentPage.getSubPages().size() + 1 : 1;
        Page page = new PageImpl();
        page.setName(pageName);
        page.setOwnerId(user.getId());
        page.setPageLayout(pageLayout);
        page.setRegions(regions);
        // set this as a "sub-page" page type
        page.setPageType(PageType.SUB_PAGE);

        PageUser pageUser = new PageUserImpl(page.getOwnerId(), page, renderSequence);
        pageUser.setPageStatus(PageInvitationStatus.OWNER);
        List<PageUser> members = new ArrayList<PageUser>();
        members.add(pageUser);
        page.setMembers(members);

        // Properly sets both sides of the circular parent-child reference
        page.setParentPage(parentPage);
        if (parentPage.getSubPages() != null){
            parentsSubPages = parentPage.getSubPages();
        }
        parentsSubPages.add(page);
        parentPage.setSubPages(parentsSubPages);
View Full Code Here

        }

        // If we have a page already or if there was an exception from above then create the page
        // Create the new page for the user
        long renderSequence = defaultUserPage.size() + 1;
        page = new PageImpl();
        page.setName(pageName);
        page.setOwnerId(user.getId());
        page.setPageLayout(pageLayout);
        PageUser pageUser = new PageUserImpl(page.getOwnerId(), page, renderSequence);
        pageUser.setPageStatus(PageInvitationStatus.OWNER);
View Full Code Here

        user.setUsername(VALID_USERNAME);
        user.setId(VALID_USER_ID);
        user2 = new UserImpl();
        user2.setUsername(VALID_USERNAME2);
        user2.setId(VALID_USER_ID2);
        page = new PageImpl();
        page.setId(VALID_PAGE_ID);
        page.setOwnerId(user.getId());
        region = new RegionImpl(VALID_REGION_ID);
        region.setPage(page);
        regionWidget = new RegionWidgetImpl(VALID_REGION_WIDGET_ID);
View Full Code Here

        assertThat(pageConverter.convert(page), is(nullValue()));
    }

    @Test
    public void newPage() {
        Page page = new PageImpl();
        page.setId("1");
        page.setMembers(new ArrayList<PageUser>());
        page.setName("name");
        page.setOwnerId("");
        page.setPageLayout(new PageLayoutImpl());
        page.setPageType(PageType.USER);
        page.setParentPage(new PageImpl("1"));
        page.setRegions(new ArrayList<Region>());
        page.setSubPages(new ArrayList<Page>());

        JpaPage converted = pageConverter.convert(page);
        assertThat(converted, is(not(sameInstance(page))));
        assertThat(converted, is(instanceOf(JpaPage.class)));
        assertThat(converted.getId(), is(equalTo(page.getId())));
        assertThat(converted.getParentPage().getId(), is(equalTo(page.getParentPage().getId())));
        assertThat(converted.getRegions(), is(equalTo(page.getRegions())));
        assertThat(converted.getMembers(), is(equalTo(page.getMembers())));
        assertThat(converted.getName(), is(equalTo(page.getName())));
        assertThat(converted.getOwnerId(), is(equalTo(page.getOwnerId())));
        assertThat(converted.getPageLayout().getCode(), is(equalTo(page.getPageLayout().getCode())));
        assertThat(converted.getPageType(), is(equalTo(page.getPageType())));
        assertThat(converted.getSubPages(), is(equalTo(page.getSubPages())));
    }
View Full Code Here

        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>();
View Full Code Here

    profileController = new ProfileController(userService, pageService);

        validPageLayout = new PageLayoutImpl();
        validPageLayout.setCode(VALID_PAGE_LAYOUT_CODE);

        defaultPage = new PageImpl(DEFAULT_PAGE_ID);
        defaultPage.setPageLayout(validPageLayout);
        otherPage = new PageImpl(OTHER_PAGE_ID);
        otherPage.setPageLayout(validPageLayout);

        allProfilePages = new ArrayList<Page>();
        allProfilePages.add(defaultPage);
        allProfilePages.add(otherPage);
View Full Code Here

    final int modelSize = 4;
    final String username="canonical";
        user.setUsername(username);
        user.setId(USER_ID);
    String userProfile = new String(ModelKeys.USER_PROFILE);
        Page personProfile = new PageImpl();
        PageLayout pageLayout = new PageLayoutImpl();
        pageLayout.setCode(VALID_PAGE_LAYOUT_CODE);
        personProfile.setPageLayout(pageLayout);
        List<Person> personObjects = new ArrayList<Person>();

    expect(userService.getUserByUsername(username)).andReturn(user).once();
        expect(pageService.getPersonProfilePage(user.getId())).andReturn(personProfile);
    expect(userService.getFriendRequestsReceived(username)).andReturn(personObjects);
View Full Code Here

TOP

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

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.