Package org.apache.rave.portal.model

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


    }

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


        template.setHideChrome(true);
        template.setPageTemplateRegion(new PageTemplateRegionImpl("1"));
        template.setRenderSeq(1);
        template.setWidgetId(widget.getId());

        JpaPageTemplateWidget jpaTemplate = converter.convert(template);

        assertThat(jpaTemplate, is(not(sameInstance(template))));
        assertThat(jpaTemplate, is(instanceOf(JpaPageTemplateWidget.class)));
        assertThat(jpaTemplate.isLocked(), is(equalTo(template.isLocked())));
        assertThat(jpaTemplate.getPageTemplateRegion(), is(instanceOf(JpaPageTemplateRegion.class)));
        assertThat(jpaTemplate.getRenderSeq(), is(equalTo(template.getRenderSeq())));
        assertThat(jpaTemplate.getWidgetId(), is(equalTo(template.getWidgetId())));
        assertThat(jpaTemplate.isLocked(), is(equalTo(template.isLocked())));
        assertThat(jpaTemplate.isHideChrome(), is(equalTo(template.isHideChrome())));
    }
View Full Code Here

    public JpaPageTemplateWidget convert(PageTemplateWidget source) {
        return source instanceof JpaPageTemplateWidget ? (JpaPageTemplateWidget) source : createEntity(source);
    }

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

    public JpaPageTemplateWidget convert(PageTemplateWidget source) {
        return source instanceof JpaPageTemplateWidget ? (JpaPageTemplateWidget) source : createEntity(source);
    }

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

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

    public JpaPageTemplateWidget convert(PageTemplateWidget source) {
        return source instanceof JpaPageTemplateWidget ? (JpaPageTemplateWidget) source : createEntity(source);
    }

    private JpaPageTemplateWidget createEntity(PageTemplateWidget source) {
        JpaPageTemplateWidget converted = null;
        if (source != null) {
            converted = manager.find(JpaPageTemplateWidget.class, source.getId());

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

    public JpaPageTemplateWidget convert(PageTemplateWidget source) {
        return source instanceof JpaPageTemplateWidget ? (JpaPageTemplateWidget) source : createEntity(source);
    }

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

TOP

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

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.