cpee 1.3.181 → 1.3.183

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. checksums.yaml +4 -4
  2. data/cockpit/css/ui.css +19 -60
  3. data/cockpit/css/wfadaptor.css +11 -0
  4. data/cockpit/index.html +45 -71
  5. data/cockpit/js/details.js +50 -139
  6. data/cockpit/js/instance.js +133 -185
  7. data/cockpit/js/parameters.js +57 -55
  8. data/cockpit/js/ui.js +4 -29
  9. data/cockpit/js/wfadaptor.js +190 -108
  10. data/cockpit/rngs/attributes.rng +8 -0
  11. data/cockpit/rngs/dataelements.rng +8 -0
  12. data/cockpit/rngs/endpoints.rng +8 -0
  13. data/cockpit/testsets/Concurrent.xml +6 -6
  14. data/cockpit/testsets/Coopis Testset.xml +12 -12
  15. data/cockpit/testsets/ICSOC Testset.xml +27 -27
  16. data/cockpit/testsets/Infinity.xml +4 -4
  17. data/cockpit/testsets/Linear.xml +10 -10
  18. data/cockpit/testsets/Mangler 1.xml +20 -20
  19. data/cockpit/testsets/Mangler 2.xml +18 -18
  20. data/cockpit/testsets/Promise.xml +258 -0
  21. data/cockpit/testsets/SOPROMO Test Sonification.xml +11 -11
  22. data/cockpit/testsets/Syncing P34 1.xml +12 -12
  23. data/cockpit/testsets/Syncing P34 2.xml +12 -12
  24. data/cockpit/testsets/Syncing P34 3.xml +12 -12
  25. data/cockpit/testsets/Syncing P34.xml +12 -12
  26. data/cockpit/testsets/TEST - Bad Loop.xml +39 -39
  27. data/cockpit/testsets/Update.xml +1 -1
  28. data/cockpit/testsets/Worklist Parallel.xml +8 -8
  29. data/cockpit/testsets/Worklist Test CPEE.xml +2 -2
  30. data/cockpit/testsets/Worklist Test.xml +2 -2
  31. data/cockpit/testsets/testsets.xml +2 -0
  32. data/cockpit/themes/adventure/rngs/alternative.rng +5 -0
  33. data/cockpit/themes/adventure/rngs/call.rng +29 -0
  34. data/cockpit/{rngtest2.rng → themes/adventure/rngs/callmanipulate.rng} +9 -9
  35. data/cockpit/themes/adventure/rngs/choose.rng +8 -0
  36. data/cockpit/themes/adventure/rngs/critical.rng +5 -0
  37. data/cockpit/themes/adventure/rngs/escape.rng +1 -0
  38. data/cockpit/themes/adventure/rngs/finalize.rng +6 -0
  39. data/cockpit/themes/adventure/rngs/group.rng +3 -0
  40. data/cockpit/themes/adventure/rngs/loop.rng +11 -0
  41. data/cockpit/themes/adventure/rngs/manipulate.rng +6 -0
  42. data/cockpit/themes/adventure/rngs/otherwise.rng +1 -0
  43. data/cockpit/themes/adventure/rngs/parallel.rng +5 -0
  44. data/cockpit/themes/adventure/rngs/parallel_branch.rng +8 -0
  45. data/cockpit/themes/adventure/rngs/update.rng +6 -0
  46. data/cockpit/themes/adventure/symbols/alternative.svg +4 -0
  47. data/cockpit/themes/adventure/symbols/call.svg +4 -0
  48. data/cockpit/themes/adventure/symbols/callmanipulate.svg +6 -0
  49. data/cockpit/themes/adventure/symbols/choose.svg +5 -0
  50. data/cockpit/themes/adventure/symbols/choose_exclusive.svg +5 -0
  51. data/cockpit/themes/adventure/symbols/choose_inclusive.svg +4 -0
  52. data/cockpit/themes/adventure/symbols/critical.svg +4 -0
  53. data/cockpit/themes/adventure/symbols/escape.svg +5 -0
  54. data/cockpit/themes/adventure/symbols/loop.svg +5 -0
  55. data/cockpit/themes/adventure/symbols/manipulate.svg +4 -0
  56. data/cockpit/themes/adventure/symbols/otherwise.svg +4 -0
  57. data/cockpit/themes/adventure/symbols/parallel.svg +5 -0
  58. data/cockpit/themes/adventure/symbols/parallel_branch.svg +4 -0
  59. data/cockpit/themes/adventure/symbols/scripts.svg +4 -0
  60. data/cockpit/themes/adventure/symbols/start.svg +3 -0
  61. data/cockpit/themes/adventure/theme.js +729 -0
  62. data/cockpit/themes/default/rngs/alternative.rng +5 -0
  63. data/cockpit/themes/default/rngs/call.rng +29 -0
  64. data/cockpit/themes/default/rngs/callmanipulate.rng +41 -0
  65. data/cockpit/themes/default/rngs/choose.rng +8 -0
  66. data/cockpit/themes/default/rngs/critical.rng +5 -0
  67. data/cockpit/themes/default/rngs/escape.rng +1 -0
  68. data/cockpit/themes/default/rngs/finalize.rng +6 -0
  69. data/cockpit/themes/default/rngs/group.rng +3 -0
  70. data/cockpit/themes/default/rngs/loop.rng +11 -0
  71. data/cockpit/themes/default/rngs/manipulate.rng +6 -0
  72. data/cockpit/themes/default/rngs/otherwise.rng +1 -0
  73. data/cockpit/themes/default/rngs/parallel.rng +5 -0
  74. data/cockpit/themes/default/rngs/parallel_branch.rng +8 -0
  75. data/cockpit/themes/default/rngs/update.rng +6 -0
  76. data/cockpit/themes/default/symbols/alternative.svg +4 -0
  77. data/cockpit/themes/default/symbols/call.svg +4 -0
  78. data/cockpit/themes/default/symbols/callmanipulate.svg +6 -0
  79. data/cockpit/themes/default/symbols/choose.svg +5 -0
  80. data/cockpit/themes/default/symbols/choose_exclusive.svg +5 -0
  81. data/cockpit/themes/default/symbols/choose_inclusive.svg +4 -0
  82. data/cockpit/themes/default/symbols/critical.svg +4 -0
  83. data/cockpit/themes/default/symbols/escape.svg +5 -0
  84. data/cockpit/themes/default/symbols/loop.svg +5 -0
  85. data/cockpit/themes/default/symbols/manipulate.svg +4 -0
  86. data/cockpit/themes/default/symbols/otherwise.svg +4 -0
  87. data/cockpit/themes/default/symbols/parallel.svg +5 -0
  88. data/cockpit/themes/default/symbols/parallel_branch.svg +4 -0
  89. data/cockpit/themes/default/symbols/scripts.svg +4 -0
  90. data/cockpit/themes/default/symbols/start.svg +3 -0
  91. data/cockpit/themes/default/theme.js +729 -0
  92. data/cockpit/themes/lego/rngs/alternative.rng +5 -0
  93. data/cockpit/themes/lego/rngs/call.rng +41 -0
  94. data/cockpit/themes/lego/rngs/choose.rng +8 -0
  95. data/cockpit/themes/lego/rngs/critical.rng +5 -0
  96. data/cockpit/themes/lego/rngs/loop.rng +11 -0
  97. data/cockpit/themes/lego/rngs/manipulate.rng +6 -0
  98. data/cockpit/themes/lego/rngs/parallel.rng +5 -0
  99. data/cockpit/themes/lego/rngs/parallel_branch.rng +8 -0
  100. data/cockpit/themes/lego/symbols/alternative.svg +4 -0
  101. data/cockpit/themes/lego/symbols/call.svg +4 -0
  102. data/cockpit/themes/lego/symbols/callmanipulate.svg +6 -0
  103. data/cockpit/themes/lego/symbols/callori.svg +4 -0
  104. data/cockpit/themes/lego/symbols/choose.svg +4 -0
  105. data/cockpit/themes/lego/symbols/choose_exclusive.svg +5 -0
  106. data/cockpit/themes/lego/symbols/choose_inclusive.svg +4 -0
  107. data/cockpit/themes/lego/symbols/critical.svg +4 -0
  108. data/cockpit/themes/lego/symbols/escape.svg +5 -0
  109. data/cockpit/themes/lego/symbols/lego.svg +72 -0
  110. data/cockpit/themes/lego/symbols/loop.svg +5 -0
  111. data/cockpit/themes/lego/symbols/manipulate.svg +4 -0
  112. data/cockpit/themes/lego/symbols/otherwise.svg +4 -0
  113. data/cockpit/themes/lego/symbols/parallel.svg +6 -0
  114. data/cockpit/themes/lego/symbols/parallel_branch.svg +4 -0
  115. data/cockpit/themes/lego/symbols/scripts.svg +4 -0
  116. data/cockpit/themes/lego/symbols/start.svg +3 -0
  117. data/cockpit/themes/lego/theme.js +742 -0
  118. data/cockpit/themes/promise/rngs/alternative.rng +5 -0
  119. data/cockpit/themes/promise/rngs/call.rng +41 -0
  120. data/cockpit/themes/promise/rngs/choose.rng +8 -0
  121. data/cockpit/themes/promise/rngs/critical.rng +5 -0
  122. data/cockpit/themes/promise/rngs/loop.rng +11 -0
  123. data/cockpit/themes/promise/rngs/manipulate.rng +6 -0
  124. data/cockpit/themes/promise/rngs/parallel.rng +5 -0
  125. data/cockpit/themes/promise/rngs/parallel_branch.rng +8 -0
  126. data/cockpit/themes/promise/symbols/alternative.svg +4 -0
  127. data/cockpit/themes/promise/symbols/call.svg +4 -0
  128. data/cockpit/themes/promise/symbols/callmanipulate.svg +6 -0
  129. data/cockpit/themes/promise/symbols/choose.svg +4 -0
  130. data/cockpit/themes/promise/symbols/choose_exclusive.svg +5 -0
  131. data/cockpit/themes/promise/symbols/choose_inclusive.svg +4 -0
  132. data/cockpit/themes/promise/symbols/critical.svg +4 -0
  133. data/cockpit/themes/promise/symbols/escape.svg +5 -0
  134. data/cockpit/themes/promise/symbols/loop.svg +5 -0
  135. data/cockpit/themes/promise/symbols/manipulate.svg +4 -0
  136. data/cockpit/themes/promise/symbols/otherwise.svg +4 -0
  137. data/cockpit/themes/promise/symbols/parallel.svg +6 -0
  138. data/cockpit/themes/promise/symbols/parallel_branch.svg +4 -0
  139. data/cockpit/themes/promise/symbols/preminder.svg +6 -0
  140. data/cockpit/themes/promise/symbols/scripts.svg +4 -0
  141. data/cockpit/themes/promise/symbols/start.svg +3 -0
  142. data/cockpit/themes/promise/theme.js +742 -0
  143. data/cpee.gemspec +2 -2
  144. data/lib/cpee/implementation.rb +15 -15
  145. data/server/handlerwrappers/default.rb +19 -19
  146. data/server/handlerwrappers/log.rb +264 -0
  147. data/server/instances/10/properties.xml +148 -0
  148. data/server/instances/11/properties.xml +149 -0
  149. data/server/instances/12/properties.xml +149 -0
  150. data/server/instances/13/properties.xml +149 -0
  151. data/server/instances/14/properties.xml +111 -0
  152. data/server/instances/15/properties.xml +113 -0
  153. data/server/instances/16/properties.xml +113 -0
  154. data/server/instances/17/properties.xml +149 -0
  155. data/server/instances/18/properties.xml +149 -0
  156. data/server/instances/19/properties.xml +114 -0
  157. data/server/instances/2/properties.xml +1 -1
  158. data/server/instances/20/properties.xml +113 -0
  159. data/server/instances/21/notifications/0851248d60c898cadd743d0dd5b6d273/consumer-secret +1 -0
  160. data/server/instances/21/notifications/0851248d60c898cadd743d0dd5b6d273/producer-secret +1 -0
  161. data/server/instances/21/notifications/0851248d60c898cadd743d0dd5b6d273/subscription.xml +6 -0
  162. data/server/instances/21/notifications/b7bac3f3010d433ce5d8f29338a06f9a/consumer-secret +1 -0
  163. data/server/instances/21/notifications/b7bac3f3010d433ce5d8f29338a06f9a/producer-secret +1 -0
  164. data/server/instances/21/notifications/b7bac3f3010d433ce5d8f29338a06f9a/subscription.xml +23 -0
  165. data/server/instances/21/properties.xml +149 -0
  166. data/server/instances/22/properties.xml +113 -0
  167. data/server/instances/23/properties.xml +88 -0
  168. data/server/instances/24/properties.xml +168 -0
  169. data/server/instances/25/properties.xml +149 -0
  170. data/server/instances/26/properties.xml +113 -0
  171. data/server/instances/27/properties.xml +141 -0
  172. data/server/instances/3/properties.xml +46 -0
  173. data/server/instances/4/properties.xml +148 -0
  174. data/server/instances/5/properties.xml +148 -0
  175. data/server/instances/6/properties.xml +148 -0
  176. data/server/instances/7/properties.xml +148 -0
  177. data/server/instances/8/properties.xml +148 -0
  178. data/server/instances/9/properties.xml +46 -0
  179. data/server/resources/properties.init +2 -1
  180. data/server/resources/transformation_dslx.xsl +12 -12
  181. data/server/server.pid +1 -0
  182. data/server/server.rb +2 -0
  183. metadata +152 -12
  184. data/cockpit/js/wfadaptor.cpee.js +0 -936
  185. data/cockpit/rngtest1.html +0 -53
  186. data/cockpit/rngtest1.rng +0 -38
  187. data/cockpit/rngtest1.xml +0 -16
  188. data/cockpit/rngtest2.html +0 -53
  189. data/cockpit/rngtest2.xml +0 -11
  190. data/cockpit/test.html +0 -46
@@ -1,6 +1,5 @@
1
1
  var ws;
2
2
  var running = false;
3
- var graphrealization;
4
3
  var subscription;
5
4
  var subscription_state = 'less';
6
5
  var save = {};
@@ -8,7 +7,9 @@ var save = {};
8
7
  save['dsl'] = undefined;
9
8
  save['endpoints'] = undefined;
10
9
  save['dataelements'] = undefined;
10
+ save['attributes'] = undefined;
11
11
  save['details'] = undefined;
12
+ save['details_target'] = undefined;
12
13
  var node_state = {};
13
14
  var sub_more = 'topic' + '=' + 'activity' + '&' +// {{{
14
15
  'events' + '=' + 'calling,status,manipulating,failed,done' + '&' +
@@ -67,8 +68,8 @@ $(document).ready(function() {// {{{
67
68
  $("input[name=testsetfile]").change(load_testsetfile_after);
68
69
  $("input[name=modelfile]").change(load_modelfile_after);
69
70
 
70
- $.ajax({
71
- url: "testsets/testsets.xml",
71
+ $.ajax({
72
+ url: "testsets/testsets.xml",
72
73
  dataType: 'xml',
73
74
  success: function(res){
74
75
  $('testset',res).each(function(){
@@ -94,11 +95,11 @@ $(document).ready(function() {// {{{
94
95
  ui_activate_tab("#tabexecution");
95
96
  // ui_toggle_vis_tab($("#instance td.switch"));
96
97
  monitor_instance(false);
97
- }
98
+ }
98
99
  }
99
100
  });
100
- $.ajax({
101
- url: "testsets/transformations.xml",
101
+ $.ajax({
102
+ url: "testsets/transformations.xml",
102
103
  dataType: 'xml',
103
104
  success: function(res){
104
105
  $('transformation',res).each(function(){
@@ -115,29 +116,29 @@ function check_subscription() { // {{{
115
116
  if ($("input[name=votecontinue]").is(':checked')) num += 1;
116
117
  if (num > 0 && subscription_state == 'less') {
117
118
  $.ajax({
118
- type: "PUT",
119
+ type: "PUT",
119
120
  url: url + "/notifications/subscriptions/" + subscription,
120
121
  data: (
121
- 'message-uid' + '=' + 'xxx' + '&' +
122
122
  sub_more + '&' +
123
+ 'message-uid' + '=' + 'xxx' + '&' +
123
124
  'fingerprint-with-producer-secret' + '=' + 'xxx'
124
125
  )
125
126
  });
126
127
  subscription_state = 'more';
127
- }
128
+ }
128
129
  if (num == 0 && subscription_state == 'more') {
129
130
  $.ajax({
130
- type: "PUT",
131
+ type: "PUT",
131
132
  url: url + "/notifications/subscriptions/" + subscription,
132
133
  data: (
133
- 'message-uid' + '=' + 'xxx' + '&' +
134
134
  sub_less + '&' +
135
+ 'message-uid' + '=' + 'xxx' + '&' +
135
136
  'fingerprint-with-producer-secret' + '=' + 'xxx'
136
137
  )
137
- });
138
+ });
138
139
  subscription_state = 'less';
139
140
  format_visual_vote_clear();
140
- }
141
+ }
141
142
  }// }}}
142
143
 
143
144
  function create_instance(ask) {// {{{
@@ -146,14 +147,14 @@ function create_instance(ask) {// {{{
146
147
  if (info.match(/\S/)) {
147
148
  var base = $("input[name=base-url]").val();
148
149
  $.ajax({
149
- type: "POST",
150
+ type: "POST",
150
151
  url: base,
151
152
  dataType: "text",
152
- data: "info=" + info,
153
+ data: "info=" + info,
153
154
  success: function(res){
154
155
  $("input[name=instance-url]").val((base + "//" + res + "/").replace(/\/+/g,"/").replace(/:\//,"://"));
155
156
  if (ask) monitor_instance(true);
156
- },
157
+ },
157
158
  error: function(a,b,c) {
158
159
  alert("No CPEE running.");
159
160
  }
@@ -161,9 +162,9 @@ function create_instance(ask) {// {{{
161
162
  } else {
162
163
  alert("An instance info is necessary!");
163
164
  }
164
- }
165
+ }
165
166
  }// }}}
166
-
167
+
167
168
  function monitor_instance(load) {// {{{
168
169
  var url = $("input[name=instance-url]").val();
169
170
 
@@ -171,7 +172,7 @@ function monitor_instance(load) {// {{{
171
172
  $('#dat_details').empty();
172
173
 
173
174
  $.ajax({
174
- type: "GET",
175
+ type: "GET",
175
176
  url: url + "/properties/schema/",
176
177
  success: function(res){
177
178
  $("ui-tabbed.hidden, ui-rest.hidden").removeClass("hidden");
@@ -194,7 +195,7 @@ function monitor_instance(load) {// {{{
194
195
  subscription_state = 'less';
195
196
 
196
197
  $.ajax({
197
- type: "POST",
198
+ type: "POST",
198
199
  url: url + "/notifications/subscriptions/",
199
200
  data: sub_less,
200
201
  success: function(res){
@@ -202,7 +203,7 @@ function monitor_instance(load) {// {{{
202
203
  $.each(res,function(a,b){
203
204
  if (b[0] == 'key') {
204
205
  subscription = b[1];
205
- }
206
+ }
206
207
  });
207
208
  append_to_log("monitoring", "id", subscription);
208
209
  var Socket = "MozWebSocket" in window ? MozWebSocket : WebSocket;
@@ -216,17 +217,18 @@ function monitor_instance(load) {// {{{
216
217
  if ($('event > topic',data).length > 0) {
217
218
  switch($('event > topic',data).text()) {
218
219
  case 'dataelements':
219
- monitor_instance_dataelements();
220
+ monitor_instance_values("dataelements");
220
221
  break;
221
222
  case 'description':
222
223
  monitor_instance_dsl();
223
224
  break;
224
225
  case 'endpoints':
225
- monitor_instance_endpoints();
226
+ monitor_instance_values("endpoints");
226
227
  break;
227
228
  case 'attributes':
228
- monitor_instance_attributes();
229
+ monitor_instance_values("attributes");
229
230
  monitor_instance_transformation();
231
+ monitor_graph_change();
230
232
  break;
231
233
  case 'state':
232
234
  monitor_instance_state_change(JSON.parse($('event > notification',data).text()).state);
@@ -247,7 +249,7 @@ function monitor_instance(load) {// {{{
247
249
  var notification = $('vote > notification',data).text();
248
250
  append_to_log("vote", $('vote > topic',data).text() + "/" + $('vote > vote',data).text(), notification);
249
251
  monitor_instance_vote_add(notification);
250
- }
252
+ }
251
253
  };
252
254
  ws.onclose = function() {
253
255
  append_to_log("monitoring", "closed", "server down i assume.");
@@ -256,9 +258,9 @@ function monitor_instance(load) {// {{{
256
258
  }
257
259
  });
258
260
 
259
- monitor_instance_dataelements();
260
- monitor_instance_endpoints();
261
- monitor_instance_attributes();
261
+ monitor_instance_values("dataelements");
262
+ monitor_instance_values("endpoints");
263
+ monitor_instance_values("attributes");
262
264
  monitor_instance_transformation();
263
265
  monitor_instance_dsl();
264
266
  monitor_instance_state();
@@ -267,94 +269,55 @@ function monitor_instance(load) {// {{{
267
269
  alert("This ain't no CPEE instance");
268
270
  ui_activate_tab("#tabnew");
269
271
  }
270
- });
272
+ });
271
273
  }// }}}
272
274
 
273
- function monitor_instance_dataelements() {// {{{
275
+ function monitor_instance_values(val) {// {{{
274
276
  var url = $("#current-instance").text();
275
277
  $.ajax({
276
- type: "GET",
277
- url: url + "/properties/values/dataelements/",
278
+ type: "GET",
279
+ url: url + "/properties/values/" + val + "/",
278
280
  success: function(res){
279
- var values = $("value > *",res);
280
- var temp = {};
281
- values.each(function() {
282
- temp[this.nodeName] = format_text($(this).text());
283
- });
284
- var temp_xml = serialize_hash(temp);
285
-
286
- if (temp_xml != save['dataelements']) {
287
- save['dataelements'] = temp_xml;
288
- var ctv = $("#dat_dataelements");
289
- ctv.empty();
290
- $.each(temp,function(a,b){
291
- var node = $("#dat_template_pair tr").clone(true);
292
- $('.pair_name',node).val(a);
293
- $('.pair_value',node).val(b);
294
- ctv.append(node);
295
- });
296
- }
281
+ save[val].content(res);
297
282
  }
298
- });
283
+ });
299
284
  } // }}}
300
285
 
301
- function monitor_instance_endpoints() {// {{{
302
- var url = $("#current-instance").text();
303
- $.ajax({
304
- type: "GET",
305
- url: url + "/properties/values/endpoints/",
306
- success: function(res){
307
- var values = $("value > *",res);
308
- var temp = {}
309
- values.each(function(){
310
- temp[this.nodeName] = $(this).text();
286
+ function adaptor_init(url,theme,dslx) {
287
+ new WfAdaptor($('body').data('theme-base') + '/' + theme + '/theme.js',function(graphrealization){
288
+ graphrealization.set_svg_container($('#graphcanvas'));
289
+ graphrealization.set_description($(dslx), true);
290
+ graphrealization.notify = function(svgid) {
291
+ $.ajax({
292
+ type: "PUT",
293
+ url: url + "/properties/values/description/",
294
+ data: ({'content': '<content>' + graphrealization.get_description() + '</content>'})
311
295
  });
312
- var temp_xml = serialize_hash(temp);
313
-
314
- if (temp_xml != save['endpoints']) {
315
- save['endpoints'] = temp_xml;
316
- var ctv = $("#dat_endpoints");
317
- ctv.empty();
318
- $.each(temp,function(a,b){
319
- var node = $("#dat_template_pair tr").clone(true);
320
- $('.pair_name',node).val(a);
321
- $('.pair_value',node).val(b);
322
- ctv.append(node);
323
- });
324
- ctv.append(temp);
325
- }
326
- }
296
+ manifestation.events.click(svgid,undefined);
297
+ };
298
+ monitor_instance_pos();
327
299
  });
328
- }// }}}
300
+ }
329
301
 
330
- function monitor_instance_attributes() {// {{{
302
+ function monitor_graph_change() {
331
303
  var url = $("#current-instance").text();
332
304
  $.ajax({
333
- type: "GET",
334
- url: url + "/properties/values/attributes/",
335
- success: function(res){
336
- var values = $("value > *",res);
337
- var temp = {}
338
- values.each(function(){
339
- temp[this.nodeName] = $(this).text();
305
+ type: "GET",
306
+ url: url + "/properties/values/dslx/",
307
+ success: function(dslx){
308
+ $.ajax({
309
+ type: "GET",
310
+ url: url + "/properties/values/attributes/theme/",
311
+ success: function(res){
312
+ adaptor_init(url,$('value',res).text(),dslx);
313
+ },
314
+ error: function() {
315
+ adaptor_init(url,'default',dslx);
316
+ }
340
317
  });
341
- var temp_xml = serialize_hash(temp);
342
-
343
- if (temp_xml != save['attributes']) {
344
- save['attributes'] = temp_xml;
345
- var ctv = $("#dat_attributes");
346
- ctv.empty();
347
- $.each(temp,function(a,b){
348
- var node = $("#dat_template_pair tr").clone(true);
349
- $('.pair_name',node).val(a);
350
- $('.pair_value',node).val(b);
351
- ctv.append(node);
352
- });
353
- ctv.append(temp);
354
- }
355
318
  }
356
319
  });
357
- }// }}}
320
+ }
358
321
 
359
322
  function monitor_instance_dsl() {// {{{
360
323
  var url = $("#current-instance").text();
@@ -373,22 +336,7 @@ function monitor_instance_dsl() {// {{{
373
336
  res = res.replace(/activity\s+\[:([A-Za-z][a-zA-Z0-9_]+)([^\]]*\])/g,"<span class='activities' id=\"activity-$1\">activity [:$1$2</span>");
374
337
 
375
338
  ctv.append(res);
376
-
377
- $.ajax({
378
- type: "GET",
379
- url: url + "/properties/values/dslx/",
380
- success: function(res){
381
- graphrealization = new WfAdaptor(CPEE);
382
- graphrealization.set_svg_container($('#graphcanvas'));
383
- graphrealization.set_description($(res), true);
384
- graphrealization.notify = function(svgid) {
385
- console.log('rrr');
386
- save_description();
387
- manifestation.events.click(svgid,undefined);
388
- };
389
- monitor_instance_pos();
390
- }
391
- });
339
+ monitor_graph_change();
392
340
  }
393
341
  }
394
342
  });
@@ -397,7 +345,7 @@ function monitor_instance_dsl() {// {{{
397
345
  function monitor_instance_state() {// {{{
398
346
  var url = $("#current-instance").text();
399
347
  $.ajax({
400
- type: "GET",
348
+ type: "GET",
401
349
  url: url + "/properties/values/state/",
402
350
  dataType: "text",
403
351
  success: function(res){
@@ -408,7 +356,7 @@ function monitor_instance_state() {// {{{
408
356
  function monitor_instance_transformation() {// {{{
409
357
  var url = $("#current-instance").text();
410
358
  $.ajax({
411
- type: "GET",
359
+ type: "GET",
412
360
  url: url + "/properties/values/attributes/modeltype",
413
361
  success: function(res){
414
362
  $("#currentmodel").text($(res.documentElement).text());
@@ -422,7 +370,7 @@ function monitor_instance_transformation() {// {{{
422
370
  function monitor_instance_pos() {// {{{
423
371
  var url = $("#current-instance").text();
424
372
  $.ajax({
425
- type: "GET",
373
+ type: "GET",
426
374
  url: url + "/properties/values/positions/",
427
375
  success: function(res){
428
376
  var values = $("value > *",res);
@@ -446,7 +394,7 @@ function monitor_instance_running(notification,event) {// {{{
446
394
  function monitor_instance_state_change(notification) { //{{{
447
395
  if (notification == "ready" || notification == "stopped" || notification == "running") {
448
396
  $("#state button").removeAttr('disabled');
449
- }
397
+ }
450
398
  if (notification != save['state']) {
451
399
  save['state'] = notification;
452
400
 
@@ -455,10 +403,10 @@ function monitor_instance_state_change(notification) { //{{{
455
403
 
456
404
  if (notification == "stopped") {
457
405
  monitor_instance_pos();
458
- }
406
+ }
459
407
  if (notification == "running") {
460
408
  format_visual_clear();
461
- }
409
+ }
462
410
 
463
411
  var but = "";
464
412
  if (notification == "ready" || notification == "stopped") {
@@ -472,7 +420,7 @@ function monitor_instance_state_change(notification) { //{{{
472
420
  $('.tabbehind button').hide();
473
421
  } else {
474
422
  $('#parameters .tabbehind button').show();
475
- }
423
+ }
476
424
 
477
425
  ctv.append(notification + but);
478
426
  }
@@ -481,12 +429,12 @@ function monitor_instance_pos_change(notification) {// {{{
481
429
  var parts = JSON.parse(notification);
482
430
  if (parts['unmark']) {
483
431
  $.each(parts['unmark'],function(a,b){
484
- format_visual_remove(b,"passive")
432
+ format_visual_remove(b,"passive")
485
433
  });
486
434
  }
487
435
  if (parts['at']) {
488
436
  $.each(parts['at'],function(a,b){
489
- format_visual_add(b,"passive")
437
+ format_visual_add(b,"passive")
490
438
  });
491
439
  }
492
440
  } // }}}
@@ -504,7 +452,7 @@ function monitor_instance_vote_add(notification) {// {{{
504
452
  function monitor_instance_vote_remove(activity,callback,value) {//{{{
505
453
  var url = $("#current-instance").text();
506
454
  $.ajax({
507
- type: "PUT",
455
+ type: "PUT",
508
456
  url: url + "/callbacks/" + callback,
509
457
  data: ({'continue': value}),
510
458
  error: report_failure
@@ -516,7 +464,7 @@ function monitor_instance_vote_remove(activity,callback,value) {//{{{
516
464
  function start_instance() {// {{{
517
465
  var url = $("#current-instance").text();
518
466
  $.ajax({
519
- type: "PUT",
467
+ type: "PUT",
520
468
  url: url + "/properties/values/state",
521
469
  data: ({value: "running"}),
522
470
  error: report_failure
@@ -525,7 +473,7 @@ function start_instance() {// {{{
525
473
  function sim_instance() {// {{{
526
474
  var url = $("#current-instance").text();
527
475
  $.ajax({
528
- type: "PUT",
476
+ type: "PUT",
529
477
  url: url + "/properties/values/state",
530
478
  data: ({value: "simulating"}),
531
479
  error: report_failure
@@ -534,7 +482,7 @@ function sim_instance() {// {{{
534
482
  function stop_instance() {// {{{
535
483
  var url = $("#current-instance").text();
536
484
  $.ajax({
537
- type: "PUT",
485
+ type: "PUT",
538
486
  url: url + "/properties/values/state",
539
487
  data: ({value: "stopping"}),
540
488
  error: report_failure
@@ -546,34 +494,34 @@ function save_testset() {// {{{
546
494
  var testset = $X('<testset/>');
547
495
 
548
496
  $.ajax({
549
- type: "GET",
497
+ type: "GET",
550
498
  url: base + "/properties/values/dataelements/",
551
499
  success: function(res){
552
500
  var pars = $X('<dataelements/>');
553
501
  pars.append($(res.documentElement).children());
554
502
  testset.append(pars);
555
503
  $.ajax({
556
- type: "GET",
504
+ type: "GET",
557
505
  url: base + "/properties/values/handlerwrapper/",
558
506
  success: function(res){
559
507
  var pars = $X('<handlerwrapper>' + res + '</handlerwrapper>');
560
508
  testset.append(pars);
561
509
  $.ajax({
562
- type: "GET",
510
+ type: "GET",
563
511
  url: base + "/properties/values/endpoints/",
564
512
  success: function(res){
565
513
  var pars = $X('<endpoints/>');
566
514
  pars.append($(res.documentElement).children());
567
515
  testset.append(pars);
568
516
  $.ajax({
569
- type: "GET",
517
+ type: "GET",
570
518
  url: base + "/properties/values/positions/",
571
519
  success: function(res){
572
520
  var pars = $X('<positions/>');
573
521
  pars.append($(res.documentElement).children());
574
522
  testset.append(pars);
575
523
  $.ajax({
576
- type: "GET",
524
+ type: "GET",
577
525
  url: base + "/properties/values/dslx/",
578
526
  success: function(res){
579
527
  var pars = $X('<description/>');
@@ -582,7 +530,7 @@ function save_testset() {// {{{
582
530
  pars = $X('<transformation><description type="copy"/><dataelements type="none"/><endpoints type="none"/></transformation>');
583
531
  testset.append(pars);
584
532
  $.ajax({
585
- type: "GET",
533
+ type: "GET",
586
534
  url: base + "/properties/values/attributes/",
587
535
  success: function(res){
588
536
  var name = $("value > info",res).text();
@@ -592,10 +540,10 @@ function save_testset() {// {{{
592
540
  $('#savetestset').attr('download',name + '.xml');
593
541
  $('#savetestset').attr('href','data:application/xml;charset=utf-8;base64,' + window.btoa(testset.serializeXML()));
594
542
  document.getElementById('savetestset').click();
595
- },
543
+ },
596
544
  error: report_failure
597
545
  });
598
- },
546
+ },
599
547
  error: report_failure
600
548
  });
601
549
  },
@@ -609,20 +557,20 @@ function save_testset() {// {{{
609
557
  });
610
558
  },
611
559
  error: report_failure
612
- });
613
- }// }}}
560
+ });
561
+ }// }}}
614
562
  function save_svg() {// {{{
615
563
  var base = $("#current-instance").text();
616
564
  var params = { mimetype: 'image/svg+xml' };
617
565
 
618
566
  var gc = $('#graphcanvas').clone();
619
567
  $.ajax({
620
- type: "GET",
568
+ type: "GET",
621
569
  url: "lib/wfadaptor.css",
622
570
  success: function(res){
623
571
  gc.prepend($X('<style xmlns="http://www.w3.org/2000/svg" type="text/css"><![CDATA[' + res + ']]></style>'));
624
572
  $.ajax({
625
- type: "GET",
573
+ type: "GET",
626
574
  url: base + "/properties/values/attributes/info/",
627
575
  success: function(res){
628
576
  var name = $(res.documentElement).text();
@@ -630,17 +578,17 @@ function save_svg() {// {{{
630
578
  $('#savesvg').attr('download',name + '.svg');
631
579
  $('#savesvg').attr('href','data:application/xml;charset=utf-8;base64,' + window.btoa(gc.serializeXML()));
632
580
  document.getElementById('savesvg').click();
633
- },
581
+ },
634
582
  error: report_failure
635
583
  });
636
- }
584
+ }
637
585
  });
638
586
  }// }}}
639
587
  function set_testset(testset) {// {{{
640
588
  var url = $("#current-instance").text();
641
589
 
642
590
  $.ajax({
643
- type: "GET",
591
+ type: "GET",
644
592
  url: url + "/notifications/subscriptions/",
645
593
  success: function(res){
646
594
  var rcount = 0;
@@ -652,7 +600,7 @@ function set_testset(testset) {// {{{
652
600
  load_testset_handlers(url,testset,vals);
653
601
  },
654
602
  error: report_failure
655
- });
603
+ });
656
604
 
657
605
  load_testset_dataelements(url,testset);
658
606
  load_testset_attributes(url,testset);
@@ -666,26 +614,26 @@ function set_testset(testset) {// {{{
666
614
  });
667
615
  var val = "<content>" + ser + "</content>";
668
616
  $.ajax({
669
- type: "PUT",
617
+ type: "PUT",
670
618
  url: url + "/properties/values/transformation",
671
619
  data: ({content: val}),
672
- success: function() {
673
- load_testset_des(url,testset);
620
+ success: function() {
621
+ load_testset_des(url,testset);
674
622
  },
675
623
  error: report_failure
676
624
  });
677
625
  } else {
678
- load_testset_des(url,testset);
626
+ load_testset_des(url,testset);
679
627
  }
680
-
628
+
681
629
  load_testset_hw(url,testset);
682
630
  $.ajax({
683
- type: "GET",
631
+ type: "GET",
684
632
  url: url + "/properties/values/state/",
685
633
  dataType: "text",
686
634
  success: function(res){
687
635
  $.ajax({
688
- type: "PUT",
636
+ type: "PUT",
689
637
  url: url + "/properties/values/state",
690
638
  data: ({value: res}),
691
639
  error: report_failure
@@ -700,15 +648,15 @@ function load_testsetfile_after() { //{{{
700
648
  if (typeof window.FileReader !== 'function') {
701
649
  alert('FileReader not yet supportet');
702
650
  return;
703
- }
651
+ }
704
652
  var files = $('#testsetfile').get(0).files;
705
653
  var reader = new FileReader();
706
654
  reader.onload = function(){
707
655
  set_testset($.parseXML(reader.result));
708
656
  running = false;
709
- }
710
- reader.onerror = function(){ running = false; }
711
- reader.onabort = function(){ running = false; }
657
+ }
658
+ reader.onerror = function(){ running = false; }
659
+ reader.onabort = function(){ running = false; }
712
660
  reader.readAsText(files[0]);
713
661
  } //}}}
714
662
  function load_testsetfile() {// {{{
@@ -722,16 +670,16 @@ function load_modelfile_after() { //{{{
722
670
  if (typeof window.FileReader !== 'function') {
723
671
  alert('FileReader not yet supportet');
724
672
  return;
725
- }
673
+ }
726
674
  var files = $('#modelfile').get(0).files;
727
675
  var reader = new FileReader();
728
676
  reader.onload = function(){
729
677
  var url = $("#current-instance").text();
730
678
  load_des(url,reader.result);
731
679
  running = false;
732
- }
733
- reader.onerror = function(){ running = false; }
734
- reader.onabort = function(){ running = false; }
680
+ }
681
+ reader.onerror = function(){ running = false; }
682
+ reader.onabort = function(){ running = false; }
735
683
  reader.readAsText(files[0]);
736
684
  } //}}}
737
685
  function load_modelfile() {// {{{
@@ -744,11 +692,11 @@ function load_testset() {// {{{
744
692
  running = true;
745
693
 
746
694
  var name = $("#predefinedtestsets div.menuitem[data-selected=selected]").text();
747
- $.ajax({
695
+ $.ajax({
748
696
  cache: false,
749
697
  dataType: 'xml',
750
698
  url: "testsets/" + name + ".xml",
751
- success: function(res){
699
+ success: function(res){
752
700
  save['dsl'] = null; // reload dsl and position under all circumstances
753
701
  $('#main .tabbehind button').hide();
754
702
  $('#dat_details').empty();
@@ -765,15 +713,15 @@ function load_modeltype() {// {{{
765
713
  if (running) return;
766
714
  var url = $("#current-instance").text();
767
715
  running = true;
768
-
716
+
769
717
  var name = $("#modeltypes div.menuitem[data-selected=selected]").text();
770
- $.ajax({
718
+ $.ajax({
771
719
  cache: false,
772
720
  dataType: 'xml',
773
721
  url: "testsets/" + name + ".xml",
774
- success: function(res){
722
+ success: function(res){
775
723
  $.ajax({
776
- type: "PUT",
724
+ type: "PUT",
777
725
  url: url + "/properties/values/attributes/modeltype",
778
726
  data: ({value: name}),
779
727
  success: function(){
@@ -792,7 +740,7 @@ function load_des(url,model) { //{{{
792
740
  model = model.replace(/<\?[^\?]+\?>/,'');
793
741
  var val = "<content>" + model + "</content>";
794
742
  $.ajax({
795
- type: "PUT",
743
+ type: "PUT",
796
744
  url: url + "/properties/values/description",
797
745
  data: ({content: val}),
798
746
  error: report_failure
@@ -811,7 +759,7 @@ function load_testset_hw(url,testset) {// {{{
811
759
  $("testset > handlerwrapper",testset).each(function(){
812
760
  var val = $(this).text();
813
761
  $.ajax({
814
- type: "PUT",
762
+ type: "PUT",
815
763
  url: url + "/properties/values/handlerwrapper",
816
764
  data: ({value: val}),
817
765
  error: report_failure
@@ -826,7 +774,7 @@ function load_testset_dataelements(url,testset) {// {{{
826
774
  });
827
775
  var val = "<content>" + ser + "</content>";
828
776
  $.ajax({
829
- type: "PUT",
777
+ type: "PUT",
830
778
  url: url + "/properties/values/dataelements",
831
779
  data: ({content: val}),
832
780
  error: report_failure
@@ -840,7 +788,7 @@ function load_testset_attributes(url,testset) {// {{{
840
788
  });
841
789
  var val = "<content>" + ser + "</content>";
842
790
  $.ajax({
843
- type: "PUT",
791
+ type: "PUT",
844
792
  url: url + "/properties/values/attributes",
845
793
  data: ({content: val}),
846
794
  error: report_failure
@@ -854,11 +802,11 @@ function load_testset_endpoints(url,testset) {// {{{
854
802
  });
855
803
  var val = "<content>" + ser + "</content>";
856
804
  $.ajax({
857
- type: "PUT",
805
+ type: "PUT",
858
806
  url: url + "/properties/values/endpoints/",
859
807
  data: ({content: val}),
860
808
  error: report_failure
861
- });
809
+ });
862
810
  }// }}}
863
811
  function load_testset_pos(url,testset) {// {{{
864
812
  if ($("testset > positions",testset).length == 0) { return; }
@@ -868,12 +816,12 @@ function load_testset_pos(url,testset) {// {{{
868
816
  });
869
817
  var val = "<content>" + ser + "</content>";
870
818
  $.ajax({
871
- type: "PUT",
819
+ type: "PUT",
872
820
  url: url + "/properties/values/positions/",
873
821
  data: ({content: val}),
874
822
  success: monitor_instance_pos,
875
823
  error: report_failure
876
- });
824
+ });
877
825
  }// }}}
878
826
  function load_testset_handlers(url,testset,vals) {// {{{
879
827
  $("testset > handlers > *",testset).each(function(){
@@ -886,7 +834,7 @@ function load_testset_handlers(url,testset,vals) {// {{{
886
834
  inp += "&" + this.nodeName + "=" + $(this).text();
887
835
  });
888
836
  $.ajax({
889
- type: "POST",
837
+ type: "POST",
890
838
  url: url + "/notifications/subscriptions/",
891
839
  data: inp
892
840
  });
@@ -912,9 +860,9 @@ function format_visual_remove(what,cls) {//{{{
912
860
  }//}}}
913
861
  function format_visual_set(what) {//{{{
914
862
  if (node_state[what] != undefined) {
915
- if (node_state[what]['vote'] == undefined) node_state[what]['vote'] = 0;
916
- if (node_state[what]['active'] == undefined) node_state[what]['active'] = 0;
917
- if (node_state[what]['passive'] == undefined) node_state[what]['passive'] = 0;
863
+ if (node_state[what]['vote'] == undefined) node_state[what]['vote'] = 0;
864
+ if (node_state[what]['active'] == undefined) node_state[what]['active'] = 0;
865
+ if (node_state[what]['passive'] == undefined) node_state[what]['passive'] = 0;
918
866
 
919
867
  var votes = node_state[what]['vote'];
920
868
  var actives = node_state[what]['active'];
@@ -924,7 +872,7 @@ function format_visual_set(what) {//{{{
924
872
  $('g[element-id="' + what + '"] .super .colon').each(function(a,b){
925
873
  b.setAttribute('class','colon necessary');
926
874
  });
927
- else
875
+ else
928
876
  $('g[element-id="' + what + '"] .super .colon').each(function(a,b){
929
877
  b.setAttribute('class','colon');
930
878
  });
@@ -934,7 +882,7 @@ function format_visual_set(what) {//{{{
934
882
  var txt = b.childNodes[0];
935
883
  txt.nodeValue = actives;
936
884
  });
937
- else
885
+ else
938
886
  $('g[element-id="' + what + '"] .super .active').each(function(a,b){
939
887
  b.setAttribute('class','active');
940
888
  });
@@ -944,13 +892,13 @@ function format_visual_set(what) {//{{{
944
892
  var txt = b.childNodes[0];
945
893
  txt.nodeValue = votes;
946
894
  });
947
- else
895
+ else
948
896
  $('g[element-id="' + what + '"] .super .vote').each(function(a,b){
949
897
  b.setAttribute('class','vote');
950
898
  });
951
899
 
952
900
  $.each(['#activity-' + what, 'g[element-id="' + what + '"] g'],function(i,t){
953
- $(t).each(function(a,b){
901
+ $(t).each(function(a,b){
954
902
  if (actives > 0) vs = 'active';
955
903
  else if (votes > 0) vs = 'vote';
956
904
  else if (passives > 0) vs = 'passive';
@@ -958,7 +906,7 @@ function format_visual_set(what) {//{{{
958
906
  b.setAttribute("class",'activities ' + vs);
959
907
  });
960
908
  });
961
- }
909
+ }
962
910
 
963
911
  }//}}}
964
912
  function format_visual_clear() {//{{{
@@ -1002,10 +950,10 @@ function format_code(res,skim,lnums) {// {{{
1002
950
  res = res.replace(/ /g," &#160;");
1003
951
  res = res.replace(/\n$/g,"\n<div>&#160;");
1004
952
  res = res.replace(/\n|$/g,"</div>\n");
1005
- }
953
+ }
1006
954
  } catch(e) {
1007
955
  alert(e.toString());
1008
- }
956
+ }
1009
957
  return res;
1010
958
  }// }}}
1011
959
  function format_text(res) {// {{{