Package org.apache.jetspeed.container.state

Examples of org.apache.jetspeed.container.state.NavigationalState


       
            // create a session if not already created, necessary for Tomcat 5
            request.getRequest().getSession(true);
           
            //PortletContainerServices.prepare();
            NavigationalState state = request.getPortalURL().getNavigationalState();
            if (state != null)
            {
                state.sync(request);
            }
           
            PortalURL url = request.getPortalURL();
            PortletWindow actionWindow = url.getNavigationalState().getPortletWindowOfAction();
            if (null == actionWindow)
View Full Code Here


     *         FailedToCreateNavStateException if the nav state could not be
     *         created. Under normal circumstances, this should not happen.
     */
    public NavigationalState create() throws FailedToCreateNavStateException
    {
        NavigationalState state = null;

        try
        {
            if ( navStateCodec == null )
            {
View Full Code Here

    public WindowState getWindowState() throws Exception
    {
        try
        {
            RequestContext context = Jetspeed.getCurrentRequestContext();
            NavigationalState nav = context.getPortalURL().getNavigationalState();
            return nav.getState(windowAccess.getPortletWindow(getCurrentFragment()));
        }
        catch (Exception e)
        {
            handleError(e, e.toString(), getCurrentFragment());
            return null;
View Full Code Here

     * @throws Exception
     */
    public PortletMode getPortletMode() throws Exception
    {
        RequestContext context = Jetspeed.getCurrentRequestContext();
        NavigationalState nav = context.getPortalURL().getNavigationalState();
        try
        {
            return nav.getMode(windowAccess.getPortletWindow(getCurrentFragment()));
        }
        catch (FailedToRetrievePortletWindow e)
        {
            handleError(e, e.toString(), getCurrentFragment());
            return null;
View Full Code Here

       
        context = new JetspeedRequestContext(request, response, config, null );
               
        url = component.createURL(context.getRequest(), context.getCharacterEncoding());
        context.setPortalURL(url);
        NavigationalState nav = url.getNavigationalState();

        // Check that they come out correctly
        assertTrue("window mode is not set", nav.getMode(window).equals(PortletMode.EDIT));
        assertTrue("window state is not set", nav.getState(window).equals(WindowState.MAXIMIZED));
        PortletWindow target = nav.getPortletWindowOfAction();
        assertNotNull("target window is null", target);
        assertEquals("target window should equal window 111", target.getId(), "111");

        PortletWindow maximizedWindow = nav.getMaximizedWindow();
        assertNotNull("maximized window is null", maximizedWindow);
        assertEquals("maximized window should equal window 111", maximizedWindow.getId(), "111");

        Iterator iter = nav.getParameterNames(target);
        int parameterCount = 0;
        assertTrue("There should be one parameter",iter.hasNext());
        while ( iter.hasNext() ) {
            assertEquals("parameter name should equals \"test\"", (String)iter.next(), "test");
            String[] values = nav.getParameterValues(target,"test");
            assertNotNull("parameter name has no values", values);
            assertEquals("parameter test should have 3 values", values.length, 3);
            assertEquals("parameter test[0] should be \"one\"", values[0], "one");
            assertEquals("parameter test[1] should be \"two\"", values[1], "two");
            assertEquals("parameter test[2] should be \"three\"", values[2], "three");
View Full Code Here

       
                     
        ///////////////////////////////////////////////////////////////////////////////////////////////
   
        // handle maximized state
        NavigationalState nav = context.getPortalURL().getNavigationalState();
        PortletWindow window = nav.getMaximizedWindow();
        if (null != window)
        {
            Fragment fragment = page.getFragmentById(window.getId().toString());
            if (fragment != null)
            {
View Full Code Here

        return responseMimeTypes.iterator();
     }

     public PortletMode getPortletMode(PortletWindow portletWindow)
     {
         NavigationalState navState = context.getPortalURL().getNavigationalState();
         return navState.getMode(portletWindow);
     }
View Full Code Here

         return navState.getMode(portletWindow);
     }

     public WindowState getWindowState(PortletWindow portletWindow)
     {
         NavigationalState navState = context.getPortalURL().getNavigationalState();        
         return navState.getState(portletWindow);
     }
View Full Code Here

     */
    public WindowState getWindowState() throws Exception
    {
        try
        {
            NavigationalState nav = getRequestContext().getPortalURL().getNavigationalState();
            return nav.getState(windowAccess.getPortletWindow(getCurrentFragment()));
        }
        catch (Exception e)
        {
            handleError(e, e.toString(), getCurrentFragment());
            return null;
View Full Code Here

     * @throws Exception
     */
    public PortletMode getPortletMode() throws Exception
    {

        NavigationalState nav = getRequestContext().getPortalURL().getNavigationalState();
        try
        {
            return nav.getMode(windowAccess.getPortletWindow(getCurrentFragment()));
        }
        catch (FailedToRetrievePortletWindow e)
        {
            handleError(e, e.toString(), getCurrentFragment());
            return null;
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.container.state.NavigationalState

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.