cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6165] Minor formatting updates
Date Thu, 18 Jun 2015 15:38:54 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 59c97b4e1 -> 26aba8ecb


[CXF-6165] Minor formatting updates


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/26aba8ec
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/26aba8ec
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/26aba8ec

Branch: refs/heads/master
Commit: 26aba8ecb5c4c461e0feac9b1c60e83b3b6a81f8
Parents: 59c97b4
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Thu Jun 18 16:38:39 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Thu Jun 18 16:38:39 2015 +0100

----------------------------------------------------------------------
 .../java/demo/jaxrs/server/BigQueryService.java    | 17 ++++++++++-------
 .../jax_rs/big_query/src/main/webapp/index.html    |  2 +-
 2 files changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/26aba8ec/distribution/src/main/release/samples/jax_rs/big_query/src/main/java/demo/jaxrs/server/BigQueryService.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/big_query/src/main/java/demo/jaxrs/server/BigQueryService.java
b/distribution/src/main/release/samples/jax_rs/big_query/src/main/java/demo/jaxrs/server/BigQueryService.java
index 1937c20..49ab839 100644
--- a/distribution/src/main/release/samples/jax_rs/big_query/src/main/java/demo/jaxrs/server/BigQueryService.java
+++ b/distribution/src/main/release/samples/jax_rs/big_query/src/main/java/demo/jaxrs/server/BigQueryService.java
@@ -36,6 +36,14 @@ import org.apache.cxf.rs.security.oidc.rp.OidcClientTokenContext;
 @Path("/search")
 public class BigQueryService {
 
+    private static final String BQ_SELECT = 
+        "SELECT corpus,corpus_date FROM publicdata:samples.shakespeare WHERE word=\\\"%s\\\"";
+    private static final String BQ_REQUEST = "{" +
+        "\"kind\": \"bigquery#queryRequest\"," 
+        + "\"query\": \"%s\","
+        + "\"maxResults\": %d" 
+        + "}";
+    
     private WebClient bigQueryClient;
     
     @GET
@@ -50,14 +58,9 @@ public class BigQueryService {
         
         String searchWord = state.getFirst("word");
         String maxResults = state.getFirst("maxResults");
-        String bigQuerySelect = "SELECT corpus,corpus_date FROM publicdata:samples.shakespeare
WHERE word=\\\"" 
-            + searchWord + "\\\"";
-        String bigQueryRequest = "{" +
-            "\"kind\": \"bigquery#queryRequest\"," 
-            + "\"query\": \"" + bigQuerySelect + "\","
-            + "\"maxResults\": " + Integer.parseInt(maxResults)
-            + "}";
         
+        String bigQuerySelect = String.format(BQ_SELECT, searchWord);
+        String bigQueryRequest = String.format(BQ_REQUEST, bigQuerySelect, Integer.parseInt(maxResults));
         
         JsonMapObject jsonMap = bigQueryClient.post(bigQueryRequest, JsonMapObject.class);
         BigQueryResponse bigQueryResponse = new BigQueryResponse(context.getUserInfo().getName(),

http://git-wip-us.apache.org/repos/asf/cxf/blob/26aba8ec/distribution/src/main/release/samples/jax_rs/big_query/src/main/webapp/index.html
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/big_query/src/main/webapp/index.html
b/distribution/src/main/release/samples/jax_rs/big_query/src/main/webapp/index.html
index b783883..0f128ff 100644
--- a/distribution/src/main/release/samples/jax_rs/big_query/src/main/webapp/index.html
+++ b/distribution/src/main/release/samples/jax_rs/big_query/src/main/webapp/index.html
@@ -29,7 +29,7 @@ function signInCallback(authResult) {
     // Send the code to the server
     $.ajax({
       type: 'POST',
-      url: 'service/oidc/rp/complete',
+      url: 'service/search',
       contentType: 'application/octet-stream; charset=utf-8',
       success: function(result) {
         // Handle or verify the server response if necessary.


Mime
View raw message