Package javax.portlet

Examples of javax.portlet.ResourceURL


    @Override
    public String generateApplicationResourceURL(ApplicationResource resource,
            String mapKey) {
        if (response instanceof MimeResponse) {
            ResourceURL resourceURL = ((MimeResponse) response)
                    .createResourceURL();
            final String filename = resource.getFilename();
            if (filename == null) {
                resourceURL.setResourceID("APP/" + mapKey + "/");
            } else {
                resourceURL.setResourceID("APP/" + mapKey + "/"
                        + urlEncode(filename));
            }
            return resourceURL.toString();
        } else {
            // in a background thread or otherwise outside a request
            // TODO exception ??
            return null;
        }
View Full Code Here


         * for uploads anymore, check if this is needed for some other things
         */
        PortletURL appUri = response.createActionURL();
        config.put("appUri", "'" + appUri.toString() + "'");
        config.put("usePortletURLs", "true");
        ResourceURL uidlUrlBase = response.createResourceURL();
        uidlUrlBase.setResourceID("UIDL");
        config.put("portletUidlURLBase", "'" + uidlUrlBase.toString() + "'");
        config.put("pathInfo", "''");
        config.put("themeUri", "'" + themeURI + "'");

        String versionInfo = "{vaadinVersion:\""
                + AbstractApplicationServlet.VERSION
View Full Code Here

        if (nameToReceiver == null) {
            nameToReceiver = new HashMap<String, StreamVariable>();
            ownerToNameToStreamVariable.put(owner, nameToReceiver);
        }
        nameToReceiver.put(name, value);
        ResourceURL resurl = currentUidlResponse.createResourceURL();
        resurl.setResourceID("UPLOAD");
        resurl.setParameter("name", name);
        resurl.setParameter("rec-owner", getPaintableId((Paintable) owner));
        resurl.setProperty("name", name);
        resurl.setProperty("rec-owner", getPaintableId((Paintable) owner));
        return resurl.toString();
    }
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 (urlType == Bridge.PortletPhase.ACTION_PHASE)
      {
        baseURL = actionURL = mimeResponse.createActionURL();
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 portletURLToString(resource, isStrictXhtmlEncoded);
  }
View Full Code Here

    final String formAction = externalContext.encodeActionURL(viewHandler.getActionURL(facesContext, viewId));
    final String partialAction;
    final boolean portlet = PortletUtils.isPortletApiAvailable() && response instanceof MimeResponse;
    if (portlet) {
      final MimeResponse mimeResponse = (MimeResponse) response;
      final ResourceURL resourceURL = mimeResponse.createResourceURL();
      partialAction = externalContext.encodeResourceURL(resourceURL.toString());
    } else {
      partialAction = null;
    }

    final String contentType = writer.getContentTypeWithCharSet();
View Full Code Here

      path = getQualifiedPath(path);
      if (mimeResponse != null)
      {
        try
        {
          ResourceURL url = mimeResponse.createResourceURL();
          String resourceID = path.toString();
          url.setResourceID(resourceID);
          path = saveLastEncodedUrl(url.toString(), resourceID);
        }
        catch (Exception e)
        {
          throw new RuntimeException(e);
        }
View Full Code Here

    final String formAction = externalContext.encodeActionURL(viewHandler.getActionURL(facesContext, viewId));
    final String partialAction;
    final boolean portlet = PortletUtils.isPortletApiAvailable() && response instanceof MimeResponse;
    if (portlet) {
      final MimeResponse mimeResponse = (MimeResponse) response;
      final ResourceURL resourceURL = mimeResponse.createResourceURL();
      partialAction = externalContext.encodeResourceURL(resourceURL.toString());
    } else {
      partialAction = null;
    }

    final String contentType = writer.getContentTypeWithCharSet();
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.