This project has retired. For details please refer to its Attic page.
Files and Libraries

Files and Libraries

The following files and libraries are available:

Java Client Library

Created Nov 24, 2015 7:06:06 AM

Introduction

The Java client-side library is used to access the Web service API for this application.

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

REST Example (Raw JAXB)

java.net.URL url = new java.net.URL(baseURL + "/queryapi/savedqueries"); JAXBContext context = JAXBContext.newInstance( ResourceModifiedResponse.class, SavedQuery.class ); java.net.URLConnection connection = url.openConnection(); connection.setDoOutput(true); connection.connect(); Unmarshaller unmarshaller = context.createUnmarshaller(); Marshaller marshaller = context.createMarshaller(); marshaller.marshal(savedQuery, connection.getOutputStream()); ResourceModifiedResponse result = (ResourceModifiedResponse) unmarshaller.unmarshal( connection.getInputStream() ); //handle the result as needed...

REST Example (Jersey client)

com.sun.jersey.api.client.Client client = com.sun.jersey.api.client.Client.create(); ResourceModifiedResponse result = client.resource(baseUrl + "/queryapi/savedqueries") .entity(savedQuery) .post(ResourceModifiedResponse.class); //handle the result as needed...

Files

name size description
lens-client.jar 40.26K The binaries for the Java client library.
lens-client-sources.jar 21.95K The sources for the Java client library.

Java JSON Client Library

Created Nov 24, 2015 7:06:06 AM

Introduction

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.

REST Example (Raw Jackson)

java.net.URL url = new java.net.URL(baseURL + "/queryapi/savedqueries"); ObjectMapper mapper = new ObjectMapper(); java.net.URLConnection connection = url.openConnection(); connection.setDoOutput(true); connection.connect(); mapper.writeValue(connection.getOutputStream(), savedQuery); ResourceModifiedResponse result = (ResourceModifiedResponse) mapper.readValue( connection.getInputStream(), ResourceModifiedResponse.class ); //handle the result as needed...

Files

name size description
lens-json-client.jar 29.53K The binaries for the Java JSON client library.
lens-json-client-sources.jar 19.94K The sources for the Java JSON client library.

PHP Client Library

Created Nov 24, 2015 7:06:04 AM

Introduction

The PHP client-side library defines the PHP 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 requires the json_encode function which was included in PHP versions 5.2.0+.

Files

name size
lens.php 81.11K

Ruby Client Library

Created Nov 24, 2015 7:06:05 AM

Introduction

The Ruby 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.

JSON REST Example

require 'net/https' require 'uri' //... //read a resource from a REST url url = URI.parse("...") request = Net::HTTP::Post.new(url.request_uri) input = SavedQuery.new //set up the SavedQuery... request.body = input.to_json request['Content-Type'] = "application/json" http = Net::HTTP.new(url.host, url.port) //set up additional http stuff... res = http.start do |ht| ht.request(request) end result = ResourceModifiedResponse.from_json(JSON.parse(res.body)) //handle the result as needed...

Files

name size
lens.rb 45.68K