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

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


    public void moveRegionWidgetToPage_invalidWidget() {
        String WIDGET_ID = "-1";
        final String CURRENT_PAGE_ID = "1";
        final String TO_PAGE_ID = "2";

        Page currentPageValue = new PageImpl();
        currentPageValue.setRegions(new ArrayList<Region>());
        currentPageValue.getRegions().add(originalRegion);
        currentPageValue.getRegions().add(targetRegion);

        Page toPageValue = new PageImpl();
        toPageValue.setRegions(new ArrayList<Region>());
        toPageValue.getRegions().add(originalRegion);
        toPageValue.getRegions().add(targetRegion);

        expect(pageRepository.get(CURRENT_PAGE_ID)).andReturn(currentPageValue);
        expect(pageRepository.get(TO_PAGE_ID)).andReturn(toPageValue);
        expect(regionWidgetRepository.get(WIDGET_ID)).andReturn(null);
View Full Code Here


    public void moveRegionWidgetToPage_lockedRegionWidget() {
        final String WIDGET_ID = "1";
        final String CURRENT_PAGE_ID = "1";
        final String TO_PAGE_ID = "2";

        Page currentPageValue = new PageImpl();
        currentPageValue.setRegions(new ArrayList<Region>());
        currentPageValue.getRegions().add(originalRegion);
        currentPageValue.getRegions().add(targetRegion);

        Page toPageValue = new PageImpl();
        toPageValue.setRegions(new ArrayList<Region>());
        toPageValue.getRegions().add(originalRegion);
        toPageValue.getRegions().add(targetRegion);

        Region region = new RegionImpl();
        region.setLocked(false);

        RegionWidget regionWidget = new RegionWidgetImpl(VALID_REGION_WIDGET_ID);
View Full Code Here

        final String WIDGET_ID = "1";
        final String CURRENT_PAGE_ID = "1";
        final String TO_PAGE_ID = "2";

        Page currentPageValue = new PageImpl();
        currentPageValue.setRegions(new ArrayList<Region>());
        currentPageValue.getRegions().add(originalRegion);
        currentPageValue.getRegions().add(targetRegion);

        Page toPageValue = new PageImpl();
        toPageValue.setRegions(new ArrayList<Region>());
        toPageValue.getRegions().add(originalRegion);
        toPageValue.getRegions().add(targetRegion);

        Region region = new RegionImpl();
        region.setLocked(false);

        RegionWidget regionWidget = new RegionWidgetImpl(VALID_REGION_WIDGET_ID);
View Full Code Here

        final String WIDGET_ID = "1";
        final String CURRENT_PAGE_ID = "1";
        final String TO_PAGE_ID = "2";

        Page currentPageValue = new PageImpl();
        currentPageValue.setRegions(new ArrayList<Region>());
        currentPageValue.getRegions().add(originalRegion);
        currentPageValue.getRegions().add(targetRegion);

        Page toPageValue = new PageImpl();
        toPageValue.setRegions(new ArrayList<Region>());
        toPageValue.getRegions().add(originalRegion);
        toPageValue.getRegions().add(targetRegion);

        Region region = new RegionImpl();
        region.setLocked(false);

        RegionWidget regionWidget = new RegionWidgetImpl(VALID_REGION_WIDGET_ID);
View Full Code Here

        pageService = new DefaultPageService(pageRepository, pageTemplateRepository, regionRepository, widgetRepository, regionWidgetRepository,
                                             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");
View Full Code Here


    @Test
    public void getAllPersonProfilePages_userHasPersonPage() {
        List<Page> VALID_PAGES = new ArrayList<Page>();
        Page personPage = new PageImpl();
        VALID_PAGES.add(personPage);

        expect(pageRepository.getAllPages(VALID_USER_ID, PageType.PERSON_PROFILE)).andReturn(VALID_PAGES);
        replay(pageRepository,userService,pageTemplateRepository);
View Full Code Here

    }

    @Test
    public void getAllPersonProfilePages_noPersonPage() {
        List<Page> VALID_PAGES = new ArrayList<Page>();
        Page personPage = new PageImpl();
        PageTemplate pageTemplate = new PageTemplateImpl();
        UserImpl user = new UserImpl();

        expect(pageRepository.getAllPages(VALID_USER_ID, PageType.PERSON_PROFILE)).andReturn(VALID_PAGES);
        expect(userService.getUserById(isA(String.class))).andReturn(user).once();
View Full Code Here

    @Test
    public void addNewUserPage_noExistingPages() {
        final String PAGE_NAME = "my new page";
        final Long EXPECTED_RENDER_SEQUENCE = 1L;
        PageTemplate pageTemplate = new PageTemplateImpl() ;
        Page expectedPage = new PageImpl();
        expectedPage.setName(PAGE_NAME);
        expectedPage.setOwnerId(user.getId());
        expectedPage.setPageLayout(pageLayout);
        expectedPage.setRegions(createEmptyRegionList(pageLayout.getNumberOfRegions()));
        expectedPage.setPageType(PageType.USER);
        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);
        expect(pageLayoutRepository.getByPageLayoutCode(PAGE_LAYOUT_CODE)).andReturn(pageLayout);
        expect(pageTemplateRepository.getDefaultPage(PageType.USER)).andReturn(pageTemplate);
        expect(pageRepository.createPageForUser(user, pageTemplate)).andReturn(expectedPage);
View Full Code Here

    @Test
    public void addNewUserPage_noExistingPages_and_have_template() {
        final String PAGE_NAME = "my new page";
        final Long EXPECTED_RENDER_SEQUENCE = 1L;
        PageTemplate pageTemplate = new PageTemplateImpl();
        Page userPage = new PageImpl();
        userPage.setName("Page Template");
        userPage.setRegions(createEmptyRegionList(pageLayout.getNumberOfRegions()));

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

    @Test
    public void addNewUserPage_existingPages() {
        final String PAGE_NAME = "my new page";
        final Long EXPECTED_RENDER_SEQUENCE = 2L;
        List<Page> existingPages = new ArrayList<Page>();
        existingPages.add(new PageImpl());

        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);
        expect(pageLayoutRepository.getByPageLayoutCode(PAGE_LAYOUT_CODE)).andReturn(pageLayout);
        expect(pageRepository.save(expectedPage)).andAnswer(new IAnswer<Page>() {
            @Override
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.