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

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


    }//end convertUser_valid

    @Test
    public void convertUser_MongoInstance(){
        PageUser sourceUser = new PageUserImpl();
        sourceUser.setUserId("1234");

        PageUserImpl converted = converter.convert(sourceUser);
        assertNotNull(converted.getId());
    }
View Full Code Here


        page.getRegions().add(region1);
        page.getRegions().add(region2);

        page.setMembers(Lists.<PageUser>newLinkedList());
        PageUserImpl member1 = new PageUserImpl();
        PageUser member2 = new PageUserImpl();
        page.getMembers().add(member1);
        page.getMembers().add(member2);

        Region subRegion = new RegionImpl();
        subRegion.setRegionWidgets(Lists.<RegionWidget>newLinkedList());
        RegionWidget subRegionWidget = new RegionWidgetImpl();
        subRegion.getRegionWidgets().add(subRegionWidget);

        page.setSubPages(Lists.<Page>newLinkedList());
        MongoDbPage subPage1 = new MongoDbPage();
        PageUserImpl subMember = new PageUserImpl();
        subPage1.setMembers(Lists.<PageUser>newLinkedList());
        subPage1.setRegions(Lists.<Region>newLinkedList());
        subPage1.getMembers().add(subMember);
        subPage1.getRegions().add(subRegion);
        Page subPage2 = new PageImpl();
View Full Code Here

        page.setPageLayout(pageLayout);
        page.setRegions(regions);
        // set this as a "sub-page" page type
        page.setPageType(PageType.SUB_PAGE.toString());

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

    }

    @Transactional
    public Boolean addMemberToPage(String pageId, String userId){
        Page page = getPage(pageId);
        PageUser pageUser = new PageUserImpl();
        pageUser.setUserId(userService.getUserById(userId).getId());
        pageUser.setPage(page);
        pageUser.setPageStatus(PageInvitationStatus.PENDING);
        List<PageUser> thisUsersPages = pageRepository.getPagesForUser(userService.getUserById(userId).getId(), PageType.USER.toString());
        pageUser.setRenderSequence(new Long(thisUsersPages.size() + 1));
        page.getMembers().add(pageUser);
        if(pageRepository.save(page) != null){
            return Boolean.TRUE;
        }else{
            return Boolean.FALSE;
View Full Code Here

        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);
        pageUser.setEditor(true);

        List<PageUser> members = new ArrayList<PageUser>();
        members.add(pageUser);
        page.setMembers(members);
View Full Code Here

    private Page convertTemplate(PageTemplate pt, User user) {
        Page p = new PageImpl();
        p.setName(pt.getName());
        p.setPageType(pt.getPageType());
        p.setOwnerId(user.getId());
        PageUser pageUser = new PageUserImpl(user.getId(), p, pt.getRenderSequence());
        pageUser.setPageStatus(PageInvitationStatus.OWNER);
        pageUser.setEditor(true);
        List<PageUser> members = new ArrayList<PageUser>();
        members.add(pageUser);
        p.setMembers(members);

        p.setPageLayout(pt.getPageLayout());
View Full Code Here

            lPage.setPageLayout(pt.getPageLayout());
            lPage.setParentPage(page);
            lPage.setRegions(convertRegions(pt.getPageTemplateRegions(), lPage));

            // create new pageUser tuple
            PageUser pageUser = new PageUserImpl(lPage.getOwnerId(), lPage, pt.getRenderSequence());
            pageUser.setPageStatus(PageInvitationStatus.OWNER);
            pageUser.setEditor(true);
            List<PageUser> members = new ArrayList<PageUser>();
            members.add(pageUser);
            lPage.setMembers(members);
            // recursive call
            lPage.setSubPages((pt.getSubPageTemplates() == null || pt.getSubPageTemplates().isEmpty()) ? null : convertPages(pt.getSubPageTemplates(), lPage));
View Full Code Here

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

    }

    @Transactional
    public Boolean addMemberToPage(String pageId, String userId){
        Page page = getPage(pageId);
        PageUser pageUser = new PageUserImpl();
        pageUser.setUserId(userService.getUserById(userId).getId());
        pageUser.setPage(page);
        pageUser.setPageStatus(PageInvitationStatus.PENDING);
        List<PageUser> thisUsersPages = pageRepository.getPagesForUser(userService.getUserById(userId).getId(), PageType.USER);
        pageUser.setRenderSequence(new Long(thisUsersPages.size() + 1));
        page.getMembers().add(pageUser);
        if(pageRepository.save(page) != null){
            return Boolean.TRUE;
        }else{
            return Boolean.FALSE;
View Full Code Here

        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);
        pageUser.setEditor(true);

        List<PageUser> members = new ArrayList<PageUser>();
        members.add(pageUser);
        page.setMembers(members);
View Full Code Here

TOP

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

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.