Examples of JpaPage


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

    @Autowired
    private JpaPageConverter pageConverter;

    @Test
    public void noConversion() {
        Page page = new JpaPage();
        assertThat(pageConverter.convert(page), is(sameInstance(page)));
    }
View Full Code Here

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

        page.setPageType(PageType.USER);
        page.setParentPage(new PageImpl("1"));
        page.setRegions(new ArrayList<Region>());
        page.setSubPages(new ArrayList<Page>());

        JpaPage converted = pageConverter.convert(page);
        assertThat(converted, is(not(sameInstance(page))));
        assertThat(converted, is(instanceOf(JpaPage.class)));
        assertThat(converted.getId(), is(equalTo(page.getId())));
        assertThat(converted.getParentPage().getId(), is(equalTo(page.getParentPage().getId())));
        assertThat(converted.getRegions(), is(equalTo(page.getRegions())));
        assertThat(converted.getMembers(), is(equalTo(page.getMembers())));
        assertThat(converted.getName(), is(equalTo(page.getName())));
        assertThat(converted.getOwnerId(), is(equalTo(page.getOwnerId())));
        assertThat(converted.getPageLayout().getCode(), is(equalTo(page.getPageLayout().getCode())));
        assertThat(converted.getPageType(), is(equalTo(page.getPageType())));
        assertThat(converted.getSubPages(), is(equalTo(page.getSubPages())));
    }
View Full Code Here

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

    @Test
    public void newRegion() {
        Region region = new RegionImpl("9");
        region.setLocked(false);
        region.setPage(new JpaPage());
        region.setRegionWidgets(new ArrayList<RegionWidget>());
        region.setRenderOrder(9);

        JpaRegion converted = regionConverter.convert(region);
        assertThat(converted, is(not(sameInstance(region))));
View Full Code Here

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

    public JpaPage convert(Page source) {
        return source instanceof JpaPage ? (JpaPage) source : createEntity(source);
    }

    private JpaPage createEntity(Page source) {
        JpaPage converted = null;
        if (source != null) {
            converted = source.getId() == null ? new JpaPage() : manager.find(JpaPage.class, Long.parseLong(source.getId()));
            if(converted == null) {
                converted = new JpaPage();
            }
            updateProperties(source, converted);
        }
        return converted;
    }
View Full Code Here

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

    public JpaPage convert(Page source) {
        return source instanceof JpaPage ? (JpaPage) source : createEntity(source);
    }

    private JpaPage createEntity(Page source) {
        JpaPage converted = null;
        if (source != null) {
            converted = manager.find(JpaPage.class, source.getId() == null ? null : Long.parseLong(source.getId()));
            if (converted == null) {
                converted = new JpaPage();
            }
            updateProperties(source, converted);
        }
        return converted;
    }
View Full Code Here

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

    public JpaPage convert(Page source) {
        return source instanceof JpaPage ? (JpaPage) source : createEntity(source);
    }

    private JpaPage createEntity(Page source) {
        JpaPage converted = null;
        if (source != null) {
            converted = manager.find(JpaPage.class, source.getId());
            if (converted == null) {
                converted = new JpaPage();
            }
            updateProperties(source, converted);
        }
        return converted;
    }
View Full Code Here

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

    public JpaPage convert(Page source) {
        return source instanceof JpaPage ? (JpaPage) source : createEntity(source);
    }

    private JpaPage createEntity(Page source) {
        JpaPage converted = null;
        if (source != null) {
            converted = source.getId() == null ? new JpaPage() : manager.find(JpaPage.class, Long.parseLong(source.getId()));
            if(converted == null) {
                converted = new JpaPage();
            }
            updateProperties(source, converted);
        }
        return converted;
    }
View Full Code Here

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

        }
        return null;
    }

    private JpaPage createEntity(Page source) {
        JpaPage converted = source.getId() == null ? new JpaPage() : manager.find(JpaPage.class, Long.parseLong(source.getId()));
        if (converted == null) {
            converted = new JpaPage();
        }
        updateProperties(source, converted);
        return converted;
    }
View Full Code Here

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

    @Autowired
    private JpaPageConverter pageConverter;

    @Test
    public void noConversion() {
        Page page = new JpaPage();
        assertThat(pageConverter.convert(page), is(sameInstance(page)));
    }
View Full Code Here

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

        page.setParentPage(new PageImpl("1"));
        page.setRegions(new ArrayList<Region>());
        page.setSubPages(new ArrayList<Page>());
        page.setProperties(new HashMap<String, Object>());

        JpaPage converted = pageConverter.convert(page);
        assertThat(converted, is(not(sameInstance(page))));
        assertThat(converted, is(instanceOf(JpaPage.class)));
        assertThat(converted.getId(), is(equalTo(page.getId())));
        assertThat(converted.getParentPage().getId(), is(equalTo(page.getParentPage().getId())));
        assertThat(converted.getRegions(), is(equalTo(page.getRegions())));
        assertThat(converted.getMembers(), is(equalTo(page.getMembers())));
        assertThat(converted.getName(), is(equalTo(page.getName())));
        assertThat(converted.getOwnerId(), is(equalTo(page.getOwnerId())));
        assertThat(converted.getContextId(), is(equalTo(page.getContextId())));
        assertThat(converted.getPageLayout().getCode(), is(equalTo(page.getPageLayout().getCode())));
        assertThat(converted.getPageType(), is(equalTo(page.getPageType())));
        assertThat(converted.getSubPages(), is(equalTo(page.getSubPages())));
        assertThat(converted.getProperties(), is(equalTo(page.getProperties())));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.