Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: (Classic)

...

The PDS service provides 3 functions and responds to 5 events. The functions are as follows:

Functions

get_item

The get_item function takes two arguments. Both are required.

...

The get_item function then returns whatever is stored within the PDS under the specified namespace and key.

get_me

The get_me function takes one required argument.

...

The get_me function then returns the item from the entity's profile associated with the given key.

get_all_me

The get_all_me function accepts no arguments. It returns all items from the entity's profile.

Code Block
languagejavascript
themeConfluencelanguagejavascript
myProfile = pds:get_all_me();
 
returns at least ...
 
{
  "myProfileName" : "John Smith",
  "myProfilePhoto" : "data: image/png;base64, ...",
  "myProfileNotes" : "Nothing to see here, move along",
  "myProfileDescription" : "Be all you can bee"
}

 

 

Events

The PDS Service responds to 5 events. The events are as follows:

 

pds new_data_available

This event should be raised whenever you wish to add an item to the PDS. You should include three attributes to your event when raising it:

  • namespace
    • A string containing the namespace to store the data
  • keyvalue
    • A string containing the key to store the data under
  • value
    • This attribute can be a string, number, boolean, hash, or array
    • This data gets stored in the PDS under the namespace and key

pds new_map_available

This event should be raised when you wish to update all items under a namespace. The items should be in a hash with the key being the value to update and the values being the values to be set as.

...

 

Code Block
languagejavascript
// These two new_data_available events are equivilent to the new_map_available event
raise pds event new_data_available
	with namespace = "test"
	and keyvalue = "foo"
	and value = "bar";
raise pds event new_data_available
	with namespace = "test"
	and keyvalue = "bar"
	and value = "cheese";
 
 
 
raise pds event new_map_available
	with namespace = "test"
	and mapvalues = {
		"foo" : "bar",
		"bar" : "cheese"
	};

 

pds new_profile_item_available

This event should be raised whenever you wish to change the entity's profile within the PDS. Since the data is going into the profile, namespace is not used on this event. All of the attributes supplied with this event are stored into the PDS.

 

pds new_doorbell_available

This event updates the doorbell ECI stored in the entity's profile within the PDS. The event attributes used are as follows:

  • doorbell
    • The ECI of the entity's new doorbell

web sessionReady

This event gets raised within the CloudOS when the user logs in. There are two things that happen when the session is ready:

...