Examples of ERXMutableURL


Examples of er.extensions.foundation.ERXMutableURL

      else if ("none".equals(version) || version.length() == 0) {
        version = null;
      }
      if (version != null) {
        try {
          ERXMutableURL url = new ERXMutableURL(resourceUrl);
          url.addQueryParameter("", version);
          resourceUrl = url.toExternalForm();
        }
        catch (MalformedURLException e) {
          ERXResourceManager.log.error("Failed to construct URL from '" + resourceUrl + "'.", e);
        }
      }
View Full Code Here

Examples of er.extensions.foundation.ERXMutableURL

      context.generateCompleteURLs();
    }

    String url;
    try {
      ERXMutableURL mu = new ERXMutableURL();
      boolean customPath = (path != null && path.length() > 0);
      if (!customPath) {
        mu.setURL(context._directActionURL(directActionName, queryParameters, secureBool, 0, false));
        if (!includeSessionID) {
          mu.removeQueryParameter(WOApplication.application().sessionIdKey());
        }
      }
      else {
        if (secureBool) {
          mu.setProtocol("https");
        }
        else {
          mu.setProtocol("http");
        }
        mu.setHost(context.request()._serverName());
        mu.setPath(path + directActionName);
        mu.setQueryParameters(queryParameters);
        if (includeSessionID && context.session().storesIDsInURLs()) {
          mu.setQueryParameter(WOApplication.application().sessionIdKey(), context.session().sessionID());
        }
      }

      if (port != null) {
        mu.setPort(port);
      }

      if (host != null && host.length() > 0) {
        mu.setHost(host);
        if (mu.protocol() == null) {
          if (secureBool) {
            mu.setProtocol("https");
          }
          else {
            mu.setProtocol("http");
          }
        }
      }

      url = mu.toExternalForm();
    }
    catch (MalformedURLException e) {
      throw new RuntimeException("Failed to create url for direct action '" + directActionName + "'.", e);
    }
    finally {
View Full Code Here

Examples of er.extensions.foundation.ERXMutableURL

   * </span>
   */
  protected String queryParametersString() {
    String queryParametersString = null;
    if (_queryParameters != null && _queryParameters.count() > 0) {
      ERXMutableURL u = new ERXMutableURL();
      u.setQueryParameters(_queryParameters);
      queryParametersString = u.toExternalForm();
    }
    return queryParametersString;
  }
View Full Code Here

Examples of er.extensions.foundation.ERXMutableURL

        _log.warn("not adding session ID: url=" + (urlString != null ? urlString : "<null>") + " session=" + (session != null ? session : "<null>"));
        return urlString;
      }
      String sessionIdKey = WOApplication.application().sessionIdKey();
      try {
      ERXMutableURL url = new ERXMutableURL(urlString);
      if (!url.containsQueryParameter(sessionIdKey)) {
        url.setQueryParameter(sessionIdKey, session.sessionID());
      }
      return url.toExternalForm();
    }
    catch (MalformedURLException e) {
      _log.error("invalid URL string: " + urlString, e);
    }
     
View Full Code Here

Examples of er.extensions.foundation.ERXMutableURL

    return WOLipsUtilities.wolipsUrl("openComponent", params);
  }

  public String clickToDebugUrl() {
    try {
      ERXMutableURL url = new ERXMutableURL(context().componentActionURL());
      url.addQueryParameter("component", "REPLACEME");
      return url.toExternalForm();
    }
    catch (MalformedURLException e) {
      System.err.println("WOLClickToOpen.clickToDebugUrl failed to generate a URL: " + e.getMessage());
      return "http://broken";
    }
View Full Code Here

Examples of er.extensions.foundation.ERXMutableURL

  public static NSArray<String> termExtraction(String appid, String content, String context, Integer maxTerms) throws IOException, SAXException, ParserConfigurationException, FactoryConfigurationError {
    if (content == null || content.trim().length() == 0) {
      return NSArray.<String> emptyArray();
    }

    ERXMutableURL queryParameters = new ERXMutableURL();
    queryParameters.setQueryParameter("appid", appid);
    queryParameters.setQueryParameter("context", ERXStringUtilities.stripHtml(content, false));
    queryParameters.setQueryParameter("output", "xml");
    if (context != null) {
      queryParameters.setQueryParameter("context", ERXStringUtilities.stripHtml(context, false));
    }
    String postData = queryParameters.toExternalForm();

    HttpURLConnection conn = (HttpURLConnection) new URL("http://search.yahooapis.com/ContentAnalysisService/V1/termExtraction").openConnection();
    NSMutableArray<String> terms = new NSMutableArray<String>();
    try {
      conn.setRequestMethod("POST");
View Full Code Here

Examples of er.extensions.foundation.ERXMutableURL

              if (!generatingCompleteURLs) {
                context.generateCompleteURLs();
              }
              try {
                href = context._directActionURL(directActionName, queryDictionary, secure, 0, false);
                ERXMutableURL u = new ERXMutableURL(href);
                u.addQueryParameter(String.valueOf(System.currentTimeMillis()), null);
                href = u.toExternalForm();
              }
              catch (MalformedURLException e) {
                throw new NSForwardException(e);
              }
              finally {
View Full Code Here

Examples of er.extensions.foundation.ERXMutableURL

        actionUrl = AjaxUtils.ajaxComponentActionUrl(context);
      }
     
      if (replaceID != null) {
        try {
          ERXMutableURL tempActionUrl = new ERXMutableURL(actionUrl);
          tempActionUrl.addQueryParameter(ERXAjaxApplication.KEY_REPLACED, "true");
          actionUrl = tempActionUrl.toExternalForm();
        }
        catch (MalformedURLException e) {
          throw NSForwardException._runtimeExceptionForThrowable(e);
        }
      }
View Full Code Here

Examples of er.extensions.foundation.ERXMutableURL

        String inputString = request.contentString();
        JSONObject input = new JSONObject(inputString);
        String sessionIdKey = WOApplication.application().sessionIdKey();
        String sessionId = request.cookieValueForKey(sessionIdKey);
        if (sessionId == null) {
          ERXMutableURL url = new ERXMutableURL();
          url.setQueryParameters(request.queryString());
          sessionId = url.queryParameter(sessionIdKey);
          if (sessionId == null && input.has(sessionIdKey)) {
            sessionId = input.getString(sessionIdKey);
          }
        }
        context._setRequestSessionID(sessionId);
        WOSession session = null;
        if (context._requestSessionID() != null) {
          session = WOApplication.application().restoreSessionWithID(sessionId, context);
        }
        if (session != null) {
          session.awake();
        }
        try {
          JSONComponentCallback componentCallback = null;
         
          WODynamicURL url = request._uriDecomposed();
          String requestHandlerPath = url.requestHandlerPath();
          JSONRPCBridge jsonBridge;
          if (requestHandlerPath != null && requestHandlerPath.length() > 0) {
            String componentNameAndInstance = requestHandlerPath;
            String componentInstance;
            String componentName;
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.