Skip to content

blackboard/BBDN-REST-Demo-Java-Webapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bbdn-rest-demo-java

This project contains sample code for demonstrating the Blackboard Learn REST APIs in Tomcat Java Webapp. This sample code was built with OpenJDK 11.0.2.

Project at a glance:

  • Target: Blackboard Learn SaaS Release 2015.11.0-rel.8+0a806d1 minimum
  • Source Release: v1.0
  • Release Date 2016-02-25
  • Author: Scott Hurrey
  • Tested on Blackboard Learn SaaS Release 2015.11.0-rel.8+0a806d1

Requirements:

Setting Up Your Development Environment

  • Tomcat: This code was developed and tested against Tomcat 9.
  • Java 11: This code was developed and tested against openjdk11.0.2.
  • Gradle: Relies on Gradle 5.6.2.

To Use

  1. Start tomcat - tomcat/bin/startup.sh
  2. Replace place holders with your developer credentials and System URL, as described in the "Configuring the Script" section below
  3. Build project - ./gradlew build
  4. Deploy war file - cp build/libs/bbdn-rest-demo-java.war tomcat/webapps
  5. Access index in browser - http://localhost:8080/bbdn-rest-demo-java/index
  6. Follow the on-screen instructions

Configuring the Script

Before executing the script to run against your test server you must configure it with your registered application's URL, Key, and Secret.

Open src/main/java/bbdn/rest/RestConstants.java and edit lines 5, 6, and 7.

  • On line 5, if you are not testing against the developer virtual machine, replace "http://localhost:9876" with your server's top-level URL.
  • On line 6 replace "insert_your_application_key_here" with the key issued when you registered your application.
  • On line 7 replace "insert_your_application_secret_here" with the secret issued when you registered your application.

What it does

The rest demo script demonstrates authenticating a REST application, management and use of the authorization token, and creating, updating, discovering, and deleting supported Learn objects.

NOTE: Before running the example code you must register a developer account and application as described on the Developer Community REST Registry and Managing REST Integrations in Learn: The REST Integrations Tool for System Administrators pages. You must also configure the script as outlined in the below Configure the Script section.

This webapp allows you to:

  • Authenticate
  • Create, Read, and Update a Data Source
  • Create, Read, and Update a Term
  • Create, Read, and Update a Course
  • Create, Read, and Update a User
  • Create, Read, and Update a Membership
  • Delete created objects in reverse order of create - membership, user, course, term, datasource.

All generated output is sent to the browser.

Running the Demo!

Setup Your Test Server

To run the demo if you have not already done so you must as outlined above register the application via the Developer Portal and add the application to your test environment using the REST API Integration tool.

Conclusion

For a thorough walkthrough of this code, visit the corresponding Blackboard Developer Community REST Demo Using Java document.

About

This webapp demonstrates the use of the Blackboard REST Web Services using Java and the Spring @RestTemplate annotation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages