SOCIB RAMADDA Data Repository
RAMADDA Web API
Previous: RAMADDA File System Access Next: Search API Table of contents
RAMADDA User Guide
 
15.4 RAMADDA Web API
In general, a RAMADDA URL can be specified as:
http://///?entryid=
e.g.:
http://ramadda.org/repository/entry/show/Home/RAMADDA+Examples?entryid=a96b9616-40b0-41f5-914a-fb1be157d97c
The base path (by default /repository) is the same for the entire repository. This is set with the ramadda.html.urlbase property. The API path determines what service is being invoked. When viewing an entry the default path is /entry/show. This supports a number of result encodings described below. Other paths include:
/entry/get  -  return the file
/opendap     - access gridded data via OpenDAP.
The entry is identified by the entryid URL argument:
http://ramadda.org/repository/entry/show/Home/RAMADDA+Examples?entryid=a96b9616-40b0-41f5-914a-fb1be157d97c
The path to the entry (e.g., /Home/RAMADDA+Examples) is optional if the entryid argument is provided. However, if the entryid argument is not provided then RAMADDA will use the path:
http://ramadda.org/repository/entry/show/Home/RAMADDA+Examples
Though this works we kindof discourage this approach because if you change a name or location then any links the entry would break.

Entry Output

When viewing an entry in RAMADDA one can specify any number of encodings or views of the entries with the output URL argument: Basic HTML display:
http://ramadda.org/repository/entry/show/Home/RAMADDA+Examples?entryid=a96b9616-40b0-41f5-914a-fb1be157d97c&output=html.info
GeoRSS:
http://ramadda.org/repository/entry/show/Home/RAMADDA+Examples?entryid=a96b9616-40b0-41f5-914a-fb1be157d97c&output=rss.full
ATOM-XML:
http://ramadda.org/repository/entry/show/Home/RAMADDA+Examples?entryid=a96b9616-40b0-41f5-914a-fb1be157d97c&output=atom
Map:
http://ramadda.org/repository/entry/show/Home/RAMADDA+Examples?entryid=a96b9616-40b0-41f5-914a-fb1be157d97c&output=map.map
Google Earth:
http://ramadda.org/repository/entry/show/Home/RAMADDA+Examples?entryid=a96b9616-40b0-41f5-914a-fb1be157d97c&output=map.gemap
CSV:
http://ramadda.org/repository/entry/show/Home/RAMADDA+Examples?entryid=a96b9616-40b0-41f5-914a-fb1be157d97c&output=default.csv
CDL/NCML
http://ramadda.org/repository/entry/show/Home/RAMADDA+Examples/Science+Data/Gridded+Data/elev.nc?output=data.cdl

Adding APIs in plugins

The API into RAMADDA is declaratively defined with one or more api.xml files:
<api>
  <property name="admin" value="false"/>
  <property name="cancache" value="true"/>
  <group handler="repository">
      <api request="/entry/show"             method="processEntryShow"    name="Home" toplevel="true" ishome="true"/>
      <api request="/entry/show/*"           method="processEntryShow"/>
...
  </group>
  <group handler="metadatamanager">
      <api request="/metadata/list"       method="processMetadataList"/>
      <api request="/metadata/form"       method="processMetadataForm"       actions="edit"/>
...
  </group>
  <group handler="admin">
      <api request="/admin/sql"          method="adminSql"           admin="true"/>
      <api request="/admin/startstop"    method="adminDbStartStop"   admin="true"/>
...
  </group>

</api>
developer/api_dummy.xml
Note: The above file has "_dummy" appended to it. To actually use this in the IDV change the name so it ends with api.xml. This file can be organized as a set of group tags that define a handler and contain a set of api. The api tag can also define a handler. The handlers are one of: usermanager, admin, harvestermanager, actionmanager, accessmanager, metadatamanager, repository.

External classes can be used as handlers by providing the full class name. These handlers need to implement RequestHandler and need to have a public constructor that takes as argument the Repository object and the xml api Element.

The api tag contains a path attribute which is used the the url path. e.g., the main way to view an entry is the "/entry/show" path. The url ends up looking like:
<repository suffix>/entry/show?id=<entry id>
The method attribute is the method name on the handler that is called. These methods have the signature:

public Result processEntryShow(Request request) throws Exception {
    ...
}
They take a Request object and return a Result object.

 

Previous: RAMADDA File System Access Next: Search API Table of contents

Powered by Geode Systems and RAMADDA