Skip to content

Latest commit

 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Evergreen Java Web Client Library

A Java library for accessing Evergreen servers via the HTTP JSON Gateway with IDL support.

Requirements

  • Java 17 or higher

Building

This project uses Gradle for building. You don't need to install Gradle separately - the project includes the Gradle Wrapper.

Using the Gradle Wrapper (Recommended)

# Build the project
./gradlew build

# Run tests
./gradlew test

# Generate JAR
./gradlew jar

# Generate all artifacts (including sources and javadoc JARs)
./gradlew build

# Clean build outputs
./gradlew clean

Examples

UpdateUserPhone

An example program that demonstrates logging into an Evergreen server, fetching a user, and updating their phone number via the Evergreen JSON HTTP gateway.

# Build the project and copy runtime dependencies
./gradlew build copyDependencies

# Run the example
java -cp build/libs/evergreen-java-0.1.0-SNAPSHOT.jar:build/dependencies/* \
    org.evergreen_ils.examples.UpdateUserPhone \
    <hostname> <username> <password> <user_id> <new_phone>

The copyDependencies task copies the required JAR files (JSON parser, etc.) from Gradle's cache into build/dependencies/ so they can be included in the classpath when running examples.

Example:

java -cp build/libs/evergreen-java-0.1.0-SNAPSHOT.jar:build/dependencies/* \
    org.evergreen_ils.examples.UpdateUserPhone \
    evergreen.example.org admin demo123 1 "555-123-4567"

Use -k to ignore SSL certificate errors (for testing with self-signed certificates):

java -cp build/libs/evergreen-java-0.1.0-SNAPSHOT.jar:build/dependencies/* \
    org.evergreen_ils.examples.UpdateUserPhone \
    -k localhost admin demo123 1 "555-123-4567"

UpdateUserSetting

Demonstrates applying user settings via the open-ils.actor.settings.apply.user_or_ws API.

java -cp build/libs/evergreen-java-0.1.0-SNAPSHOT.jar:build/dependencies/* \
    org.evergreen_ils.examples.UpdateUserSetting \
    [-k] <hostname> <username> <password> <sms_number>

Example:

java -cp build/libs/evergreen-java-0.1.0-SNAPSHOT.jar:build/dependencies/* \
    org.evergreen_ils.examples.UpdateUserSetting \
    -k localhost admin demo123 "555-123-4567"

PatronAddress

Demonstrates retrieving and updating patron addresses. Retrieval uses open-ils.actor.user.fleshed.retrieve and updates use open-ils.actor.patron.update.

View addresses:

java -cp build/libs/evergreen-java-0.1.0-SNAPSHOT.jar:build/dependencies/* \
    org.evergreen_ils.examples.PatronAddress \
    [-k] <hostname> <username> <password> <user_id>

Update billing address street1:

java -cp build/libs/evergreen-java-0.1.0-SNAPSHOT.jar:build/dependencies/* \
    org.evergreen_ils.examples.PatronAddress \
    -k localhost admin demo123 1 "123 Main St"

License

Apache License 2.0 - See LICENSE file for details.

About

Evergreen Java Libs and Examples

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages