The following examples provide usage scenarios for ScienceBase Services using a couple of different options for interacting with REST. The use cases describe "real world" cases where information has needed to be retrieved from ScienceBase in different ways or presented to ScienceBase in order to insert or update ScienceBase Items or other records.
The ability to read or write in ScienceBase is controlled down to the individual item level for both ScienceBase Items and ScienceBase Directory items with an access control list that determines what users and groups can interact with the item. There is an inheritance process built into the hierarchical nature of ScienceBase such that an item can act as a folder under which other items can be placed, inheriting the access controls of the parent item. In order to use any of the REST HTTP methods discussed in the examples, the REST client used will need to present ScienceBase with a valid set of credentials for the desired action. Credentials can be obtained by contacting firstname.lastname@example.org.
- Groovy Examples — Core ScienceBase functionality is developed in Groovy http://groovy.codehaus.org/ and Grails http://grails.org/. The following examples show Groovy scripting used within the ScienceBase platform to interface with the REST services.
- Using RESTClient for Firefox
- Using RESTClient for Firefox to test syntax and load data — The REST Client Add-On for Firefox https://addons.mozilla.org/en-US/firefox/addon/restclient/ is useful for testing the syntax of sbJSON packaged and presented to ScienceBase for loading and manipulating data. It provides a simple, visual way to be authenticated in ScienceBase. A user can view how the REST services will behave under different scenarios or perform actual data management tasks. These tasks are going to be used once so where building a full application of some kind is not really