/** * Forwards the response to the given target, which may contain parameters appended like for example <code>?a=b&c=d</code>.<p> * * Please note: If possible, use <code>{@link #forwardRequest(String, Map, HttpServletRequest, HttpServletResponse)}</code> * where the parameters are passed as a map, since the parsing of the parameters may introduce issues with encoding * and is in general much less effective.<p> * * The parsing of parameters will likely fail for "large values" (e.g. full blown web forms with <textarea> * elements etc. Use this method only if you know that the target will just contain up to 3 parameters which * are relatively short and have no encoding or line break issues.<p> * * @param target the target to forward to (may contain parameters like <code>?a=b&c=d</code>) * @param req the request to forward * @param res the response to forward * * @throws IOException in case the forwarding fails * @throws ServletException in case the forwarding fails */ public static void forwardRequest(String target, HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { // clear the current parameters CmsUriSplitter uri = new CmsUriSplitter(target); Map<String, String[]> params = createParameterMap(uri.getQuery()); forwardRequest(uri.getPrefix(), params, req, res); }
/** * Sets the component member variables (target, anchor, query) * by splitting the uri <code>scheme://authority/path#anchor?query</code>.<p> */ private void setComponents() { CmsUriSplitter splitter = new CmsUriSplitter(m_uri, true); m_target = splitter.getPrefix(); m_anchor = splitter.getAnchor(); setQuery(splitter.getQuery()); }
uri = new CmsUriSplitter(check, true).toURI(); } catch (URISyntaxException exc) { return false;
CmsUriSplitter splitter = new CmsUriSplitter(m_requestedResource, true); String resource = splitter.getPrefix(); if (CmsStringUtil.isEmptyOrWhitespaceOnly(resource)) {
CmsMessages messageBundle = Messages.get().getBundle(getWorkplaceLocale()); try { if (new CmsUriSplitter(linkPath).getProtocol() != null) { result = new CmsResultItemBean(); result.setTitle(messageBundle.key(Messages.GUI_EXTERNAL_LINK_0));
CmsUriSplitter splitter = new CmsUriSplitter(m_requestedResource, true); String resource = splitter.getPrefix(); if (CmsStringUtil.isEmptyOrWhitespaceOnly(resource)) {
/** * Forwards the response to the given target, which may contain parameters appended like for example <code>?a=b&c=d</code>.<p> * * Please note: If possible, use <code>{@link #forwardRequest(String, Map, HttpServletRequest, HttpServletResponse)}</code> * where the parameters are passed as a map, since the parsing of the parameters may introduce issues with encoding * and is in general much less effective.<p> * * The parsing of parameters will likely fail for "large values" (e.g. full blown web forms with <textarea> * elements etc. Use this method only if you know that the target will just contain up to 3 parameters which * are relatively short and have no encoding or line break issues.<p> * * @param target the target to forward to (may contain parameters like <code>?a=b&c=d</code>) * @param req the request to forward * @param res the response to forward * * @throws IOException in case the forwarding fails * @throws ServletException in case the forwarding fails */ public static void forwardRequest(String target, HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { // clear the current parameters CmsUriSplitter uri = new CmsUriSplitter(target); Map params = createParameterMap(uri.getQuery()); forwardRequest(uri.getPrefix(), params, req, res); }
/** * Sets the component member variables (target, anchor, query) * by splitting the uri <code>scheme://authority/path#anchor?query</code>.<p> */ private void setComponents() { CmsUriSplitter splitter = new CmsUriSplitter(m_uri, true); m_target = splitter.getPrefix(); m_anchor = CmsLinkProcessor.unescapeLink(splitter.getAnchor()); setQuery(splitter.getQuery()); }
uri = new CmsUriSplitter(check, true).toURI(); } catch (URISyntaxException exc) { return false;
/** * Forwards to the next page of the new resource wizard after selecting the new resource type.<p> * * @throws IOException if forwarding fails * @throws ServletException if forwarding fails */ public void actionSelect() throws IOException, ServletException { String nextUri = getParamNewResourceUri(); if (!nextUri.startsWith("/")) { // no absolute path given, use default dialog path nextUri = PATH_DIALOGS + nextUri; } setParamAction(DIALOG_NEWFORM); CmsUriSplitter splitter = new CmsUriSplitter(nextUri); Map<String, String[]> params = CmsRequestUtil.createParameterMap(splitter.getQuery()); params.putAll(paramsAsParameterMap()); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_page) && (params.containsKey(PARAM_PAGE) && m_page.equals(params.get(PARAM_PAGE)))) { // remove page parameter if found and equal to currently shown page params.remove(PARAM_PAGE); } if (!params.containsKey(PARAM_PAGE)) { clearSession(); } sendForward(splitter.getPrefix(), params); }
/** * Forwards to the next page of the new resource wizard after selecting the new resource type.<p> * * @throws IOException if forwarding fails * @throws ServletException if forwarding fails */ public void actionSelect() throws IOException, ServletException { String nextUri = getParamNewResourceUri(); if (!nextUri.startsWith("/")) { // no absolute path given, use default dialog path nextUri = PATH_DIALOGS + nextUri; } setParamAction(DIALOG_NEWFORM); CmsUriSplitter splitter = new CmsUriSplitter(nextUri); Map params = CmsRequestUtil.createParameterMap(splitter.getQuery()); params.putAll(paramsAsParameterMap()); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_page) && (params.containsKey(PARAM_PAGE) && m_page.equals(params.get(PARAM_PAGE)))) { // remove page parameter if found and equal to currently shown page params.remove(PARAM_PAGE); } if (!params.containsKey(PARAM_PAGE)) { clearSession(); } sendForward(splitter.getPrefix(), params); }
String newUri = PATH_DIALOGS + OpenCms.getWorkplaceManager().getExplorerTypeSetting(indexPageType).getNewResourceUri(); CmsUriSplitter splitter = new CmsUriSplitter(newUri); Map params = CmsRequestUtil.createParameterMap(splitter.getQuery()); params.put(CmsPropertyAdvanced.PARAM_DIALOGMODE, CmsPropertyAdvanced.MODE_WIZARD_CREATEINDEX); params.put(PARAM_ACTION, CmsNewResource.DIALOG_NEWFORM); sendForward(splitter.getPrefix(), params); } else {
CmsUriSplitter splitSrc = new CmsUriSplitter(src); CmsResource imageRes = cms.readResource(splitSrc.getPrefix()); CmsImageScaler reScaler = null; if (splitSrc.getQuery() != null) { String[] scaleStr = (String[])CmsRequestUtil.createParameterMap(splitSrc.getQuery()).get( CmsImageScaler.PARAM_SCALE); if (scaleStr != null) {
String newUri = PATH_DIALOGS + OpenCms.getWorkplaceManager().getExplorerTypeSetting(indexPageType).getNewResourceUri(); CmsUriSplitter splitter = new CmsUriSplitter(newUri); Map<String, String[]> params = CmsRequestUtil.createParameterMap(splitter.getQuery()); params.put( CmsPropertyAdvanced.PARAM_DIALOGMODE, new String[] {CmsPropertyAdvanced.MODE_WIZARD_CREATEINDEX}); params.put(PARAM_ACTION, new String[] {CmsNewResource.DIALOG_NEWFORM}); sendForward(splitter.getPrefix(), params); } else {
CmsUriSplitter splitSrc = new CmsUriSplitter(src); if (splitSrc.getQuery() != null) { String[] scaleStr = CmsRequestUtil.createParameterMap(splitSrc.getQuery()).get(CmsImageScaler.PARAM_SCALE); if (scaleStr != null) { scaleParam = scaleStr[0]; CmsResource imageRes = cms.readResource(splitSrc.getPrefix()); CmsImageScaler original = new CmsImageScaler(cms, imageRes); scaler = getScaler(scaler, original, scaleParam);
CmsUriSplitter splitSrc = new CmsUriSplitter(src); if (splitSrc.getQuery() != null) { String[] scaleStr = CmsRequestUtil.createParameterMap(splitSrc.getQuery()).get(CmsImageScaler.PARAM_SCALE); if (scaleStr != null) { scaleParam = scaleStr[0]; CmsResource imageRes = cms.readResource(splitSrc.getPrefix()); CmsImageScaler originalScaler = new CmsImageScaler(cms, imageRes); initScaler(originalScaler, scaleParam);
try { CmsUriSplitter splitter = new CmsUriSplitter(newUri); Map<String, String[]> params = CmsRequestUtil.createParameterMap(splitter.getQuery()); params.put(PARAM_DIALOGMODE, new String[] {MODE_WIZARD_CREATEINDEX}); params.put(PARAM_ACTION, new String[] {CmsNewResource.DIALOG_NEWFORM}); sendForward(splitter.getPrefix(), params); return; } catch (IOException e) {
try { CmsUriSplitter splitter = new CmsUriSplitter(newUri); Map params = CmsRequestUtil.createParameterMap(splitter.getQuery()); params.put(PARAM_DIALOGMODE, MODE_WIZARD_CREATEINDEX); params.put(PARAM_ACTION, CmsNewResource.DIALOG_NEWFORM); sendForward(splitter.getPrefix(), params); return; } catch (IOException e) {