Examples of PortletURL


Examples of javax.portlet.PortletURL

        if (publicParameter != null) {
            writer.write("<pre>  getParameter(\"publicParameter\") = " + publicParameter + "</p>");
        }

        PortletURL actionUrl = response.createActionURL();
        String form ="<form method=\"post\" action=\"" + actionUrl + "\">" +
                "<pre>  set(\"publicParameter\") = <input type=\"text\" value=\"\" name=\"newPublicParameter\" />" +
                "<input type=\"submit\" value=\"Set\" /></pre>" +
                "</form>";
        writer.write(form);
View Full Code Here

Examples of javax.portlet.PortletURL

        if (exampleEvent != null) {
            String lastEvent = "<pre>  " + exampleEvent + "</pre>";
            writer.write(lastEvent);
        }

        PortletURL actionUrl = response.createActionURL();
        String form = "<form method=\"post\" action=\"" + actionUrl + "\">" +
                "<pre>  Event key:   <input type=\"text\" value=\"\" name=\"eventKey\" /></pre>" +
                "<pre>  Event value: <input type=\"text\" value=\"\" name=\"eventValue\" /></pre>" +
                "<pre>  <input type=\"submit\" value=\"Set\" /></pre>" +
                "</form>";
View Full Code Here

Examples of javax.portlet.PortletURL

     * @param action
     * @return action URL or null if called outside a MimeRequest (outside a
     *         UIDL request or similar)
     */
    public PortletURL generateActionURL(String action) {
        PortletURL url = null;
        if (response instanceof MimeResponse) {
            url = ((MimeResponse) response).createActionURL();
            url.setParameter("javax.portlet.action", action);
        } else {
            return null;
        }
        return url;
    }
View Full Code Here

Examples of javax.portlet.PortletURL

        if (response instanceof MimeResponse) {
            String actionKey = "" + System.currentTimeMillis();
            while (eventActionDestinationMap.containsKey(actionKey)) {
                actionKey = actionKey + ".";
            }
            PortletURL actionUrl = generateActionURL(actionKey);
            if (actionUrl != null) {
                eventActionDestinationMap.put(actionKey, name);
                eventActionValueMap.put(actionKey, value);
                window.open(new ExternalResource(actionUrl.toString()));
            } else {
                // this should never happen as we already know the response is a
                // MimeResponse
                throw new IllegalStateException(
                        "Portlet events can only be sent from a portlet request");
View Full Code Here

Examples of javax.portlet.PortletURL

        if (response instanceof MimeResponse) {
            String actionKey = "" + System.currentTimeMillis();
            while (sharedParameterActionNameMap.containsKey(actionKey)) {
                actionKey = actionKey + ".";
            }
            PortletURL actionUrl = generateActionURL(actionKey);
            if (actionUrl != null) {
                sharedParameterActionNameMap.put(actionKey, name);
                sharedParameterActionValueMap.put(actionKey, value);
                window.open(new ExternalResource(actionUrl.toString()));
            } else {
                // this should never happen as we already know the response is a
                // MimeResponse
                throw new IllegalStateException(
                        "Shared parameters can only be set from a portlet request");
View Full Code Here

Examples of javax.portlet.PortletURL

     *             (configuration, permissions etc.)
     */
    public void setPortletMode(Window window, PortletMode portletMode)
            throws IllegalStateException, PortletModeException {
        if (response instanceof MimeResponse) {
            PortletURL url = ((MimeResponse) response).createRenderURL();
            url.setPortletMode(portletMode);
            window.open(new ExternalResource(url.toString()));
        } else if (response instanceof StateAwareResponse) {
            ((StateAwareResponse) response).setPortletMode(portletMode);
        } else {
            throw new IllegalStateException(
                    "Portlet mode can only be changed from a portlet request");
View Full Code Here

Examples of javax.portlet.PortletURL

        Map<String, String> config = new LinkedHashMap<String, String>();

        /*
         * 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", "''");
View Full Code Here

Examples of javax.portlet.PortletURL

    private static PortletURL createPortletURL(ServletRequest request,
            String pageURL, boolean actionURL)
    {
        RenderResponse renderResponse = (RenderResponse) request
                .getAttribute("javax.portlet.response");
        PortletURL portletURL;
        if (actionURL)
            portletURL = renderResponse.createActionURL();
        else
            portletURL = renderResponse.createRenderURL();
        if (request instanceof HttpServletRequest)
        {
            String contextPath = ((HttpServletRequest) request)
                    .getContextPath();
            if (pageURL.startsWith(contextPath))
                pageURL = pageURL.substring(contextPath.length());
        }
        if (actionURL)
        {
            portletURL.setParameter(PAGE, pageURL.replaceAll("&amp;","&"));
            String originURL = request.getParameter(PAGE);
            if (originURL != null)
                portletURL.setParameter(ORIGIN, originURL);
        }
        else
        {
            RenderRequest renderRequest = (RenderRequest)request.getAttribute("javax.portlet.request");
            portletURL.setParameter(PAGE+renderRequest.getPortletMode().toString(), pageURL.replaceAll("&amp;","&"));
        }
        return portletURL;
    }
View Full Code Here

Examples of javax.portlet.PortletURL

     * @param actionForward
     * @return
     */   
    public PortletURL getView(String viewName)
    {
        PortletURL url = response.createRenderURL();       
        buildLink(viewName, url);
        return url;
    }
View Full Code Here

Examples of javax.portlet.PortletURL

     * @return
     */
    public PortletURL getLink(String actionForward)
    {
        String forwardName = model.getForward(actionForward);
        PortletURL url = response.createRenderURL();
        buildLink(forwardName, url);
        return url;
    }
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.