Giter VIP home page Giter VIP logo

openonderwijsapi-java's Introduction

OpenOnderwijsAPI-java

Importing the library into your project

  • If you want to be sure that you are using the latest library, build the project yourself as described at the bottom.
  • There's also a library jar available in the Library folder named oda.jar.
  • Import the library jar (oda.jar, or the one that you have built) into your project.

Using the client

There's an Android demo included, there you can see, how you should use the library.

  • For the communication with the API, create a new OnderWijsDataAPI object: OnderwijsDataAPI apiClient = new OnderwijsDataAPI("http://your.api.url");
  • Now you can get the different sub-APIs for getting different data. Getting the sub-API for persons: apiClient.getPersonsClient()
  • Use the get(...), getById(...) and the getList(...) methods to fetch the data from the sub-API. All of them have a callback, which can return with a success or failure method.
  • With get(url, params, handler) you fetch data of a single object. The url is the resource url of the object. Use entity.getResourceUrl() to get this. You can also use getById(id, params, handler), which uses the object's id instead of its URL. Remember: this is not always a number! The params is a Params type of object. You can create this the following way:
    Params params = new Params();
    params.setPage(1); //adds the &page=1 parameter to the query
    params.setEndDate(new Date()) //sets now as the ending date of the listing
    params.put("sort","name"); // you can also add custom parameters
  • getList(params, handler) works the same way as get, only it returns a list of objects.

Questions, bugs, enhancements

For questions about usage, or if you found a bug, you can use the Issues section of the repository. Also, pull requests for enhancements are welcome :)

Using the repository as a submodule in your project

  • Copy the URL of this repository.
  • In your command window, go to the directory, where you want to place the downloaded sources.
  • Enter git submodule add https://github.com/repository_url, where the last part is the URL you copied.
  • Git now downloads the repository to the directory, where you currently are.
  • You are now using this repository as a submodule :)

If you want to change the code

Building the project

  1. Open the project using eclipse.
  2. Install the FatJar plugin using this URL from the update manager: http://kurucz-grafika.de/fatjar
  3. Right-click on your project, and select Build Fat Jar
  4. Using the default settings build your .jar. Always build your project before creating the fat jar, or the changes will not be available in the fat jar.

License

This Java API client uses the following libraries:

Retrofit by Square, Inc.

google-gson

openonderwijsapi-java's People

Contributors

dzolnai avatar ijansch avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.