Package org.springframework.social.support

Examples of org.springframework.social.support.URIBuilder.build()


      NativeWebRequest request) {
    logger.warn("Error during authorization: " + error);
    URIBuilder uriBuilder = URIBuilder.fromUri(signInUrl).queryParam("error", error);
    if (errorDescription != null ) { uriBuilder.queryParam("error_description", errorDescription); }
    if (errorUri != null ) { uriBuilder.queryParam("error_uri", errorUri); }
    return redirect(uriBuilder.build().toString());
  }

  /**
   * Process the authentication callback when neither the oauth_token or code parameter is given, likely indicating that the user denied authorization with the provider.
   * Redirects to application's sign in URL, as set in the signInUrl property.
View Full Code Here


    URIBuilder uriBuilder = foursquare.withAccessToken(API_URL_BASE + path);
    uriBuilder.queryParam("v", API_VERSION);
    for (String paramName : params.keySet()) {
      uriBuilder.queryParam(paramName, String.valueOf(params.get(paramName)));
    }
    URI uri = uriBuilder.build();
    return uri;
  }
 
  private static final String API_URL_BASE = "https://api.foursquare.com/v2/";
 
View Full Code Here

      NativeWebRequest request) {
    logger.warn("Error during authorization: " + error);
    URIBuilder uriBuilder = URIBuilder.fromUri(signInUrl).queryParam("error", error);
    if (errorDescription != null ) { uriBuilder.queryParam("error_description", errorDescription); }
    if (errorUri != null ) { uriBuilder.queryParam("error_uri", errorUri); }
    return redirect(uriBuilder.build().toString());
  }

  /**
   * Process the authentication callback when neither the oauth_token or code parameter is given, likely indicating that the user denied authorization with the provider.
   * Redirects to application's sign in URL, as set in the signInUrl property.
View Full Code Here

    if (sinceId != null) {
      b.queryParam("since_id", String.valueOf(sinceId));
    }

    URI uri = b.build();
    if (logger.isDebugEnabled()) {
      logger.debug("Search uri:" + uri);
    }
    return uri;
  }
View Full Code Here

    }

    if (StringUtils.hasText(locations)) {
      b.queryParam("locations", locations);
    }
    return b.build();
  }

  @Override
  protected void doSendLine(String line) {
    sendMessage(MessageBuilder.withPayload(line).build());
View Full Code Here

  }

  public <T> PagedList<T> fetchConnections(String objectId, String connectionType, Class<T> type, MultiValueMap<String, String> queryParameters) {
    String connectionPath = connectionType != null && connectionType.length() > 0 ? "/" + connectionType : "";
    URIBuilder uriBuilder = URIBuilder.fromUri(GRAPH_API_URL + objectId + connectionPath).queryParams(queryParameters);
    JsonNode jsonNode = getRestTemplate().getForObject(uriBuilder.build(), JsonNode.class);
    return pagify(type, jsonNode);
  }

  public <T> PagedList<T> fetchPagedConnections(String objectId, String connectionType, Class<T> type, MultiValueMap<String, String> queryParameters) {
    String connectionPath = connectionType != null && connectionType.length() > 0 ? "/" + connectionType : "";
View Full Code Here

  }

  public <T> PagedList<T> fetchPagedConnections(String objectId, String connectionType, Class<T> type, MultiValueMap<String, String> queryParameters) {
    String connectionPath = connectionType != null && connectionType.length() > 0 ? "/" + connectionType : "";
    URIBuilder uriBuilder = URIBuilder.fromUri(GRAPH_API_URL + objectId + connectionPath).queryParams(queryParameters);
    JsonNode jsonNode = getRestTemplate().getForObject(uriBuilder.build(), JsonNode.class);
    return pagify(type, jsonNode);
  }

  public <T> PagedList<T> fetchConnections(String objectId, String connectionType, Class<T> type, MultiValueMap<String, String> queryParameters, String... fields) {
    if(fields.length > 0) {
View Full Code Here

 
  public PagedList<Post> searchHomeFeed(String query, PagingParameters pagedListParameters) {
    requireAuthorization();
    URIBuilder uriBuilder = URIBuilder.fromUri(GraphApi.GRAPH_API_URL + "me/home").queryParam("q", query);
    uriBuilder = appendPagedListParameters(pagedListParameters, uriBuilder);
    URI uri = uriBuilder.build();
    JsonNode responseNode = restTemplate.getForObject(uri, JsonNode.class);
    return deserializeList(responseNode, null, Post.class);
  }

  public PagedList<Post> searchUserFeed(String query) {
View Full Code Here

 
  public PagedList<Post> searchUserFeed(String userId, String query, PagingParameters pagedListParameters) {
    requireAuthorization();
    URIBuilder uriBuilder = URIBuilder.fromUri(GraphApi.GRAPH_API_URL + userId + "/feed").queryParam("q", query);
    uriBuilder = appendPagedListParameters(pagedListParameters, uriBuilder);   
    URI uri = uriBuilder.build();
    JsonNode responseNode = restTemplate.getForObject(uri, JsonNode.class);
    return deserializeList(responseNode, null, Post.class);
  }
 
  public PagedList<Post> getCheckins() {
View Full Code Here

  // private helpers
 
  private JsonNode fetchConnectionList(String baseUri, PagingParameters pagedListParameters) {
    URIBuilder uriBuilder = URIBuilder.fromUri(baseUri);
    uriBuilder = appendPagedListParameters(pagedListParameters, uriBuilder);
    URI uri = uriBuilder.build();
    JsonNode responseNode = restTemplate.getForObject(uri, JsonNode.class);
    return responseNode;
  }

  private <T> PagedList<T> deserializeList(JsonNode jsonNode, String postType, Class<T> type) {
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.