Package org.apache.rave.portal.model

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


    public void updatePage_removeRegion_moveWidgetToNonEmptyColumn() {
        String newName = "new page name";
        String layoutName = "layout name";
       
       
        RegionWidget widget = createStrictMock(RegionWidget.class);
        expect(widget.getRenderOrder()).andReturn(0).anyTimes();
        replay(widget);
        List<RegionWidget> newLastWidgetColumn = new ArrayList<RegionWidget>();
        newLastWidgetColumn.add(widget);
       
        List<Region> regions = new ArrayList<Region>();
        Region region = createStrictMock(Region.class);
        expect(region.getRegionWidgets()).andReturn(newLastWidgetColumn).times(2);
        expect(region.getRenderOrder()).andReturn(1);
        replay(region);
        regions.add(region);
       
       
        widget = createStrictMock(RegionWidget.class);
        widget.setRegion(region);
        widget.setRenderOrder(1);
        expect(widget.getRenderOrder()).andReturn(1).anyTimes();
        replay(widget);
        List<RegionWidget> movedWidgets = new ArrayList<RegionWidget>();
        movedWidgets.add(widget);
       
        Region deletedRegion = createStrictMock(Region.class);
View Full Code Here


       
    @Test
    public void updateRegionWidgetCollapsedStatus() {
        final boolean COLLAPSED = true;      
       
        RegionWidget expectedRegionWidget = new RegionWidgetImpl(VALID_REGION_WIDGET_ID);
        expectedRegionWidget.setCollapsed(COLLAPSED);

        expect(regionWidgetService.saveRegionWidgetCollapsedState(VALID_REGION_WIDGET_ID, COLLAPSED)).andReturn(expectedRegionWidget);
        replay(regionWidgetService);
        RegionWidget result = regionWidgetApi.updateRegionWidgetCollapsedStatus(VALID_REGION_WIDGET_ID, COLLAPSED);
        verify(regionWidgetService);
       
        assertThat(result, sameInstance(expectedRegionWidget));
    }
View Full Code Here

        tag.setPageContext(pageContext);
    }

    @Test
    public void doStartTag_valid() throws IOException, JspException {
        RegionWidget regionWidget = new RegionWidgetImpl();
        WidgetImpl widget = new WidgetImpl();
        regionWidget.setWidget(widget);
        widget.setType(WIDGET_TYPE);

        Set<String> strings = new HashSet<String>();
        strings.add(WIDGET_TYPE);
View Full Code Here


    @Test(expected = JspException.class)
    public void doStartTag_IOException() throws JspException, IOException {

        RegionWidget regionWidget = new RegionWidgetImpl();
        WidgetImpl widget = new WidgetImpl();
        regionWidget.setWidget(widget);
        widget.setType("INVALID");

        Set<String> strings = new HashSet<String>();
        strings.add(WIDGET_TYPE);
View Full Code Here

    @Test(expected = JspException.class)
    public void doStartTag_unsupportedWidget() throws JspException {
        replay(pageContext);

        RegionWidget regionWidget = new RegionWidgetImpl();
        Region region = new RegionImpl(25L);
        WidgetImpl widget = new WidgetImpl();
        regionWidget.setWidget(widget);
        regionWidget.setRegion(region);
        widget.setType("INVALID");

        Set<String> strings = new HashSet<String>();
        strings.add(WIDGET_TYPE);
View Full Code Here

        widget.setId(8L);
        widget.setType(WIDGET_TYPE);
        widget.setDisableRendering(true);
        widget.setDisableRenderingMessage(DISABLED_WIDGET_MESSAGE);

        RegionWidget regionWidget = new RegionWidgetImpl();
        regionWidget.setId(99L);
        regionWidget.setWidget(widget);
        regionWidget.setRegion(new RegionImpl(2L));

        Set<String> strings = new HashSet<String>();
        strings.add(WIDGET_TYPE);

        expect(service.getSupportedWidgetTypes()).andReturn(strings);
View Full Code Here

        verify(writer);
    }

    @Test
    public void getRegionWidget() throws IOException, JspException {
        RegionWidget regionWidget = new RegionWidgetImpl();
        tag.setRegionWidget(regionWidget);
        assertThat(tag.getRegionWidget(), sameInstance(regionWidget));
    }
View Full Code Here

    this.regionWidgetService = regionWidgetService;
  }

    @RequestMapping(value = {"/api/rest/regionwidget/{regionWidgetId}"}, method = RequestMethod.GET)
    public String  viewRegionWidget(Model model, @PathVariable Long regionWidgetId){
      RegionWidget rw = regionWidgetService.getRegionWidget(regionWidgetId);
        model.addAttribute(ModelKeys.REGION_WIDGET, rw);
      return ViewNames.REGION_WIDGET;
    }
View Full Code Here

        validWidget = new Widget(1L, "http://dummy.apache.org/widgets/widget.xml");
       
        targetRegion = new Region();
        targetRegion.setId(2L);
        targetRegion.setRegionWidgets(new ArrayList<RegionWidget>());
        targetRegion.getRegionWidgets().add(new RegionWidget(1L, validWidget, targetRegion, 0));
        targetRegion.getRegionWidgets().add(new RegionWidget(2L, validWidget, targetRegion, 1));
        targetRegion.getRegionWidgets().add(new RegionWidget(3L, validWidget, targetRegion, 2));

        originalRegion = new Region();
        originalRegion.setId(1L);
        originalRegion.setRegionWidgets(new ArrayList<RegionWidget>());
        originalRegion.getRegionWidgets().add(new RegionWidget(4L, validWidget, targetRegion, 0));
        originalRegion.getRegionWidgets().add(new RegionWidget(5L, validWidget, targetRegion, 1));
        originalRegion.getRegionWidgets().add(new RegionWidget(6L, validWidget, targetRegion, 2));
       
        user = new User();
        user.setId(1L);
        user.setUsername("acarlucci");
       
View Full Code Here

    @Test
    public void moveRegionWidget_validMiddle() {
        final int newPosition = 0;
        createMoveBetweenRegionsExpectations();

        RegionWidget widget = pageService.moveRegionWidget(REGION_WIDGET_ID, newPosition, TO_REGION_ID, FROM_REGION_ID);

        verify(regionRepository);
        verifyPositions(newPosition, widget, false);
    }
View Full Code Here

TOP

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

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.