The Public Data Module is a node-based data storage for Newport World Resorts's publicly
available assets. It uses the Phoenix API's $public command group,
and can be tested here.
Jump to: Quick Start, Utility Library, Node Map
Quick Start
-
In order to use any of the Nodes in the Public Data Module, first you need a list of the available nodes. You can use the
$public.listNodescommand via the Phoenix API with one of the parent keys below. Note that the list below is generated using javascript, via the$public.getcommand's 'children' response; We encourage everyone to study the javascript of this page.
As you can see on the response above, the format is 'nodeKey':'nodeName'. Note that the nodeKey contains the parentKey, and will always be unique for each node. The nodeName, on the other hand, is NOT unique.
-
String Assets are fairly easy to retrieve and store from the Public Data Module; just use the
text/plaincontent-type, and one of the NodeKeys retrieved from the listNodes command above.
As you can see on the response above, the format is 'nodeKey.stringKey':'stringValue'. It's fairly trivial to replace the nodeKey with an empty string to get the stringKey only.
-
Non-String Assets, on the other hand, does not use the Node structure, and therfore cannot be listed or retrieved in bulk. As you can see on the Node result above, one of the stringValues have a non-
text/plaincontent-type; the stringKey 'banner' has a content type ofimage/png;base64. You can retrieve that asset directly by passing its NodeKey (rwm.events.3c57033d-99c1-4482-90fe-3f610cc10f7e.banner) and its correct content-type (image/png;base64) to the$public.getcommand.
-
Non-String Assets can be easily shown via the Data URI scheme. The image below is an example of a non-string asset that is dynamically loaded to an
<img>tag. You can find out how to do this by looking at the javascript of this page
Utility Library
https://github.com/davidchambers/Base64.js
Node Map
To be determined.