Package javax.portlet

Examples of javax.portlet.ResourceURL


    @Override
    protected void doView(RenderRequest req, RenderResponse resp) throws PortletException, IOException {
        resp.setContentType("text/html");
        PrintWriter writer = resp.getWriter();
        Locale current = req.getLocale();
        ResourceURL resource = resp.createResourceURL();
        resource.setCacheability(ResourceURL.PAGE);
        String namespace = "n_" + resp.getNamespace();
        String remoteWindowName = namespace + "_remote";

        writer.print("<script type='text/javascript'>" + "var " + remoteWindowName + "; function " + namespace + "_popup(url){"
                + "window.name='" + namespace + "_parent';" + "window.open(url, '" + remoteWindowName
View Full Code Here


      // the response
      // (interaction
      // state)
      MimeResponse mimeResponse = (MimeResponse) getResponse();
      PortletURL actionURL = null;
      ResourceURL resourceURL = null;
      BaseURL baseURL = null;
      // Non-JSF actions are renderURLs as we merely dispatch to them
      if (nonFacesAction)
      {
        if (isPortletURL && urlType == Bridge.PortletPhase.ACTION_PHASE)
View Full Code Here

    }
   

    // Encode the URL
   
    ResourceURL resource = ((MimeResponse) mPortletResponse).createResourceURL();
    resource.setResourceID(path);
   
    // Walk through the queryStr Params and add as resourceParams
    // remove any attempt to set Mode/WindowState/etc. as
    // not feasible here
    // Add parameters so they don't get lost
    Enumeration<String> list = queryStr.getParameterNames();
    while (list.hasMoreElements())
    {
      String param = list.nextElement().toString();
      if (param.equals(Bridge.PORTLET_MODE_PARAMETER))
      {
        // do nothing -- just ignore -- can't encode in a resourceURL
      }
      else if (param.equals(Bridge.PORTLET_WINDOWSTATE_PARAMETER))
      {
        // do nothing -- just ignore -- can't encode in a resourceURL
      }
      else if (param.equals(Bridge.PORTLET_SECURE_PARAMETER))
      {
        try
        {
          resource.setSecure(Boolean.getBoolean(queryStr.getParameter(param)));
        }
        catch (Exception e)
        {
          ; // do nothing -- just ignore
        }
      }
      else
      {
        resource.setParameter(param, queryStr.getParameter(param));
      }
    }

    return resource.toString().replaceAll("\\&amp\\;", "&");
  }
View Full Code Here

        PortletResponse portletResponse = (PortletResponse) pageContext.getRequest()
            .getAttribute(Constants.PORTLET_RESPONSE);
       
        if (portletResponse != null) {
         
          ResourceURL resourceURL = createResourceURL(portletResponse);
                
            if(id != null){
              resourceURL.setResourceID(id);
            }

            if(cachability != null){
              try{
                resourceURL.setCacheability(cachability);
              }
              catch(IllegalArgumentException e){
                throw new JspException(e);
              }
              catch(IllegalStateException e){
View Full Code Here

   * @param portletResponse
   * @return a resourceURL
   * @throws JspException
   */
  protected ResourceURL createResourceURL(PortletResponse portletResponse) throws JspException{
    ResourceURL result = null;
    if(portletResponse instanceof RenderResponse){
        result = ((RenderResponse)portletResponse).createResourceURL()
      }
      else if(portletResponse instanceof ResourceResponse){
        result = ((ResourceResponse)portletResponse).createResourceURL();
View Full Code Here

      // the response
      // (interaction
      // state)
      MimeResponse mimeResponse = (MimeResponse) getResponse();
      PortletURL actionURL = null;
      ResourceURL resourceURL = null;
      BaseURL baseURL = null;
      // Non-JSF actions are renderURLs as we merely dispatch to them
      if (nonFacesAction)
      {
        if (isPortletURL && urlType == Bridge.PortletPhase.ACTION_PHASE)
View Full Code Here

    }
   

    // Encode the URL
   
    ResourceURL resource = ((MimeResponse) mPortletResponse).createResourceURL();
    resource.setResourceID(path);
   
    // Walk through the queryStr Params and add as resourceParams
    // remove any attempt to set Mode/WindowState/etc. as
    // not feasible here
    // Add parameters so they don't get lost
    Enumeration<String> list = queryStr.getParameterNames();
    while (list.hasMoreElements())
    {
      String param = list.nextElement().toString();
      if (param.equals(Bridge.PORTLET_MODE_PARAMETER))
      {
        // do nothing -- just ignore -- can't encode in a resourceURL
      }
      else if (param.equals(Bridge.PORTLET_WINDOWSTATE_PARAMETER))
      {
        // do nothing -- just ignore -- can't encode in a resourceURL
      }
      else if (param.equals(Bridge.PORTLET_SECURE_PARAMETER))
      {
        try
        {
          resource.setSecure(Boolean.getBoolean(queryStr.getParameter(param)));
        }
        catch (Exception e)
        {
          ; // do nothing -- just ignore
        }
      }
      else
      {
        resource.setParameter(param, queryStr.getParameter(param));
      }
    }

    return resource.toString().replaceAll("\\&amp\\;", "&");
  }
View Full Code Here

    /** . */
    private static String[] behaviors = { HTML, EXCEPTION, NOT_FOUND, NO_OP };

    @Override
    protected void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
        ResourceURL url = response.createResourceURL();
        response.setContentType("text/html");
        PrintWriter writer = response.getWriter();
        writer.print("<p>This portlet shows how a resource serving portlet can modify the response</p>");
        writer.print("<ul>");
        for (int i = 0; i < msg.length; i++) {
            url.setParameter("behavior", behaviors[i]);
            writer.print("<li><a href='" + url + "'>" + msg[i] + "</a></li>");
        }
        writer.print("</ul>");
    }
View Full Code Here

        UserNode selectedNode = Util.getUIPortal().getNavPath();
        json.put("isSelected", nodeId.equals(selectedNode.getId()));
        json.put("icon", node.getIcon());

        ResourceURL rsURL = res.createResourceURL();
        rsURL.setResourceID(node.getURI());
        json.put("getNodeURL", rsURL.toString());

        if (node.getPageRef() != null) {
            NavigationResource resource = new NavigationResource(node);
            NodeURL url = Util.getPortalRequestContext().createURL(NodeURL.TYPE, resource);
            url.setAjax(isUseAjax());
View Full Code Here

        json.put("label", node.getEncodedResolvedLabel());
        json.put("hasChild", tnode.hasChild());
        json.put("isExpanded", tnode.isExpanded());
        json.put("collapseURL", uiPortalNavigation.url("CollapseNode", nodeId));

        ResourceURL rsURL = res.createResourceURL();
        rsURL.setResourceID(nodeId);
        json.put("getNodeURL", rsURL.toString());

        if (node.getPageRef() != null) {
            NavigationResource resource = new NavigationResource(node);
            NodeURL url = Util.getPortalRequestContext().createURL(NodeURL.TYPE, resource);
            url.setAjax(isUseAjax());
View Full Code Here

TOP

Related Classes of javax.portlet.ResourceURL

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.