Package org.apache.rave.portal.model

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


        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


  public void setup() {
    userService = createMock(UserService.class);
    pageService = createMock(PageService.class);
    profileController = new ProfileController(userService, pageService);

        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

    final String username="Canonical";
        user.setUsername(username);
        user.setEntityId(USER_ID);
    String userProfile = new String(ModelKeys.USER_PROFILE);
        Page personProfile = new Page();
        PageLayout pageLayout = new PageLayout();
        pageLayout.setCode(VALID_PAGE_LAYOUT_CODE);
        personProfile.setPageLayout(pageLayout);
   
    expect(userService.getUserByUsername(username)).andReturn(user).once();
        expect(pageService.getPersonProfilePage(user.getEntityId())).andReturn(personProfile);
View Full Code Here

        final User user = null;
        final ModelMap model = new ModelMap();
        final int modelSize = 4;
        final String username="Canonical";
        Page personProfile = new Page();
        PageLayout pageLayout = new PageLayout();
        pageLayout.setCode("person_profile");
        personProfile.setPageLayout(pageLayout);

        expect(userService.getUserByUsername(username)).andThrow(new UsernameNotFoundException("Username does not exist"));

        replay(userService, pageService);
View Full Code Here

        passwordEncoder = createMock(PasswordEncoder.class);
        authorityService = createMock(AuthorityService.class);

        newAccountService = new DefaultNewAccountService(userService, pageLayoutService, authorityService);
       
        validPageLayout = new PageLayout();
        validPageLayout.setEntityId(99L);
        validPageLayout.setNumberOfRegions(4L);
        validPageLayout.setCode(VALID_LAYOUT_CODE);
       
        Authority role1 = new Authority();
View Full Code Here

    @Override
    @Transactional
    public Page updatePage(long pageId, String name, String pageLayoutCode) {
        Page page = pageRepository.get(pageId);
        PageLayout newLayout = pageLayoutRepository.getByPageLayoutCode(pageLayoutCode);
        PageLayout curLayout = page.getPageLayout();

        //if the region lengths of the layouts do not match then adjust the new layout
        if (isLayoutAdjustmentNeeded(newLayout, curLayout)) {
            //if the new layout has fewer regions than the previous layout the widgets from the
            //deleted regions need to be appended to the last valid region in the new layout
            if (curLayout.getNumberOfRegions() > newLayout.getNumberOfRegions()) {
                reduceRegionsForPage(page, newLayout.getNumberOfRegions());
            }
            //otherwise the new layout has more regions that the previous layout and
            //new regions need to be added to the page
            else {
                long numberOfNewRegionsToAdd = newLayout.getNumberOfRegions() - curLayout.getNumberOfRegions();
                createAdditionalRegionsForPage(page, numberOfNewRegionsToAdd);
            }
        }

        //save the new page properties
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();
            region.setRenderOrder(regionCount);
            regions.add(region);
        }
View Full Code Here

       
        user = new User();
        user.setEntityId(1L);
        user.setUsername("acarlucci");
       
        pageLayout = new PageLayout();
        pageLayout.setEntityId(1L);
        pageLayout.setCode(PAGE_LAYOUT_CODE);
        pageLayout.setNumberOfRegions(3L);
       
        page = new Page(PAGE_ID, user);
View Full Code Here

    @Test
    public void updatePage_nameUpdate() {
        String newName = "new page name";
        String layoutName = "layout name";
       
        PageLayout layout = createStrictMock(PageLayout.class);
        expect(layout.getNumberOfRegions()).andReturn(new Long(2)).anyTimes();
//        expect(layout.equals(layout)).andReturn((boolean) true);
        replay(layout);
       
        //create a strict mock that ensures that the appropriate setters are
        //called, rather than checking the return value from the function
View Full Code Here

        expect(region.getRenderOrder()).andReturn(1);
        replay(region);
        regions.add(new Region());
        regions.add(region);
       
        PageLayout prevLayout = createStrictMock(PageLayout.class);
        expect(prevLayout.getNumberOfRegions()).andReturn(new Long(2)).anyTimes();
        replay(prevLayout);
       
        PageLayout layout = createStrictMock(PageLayout.class);
        expect(layout.getNumberOfRegions()).andReturn(new Long(3)).anyTimes();
//        expect(layout.equals(layout)).andReturn((boolean) true);
        replay(layout);
       
        //create a strict mock that ensures that the appropriate setters are
        //called, rather than checking the return value from the function
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.