Package org.apache.pluto.driver.core

Examples of org.apache.pluto.driver.core.PortalRequestContext


     * @throws IOException  if an error occurs writing to the response.
     */
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {

        PortalRequestContext portalRequestContext =
            new PortalRequestContext(getServletContext(), request, response);

        PortalURL portalURL = portalRequestContext.getRequestedPortalURL();
        String actionWindowId = portalURL.getActionWindow();

        PortletWindowConfig actionWindowConfig =
            actionWindowId == null
                ? null
View Full Code Here


        DriverConfiguration driverConfig = (DriverConfiguration)
                servletContext.getAttribute(AttributeKeys.DRIVER_CONFIG);

        if (isWindowStateAllowed(driverConfig, state)) {
            // Retrieve the portal environment.
            PortalRequestContext portalEnv = PortalRequestContext.getContext(
                    (HttpServletRequest) pageContext.getRequest());

            PortalURL portalUrl =  portalEnv.createPortalURL();
            portalUrl.setWindowState(evaluatedPortletId, new WindowState(state));

            // Build a string buffer containing the anchor tag
            StringBuffer tag = new StringBuffer();
//            tag.append("<a class=\"" + ToolTips.CSS_CLASS_NAME + "\" href=\"" + portalUrl.toString() + "\">");
View Full Code Here

        ServletContext servletContext = pageContext.getServletContext();
        DriverConfiguration driverConfig = (DriverConfiguration)
                servletContext.getAttribute(AttributeKeys.DRIVER_CONFIG);
       
        // Retrieve the portal environment.
        PortalRequestContext portalEnv = PortalRequestContext.getContext(
                (HttpServletRequest) pageContext.getRequest());       
       
        //find the current mode for use in 'selected' attrib of select option
    PortalURL requestedPortalUrl = portalEnv.getRequestedPortalURL();
        PortletWindowConfig windowConfig =
            PortletWindowConfig.fromId(evaluatedPortletId);
        // Retrieve the portlet container from servlet context.
        PortletContainer container = (PortletContainer)
                servletContext.getAttribute(AttributeKeys.PORTLET_CONTAINER);
       
        // Create the portlet window to render.
        PortletWindow window = null;
       
       
        try
        {
          // If this fails it means that the portlet will be not available.
          // Render Tag will take care of it.
          window = new PortletWindowImpl(container, windowConfig, requestedPortalUrl);
        }
        catch(RuntimeException ex)
        {
            if (LOG.isDebugEnabled()) {
                  LOG.debug("The portlet " + windowConfig.getPortletName() + " is not available. Is already deployed?");
              }
        }
   
        //start the markup
        StringBuffer tag = new StringBuffer();
    
        // Do not render if we don't have a window.
        if(window!=null)
        {
          PortletMode currentMode = requestedPortalUrl.getPortletMode(window.getId().getStringId());


          //        String strCurrentMode = currentMode.toString();       
          //        tag.append("Current mode: " + currentMode.toString());
          tag.append("<form action=\"\" name=\"modeSelectionForm\" style=\"display:inline\"><select onchange=\"self.location=this.options[this.selectedIndex].value\">");
          Set<PortletMode> modeSet = null;
          try {
            modeSet = driverConfig.getSupportedPortletModes(evaluatedPortletId);
          } catch (PortletContainerException e) {
            throw new JspException(e);
          }

          if (modeSet != null) {
            Iterator<PortletMode> i = modeSet.iterator();
            while (i.hasNext()) {
              PortletMode mode = i.next();

              PortalURL portalUrl =  portalEnv.createPortalURL();
              portalUrl.setPortletMode(evaluatedPortletId, mode);

              // Build a string buffer containing the anchor tag
              tag.append("<option value=\"" + portalUrl.toString() + "\"");
              //Add 'selected' attribute for current mode.
View Full Code Here

        DriverConfiguration driverConfig = (DriverConfiguration)
                servletContext.getAttribute(AttributeKeys.DRIVER_CONFIG);

        if (isWindowStateAllowed(driverConfig, state)) {
            // Retrieve the portal environment.
            PortalRequestContext portalEnv = PortalRequestContext.getContext(
                    (HttpServletRequest) pageContext.getRequest());

            PortalURL portalUrl =  portalEnv.createPortalURL();
            portalUrl.setWindowState(evaluatedPortletId, new WindowState(state));

            // Build a string buffer containing the anchor tag
            StringBuffer tag = new StringBuffer();
//            tag.append("<a class=\"" + ToolTips.CSS_CLASS_NAME + "\" href=\"" + portalUrl.toString() + "\">");
View Full Code Here

        DriverConfiguration driverConfig = (DriverConfiguration)
                servletContext.getAttribute(AttributeKeys.DRIVER_CONFIG);

        if (isPortletModeAllowed(driverConfig, portletMode)) {
            // Retrieve the portal environment.
            PortalRequestContext portalEnv = PortalRequestContext.getContext(
                    (HttpServletRequest) pageContext.getRequest());       

            PortalURL portalUrl =  portalEnv.createPortalURL();
            portalUrl.setPortletMode(evaluatedPortletId, new PortletMode(portletMode));

            // Build a string buffer containing the anchor tag
            StringBuffer tag = new StringBuffer();
//            tag.append("<a class=\"" + ToolTips.CSS_CLASS_NAME + "\" href=\"" + portalUrl.toString() + "\">");
View Full Code Here

        if (LOG.isDebugEnabled()) {
            LOG.debug("Rendering Portlet Window: " + windowConfig);
        }
       
        // Retrieve the current portal URL.
        PortalRequestContext portalEnv = PortalRequestContext.getContext(
                (HttpServletRequest) pageContext.getRequest());
        PortalURL portalURL = portalEnv.getRequestedPortalURL();
       
        // Retrieve the portlet container from servlet context.
        PortletContainer container = (PortletContainer)
                servletContext.getAttribute(AttributeKeys.PORTLET_CONTAINER);
       
View Full Code Here

    public boolean doPortletPrepare(HttpServletRequest request, HttpServletResponse response)
        throws IOException, ServletException {

      boolean actionRequestProcessed = false;
     
        PortalRequestContext portalRequestContext =
            new PortalRequestContext(getServletContext(), request, response);

        PortalURL portalURL = portalRequestContext.getRequestedPortalURL();
        String actionWindowId = portalURL.getActionWindow();

        PortletWindowConfig actionWindowConfig =
            actionWindowId == null
                ? null
View Full Code Here

        if ( contentType != "" ) {
            response.setContentType( contentType );
        }

        PortalRequestContext portalRequestContext =
            new PortalRequestContext(getServletContext(), request, response);

        PortalURL portalURL = null;
       
        try {
          portalURL = portalRequestContext.getRequestedPortalURL();
        } catch(Exception ex) {
          String msg = "Cannot handle request for portal URL. Problem: "  + ex.getMessage();
          LOG.error(msg, ex);
          throw new ServletException(msg, ex);
        }
View Full Code Here

                pageContext.getRequest();

        HttpServletResponse response = (HttpServletResponse)
                pageContext.getResponse();

        PortalRequestContext ctx = PortalRequestContext.getContext(request);

        PortalURL portalUrl =  ctx.createPortalURL();

        // Encode window state of the current portlet in the portal URL.
        String portletId = parentTag.getEvaluatedPortletId();
        if (windowState != null) {
            portalUrl.setWindowState(portletId, new WindowState(windowState));
View Full Code Here

public class IsMaximizedTag extends TagSupport {

    private String var;

    public int doStartTag() throws JspException {
        PortalRequestContext portalEnv = PortalRequestContext.getContext(
                (HttpServletRequest) pageContext.getRequest());

        PortalURL portalURL = portalEnv.getRequestedPortalURL();

        // Check if someone else is maximized. If yes, don't show content.
        Map windowStates = portalURL.getWindowStates();
        for (Iterator it = windowStates.values().iterator(); it.hasNext();) {
            WindowState windowState = (WindowState) it.next();
View Full Code Here

TOP

Related Classes of org.apache.pluto.driver.core.PortalRequestContext

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.