public String getActionURL(FacesContext context, String viewId) { HttpServletRequest req = (HttpServletRequest) context.getExternalContext().getRequest(); if (req.getAttribute(URL_EXT) == null) { // If the request didn't go through JsfTool (the JSF is accessed directly from its webapp, // not as a Sakai tool), then don't do Sakai's special action URL handling. return m_wrapped.getActionURL(context, viewId); } // get the path that got us here (from the tool's point of view) String path = viewId; // modify the path to remove things that were added by Sakai navigation to get here (prefix path, suffix extension) String prefix = (String) req.getAttribute(URL_PATH); if ((prefix != null) && path.startsWith(prefix)) path = path.substring(prefix.length()); Object extensions = req.getAttribute(URL_EXT); String [] exts = extensions instanceof String?new String[]{(String)extensions}:(String[])extensions; for (String ext:exts) { if ((ext != null) && path.endsWith(ext)) path = path.substring(0, path.length() - ext.length()); } // make sure the URL processing uses the Sakai, not Native the request object so we can get at the URL information setup by the invoker req.removeAttribute(Tool.NATIVE_URL); // form our return URL String rv = Web.returnUrl(req, path); // restore (if needed) req.setAttribute(Tool.NATIVE_URL, Tool.NATIVE_URL); log.debug("action url for view: " + viewId + " = " + rv); return rv; }
public String getActionURL(FacesContext context, String viewId) { HttpServletRequest req = (HttpServletRequest) context.getExternalContext().getRequest(); if (req.getAttribute(URL_EXT) == null) { // If the request didn't go through JsfTool (the JSF is accessed directly from its webapp, // not as a Sakai tool), then don't do Sakai's special action URL handling. return m_wrapped.getActionURL(context, viewId); } // get the path that got us here (from the tool's point of view) String path = viewId; // modify the path to remove things that were added by Sakai navigation to get here (prefix path, suffix extension) String prefix = (String) req.getAttribute(URL_PATH); if ((prefix != null) && path.startsWith(prefix)) path = path.substring(prefix.length()); Object extensions = req.getAttribute(URL_EXT); String [] exts = extensions instanceof String?new String[]{(String)extensions}:(String[])extensions; for (String ext:exts) { if ((ext != null) && path.endsWith(ext)) path = path.substring(0, path.length() - ext.length()); } // make sure the URL processing uses the Sakai, not Native the request object so we can get at the URL information setup by the invoker req.removeAttribute(Tool.NATIVE_URL); // form our return URL String rv = Web.returnUrl(req, path); // restore (if needed) req.setAttribute(Tool.NATIVE_URL, Tool.NATIVE_URL); log.debug("action url for view: " + viewId + " = " + rv); return rv; }
String rv = Web.returnUrl(req, path);
/** * Get a new ActionURL. * * @param req * The current request. * @return A new ActionURL. */ protected ActionURL getActionURL(HttpServletRequest request) { ActionURL a = new ActionURL(Web.returnUrl(request, null), request); // set the pid and panel, if present in the request // a.setPid(request.getParameter(ActionURL.PARAM_PID)); a.setPanel(request.getParameter(ActionURL.PARAM_PANEL)); a.setSite(request.getParameter(ActionURL.PARAM_SITE)); a.setPage(request.getParameter(ActionURL.PARAM_PAGE)); return a; } }
/** * Get a new ActionURL. * * @param req * The current request. * @return A new ActionURL. */ protected ActionURL getActionURL(HttpServletRequest request) { ActionURL a = new ActionURL(Web.returnUrl(request, null), request); // set the pid and panel, if present in the request // a.setPid(request.getParameter(ActionURL.PARAM_PID)); a.setPanel(request.getParameter(ActionURL.PARAM_PANEL)); a.setSite(request.getParameter(ActionURL.PARAM_SITE)); a.setPage(request.getParameter(ActionURL.PARAM_PAGE)); return a; } }
String returnUrl = Web.returnUrl(req, returnPath); if (req.getQueryString() != null ) returnUrl += "?"+req.getQueryString();
" context=" + context + " web util val=" + Web.returnUrl(req, value));
String returnUrl = Web.returnUrl(req, returnPath); if (req.getQueryString() != null ) returnUrl += "?"+req.getQueryString();
session.setAttribute(Tool.HELPER_DONE_URL, Web.returnUrl(req, Validator.escapeUrl(path)));
String addr = Web.returnUrl(req, req.getPathInfo()) + ("/".equals(req.getPathInfo()) ? "" : Entity.SEPARATOR); try
Site s = (Site) iSi.next(); if (myWorkspaceSiteId.equals(s.getId()) ) { mrphs_worksiteUrl = Web.returnUrl(request, "/site/" + Web.escapeUrl(siteHelper.getSiteEffectiveId(s))); List pages = siteHelper.getPermittedPagesInOrder(s); for (Iterator iPg = pages.iterator(); iPg.hasNext();) { ToolConfiguration placement = (ToolConfiguration) iPt.next(); if ( profileToolId.equals(placement.getToolId()) ) { profileToolUrl = Web.returnUrl(request, "/site/" + Web.escapeUrl(siteHelper.getSiteEffectiveId(s)) + "/page/" + Web.escapeUrl(p.getId())); mrphs_profileToolUrl = Web.returnUrl(request, "/site/" + Web.escapeUrl(siteHelper.getSiteEffectiveId(s)) + "/tool-reset/" + Web.escapeUrl(placement.getId())); } else if ( preferencesToolId.equals(placement.getToolId()) ) { prefsToolUrl = Web.returnUrl(request, "/site/" + Web.escapeUrl(siteHelper.getSiteEffectiveId(s)) + "/page/" + Web.escapeUrl(p.getId())); mrphs_prefsToolUrl = Web.returnUrl(request, "/site/" + Web.escapeUrl(siteHelper.getSiteEffectiveId(s)) + "/tool-reset/" + Web.escapeUrl(placement.getId())); } else if ( worksiteToolId.equals(placement.getToolId()) ) { worksiteToolUrl = Web.returnUrl(request, "/site/" + Web.escapeUrl(siteHelper.getSiteEffectiveId(s)) + "/page/" + Web.escapeUrl(p.getId())); mrphs_worksiteToolUrl = Web.returnUrl(request, "/site/" + Web.escapeUrl(siteHelper.getSiteEffectiveId(s)) + "/tool-reset/" + Web.escapeUrl(placement.getId()));
String url = Web.returnUrl(req, null);
String pageUrl = Web.returnUrl(req, "/" + portalPrefix + "/" + Web.escapeUrl(effectiveSiteId) + "/page/"); pageUrl = pageUrl + Web.escapeUrl(pageAlias); if (!trinity) return pageUrl; pageUrl = Web.returnUrl(req, "/" + portalPrefix + "/" + Web.escapeUrl(effectiveSiteId)); if (reset || resetSiteProperty) { pageUrl = pageUrl + "/tool-reset/";
String addr = Web.returnUrl(req, req.getPathInfo()) + "index.html"; try