-
Notifications
You must be signed in to change notification settings - Fork 0
/
code_actions
149 lines (110 loc) · 3.24 KB
/
code_actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
$ : execute
> : edit
# : browse
[ Prep ]
$ log in to sandbox
$ clean out everything, recreate group
$ uninstall add-on
$ log in to nitrous
$ have 'https://github.com/tjconsult/jiveworld-demo' in clipboard
$ select node!
$ Fire up a brand new nitrous box
[ Intro ]
[0:00]
$ cd workspace
$ npm install -g jive-sdk
[ Building a Service ]
[3:00]
(maximize screen)
$ jive-sdk help
$ jive-sdk list services
$ jive-sdk create example-service --name="performanceservice"
[4:00]
> set tab to 4
> jiveclientconfiguration.json:
* change port to 3000 (maps to 80 on nitrous) ?? try with 80 ??
* change URL to the nitrous.io box host name
[5:00]
$ npm update
> show app.js
$ node app.js
# (click Preview) <host>/performanceservice/hello
> delete service/performanceservice/definition.json
$ node app.js
> delete public folder
> services/performanceservice/backend/routes/explicit_routes.js:
* last
* Math.round(Math.random() * 2499) + 1
* var jive = require('jive-sdk');
* jive.logger.info
* return string
> delete services.js
$ node app.js
# host:3000/performanceservice/last
[ Building a Tile ]
[11:00]
$ jive-sdk list tiles
$ jive-sdk create tile-gauge --name="performance-tile"
$ npm update
> edit definition.json:
#021677 #5a2bac #0088e1 #00c4dc
Trouble! Slow! Good Fast
"message": "Remote Service Performance"
"displayName": "Remote Performance"
"description": "Shows performance indicators of a remote service"
! add the action and explain why
show screenshot
> cheating with lib.js: copy from checkout
> datapusher.js:
var jive = require("jive-sdk"),
lib = require("../../lib"),
tileData = require("../definition.json").sampleData,
defaultRanges = [ 1, 2000, 1500, 1000 ];
.fail(function(error) {
console.log(error);
});
copy & paste pusher, but delete action data
> configure/get.js
- clean up code a bit
# delete main.css and use /public/stylesheets/style.css instead
body {
background-color: #eee;
margin:20px;
}
label, p { display: block; margin: 0.4em 0; }
label input, label strong { display: inline-block; width: 4em; text-align: right; }
button { font-size: 1.15em; font-weight: bold }
> configuration.html
- change the form (explain indexes)
> main.js
TODO (don't rename!!)
[25:00]
[ Deploying a Tile ]
> db/jiveExtension.json "name": "JiveWorld Purposeful Places Add-on",
"description": "Jive Node SDK Demo"
$ node app.js
- install add-on > avatar > Add-ons > Upload Package > ...
- in our case, where we're using the default file-based Jive persistence, the Jive instance's registration information show up in the db folder
[28:00]
[ Adding a Tile Action ]
> new get.js
> new action.html
> new action.js
> update datapusher.js to return action URL and
[38:00]
[ Adding a Stream Integration ]
$ jive-sdk list tiles
$ jive-sdk create tile-activity --name="performance-notification"
> templates.json
add the performance-notification
$ customize stream integration
> get.js
> configuration.html
> delete js
> definition.json
$ node app.js
- upload new package
[40:00]
- create a new place based on the addons template
- TODO add the gauge tile to MyPage
"The applied template has social group type of 'Open', but the current setting is 'Secret'. You can change it in the About menu."