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

  1. 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.listNodes command via the Phoenix API with one of the parent keys below. Note that the list below is generated using javascript, via the $public.get command's 'children' response; We encourage everyone to study the javascript of this page.


    ...
    "rwm.events.0e3ffcc4-c64d-463f-b598-7091a1e058dc":"Grand Fiesta 2012",
    "rwm.events.3c57033d-99c1-4482-90fe-3f610cc10f7e":"Pinoy Ultimate Jeepney",
    ...             

    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.

  2. String Assets are fairly easy to retrieve and store from the Public Data Module; just use the text/plain content-type, and one of the NodeKeys retrieved from the listNodes command above.

    ...
    "rwm.events.3c57033d-99c1-4482-90fe-3f610cc10f7e.nodeName":"Pinoy Ultimate Jeepney",
    "rwm.events.3c57033d-99c1-4482-90fe-3f610cc10f7e.location":"Newport World Resorts",
    "rwm.events.3c57033d-99c1-4482-90fe-3f610cc10f7e.description":"Join us as we bring the spotlight on the country's iconic je...",
    "rwm.events.3c57033d-99c1-4482-90fe-3f610cc10f7e.banner":"Content-Type:image/png;base64"
    ...             

    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.

  3. 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/plain content-type; the stringKey 'banner' has a content type of image/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.get command.

    ...
    "key":"rwm.events.3c57033d-99c1-4482-90fe-3f610cc10f7e.banner",
    "content-type":"image/png;base64",
    "value":"/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAA8AAD/4QMraHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNr...",
    ...             
  4. 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

  5. Utility Library

    https://github.com/davidchambers/Base64.js

    Node Map

    To be determined.