Package org.apache.rave.portal.model

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


    }

    @Test
    public void testNoConversion() {
        JpaPageTemplateRegion template = new JpaPageTemplateRegion();
        assertThat(converter.convert(template), is(sameInstance(template)));
    }
View Full Code Here


        template.setRenderSequence(1);
        template.setPageTemplateWidgets(new ArrayList<PageTemplateWidget>());
        template.setPageTemplate(new PageTemplateImpl("1"));
        template.setLocked(true);

        JpaPageTemplateRegion jpaTemplate = converter.convert(template);

        assertThat(jpaTemplate, is(not(sameInstance(template))));
        assertThat(jpaTemplate, is(instanceOf(JpaPageTemplateRegion.class)));
        assertThat(jpaTemplate.getRenderSequence(), is(equalTo(template.getRenderSequence())));
        assertThat(jpaTemplate.getPageTemplate(), is(instanceOf(JpaPageTemplate.class)));
        assertThat(jpaTemplate.getPageTemplateWidgets(), is(equalTo(template.getPageTemplateWidgets())));
        assertThat(jpaTemplate.isLocked(), is(equalTo(template.isLocked())));
    }
View Full Code Here

    public JpaPageTemplateRegion convert(PageTemplateRegion source) {
        return source instanceof JpaPageTemplateRegion ? (JpaPageTemplateRegion) source : createEntity(source);
    }

    private JpaPageTemplateRegion createEntity(PageTemplateRegion source) {
        JpaPageTemplateRegion converted = null;

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

    public JpaPageTemplateRegion convert(PageTemplateRegion source) {
        return source instanceof JpaPageTemplateRegion ? (JpaPageTemplateRegion) source : createEntity(source);
    }

    private JpaPageTemplateRegion createEntity(PageTemplateRegion source) {
        JpaPageTemplateRegion converted = null;

        if (source != null) {
            converted = manager.find(JpaPageTemplateRegion.class, source.getId() == null ? null : Long.parseLong(source.getId()));

            if (converted == null) {
                converted = new JpaPageTemplateRegion();
            }
            updateProperties(source, converted);
        }
        return converted;
    }
View Full Code Here

    }

    @Test
    public void testNoConversion() {
        JpaPageTemplateRegion template = new JpaPageTemplateRegion();
        assertThat(converter.convert(template), is(sameInstance(template)));
    }
View Full Code Here

        template.setRenderSequence(1);
        template.setPageTemplateWidgets(new ArrayList<PageTemplateWidget>());
        template.setPageTemplate(new PageTemplateImpl());
        template.setLocked(true);

        JpaPageTemplateRegion jpaTemplate = converter.convert(template);

        assertThat(jpaTemplate, is(not(sameInstance(template))));
        assertThat(jpaTemplate, is(instanceOf(JpaPageTemplateRegion.class)));
        assertThat(jpaTemplate.getRenderSequence(), is(equalTo(template.getRenderSequence())));
        assertThat(jpaTemplate.getPageTemplate(), is(instanceOf(JpaPageTemplate.class)));
        assertThat(jpaTemplate.getPageTemplateWidgets(), is(equalTo(template.getPageTemplateWidgets())));
        assertThat(jpaTemplate.isLocked(), is(equalTo(template.isLocked())));
    }
View Full Code Here

    public JpaPageTemplateRegion convert(PageTemplateRegion source) {
        return source instanceof JpaPageTemplateRegion ? (JpaPageTemplateRegion) source : createEntity(source);
    }

    private JpaPageTemplateRegion createEntity(PageTemplateRegion source) {
        JpaPageTemplateRegion converted = null;

        if (source != null) {
            converted = manager.find(JpaPageTemplateRegion.class, source.getId());

            if (converted == null) {
                converted = new JpaPageTemplateRegion();
            }
            updateProperties(source, converted);
        }
        return converted;
    }
View Full Code Here

    }

    @Test
    public void testNoConversion() {
        JpaPageTemplateRegion template = new JpaPageTemplateRegion();
        assertThat(converter.convert(template), is(sameInstance(template)));
    }
View Full Code Here

        template.setRenderSequence(1);
        template.setPageTemplateWidgets(new ArrayList<PageTemplateWidget>());
        template.setPageTemplate(new PageTemplateImpl("1"));
        template.setLocked(true);

        JpaPageTemplateRegion jpaTemplate = converter.convert(template);

        assertThat(jpaTemplate, is(not(sameInstance(template))));
        assertThat(jpaTemplate, is(instanceOf(JpaPageTemplateRegion.class)));
        assertThat(jpaTemplate.getRenderSequence(), is(equalTo(template.getRenderSequence())));
        assertThat(jpaTemplate.getPageTemplate(), is(instanceOf(JpaPageTemplate.class)));
        assertThat(jpaTemplate.getPageTemplateWidgets(), is(equalTo(template.getPageTemplateWidgets())));
        assertThat(jpaTemplate.isLocked(), is(equalTo(template.isLocked())));
    }
View Full Code Here

    public JpaPageTemplateRegion convert(PageTemplateRegion source) {
        return source instanceof JpaPageTemplateRegion ? (JpaPageTemplateRegion) source : createEntity(source);
    }

    private JpaPageTemplateRegion createEntity(PageTemplateRegion source) {
        JpaPageTemplateRegion converted = null;

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

TOP

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

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.