Package org.apache.rave.portal.model

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


        final User user = null;
        final ModelMap model = new ModelMap();
        final int modelSize = 4;
        final String username="Canonical";
        Page personProfile = new PageImpl();
        PageLayout pageLayout = new PageLayoutImpl();
        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


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

        expect(userService.getUserById(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, pageService, pageLayoutService, regionService, authorityService);
       
        validPageLayout = new PageLayout();
        validPageLayout.setEntityId(99L);
        validPageLayout.setNumberOfRegions(4L);
        validPageLayout.setCode(VALID_LAYOUT_CODE);
       
        Authority role1 = new Authority();
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

  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

        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);

        validUser = new User(USER_ID);
View Full Code Here

        }
    }   
   
    @Test
    public void getByPageLayoutCode() {
        PageLayout pageLayout = repository.getByPageLayoutCode(VALID_LAYOUT_CODE);
        assertThat(pageLayout.getCode(), is(VALID_LAYOUT_CODE));
        assertThat(pageLayout.getNumberOfRegions(), is(2L));
        assertThat(pageLayout.getEntityId(), is(notNullValue(Long.class)));
    }
View Full Code Here

    @Override
    @Transactional
    public Page addNewSubPage(String pageName, String pageLayoutCode, Page parentPage) {
        User user = userService.getAuthenticatedUser();
        PageLayout pageLayout = pageLayoutRepository.getByPageLayoutCode(pageLayoutCode);

        // Create regions
        List<Region> regions = new ArrayList<Region>();
        List<Page> parentsSubPages = new ArrayList<Page>();
        int regionCount;
        for (regionCount = 0; regionCount < pageLayout.getNumberOfRegions(); regionCount++) {
            Region region = new Region();
            region.setRenderOrder(regionCount);
            // TODO: this should eventually be defined by the PageTemplateRegion.locked field
            region.setLocked(false);
            regions.add(region);
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.