Package org.apache.rave.portal.model

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


   
    private List<Region> createEmptyRegionList(long numberOfRegions) {
        List<Region> regions = new ArrayList<Region>();
        int regionCount;
        for (regionCount = 0; regionCount < numberOfRegions; regionCount++) {
              Region region = new Region();
              regions.add(region);
        }
        return regions;
    }
View Full Code Here


    }

    @Test
    public void deleteWidget_validParams() {
        final long WIDGET_ID = 3;
        expect(pageService.removeWidgetFromPage(WIDGET_ID)).andReturn(new Region());
        replay(pageService);

        RpcResult<Region> result = pageApi.removeWidgetFromPage(WIDGET_ID);
        verify(pageService);
        assertThat(result, is(notNullValue()));
View Full Code Here

        WidgetImpl w = new WidgetImpl();
        w.setId(WIDGET_ID);
        w.setType(Constants.WIDGET_TYPE);
        w.setUrl(VALID_GADGET_URL);
        Region region = new RegionImpl(REGION_ID);
        RegionWidget rw = new RegionWidgetImpl();
        rw.setId(REGION_WIDGET_ID);
        rw.setCollapsed(VALID_COLLAPSED);
        rw.setWidget(w);
        rw.setRegion(region);
View Full Code Here

    @Test
    public void render_null() {
        WidgetImpl w = new WidgetImpl();
        w.setType(Constants.WIDGET_TYPE);
        Region region = new RegionImpl(1L);
        RegionWidget rw = new RegionWidgetImpl();
        rw.setWidget(w);
        rw.setRegion(region);

        final String markup =
View Full Code Here

        replay(userService);
       
        W3CWidget w = new W3CWidget();
        w.setType(Constants.WIDGET_TYPE);
        w.setUrl("http://example.com/widgets/1");
        Region region = new RegionImpl(REGION_ID);
        RegionWidget rw = new RegionWidgetImpl();
        rw.setId(REGION_WIDGET_ID);
        rw.setWidget(w);
        rw.setRegion(region);
View Full Code Here

        region.setRegionWidgets(new ArrayList<RegionWidget>());
        RegionWidget regionWidget = new JpaRegionWidget();
        regionWidget.setId(1L);
        region.getRegionWidgets().add(regionWidget);

        Region saved = repository.save(region);
        manager.flush();

        assertThat(saved.getRegionWidgets().size(), is(equalTo(1)));
        RegionWidget actual = saved.getRegionWidgets().get(0);

        assertThat(actual, is(not(sameInstance(regionWidget))));
        assertThat(actual.getId(), is(equalTo(1L)));
    }
View Full Code Here

    public void save_cascadeOrphan() {
        JpaRegion region = (JpaRegion)repository.get(1L);
        long id = region.getRegionWidgets().get(0).getId();
        region.getRegionWidgets().remove(0);

        Region saved = repository.save(region);
        manager.flush();
        RegionWidget widget = manager.find(JpaRegionWidget.class, id);

        assertThat(saved.getRegionWidgets().size(), is(equalTo(1)));
        assertThat(widget, is(nullValue()));
    }
View Full Code Here

    }

    @Test
    @Rollback(true)
    public void delete_jpaObject() {
        Region r = repository.get(REGION_ID);
        assertThat(r, is(notNullValue()));
        repository.delete(r);
        r = repository.get(REGION_ID);
        assertThat(r, is(nullValue()));
    }
View Full Code Here

    }

    @Test
    @Rollback(true)
    public void delete_implObject() {
        Region r = repository.get(REGION_ID);
        assertThat(r, is(notNullValue()));
        RegionImpl impl = new RegionImpl(r.getId());
        repository.delete(impl);
        r = repository.get(REGION_ID);
        assertThat(r, is(nullValue()));
    }
View Full Code Here

    }   
   
    @Override
    @Transactional
    public RegionWidget moveRegionWidget(long regionWidgetId, int newPosition, long toRegion, long fromRegion) {
        Region target = getFromRepository(toRegion, regionRepository);
        if (toRegion == fromRegion) {
            moveWithinRegion(regionWidgetId, newPosition, target);
        } else {
            moveBetweenRegions(regionWidgetId, newPosition, fromRegion, target);
        }
        target = regionRepository.save(target);
        return findRegionWidgetById(regionWidgetId, target.getRegionWidgets());
    }
View Full Code Here

TOP

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

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.