Collections API

From HyperCities Help
Revision as of 16:59, 5 June 2013 by Davidshepard (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Collections are ordered sequences of objects, and other collections (nested to any level). Accessing a collection will return a full description of all the objects inside them, which can be quite large.

This is the JSON description of an object. Many fields, as you will see, are shared between objects and collections.

{
   "description": "", // Full text description of the object
   "copyright": "CCBY", 
   "creator": "admin", 
   "name": "The Imperial Procession of 404 CE", 
   "mapping": {
       "swLat": "36.65504670", 
       "dateTo": {
           "date": "0525-01-01 00:00:00", 
           "timezone_type": 3, 
           "timezone": "America/Los_Angeles"
       }, 
       "kml": "", 
       "dateFrom": {
           "date": "0404-01-01 00:00:00", 
           "timezone_type": 3, 
           "timezone": "America/Los_Angeles"
       }, 
       "zoom": "14", 
       "neLon": "19.27059636", 
       "neLat": "45.78679485", 
       "swLon": "7.99368023", 
       "markerStyle": 0, 
       "view": "<Camera><longitude>12.486970755828</longitude><latitude>41.891783564551</latitude><altitude>60.785260345922</altitude><roll>3.4195511018927E-9</roll><tilt>81.922735124754</tilt><heading>-64.503780514316</heading></Camera>"
   }, 
   "id": 23077, 
   "state": "2", 
   "owner": 98, 
   "objectType": 2, 
   "linkUrl": "http://linuxdev.ats.ucla.edu/~jay/devHC/trunk/provider/collections/23077", 
   "children": [], // Full JSON of all objects in the collection. See Rich Objects for an example.
   "hcPermalink": "http://linuxdev.ats.ucla.edu/~jay/devHC/trunk/spawnSession.php?authType=shibboleth&collection=23077"
}

Searching

Searching for Collections (/collections, GET)

To search for collections, send a GET request to /collections. All criteria for objects are valid; there is only one additional field, "ids", a comma-separated list of IDs to query. The ids parameter can be used to search a number of collections for objects within them at the same time. The primary use for this is to search inside multiple collections.

Almost every HyperCities collection proceeds from a hierarchy that begins at one of a few root collections (in the main HyperCities instance): Public Collections, Featured Collections, Class Collections, or a user’s My Collections. For its browsing interface, the main HyperCities viewer searches these four collections instead of just searching all collections.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox