Link
The Link element allows a developer to take advantage of application
life-cycle events defined by a container. Such events might be
application installs or uninstalls, or any other event in the day-to-day
life of a social application. The container supports these features by
sending relevant query parameters denoting the event to a URL endpoint specified within the Link node.
A Link node may take the
following form under the ModulePrefs
element:
<ModulePrefs>
<Link rel="event" href="http://www.mysite.com/ping.php" method="POST" />
<Link rel="event.addapp" href="http://www.mysite.com/add_app.php" />
<Link rel="event.removeapp" href="http://www.mysite.com/remove_app.php" />
</ModulePrefs>As you can see in the preceding example, the Link node has several associated attributes.
They are listed in Table 3-5.
Table 3-5. Link attributes
Attribute | Description |
|---|---|
| The string value that denotes the event being triggered. This value is required. |
| The URL to make a request to once the event has been triggered. This value is required. |
| The HTTP request method, either |
If a Link node is specified
with a rel of
opensocialevent (e.g., rel="event"), then any undefined life-cycle
event types will be sent through to that href value by default. If there are one or more Link nodes with a rel of
opensocialevent.type (e.g., rel="event.addapp"), then any ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access