Getting the Most Out of OpenSocial Gadgets

44

Transcript of Getting the Most Out of OpenSocial Gadgets

Page 1: Getting the Most Out of OpenSocial Gadgets
Page 2: Getting the Most Out of OpenSocial Gadgets

Getting the most out of OpenSocial gadgets

2

Mark HalvorsonDirector of Interactive Marketing, AtlassianBoard Member, OpenSocial [email protected], @halv0112

Page 3: Getting the Most Out of OpenSocial Gadgets

Agenda

3

• What it is a Gadget

• Why Atlassian chose OpenSocial

• Why you should too!

Page 4: Getting the Most Out of OpenSocial Gadgets

What is OpenSocial?

4

Page 5: Getting the Most Out of OpenSocial Gadgets

Social Data Model

5

Page 6: Getting the Most Out of OpenSocial Gadgets

Web Service APIs

6

Page 7: Getting the Most Out of OpenSocial Gadgets

Gadgets

7

Page 8: Getting the Most Out of OpenSocial Gadgets

8

Our Problem

Page 9: Getting the Most Out of OpenSocial Gadgets

Before

• Enterprise Apps are Silos

9

FishEye Source Code

JIRA Issues & Tasks

Confluence Wiki

Page 10: Getting the Most Out of OpenSocial Gadgets

Emphasize Teams, Projects & Tasks over Tools

10

Page 11: Getting the Most Out of OpenSocial Gadgets

11

Too Many Dashboards

Page 12: Getting the Most Out of OpenSocial Gadgets

Cross-Product Sharing

12

Page 13: Getting the Most Out of OpenSocial Gadgets

Integration with non-Atlassian apps

13

Page 14: Getting the Most Out of OpenSocial Gadgets

14

Solution: OpenSocial Gadgets

Page 15: Getting the Most Out of OpenSocial Gadgets

Gadgets are a Great Solution for Dashboards

15

Page 16: Getting the Most Out of OpenSocial Gadgets

After

• Open standard for enterprise application connection

16

view complete projectsingle activity streamcomment & interact

Page 17: Getting the Most Out of OpenSocial Gadgets

Managers Do Email

• Not just about portals, or internal applications.

17

view activity & statuscreate issues

Page 18: Getting the Most Out of OpenSocial Gadgets

18

Page 19: Getting the Most Out of OpenSocial Gadgets

Why Write Gadgets?

• They’re easy!

• They use stable, widely accessible and understood technologies

• Write once, display in multiple containers

19

Page 20: Getting the Most Out of OpenSocial Gadgets

20

The Hello World Example

Page 21: Getting the Most Out of OpenSocial Gadgets

Anatomy of a Gadget

• XML Spec File

•Metadata, HTML Content, and JavaScript

• Core JavaScript API

•Access Preferences, Make Requests

• Gadget Features

•Additional, Optional Capabilities & APIs

21

Page 22: Getting the Most Out of OpenSocial Gadgets

22

XML Spec File

Page 23: Getting the Most Out of OpenSocial Gadgets

23

<ModulePrefs>

<?xml version="1.0" encoding="UTF-8" ?><Module> <ModulePrefs title="JIRA Issues" author="Atlassian" thumbnail="http://labs.atlassian.com/svn/GADGETS/trunk/jira-issues/basic/jira-issues-thumbnail.png" description="A list of recently created Issues">

<Require feature="minimessage" /> <Require feature="dynamic-height" />

</ModulePrefs>

Page 24: Getting the Most Out of OpenSocial Gadgets

24

<UserPref>

<UserPref name="show_date" display_name="Show Dates?" datatype="bool" default_value="true"/> <UserPref name="show_summ" display_name="Show Summaries?" datatype="bool" default_value="true"/> <UserPref name="num_entries" display_name="Number of Entries:" default_value="5" required="true"/>

Page 25: Getting the Most Out of OpenSocial Gadgets

25

<Content>

<Content type="html"><![CDATA[ <link rel="stylesheet" href="http://labs.atlassian.com/svn/GADGETS/trunk/jira-issues/basic/jira-issues.css">

<div id="content_div"></div>

<script type="text/javascript" src="http://labs.atlassian.com/svn/GADGETS/trunk/jira-issues/basic/jira-issues.js"></script> ]]></Content></Module>

Page 26: Getting the Most Out of OpenSocial Gadgets

26

Views - DEFAULT view

Page 27: Getting the Most Out of OpenSocial Gadgets

27

Views - DEFAULT view

Page 28: Getting the Most Out of OpenSocial Gadgets

28

Views - CANVAS view

Page 29: Getting the Most Out of OpenSocial Gadgets

29

Views - DEFAULT view (Gmail)

Page 30: Getting the Most Out of OpenSocial Gadgets

Views - CANVAS view (Gmail)

30

Page 31: Getting the Most Out of OpenSocial Gadgets

Inline Contextual Gadget

31

+

Page 32: Getting the Most Out of OpenSocial Gadgets

32

Views - Custom view

Page 33: Getting the Most Out of OpenSocial Gadgets

Wallboards

• Gadgets go beyond the JIRA Dashboard onto your wall!

33

Page 34: Getting the Most Out of OpenSocial Gadgets

Wallboard – Default View

34

Page 35: Getting the Most Out of OpenSocial Gadgets

Wallboard – Wallboard View

35

Page 36: Getting the Most Out of OpenSocial Gadgets

36

JavaScript

// Create minimessage factoryvar msg = new gadgets.MiniMessage();// Show a small loading message to the uservar loadMessage = msg.createStaticMessage("loading...");

// Get configured user prefsvar prefs = new gadgets.Prefs();var showDate = prefs.getBool("show_date");var showSummary = prefs.getBool("show_summ");var numEntries = prefs.getInt("num_entries");

// Fetch issues when the gadget loadsgadgets.util.registerOnLoadHandler(fetchIssues);

Page 37: Getting the Most Out of OpenSocial Gadgets

Requesting Data from Web Services

• AJAX + DOM

• OAuth

• Request Proxy

37

Page 38: Getting the Most Out of OpenSocial Gadgets

38

gadgets.io.makeRequest()

Requesting Data from Web Services

Page 39: Getting the Most Out of OpenSocial Gadgets

What Can You Call?

• Any URL

• XML and JSON are the most useful

39

Page 40: Getting the Most Out of OpenSocial Gadgets

40

Fetching Issues

function fetchIssues() { var url = "http://jira.atlassian.com/sr/" + "jira.issueviews:searchrequest-xml" + "/temp/SearchRequest.xml?" + "created%3Aprevious=-1w&resolution=-1" + "&sorter/field=issuekey&sorter/order=DESC" + "&sorter/field=created&sorter/order=DESC" + "&tempMax=20";

var params = {}; params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.DOM;

gadgets.io.makeRequest(url, handleResponse, params);}

Page 41: Getting the Most Out of OpenSocial Gadgets

41

Handling the Response

function handleResponse(obj) { var domData = obj.data;

var jiraIssues = { title : getTitle(domData), items : getItems(domData) }; renderJiraIssues(jiraIssues);

msg.dismissMessage(loadMessage); gadgets.window.adjustHeight();}

Page 42: Getting the Most Out of OpenSocial Gadgets

Summary - Why write gadgets?• Easy!

•Simple web based technologies mean anyone can write a gadget.

• Reusable!

•Use in any OpenSocial Container. iGoogle, Gmail, JIVE, more every day.

• Fun!

•Thinking about applications as atomic units of work add a new dimension to application design.

42

Page 43: Getting the Most Out of OpenSocial Gadgets

#summit11

Building #opensocial gadgets is the easiest way to integrate external content into JIRA & Confluence. Join the #openapprevolution !

43

Page 44: Getting the Most Out of OpenSocial Gadgets

Questions?

Mark [email protected]: @halv0112