Files and Libraries

GWT JSON Overlay

Created May 11, 2020

The Google Web Toolkit JSON Overlay library provides the JSON Overlays that can be used to access the Web service API for this application.

JSON Overlay Example
String url = ...;
RequestBuilder request = new RequestBuilder(RequestBuilder.GET, url);
request.sendRequest(null, new RequestCallback() {
  public void onResponseReceived(Request request, Response response) {
    if (200 == response.getStatusCode()) {
      //handle the successful data...
      Job data = Job.fromJson(response.getText());
      //handle the Job...
    }
    else {
      //handle the error...
    }
  }

  public void onError(Request request, Throwable throwable) {
    //handle the error...
  }
});
    

Files
name size description
pod-rest-gwt-json-overlay.jar 9.84K The sources for the GWT JSON overlay.

Java JSON Client Library

Created May 11, 2020

The Java client-side library is used to provide the set of Java objects that can be serialized to/from JSON using Jackson. This is useful for accessing the JSON REST endpoints that are published by this application.

Resources Example (Raw JAXB)
java.net.URL url = new java.net.URL(baseURL + "/jobService/job/{jobId}");
ObjectMapper mapper = new ObjectMapper();
java.net.URLConnection connection = url.openConnection();
connection.connect();

Job result = (Job) mapper.readValue( connection.getInputStream(), Job.class );
//handle the result as needed...
    
Resources Example (Jersey client)
javax.ws.rs.client.Client client = javax.ws.rs.client.ClientBuilder.newClient();

Job result = client.target(baseUrl + "/jobService/job/{jobId}")
  .get(Job.class);

//handle the result as needed...
    

Files
name size description
pod-rest-json-client.jar 12.20K The binaries for the Java JSON client library.
pod-rest-json-client-json-sources.jar 9.03K The sources for the Java JSON client library.

PHP JSON Client Library

Created May 11, 2020

The PHP JSON client-side library defines the PHP classes that can be (de)serialized to/from JSON. This is useful for accessing the resources that are published by this application, but only those that produce a JSON representation of their resources (content type "application/json").

This library requires the json_encode function which was included in PHP versions 5.2.0+.

PHP JSON Example
//read the resource in JSON:
$json = ...;

//read the json as an array.
$parsed = json_decode($json, true);

//read the json array as the object
$result = new Object($parsed);

//open a writer for the json
$json = $result->toJson();
    

Files
name size description
pod-rest-php.zip 4.16K  

Ruby JSON Client Library

Created May 11, 2020

The Ruby JSON client-side library defines the Ruby classes that can be (de)serialized to/from JSON. This is useful for accessing the REST endpoints that are published by this application, but only those that produce a JSON representation of their resources (content type "application/json").

This library leverages the Ruby JSON Implementation, which is required in order to use this library.

Ruby JSON Example
require 'net/https'
require 'uri'
//...

//read a resource from a REST url
url = URI.parse("...")
request = Net::HTTP::Get.new(url.request_uri)

http = Net::HTTP.new(url.host, url.port)
//set up additional http stuff...
res = http.start do |ht|
  ht.request(request)
end

result = Object.from_json(JSON.parse(res.body))

//handle the result as needed...
    

Files
name size description
pod-rest.rb 23.38K