Package org.apache.rave.portal.model

Examples of org.apache.rave.portal.model.PageLayout


        assertThat(pageLayout.getEntityId(), is(nullValue()));
        repository.save(pageLayout);
        long newId = pageLayout.getEntityId();
        assertThat(newId > 0, is(true));
        PageLayout newLayout = repository.get(newId);
        assertThat(newLayout.getCode(), is(newCode));
        assertThat(newLayout.getRenderSequence(), is(newRenderSeq));
        assertThat(newLayout.getNumberOfRegions(), is(newNumRegions));
        assertThat(newLayout.isUserSelectable(), is(newUserSelectable));
    }
View Full Code Here


    @Test
    @Transactional(readOnly=false)
    @Rollback(true)
    public void save_existing() {
        final String UPDATED_CODE = "updated code";
        PageLayout pageLayout = repository.get(VALID_ID);
        assertThat(pageLayout.getCode(), is(not(UPDATED_CODE)));
        pageLayout.setCode(UPDATED_CODE);
        repository.save(pageLayout);
        PageLayout updatedPageLayout = repository.get(VALID_ID);
        assertThat(updatedPageLayout.getCode(), is(UPDATED_CODE));
    }
View Full Code Here

    @Test
    @Transactional(readOnly = false)
    @Rollback(true)
    public void delete() {
        PageLayout pl = repository.get(VALID_ID);
        assertThat(pl, is(notNullValue()));
        repository.delete(pl);
        pl = repository.get(VALID_ID);
        assertThat(pl, is(nullValue()));
    }
View Full Code Here

        source.getRegionWidgets().remove(widget);
        target.getRegionWidgets().add(newPosition, widget);
    }

    private Page addNewPage(User user, String pageName, String pageLayoutCode) {
        PageLayout pageLayout = pageLayoutRepository.getByPageLayoutCode(pageLayoutCode);
       
        // Create regions
        List<Region> regions = new ArrayList<Region>();
        int regionCount;
        for (regionCount = 0; regionCount < pageLayout.getNumberOfRegions(); regionCount++) {
            Region region = new Region();
            regions.add(region);
        }

        // Create a Page object and register it.
View Full Code Here

       
        allPages = new ArrayList<Page>();
        allPages.add(defaultPage);  
        allPages.add(otherPage);           
       
        validPageLayout = new PageLayout();
        validPageLayout.setEntityId(33L);
        validPageLayout.setCode(VALID_PAGE_LAYOUT_CODE);
       
        validUser = new User(USER_ID);
        validUser.setDefaultPageLayout(validPageLayout);
View Full Code Here

        pageLayoutService = createMock(PageLayoutService.class);
        pageController = new PageController(pageService, userService, pageLayoutService);
        model = new ExtendedModelMap();
        request = new MockHttpServletRequest();

        validPageLayout = new PageLayout();
        validPageLayout.setEntityId(33L);
        validPageLayout.setCode(VALID_PAGE_LAYOUT_CODE);

        defaultPage = new Page(DEFAULT_PAGE_ID);
        defaultPage.setPageLayout(validPageLayout);
View Full Code Here

        pageLayoutRepository.get(id);
    }

    @Test
    public void save_Valid() {
        PageLayout item1 = new MongoDbPageLayout();
        item1.setCode("blah1");
        expect(template.findOne(new Query(where("code").is(item1.getCode())), pageLayoutRepository.CLASS, CollectionNames.PAGE_LAYOUT_COLLECTION)).andReturn(null);
        template.save(isA(MongoDbPageLayout.class), eq(CollectionNames.PAGE_LAYOUT_COLLECTION));
        expectLastCall();
        replay(template);

        PageLayout saved = pageLayoutRepository.save(item1);

        assertThat(saved, is(instanceOf(MongoDbPageLayout.class)));
        assertThat(saved.getCode(), is(sameInstance(item1.getCode())));
        assertThat(saved.getNumberOfRegions(), is(sameInstance(item1.getNumberOfRegions())));
        assertThat(saved.getRenderSequence(), is(sameInstance(item1.getRenderSequence())));
        assertThat(saved.isUserSelectable(), is(sameInstance(item1.isUserSelectable())));
    }
View Full Code Here

        assertThat(saved.isUserSelectable(), is(sameInstance(item1.isUserSelectable())));
    }

    @Test
    public void save_Null(){
        PageLayout item1 = new MongoDbPageLayout();
        item1.setCode("blah1");
        item1.setNumberOfRegions((long)123);
        item1.setRenderSequence((long)432);
        item1.setUserSelectable(true);
        MongoDbPageLayout toSave = new MongoDbPageLayout();
        expect(template.findOne(new Query(where("code").is(item1.getCode())), pageLayoutRepository.CLASS, CollectionNames.PAGE_LAYOUT_COLLECTION)).andReturn(toSave);
        template.save(isA(MongoDbPageLayout.class), eq(CollectionNames.PAGE_LAYOUT_COLLECTION));
        expectLastCall();
        replay(template);

        PageLayout saved = pageLayoutRepository.save(item1);

        assertThat(saved.getCode(), is(sameInstance(item1.getCode())));
        assertThat(saved.getNumberOfRegions(), is(sameInstance(item1.getNumberOfRegions())));
        assertThat(saved.getRenderSequence(), is(sameInstance(item1.getRenderSequence())));
        assertThat(saved.isUserSelectable(), is(sameInstance(item1.isUserSelectable())));
    }
View Full Code Here

        assertThat(saved.isUserSelectable(), is(sameInstance(item1.isUserSelectable())));
    }

    @Test
    public void delete_Valid(){
        PageLayout item = new MongoDbPageLayout();
        item.setCode("123");
        expect(template.findOne(new Query(where("code").is(item.getCode())), pageLayoutRepository.CLASS, CollectionNames.PAGE_LAYOUT_COLLECTION)).andReturn((MongoDbPageLayout)item);

          template.remove(item);
        expectLastCall();
        replay(template);
View Full Code Here

        region.getRegionWidgets().add(rw);
        sourcePage.setRegions(Lists.<Region>newLinkedList());
        sourcePage.getRegions().add(region);

        Page parentPage = new PageImpl();
        PageLayout pagelayout = new PageLayoutImpl();
        pagelayout.setCode("asdf");

        sourcePage.setId(PAGEID);
        sourcePage.setOwnerId(USER2ID);
        sourcePage.setPageLayout(pagelayout);
        sourcePage.setName("Carol");
View Full Code Here

TOP

Related Classes of org.apache.rave.portal.model.PageLayout

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.