Package javax.portlet

Examples of javax.portlet.ResourceURL


    public void processRender(WebuiRequestContext context) throws Exception {

        RenderResponse resp = context.getResponse();

        //
        ResourceURL url = resp.createResourceURL();

        // context.getPortalContextPath() + "/captcha?v=" + Calendar.getInstance().getTimeInMillis()

        String random = "&v=" + Calendar.getInstance().getTimeInMillis();

        context.getWriter().write("<div id='" + getId() + "'><img src=\"" + url.toString() + random + "\" alt=\"Captcha image for visual validation\" /><br/>");
        super.processRender(context);
        context.getWriter().write("</div>");
    }
View Full Code Here


    @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 + "/" + filename);
            }
            return resourceURL.toString();
        } else {
            // in a background thread or otherwise outside a request
            return null;
        }
    }
View Full Code Here

                    /*
                     * The application manager needs an URL to the dummy page.
                     * See the PortletCommunicationManager.sendUploadResponse
                     * method for more information.
                     */
                    ResourceURL dummyURL = ((RenderResponse) response)
                            .createResourceURL();
                    dummyURL.setResourceID("DUMMY");
                    applicationManager.dummyURL = dummyURL.toString();
                }

                /* Update browser information from request */
                updateBrowserProperties(applicationContext.getBrowser(),
                        request);
View Full Code Here

         * We need this in order to get uploads to work.
         */
        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

   {
      renderResponse.setContentType("text/html");
      PrintWriter printWriter = renderResponse.getWriter();
      String namespace = "n_" + renderResponse.getNamespace();
      printWriter.print("<p><a href='#' onclick=\"" + namespace + "_remote=" + namespace + "_openRemote('");
      ResourceURL resource = renderResponse.createResourceURL();
      printWriter.print(resource);
      printWriter.print("')\">Open remote control!</a></p>");
   }
View Full Code Here

    public void processRender(WebuiRequestContext context) throws Exception {

        RenderResponse resp = context.getResponse();

        //
        ResourceURL url = resp.createResourceURL();

        // context.getPortalContextPath() + "/captcha?v=" + Calendar.getInstance().getTimeInMillis()

        String random = "&v=" + Calendar.getInstance().getTimeInMillis();

        context.getWriter().write("<div id='" + getId() + "'><img src=\"" + url.toString() + random + "\" /><br/>");
        super.processRender(context);
        context.getWriter().write("</div>");
    }
View Full Code Here

        json.put("label", node.getEncodedResolvedLabel());
        json.put("hasChild", node.getChildrenCount() > 0);
        json.put("isSelected", nodeId.equals(getSelectedNode().getId()));
        json.put("icon", node.getIcon());

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

        if (node.getPageRef() != null) {
            NavigationResource resource = new NavigationResource(node);
            NodeURL url = Util.getPortalRequestContext().createURL(NodeURL.TYPE, resource);
            json.put("actionLink", url.setAjax(false).toString());
View Full Code Here

        }
    }

    @Override
    protected String getServiceUrl(BootstrapContext context) {
        ResourceURL portletResourceUrl = getRenderResponse(context)
                .createResourceURL();
        portletResourceUrl.setResourceID(VaadinPortlet.RESOURCE_URL_ID);
        return portletResourceUrl.toString();
    }
View Full Code Here

                .getResponse();
        VaadinPortletRequest request = (VaadinPortletRequest) context
                .getRequest();
        MimeResponse portletResponse = (MimeResponse) response
                .getPortletResponse();
        ResourceURL resourceURL = portletResponse.createResourceURL();
        resourceURL.setResourceID("v-browserDetails");
        parameters.put("browserDetailsUrl", resourceURL.toString());

        // Always send path info as a query parameter
        parameters
                .put(ApplicationConstants.SERVICE_URL_PATH_AS_PARAMETER, true);
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.