Package de.innovationgate.utils

Examples of de.innovationgate.utils.URLBuilder.rebuild()


                    if (requestedDBKey.equalsIgnoreCase(defaultDBKey)) {
                        // if default db requested redirect to url without dbkey
                        URLBuilder builder = new URLBuilder(httpRequest, _core.getCharacterEncoding());
                        String path = builder.getPath().substring(httpRequest.getContextPath().length());                                      
                        builder.setPath(httpRequest.getContextPath() + path.substring(defaultDBKey.length() + 1));
                        httpResponse.sendRedirect(builder.rebuild().toString());
                        return;
                    }
                   
                    // we have to check if requestedDBKey is a valid content database - if not we use defaultDatabase
                    if (!_core.getContentdbs().containsKey(requestedDBKey.toLowerCase())) {
View Full Code Here


            StringBuffer url = super.getRequestURL();          
            try {
                URLBuilder builder = new URLBuilder(new URL(url.toString()));
                String path = builder.getPath().substring(_request.getContextPath().length());
                builder.setPath(_request.getContextPath() + "/" + _dbkey + path);
                return new StringBuffer(builder.rebuild().toString());
            } catch (Exception e) {
                _core.getLog().error("Unable to compute request url.", e);
            }      
            return url;
        }
View Full Code Here

            // create ajaxInfo
            AjaxInfo ajaxInfo = new AjaxInfo(uniquePortletID);
            try {
        URLBuilder builder = new URLBuilder(getTMLContext().getrequest());
        builder.removeParameter("$action");
        java.net.URL url = builder.rebuild();
        ajaxInfo.setQueryString(url.getQuery());
      } catch (Exception e1) {
        getTMLContext().addwarning("Unable to build request querystring for ajax environment.");
      }
            ajaxInfo.setTmlmodule(pReg.getDesign());
View Full Code Here

        else {
            try {
                URLBuilder builder = new URLBuilder(new java.net.URL(tag.getRequestURL()));
                builder.setParameterEncoding(context.getwgacore().getCharacterEncoding());
                builder.setParameter("$action", encodedActionLink);
                return builder.rebuild(false);
            }
            catch (MalformedURLException exc) {
                context.getlog().error("Error building action URL", exc);
                return null;
            }
View Full Code Here

                        String defaultDBKey = WGAVirtualHostingFilter.getDefaultDBKey(core, vHost);
                        if (defaultDBKey != null && targetDBKey.equalsIgnoreCase(defaultDBKey)) {
                            // default db requested - remove from path
                            builder.setPath(path.substring(defaultDBKey.length()));
                            try {
                                return builder.rebuild(false).toString();
                            }
                            catch (UnsupportedEncodingException e) {
                                core.getLog().error("Unable to rewrite url '" + url + "'.");
                            }
                        }
View Full Code Here

                                 // default db requested - remove from path
                                    builder.setPath(path.substring(defaultDBKey.length()));
                                }
                            }
                            try {
                                return builder.rebuild(true).toString();
                            }
                            catch (UnsupportedEncodingException e) {
                                core.getLog().error("Unable to rewrite url '" + url + "'.");
                            }
                        }
View Full Code Here

            URLBuilder urlBuilder = new URLBuilder(null, 0, null, langContext.contenturl(path.getMediaKey(), path.getLayoutKey()), context.getrequest().getQueryString());
            if (urlBuilder.hasParameter("$action")) {
                urlBuilder.removeParameter("$action");
            }
           
      context.redirectto(urlBuilder.rebuild(false));
    }
    catch (IOException e) {
      throw new TMLException("Error redirecting to new language", e, true);
    }
        catch (WGAPIException e) {
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.