Package javax.portlet

Examples of javax.portlet.WindowState


        }
        else if (param.equals(Bridge.PORTLET_WINDOWSTATE_PARAMETER))
        {
          try
          {
            actionURL.setWindowState(new WindowState(queryStr.getParameter(param)));
          }
          catch (Exception e)
          {
            ; // do nothing -- just ignore
          }
        }
        else if (param.equals(Bridge.PORTLET_SECURE_PARAMETER))
        {
          try
          {
            actionURL.setSecure(Boolean.getBoolean(queryStr.getParameter(param)));
          }
          catch (Exception e)
          {
            ; // do nothing -- just ignore
          }
        }
        else
        {
          actionURL.setParameter(param, queryStr.getParameter(param));
        }
      }

      // TODO hack to workaround double encoding problem
      url = actionURL.toString();
      url = url.replaceAll("\\&amp\\;", "&");
    }
    else
    { // action - write the viewId to navigational state
      ActionResponse actionResponse = (ActionResponse) getResponse();

      // set request params into navigational states
      Enumeration<String> list = queryStr.getParameterNames();
      while (list.hasMoreElements())
      {
        String param = list.nextElement();
        if (param.equals(Bridge.PORTLET_MODE_PARAMETER))
        {
          try
          {
            actionResponse.setPortletMode(new PortletMode(queryStr.getParameter(param)));
          }
          catch (Exception e)
          {
            //TODO: Ignoring is probably dangerous here as it means that we are
            //      EITHER using exceptions for flow control (which is extreemly
            //      inefficient) or we should log a message saying what the issue
            //      is.  According to the Javadocs an exception is thrown here if the
            //      portlet mode is not allowed or if sendRedirect has already been
            //      called.  In either case we should log an information type message
            //      here.
            ; // do nothing -- just ignore
          }
        }
        else if (param.equals(Bridge.PORTLET_WINDOWSTATE_PARAMETER))
        {
          try
          {
            actionResponse.setWindowState(new WindowState(queryStr.getParameter(param)));
          }
          catch (Exception e)
          {
            ; // do nothing -- just ignore
          }
View Full Code Here


    if (isNonFacesRequest(request, response))
    {
      return doNonFacesDispatch(request, response);
    } else
    {
      WindowState state = request.getWindowState();
      if (!state.equals(WindowState.MINIMIZED))
      {
        doBridgeDispatch(request, response);
      }
      return true;
    }
View Full Code Here

     * Return all default states
     */
    protected Vector getDefaultStates() {
        Vector s = new Vector();

        s.add(new WindowState("normal"));
        s.add(new WindowState("minimized"));
        s.add(new WindowState("maximized"));
       
        return s;
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.pluto.services.information.DynamicInformationProvider#getWindowState(org.apache.pluto.om.window.PortletWindow)
     */
    public WindowState getWindowState(PortletWindow portletWindow) {
        final CopletInstanceData cid = ((PortletEntityImpl)portletWindow.getPortletEntity()).getCopletInstanceData();
        WindowState ws = (WindowState) cid.getAttribute("window-state");
        if ( ws == null ) {
            ws = WindowState.NORMAL;
        }
        return ws;
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.pluto.services.information.DynamicInformationProvider#getPreviousWindowState(org.apache.pluto.om.window.PortletWindow)
     */
    public WindowState getPreviousWindowState(PortletWindow portletWindow) {
        final CopletInstanceData cid = ((PortletEntityImpl)portletWindow.getPortletEntity()).getCopletInstanceData();
        WindowState ws = (WindowState) cid.getAttribute("previous-window-state");       
        return ws;
    }
View Full Code Here

            final PortletWindowImpl impl = (PortletWindowImpl)this.portletWindow;
            final CopletLayout cl = impl.getLayout();
            Event sizingEvent = null;
            if ( cl != null ) {
                final CopletInstanceData cid = cl.getCopletInstanceData();
                WindowState oldState = (WindowState)cid.getAttribute("window-state");
                if ( oldState == null ) {
                    oldState = WindowState.NORMAL;
                }
                if ( this.state != null && !this.state.equals(oldState) ) {
                    if ( oldState.equals(WindowState.MAXIMIZED) ) {
                        sizingEvent = new FullScreenCopletEvent( cid, null );                   
                    } else {
                        if ( this.state.equals(WindowState.MAXIMIZED) ) {
                            sizingEvent = new FullScreenCopletEvent( cid, cl );                                           
                        }
View Full Code Here

            pap = dynProv.getPortletActionProvider(event.getPortletWindow());
            final PortletMode mode = event.getPortletMode();
            if ( mode != null ) {
                pap.changePortletMode(mode);
            }
            final WindowState state = event.getWindowState();
            if ( state != null ) {
                pap.changePortletWindowState(state);
            }
        }
    }
View Full Code Here

     * @see org.apache.pluto.services.information.PortletActionProvider#changePortletWindowState(PortletWindow, WindowState)
     */
    public void changePortletWindowState(WindowState state) {
        if ( state != null ) {
            final CopletInstanceData cid = ((PortletEntityImpl)portletWindow.getPortletEntity()).getCopletInstanceData();
            WindowState ws = (WindowState) cid.getAttribute("window-state");
            if ( (ws == null && !state.equals(PortletMode.VIEW))
                || (ws != null && !ws.equals(state)) ) {
                if ( ws != null ) {
                    cid.setAttribute("previous-window-state", ws);
                }
                cid.setAttribute("window-state", state);
            }
View Full Code Here

            if ( this.environment != null ) {
                InformationProviderService ips = (InformationProviderService) this.environment.getContainerService(InformationProviderService.class);
                DynamicInformationProvider dip = ips.getDynamicProvider((HttpServletRequest) context.getObjectModel().get("portlet-request"));
               
                // Sizing
                WindowState ws = (WindowState)copletInstanceData.getAttribute("window-state");
                if ( ws == null ) {
                    ws = WindowState.NORMAL;
                }
               
                if ( !ws.equals(WindowState.MINIMIZED) && !ws.equals(WindowState.MAXIMIZED)) {
                    PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
                    url.clearParameters();
                    url.setWindowState(WindowState.MINIMIZED);
                   
                    XMLUtils.createElement(contenthandler, "minimize-uri", url.toString());
                }

                if ( !ws.equals(WindowState.NORMAL)) {
                    PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
                    url.clearParameters();
                    url.setWindowState(WindowState.NORMAL);
                    XMLUtils.createElement(contenthandler, "maximize-uri", url.toString());
                }

                if ( !ws.equals(WindowState.MAXIMIZED)) {
                    PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
                    url.clearParameters();
                    url.setWindowState(WindowState.MAXIMIZED);
                    XMLUtils.createElement(contenthandler, "fullscreen-uri", url.toString());
                }
View Full Code Here

            } catch (PortletModeException e) {
                throw new CascadingRuntimeException("Cant set portlet mode '" + value + "'", e);
            }
        } else if (PortletEnvironment.HEADER_WINDOW_STATE.equals(name)) {
            try {
                this.getActionResponse().setWindowState(new WindowState(value));
            } catch (WindowStateException e) {
                throw new CascadingRuntimeException("Cant set window state '" + value + "'", e);
            }
        } else {
            super.addHeader(name, value);
View Full Code Here

TOP

Related Classes of javax.portlet.WindowState

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.