Package org.apache.jetspeed.om.page.psml

Examples of org.apache.jetspeed.om.page.psml.FragmentImpl


    /* (non-Javadoc)
     * @see org.apache.jetspeed.aggregator.Aggregator#build(org.apache.jetspeed.request.RequestContext)
     */
    public void build(RequestContext context) throws JetspeedException, IOException
    {
        Fragment fragment = new FragmentImpl(); // TODO: fragment factory
        fragment.setType(Fragment.PORTLET);
        fragment.setName(context.getRequestParameter(PortalReservedParameters.PORTLET));
        String entity = context.getRequestParameter(PortalReservedParameters.PORTLET_ENTITY);
        if (entity == null)
        {
            entity = (String)context.getAttribute(PortalReservedParameters.PORTLET_ENTITY);         
        }
        fragment.setId(entity)
        
        String decorator = fragment.getDecorator();
        if( decorator == null)
        {
           // decorator = context.getPage().getDefaultDecorator(fragment.getType());
            log.debug("No sepecific decorator portlet so using page default: "+decorator);
        }
       

        ContentDispatcher dispatcher = renderer.getDispatcher(context, false);
        renderer.renderNow(fragment, context);
//       dispatcher.include(fragment);
        context.getResponse().getWriter().write(fragment.getRenderedContent());
       
    }
View Full Code Here


        assertEquals(f2, testFragment);
    }

    public void testColumnLimitExceeded() throws Exception
    {
        FragmentImpl f1 = new FragmentImpl();
        f1.setId("f1");
        f1.setLayoutRow(0);
        f1.setLayoutColumn(5);

        ColumnLayout layout = new ColumnLayout(3, "test", null);
        layout.addFragment(f1);

        // Exceeded columns just get dumped into the last column
View Full Code Here

        assertEquals(f5, layout.getFragmentAt(new LayoutCoordinate(0, 0)));
        assertEquals(f6, layout.getFragmentAt(new LayoutCoordinate(0, 2)));

        // This is a test to make sure the next row pointer is being decremented
        // correctly
        FragmentImpl f7 = new FragmentImpl();
        f7.setId("f7");
        f7.setName("test");
        f7.setLayoutRow(0);
        f7.setLayoutColumn(1);

        listenerMock.reset();
        LayoutCoordinate coordinate = new LayoutCoordinate(1, 0);
        LayoutEvent event = new LayoutEvent(LayoutEvent.ADDED, f7, coordinate, coordinate);
        listenerMock.expects(once()).method("handleEvent").with(eq(event));
View Full Code Here

        assertEquals(f6, layout.getFragmentAt(new LayoutCoordinate(1, 2)));
    }

    protected void setUp() throws Exception
    {
        f1 = new FragmentImpl();
        f1.setId("f1");
        f1.setName("test");
        f1.setLayoutRow(0);
        f1.setLayoutColumn(0);

        f2 = new FragmentImpl();
        f2.setId("f2");
        f2.setName("test");
        f2.setLayoutRow(1);
        f2.setLayoutColumn(0);

        f3 = new FragmentImpl();
        f3.setId("f3");
        f3.setName("test");
        f3.setLayoutRow(2);
        f3.setLayoutColumn(0);
       
        f4 = new FragmentImpl();
        f4.setId("f4");
        f4.setName("test");
        f4.setLayoutRow(0);
        f4.setLayoutColumn(1);
       
        f5 = new FragmentImpl();
        f5.setId("f5");
        f5.setName("test");
        f5.setLayoutRow(1);
        f5.setLayoutColumn(1);

        f6 = new FragmentImpl();
        f6.setId("f6");
        f6.setName("test");
        f6.setLayoutRow(2);
        f6.setLayoutColumn(1);
       
        f8 = new FragmentImpl();
        f8.setId("f8");
        f8.setName("test");
        f8.setLayoutRow(1);
        f8.setLayoutColumn(2);
View Full Code Here

        assertEquals("none", layout.getColumnFloat(3));
    }

    public void testSameRowSameColumn() throws Exception
    {
        FragmentImpl f1 = new FragmentImpl();
        f1.setId("f1");
        f1.setName("test");
        f1.setLayoutRow(0);
        f1.setLayoutColumn(0);

        FragmentImpl f2 = new FragmentImpl();
        f2.setId("f2");
        f2.setName("test");
        f2.setLayoutRow(0);
        f2.setLayoutColumn(0);

        ColumnLayout layout = new ColumnLayout(3, "test", null);
        layout.addFragment(f1);
        layout.addFragment(f2);
View Full Code Here

    }

    public void testColumnNotSet() throws Exception
    {
        FragmentImpl f1 = new FragmentImpl();
        f1.setId("f1");
        f1.setName("test");
        f1.setLayoutRow(0);
        f1.setLayoutColumn(0);

        FragmentImpl f2 = new FragmentImpl();
        f2.setId("f2");
        f2.setName("test");
        f2.setLayoutRow(0);

        ColumnLayout layout = new ColumnLayout(3, "test", null);
        layout.addFragment(f1);
        layout.addFragment(f2);
View Full Code Here

        assertNotNull(layout.getLastColumn());
    }

    public void testRowNotSet() throws Exception
    {
        FragmentImpl f1 = new FragmentImpl();
        f1.setId("f1");
        f1.setName("test");
        f1.setLayoutRow(0);
        f1.setLayoutColumn(0);

        FragmentImpl f2 = new FragmentImpl();
        f2.setId("f2");
        f2.setName("test");
        f2.setLayoutColumn(0);

        ColumnLayout layout = new ColumnLayout(3, "test", null);
        layout.addFragment(f1);
        layout.addFragment(f2);
View Full Code Here

     * @return fragment
     */
    public Fragment newFragment()
    {
        // FragmentImpl requires generated ids
        FragmentImpl fragment = (FragmentImpl)super.newFragment();
        fragment.setId(generator.getNextPeid());
        return fragment;
    }
View Full Code Here

    }

    public Fragment newPortletFragment()
    {
        // FragmentImpl requires generated ids
        FragmentImpl fragment = (FragmentImpl)super.newFragment();
        fragment.setType(Fragment.PORTLET);
        fragment.setId(generator.getNextPeid());
        return fragment;
    }
View Full Code Here

        assertEquals("none", layout.getColumnFloat(3));
    }

    public void testSameRowSameColumn() throws Exception
    {
        FragmentImpl f1 = new FragmentImpl();
        f1.setId("f1");
        f1.setName("test");
        f1.setLayoutRow(0);
        f1.setLayoutColumn(0);

        FragmentImpl f2 = new FragmentImpl();
        f2.setId("f2");
        f2.setName("test");
        f2.setLayoutRow(0);
        f2.setLayoutColumn(0);

        ColumnLayout layout = new ColumnLayout(3, "test", null);
        layout.addFragment(f1);
        layout.addFragment(f2);
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.page.psml.FragmentImpl

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.