Examples of PortalURL


Examples of org.apache.pluto.driver.url.PortalURL

    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();
            if (WindowState.MAXIMIZED.equals(windowState)) {
                pageContext.setAttribute(var, Boolean.TRUE);
                break;
View Full Code Here

Examples of org.apache.pluto.driver.url.PortalURL

        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() + "\">");
//            tag.append("<span class=\"" + state + "\"></span>");
//            tag.append("<span class=\"" + ToolTips.CSS_CLASS_NAME + "\">");
//            tag.append(ToolTips.forWindowState(new WindowState(state)));
//            tag.append("</span></a>");
            tag.append("<a title=\"");
            tag.append(ToolTips.forWindowState(new WindowState(state)));
            tag.append("\" ");
            tag.append("href=\"" + portalUrl.toString() + "\">");
            tag.append("<span class=\"" + state + "\">");
            tag.append("</span></a>");

            // Print the mode anchor tag.
            try {
View Full Code Here

Examples of org.apache.pluto.driver.url.PortalURL

            //  allready processed this request. No infinite loops for us!!!!
            if (PortalRequestContext.getContext(req) == null) {
                PortalRequestContext ctx = doPortletPrepare(req, (HttpServletResponse) response);
                LOG.debug("Render Path: " + ctx.getRequestedPortalURL().getRenderPath());
                LOG.debug("Servlet Path: " + ctx.getRequestedPortalURL().getServletPath());
                PortalURL url = ctx.getRequestedPortalURL();
                if (url.getActionWindow() != null) {
                    return;
                }

            }
View Full Code Here

Examples of org.apache.pluto.driver.url.PortalURL

        throws IOException, ServletException {

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

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

        PortletWindowConfig actionWindowConfig =
            actionWindowId == null
                ? null
                : PortletWindowConfig.fromId(actionWindowId);
View Full Code Here

Examples of org.apache.pluto.driver.url.PortalURL

        }

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

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

        PortletWindowConfig actionWindowConfig =
            actionWindowId == null
                ? null
                : PortletWindowConfig.fromId(actionWindowId);

        // Action window config will only exist if there is an action request.
        if (actionWindowConfig != null) {
            PortletWindowImpl portletWindow = new PortletWindowImpl(
                actionWindowConfig, portalURL);
            if (LOG.isDebugEnabled()) {
                LOG.debug("Processing action request for window: "
                    + portletWindow.getId().getStringId());
            }
            try {
                container.doAction(portletWindow, request, response);
            } catch (PortletContainerException ex) {
                throw new ServletException(ex);
            } catch (PortletException ex) {
                throw new ServletException(ex);
            }
            if (LOG.isDebugEnabled()) {
              LOG.debug("Action request processed.\n\n");
            }
        }

        // Otherwise (actionWindowConfig == null), handle the render request.
        else {
          if (LOG.isDebugEnabled()) {
            LOG.debug("Processing render request.");
          }
            PageConfig pageConfig = getPageConfig(portalURL);
            if (pageConfig == null)
            {
                // TODO Shouldn't we throw an exception here?
                LOG.error("PageConfig for render path [" + portalURL.getRenderPath() + "] could not be found.");
            }

            request.setAttribute(AttributeKeys.CURRENT_PAGE, pageConfig);
            String uri = (pageConfig.getUri() != null)
                ? pageConfig.getUri() : DEFAULT_PAGE_URI;
View Full Code Here

Examples of org.apache.pluto.driver.url.PortalURL

        int port = request.getServerPort();
        String contextPath = request.getContextPath();
        String servletName = request.getServletPath();

        // Construct portal URL using info retrieved from servlet request.
        PortalURL portalURL = null;
        if ((request.isSecure() && port != 443)
            || (!request.isSecure() && port != 80)) {
          portalURL = new PortalURLImpl(protocol, server, port, contextPath, servletName);
        } else {
          portalURL = new PortalURLImpl(protocol, server, contextPath, servletName);
        }

        String pathInfo = request.getPathInfo();
        if (pathInfo == null) {
            return portalURL;
        }

        if (LOG.isDebugEnabled()) {
            LOG.debug("Parsing request pathInfo: " + pathInfo);
        }
        StringBuffer renderPath = new StringBuffer();
        StringTokenizer st = new StringTokenizer(pathInfo, "/", false);
        while (st.hasMoreTokens()) {

          String token = st.nextToken();

          // Part of the render path: append to renderPath.
          if (!token.startsWith(PREFIX)) {
//            renderPath.append(token);
            //Fix for PLUTO-243
            renderPath.append('/').append(token);
          }
          // Action window definition: portalURL.setActionWindow().
          else if (token.startsWith(PREFIX + ACTION)) {
            portalURL.setActionWindow(decodeControlParameter(token)[0]);
          }
          // Window state definition: portalURL.setWindowState().
          else if (token.startsWith(PREFIX + WINDOW_STATE)) {
            String[] decoded = decodeControlParameter(token);
            portalURL.setWindowState(decoded[0], new WindowState(decoded[1]));
          }
          // Portlet mode definition: portalURL.setPortletMode().
          else if (token.startsWith(PREFIX + PORTLET_MODE)) {
            String[] decoded = decodeControlParameter(token);
            portalURL.setPortletMode(decoded[0], new PortletMode(decoded[1]));
          }
          // Portal URL parameter: portalURL.addParameter().
          else {
            String value = null;
            if (st.hasMoreTokens()) {
              value = st.nextToken();
            }
            portalURL.addParameter(decodeParameter(token, value));
          }
        }
        if (renderPath.length() > 0) {
            portalURL.setRenderPath(renderPath.toString());
        }

        // Return the portal URL.
        return portalURL;
    }
View Full Code Here

Examples of org.apache.pluto.driver.url.PortalURL

        String contextPath = request.getContextPath();
        String servletName = request.getServletPath();

        // Construct portal URL using info retrieved from servlet request.
        PortalURL portalURL =  new RelativePortalURLImpl(contextPath, servletName, this);

        // Support added for filter.  Should we seperate into a different impl?
        String pathInfo = request.getPathInfo();
        if (pathInfo == null) {
            if((servletName.indexOf(".jsp") != -1) && !servletName.endsWith(".jsp")) {
                int idx = servletName.indexOf(".jsp")+".jsp".length();
                pathInfo = servletName.substring(idx);
                servletName = servletName.substring(0, idx);
                portalURL = new RelativePortalURLImpl(contextPath, servletName, this);
            } else {
                return portalURL;
            }
        }

        if (LOG.isDebugEnabled()) {
            LOG.debug("Parsing request pathInfo: " + pathInfo);
        }
        StringBuffer renderPath = new StringBuffer();
        StringTokenizer st = new StringTokenizer(pathInfo, "/", false);
        while (st.hasMoreTokens()) {

            String token = st.nextToken();

            // Part of the render path: append to renderPath.
            if (!token.startsWith(PREFIX)) {
//              renderPath.append(token);
                //Fix for PLUTO-243
                renderPath.append('/').append(token);
            }
            // Action window definition: portalURL.setActionWindow().
            else if (token.startsWith(PREFIX + ACTION)) {
                portalURL.setActionWindow(decodeControlParameter(token)[0]);
            }
            // Window state definition: portalURL.setWindowState().
            else if (token.startsWith(PREFIX + WINDOW_STATE)) {
                String[] decoded = decodeControlParameter(token);
                portalURL.setWindowState(decoded[0], new WindowState(decoded[1]));
            }
            // Portlet mode definition: portalURL.setPortletMode().
            else if (token.startsWith(PREFIX + PORTLET_MODE)) {
                String[] decoded = decodeControlParameter(token);
                portalURL.setPortletMode(decoded[0], new PortletMode(decoded[1]));
            }
            // Portal URL parameter: portalURL.addParameter().
            else {
                String value = null;
                if (st.hasMoreTokens()) {
                    value = st.nextToken();
                }

                // Defect PLUTO-361
                // ADDED
                PortalURLParameter param = decodeParameter( token, value );
                if( param != null )
                {
                    portalURL.addParameter( param );
                }
                // REMOVED
                // portalURL.addParameter(decodeParameter(token, value));
            }
        }
        if (renderPath.length() > 0) {
            portalURL.setRenderPath(renderPath.toString());
        }

        // Return the portal URL.
        return portalURL;
    }
View Full Code Here

Examples of org.apache.pluto.portalImpl.core.PortalURL

        PortalEnvironment env =
            new PortalEnvironment(servletRequest,
                                  servletResponse,
                                  getServletConfig());

        PortalURL currentURL = env.getRequestedPortalURL();
        PortalControlParameter control = new PortalControlParameter(currentURL);
        PortletWindow actionWindow = control.getPortletWindowOfAction();
        if (actionWindow!=null)
        {
            try {
View Full Code Here

Examples of org.apache.pluto.portalImpl.core.PortalURL

          throw new java.lang.InstantiationException("bean fragment not found within scope");
        }
      }
      out.write("\n<!-- inside PageFragment -->\n");

    PortalURL url = PortalEnvironment.getPortalEnvironment(request).getRequestedPortalURL();
    if (url.isPartOfGlobalNavigation(fragment.getId()))
    {
        Iterator childIterator = fragment.getChildFragments().iterator();
        while (childIterator.hasNext())
        {
            Fragment subfragment = (Fragment)childIterator.next();
View Full Code Here

Examples of org.apache.pluto.portalImpl.core.PortalURL

      out.print(request.getContextPath());
      out.write("/images/spacer.gif\" width=\"1\" height=\"1\"></td>\n                <td class=\"CollapsedRight\"><img src=\"");
      out.print(request.getContextPath());
      out.write("/images/spacer.gif\" width=\"1\" height=\"1\"></td> \n              </tr>\n\t\t\t\t\t\t</table></div></td></tr>\n");

    PortalURL url = PortalEnvironment.getPortalEnvironment(request).getRequestedPortalURL();
    NavigationTreeBean[] tree = fragment.getNavigationView(url);
    String GIF = ".gif";
    String DEFAULT_GIF = "ico_doc_16x16.gif";

    // Aaron's code -- to force the navigation tree to render fully expanded, and not offer links to non-leaf nodes
    //                 todo this is pretty bad and should be replaced by a subclass of TabNavigation
    //                 see http://svn.apache.org/repos/asf/portals/pluto/trunk/portal/src/java/org/apache/pluto/portalImpl/aggregation/navigation/
    java.util.List list = new java.util.ArrayList();
    java.util.Stack stack = new java.util.Stack();
    Navigation root = fragment.getRootNavigation();
    java.util.List childList = (java.util.List)root.getChildren();
    java.util.Map map = new java.util.HashMap();
    for(int i=childList.size()-1; i>=0; i--) {
        stack.push(childList.get(i));
        map.put(stack.peek(), new Integer(0));
    }
    while(!stack.isEmpty()) {
        Navigation nav = (Navigation) stack.pop();
        Integer depth = (Integer) map.get(nav);
        list.add(new NavigationTreeBean(nav, nav.getChildren().size() > 0 || url.isPartOfGlobalNavigation(nav.getLinkedFragment().getId()), depth.intValue()));
        childList = (java.util.List)nav.getChildren();
        for(int i=childList.size()-1; i>=0; i--) {
            stack.push(childList.get(i));
            map.put(stack.peek(), new Integer(depth.intValue()+1));
        }
    }
    tree = (NavigationTreeBean[]) list.toArray(new NavigationTreeBean[list.size()]);
    // End Aaron's Code

    for (int i=0; i<tree.length; i++) {
            Navigation nav = tree[i].navigation;
            String imageName = nav.getDescription();
            int index = imageName.indexOf(" ");
            if ((index == -1) || !imageName.substring(index-4, index).equals(GIF)) {
               imageName = DEFAULT_GIF;
            } else {
               imageName = imageName.substring(0,index);
            }

            boolean partOfNav = tree[i].partOfGlobalNav;

            if (tree[i].depth>0)
            {

      out.write("\n\t\t\t\t\t\t\t\t<tr><td><div class=\"Subselection\"><table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"0\"> \n                <tr>\n                  <td class=\"Left\">&nbsp;</td> \n                  <td class=\"Indent\">&nbsp;</td> \n                  <td class=\"Middle\">\n");

              for (int k=0; k<tree[i].depth; k++)
              {

      out.write("\n  \t\t\t\t\t\t\t&nbsp;&nbsp;&nbsp;\n");

              }
                if (!partOfNav)
                {

      out.write("\n                    <a href=\"");
      out.print(new PortalURL(request, nav.getLinkedFragment()).toString());
      out.write("\"><img border=\"0\" src=\"");
      out.print(request.getContextPath());
      out.write("/images/");
      out.print(imageName);
      out.write("\">&nbsp;");
      out.print(nav.getTitle());
      out.write("</a>\n");

                }
                else
                {

      out.write("                  <img border=\"0\" src=\"");
      out.print(request.getContextPath());
      out.write("/images/");
      out.print(imageName);
      out.write("\">&nbsp;");
      out.print(nav.getTitle());
      out.write('\n');

                }

      out.write("\n                  </td> \n                  <td class=\"Right\">&nbsp;</td> \n                </tr> \n\t\t\t\t\t\t\t\t</table></div></td></tr>\n");

            }
            else
            {

      out.write("\t\t\t\t\t\t\n\t\t\n  \t\t\t\t\t\t<tr><td><div class=\"Selection\"><table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"0\">\n              <tr>\n\t\t\t\t\t\t\t  <td class=\"CollapsedLeft\">&nbsp;</td>\n\t\t\t\t\t\t\t\t<td class=\"Indent\">&nbsp;</td>\n\t\t\t\t\t\t\t  <td class=\"TopMiddle\">\n");

                if (!partOfNav)
                {

      out.write("                  <a href=\"");
      out.print(new PortalURL(request, nav.getLinkedFragment()).toString());
      out.write("\"><img border=\"0\" src=\"");
      out.print(request.getContextPath());
      out.write("/images/");
      out.print(imageName);
      out.write("\">&nbsp;");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.