SC4 Devotion Forum Archives

SC4Evermore Welcome Portal => LEX File Exchange Discussion => LEX Development Centre => Topic started by: CasperVg on November 22, 2013, 08:20:15 AM

Title: LEX4J - Java LEX API Wrapper
Post by: CasperVg on November 22, 2013, 08:20:15 AM
Hi everyone,

After working on the new SC4Devotion LEX API (https://github.com/caspervg/SC4Devotion-LEX-API), which allows easy access to the LEX functionality outside the SC4Devotion website for a fair bit, I decided to start building a Java LEX API Wrapper, which will abstract most of the lower level stuff (fetching the JSON, putting the results into Java beans, etc.) for you and allow you to focus on your LEX application only.

Example:
This is how you can get the profile for a user and print the full name:

        Auth auth = new Auth("username", "password");
        UserRoute route = new UserRoute(auth);
        User user = route.getUser();
        System.out.println(user.getFullname());


Source:
Source-code is available at the Github repository (https://github.com/caspervg/SC4D-LEX4J) and is licensed under the GPLv2 License. Everyone who wants to help and contribute is free to do so of course.

Documentation/Javadoc:
Documentation in the form of Javadoc is available through Github Pages:
http://caspervg.github.io/SC4D-LEX4J (http://caspervg.github.io/SC4D-LEX4J)

Releases:
v 0.5.0-beta: Click here to download (https://github.com/caspervg/SC4D-LEX4J/releases/tag/v1.0.0)

Usage instructions:
Add the "LEX4J.jar" and the dependencies in the /lib/ directory to your project. That's it ;)
Title: Re: LEX4J - Java LEX API Wrapper - Release 0.5.0-beta
Post by: CasperVg on November 23, 2013, 02:17:51 AM
After some more testing and adding some extra features (it can grab the various LEX search categories now too) I have decided to release the first binary build (v0.5.0-beta) for people to experiment with.

It is available through a Github Release here: Click me! (https://github.com/caspervg/SC4D-LEX4J/releases/tag/v1.0.0)
Title: LEX4J - Java LEX API Wrapper - Release v. 0.7
Post by: CasperVg on August 05, 2014, 12:42:10 AM
Version 0.7 of the LEX4J API Wrapper has been released. Changelog:

    v. 0.5 - Initial release
    v. 0.6 - Improved documentation for the search filters
    v. 0.7 - Switched to v2 LEX API, add support for new search query

You can also easily add LEX4J to your dependencies by adding this to your Maven pom.xml (or similar in Gradle, etc.)

<dependencies>
  ...
  <dependency>
      <groupId>net.caspervg.lex4j</groupId>
      <artifactId>LEX4J</artifactId>
      <version>0.7</version>
  </dependency>
  ...
</dependencies>
Title: Re: LEX4J - Java LEX API Wrapper
Post by: CasperVg on August 03, 2015, 09:15:23 AM
Version 4.0 of the LEX4J API wrapper has been released. It adds compatibility for the recently released LEX API v4.