cpee 1.3.102

Sign up to get free protection for your applications and to get access to all the features.
Files changed (281) hide show
  1. data/AUTHORS +3 -0
  2. data/COPYING +165 -0
  3. data/FEATURES +28 -0
  4. data/INSTALL +23 -0
  5. data/README +7 -0
  6. data/Rakefile +28 -0
  7. data/cockpit/contrib/symbols.svg +224 -0
  8. data/cockpit/contrib/transformation1.xsl +264 -0
  9. data/cockpit/contrib/transformation2.xsl +10 -0
  10. data/cockpit/css/ui.css +155 -0
  11. data/cockpit/index.html +241 -0
  12. data/cockpit/js/details.js +146 -0
  13. data/cockpit/js/instance.js +927 -0
  14. data/cockpit/js/parameters.js +66 -0
  15. data/cockpit/js/ui.js +48 -0
  16. data/cockpit/js/wfadaptor.cpee.js +1082 -0
  17. data/cockpit/lib/contextmenu.css +72 -0
  18. data/cockpit/lib/contextmenu.js +63 -0
  19. data/cockpit/lib/jquery-ui.custom.min.js +259 -0
  20. data/cockpit/lib/jquery-ui.custom.min.txt +16 -0
  21. data/cockpit/lib/jquery.caret.min.js +10 -0
  22. data/cockpit/lib/jquery.min.js +4 -0
  23. data/cockpit/lib/jquery.svgdom.js +281 -0
  24. data/cockpit/lib/parsequery.js +19 -0
  25. data/cockpit/lib/printf.js +368 -0
  26. data/cockpit/lib/strftime.min.js +1 -0
  27. data/cockpit/lib/ui.css +270 -0
  28. data/cockpit/lib/ui.js +60 -0
  29. data/cockpit/lib/underscore.min.js +27 -0
  30. data/cockpit/lib/util.js +53 -0
  31. data/cockpit/lib/wfadaptor-doc/demo1.html +517 -0
  32. data/cockpit/lib/wfadaptor-doc/demo2.html +84 -0
  33. data/cockpit/lib/wfadaptor-doc/index.html +54 -0
  34. data/cockpit/lib/wfadaptor.css +217 -0
  35. data/cockpit/lib/wfadaptor.js +410 -0
  36. data/cockpit/testsets/ADVENTURE Dynamic Order.xml +353 -0
  37. data/cockpit/testsets/ADVENTURE Main Loop.xml +327 -0
  38. data/cockpit/testsets/ADVENTURE Order.xml +424 -0
  39. data/cockpit/testsets/ADVENTURE Performance Test 1.xml +311 -0
  40. data/cockpit/testsets/ADVENTURE Performance Test 2.xml +297 -0
  41. data/cockpit/testsets/Concurrent.xml +315 -0
  42. data/cockpit/testsets/Coopis Testset.xml +346 -0
  43. data/cockpit/testsets/Endpoints and Data Manipulation.xml +359 -0
  44. data/cockpit/testsets/ICSOC Testset.xml +354 -0
  45. data/cockpit/testsets/Linear.xml +328 -0
  46. data/cockpit/testsets/Mangler 1.xml +352 -0
  47. data/cockpit/testsets/Mangler 2.xml +372 -0
  48. data/cockpit/testsets/RESCUE - Book Movie - Local.xml +385 -0
  49. data/cockpit/testsets/RESCUE - Book Movie.xml +385 -0
  50. data/cockpit/testsets/RESCUE - Loop-Parallel Injection.xml +393 -0
  51. data/cockpit/testsets/SOPROMO Test Sonification.xml +356 -0
  52. data/cockpit/testsets/Syncing P34 1.xml +329 -0
  53. data/cockpit/testsets/Syncing P34 2.xml +329 -0
  54. data/cockpit/testsets/Syncing P34 3.xml +329 -0
  55. data/cockpit/testsets/Syncing P34.xml +329 -0
  56. data/cockpit/testsets/TEST - Bad Loop.xml +428 -0
  57. data/cockpit/testsets/TEST - Wrong Positions.xml +470 -0
  58. data/cockpit/testsets/index.xml +24 -0
  59. data/contrib/Screenshot at 2011-09-28 02:38:11.png +0 -0
  60. data/contrib/logo2-small.png +0 -0
  61. data/contrib/logo2.png +0 -0
  62. data/contrib/logo2.svg +7610 -0
  63. data/contrib/logo2a.png +0 -0
  64. data/contrib/logo2a.svg +367 -0
  65. data/cpee.gemspec +24 -0
  66. data/lib/cpee.xml +39 -0
  67. data/lib/cpee/callback.rb +40 -0
  68. data/lib/cpee/controller.rb +440 -0
  69. data/lib/cpee/empty_workflow.rb +24 -0
  70. data/lib/cpee/handler_notifications.rb +46 -0
  71. data/lib/cpee/handler_properties.rb +43 -0
  72. data/lib/cpee/implementation.rb +174 -0
  73. data/lib/engine.xml +85 -0
  74. data/lib/engine/callbacks.rng +41 -0
  75. data/lib/engine/instance-info.rng +41 -0
  76. data/lib/engine/instances.rng +38 -0
  77. data/server/handlerwrappers/default.rb +142 -0
  78. data/server/handlerwrappers/rescue.rb +216 -0
  79. data/server/handlerwrappers/soap.rb +152 -0
  80. data/server/instances/1/notifications/1d41ebf5e52bf039b3c3873fddb8e9bd/consumer-secret +1 -0
  81. data/server/instances/1/notifications/1d41ebf5e52bf039b3c3873fddb8e9bd/producer-secret +1 -0
  82. data/server/instances/1/notifications/1d41ebf5e52bf039b3c3873fddb8e9bd/subscription.xml +27 -0
  83. data/server/instances/1/notifications/66ad546f13c6c7c84f36215c24dd2e6e/consumer-secret +1 -0
  84. data/server/instances/1/notifications/66ad546f13c6c7c84f36215c24dd2e6e/producer-secret +1 -0
  85. data/server/instances/1/notifications/66ad546f13c6c7c84f36215c24dd2e6e/subscription.xml +27 -0
  86. data/server/instances/1/notifications/9f23b768395a19cc1dd6c2d2a243c78e/consumer-secret +1 -0
  87. data/server/instances/1/notifications/9f23b768395a19cc1dd6c2d2a243c78e/producer-secret +1 -0
  88. data/server/instances/1/notifications/9f23b768395a19cc1dd6c2d2a243c78e/subscription.xml +27 -0
  89. data/server/instances/1/notifications/fa690a88cc565dfa53b13ced355cd039/consumer-secret +1 -0
  90. data/server/instances/1/notifications/fa690a88cc565dfa53b13ced355cd039/producer-secret +1 -0
  91. data/server/instances/1/notifications/fa690a88cc565dfa53b13ced355cd039/subscription.xml +5 -0
  92. data/server/instances/1/properties.xml +522 -0
  93. data/server/instances/10/notifications/0867c4a937f882af259137e36d331261/consumer-secret +1 -0
  94. data/server/instances/10/notifications/0867c4a937f882af259137e36d331261/producer-secret +1 -0
  95. data/server/instances/10/notifications/0867c4a937f882af259137e36d331261/subscription.xml +27 -0
  96. data/server/instances/10/notifications/28acb605c56588ec8e47431c1fcf0b20/consumer-secret +1 -0
  97. data/server/instances/10/notifications/28acb605c56588ec8e47431c1fcf0b20/producer-secret +1 -0
  98. data/server/instances/10/notifications/28acb605c56588ec8e47431c1fcf0b20/subscription.xml +27 -0
  99. data/server/instances/10/notifications/31d3f699def1d1e86dc18ef421f718ad/consumer-secret +1 -0
  100. data/server/instances/10/notifications/31d3f699def1d1e86dc18ef421f718ad/producer-secret +1 -0
  101. data/server/instances/10/notifications/31d3f699def1d1e86dc18ef421f718ad/subscription.xml +27 -0
  102. data/server/instances/10/notifications/380b57220000c45342fc56a1ed8e9e3f/consumer-secret +1 -0
  103. data/server/instances/10/notifications/380b57220000c45342fc56a1ed8e9e3f/producer-secret +1 -0
  104. data/server/instances/10/notifications/380b57220000c45342fc56a1ed8e9e3f/subscription.xml +27 -0
  105. data/server/instances/10/notifications/41eeb5d90b513781fb4b440cb97ca7f1/consumer-secret +1 -0
  106. data/server/instances/10/notifications/41eeb5d90b513781fb4b440cb97ca7f1/producer-secret +1 -0
  107. data/server/instances/10/notifications/41eeb5d90b513781fb4b440cb97ca7f1/subscription.xml +27 -0
  108. data/server/instances/10/notifications/4d8c1b3a8dfdacac98144fad072c46d8/consumer-secret +1 -0
  109. data/server/instances/10/notifications/4d8c1b3a8dfdacac98144fad072c46d8/producer-secret +1 -0
  110. data/server/instances/10/notifications/4d8c1b3a8dfdacac98144fad072c46d8/subscription.xml +27 -0
  111. data/server/instances/10/notifications/4dde696cfb001e00a7efbd8e86ba227d/consumer-secret +1 -0
  112. data/server/instances/10/notifications/4dde696cfb001e00a7efbd8e86ba227d/producer-secret +1 -0
  113. data/server/instances/10/notifications/4dde696cfb001e00a7efbd8e86ba227d/subscription.xml +27 -0
  114. data/server/instances/10/notifications/4e1c0065dd95f7c175bbccb874f0baea/consumer-secret +1 -0
  115. data/server/instances/10/notifications/4e1c0065dd95f7c175bbccb874f0baea/producer-secret +1 -0
  116. data/server/instances/10/notifications/4e1c0065dd95f7c175bbccb874f0baea/subscription.xml +27 -0
  117. data/server/instances/10/notifications/6198fb7d6a8249f7820e3e57eeefa8af/consumer-secret +1 -0
  118. data/server/instances/10/notifications/6198fb7d6a8249f7820e3e57eeefa8af/producer-secret +1 -0
  119. data/server/instances/10/notifications/6198fb7d6a8249f7820e3e57eeefa8af/subscription.xml +27 -0
  120. data/server/instances/10/notifications/6aeb90da52abc150f0f0135d8ba2dbac/consumer-secret +1 -0
  121. data/server/instances/10/notifications/6aeb90da52abc150f0f0135d8ba2dbac/producer-secret +1 -0
  122. data/server/instances/10/notifications/6aeb90da52abc150f0f0135d8ba2dbac/subscription.xml +27 -0
  123. data/server/instances/10/notifications/6d77f5bac1eb9d6165394b6bfc9b492a/consumer-secret +1 -0
  124. data/server/instances/10/notifications/6d77f5bac1eb9d6165394b6bfc9b492a/producer-secret +1 -0
  125. data/server/instances/10/notifications/6d77f5bac1eb9d6165394b6bfc9b492a/subscription.xml +27 -0
  126. data/server/instances/10/notifications/7092411a6bb6822f651798fdcd3c4787/consumer-secret +1 -0
  127. data/server/instances/10/notifications/7092411a6bb6822f651798fdcd3c4787/producer-secret +1 -0
  128. data/server/instances/10/notifications/7092411a6bb6822f651798fdcd3c4787/subscription.xml +27 -0
  129. data/server/instances/10/notifications/7ab29bbad4122295c05f9e33fd1e0fc3/consumer-secret +1 -0
  130. data/server/instances/10/notifications/7ab29bbad4122295c05f9e33fd1e0fc3/producer-secret +1 -0
  131. data/server/instances/10/notifications/7ab29bbad4122295c05f9e33fd1e0fc3/subscription.xml +27 -0
  132. data/server/instances/10/notifications/7fabcecc57fe0bd27ce50bedaef47bd2/consumer-secret +1 -0
  133. data/server/instances/10/notifications/7fabcecc57fe0bd27ce50bedaef47bd2/producer-secret +1 -0
  134. data/server/instances/10/notifications/7fabcecc57fe0bd27ce50bedaef47bd2/subscription.xml +27 -0
  135. data/server/instances/10/notifications/85760dad8f7abbd73ae1dd44140dabf1/consumer-secret +1 -0
  136. data/server/instances/10/notifications/85760dad8f7abbd73ae1dd44140dabf1/producer-secret +1 -0
  137. data/server/instances/10/notifications/85760dad8f7abbd73ae1dd44140dabf1/subscription.xml +27 -0
  138. data/server/instances/10/notifications/8b9a96d109d44a1fc22858006c0f0e16/consumer-secret +1 -0
  139. data/server/instances/10/notifications/8b9a96d109d44a1fc22858006c0f0e16/producer-secret +1 -0
  140. data/server/instances/10/notifications/8b9a96d109d44a1fc22858006c0f0e16/subscription.xml +27 -0
  141. data/server/instances/10/notifications/9120a477e64d7debae2cda964a9948a0/consumer-secret +1 -0
  142. data/server/instances/10/notifications/9120a477e64d7debae2cda964a9948a0/producer-secret +1 -0
  143. data/server/instances/10/notifications/9120a477e64d7debae2cda964a9948a0/subscription.xml +27 -0
  144. data/server/instances/10/notifications/93c5a5ab72a745c0f9fffe2fe58db205/consumer-secret +1 -0
  145. data/server/instances/10/notifications/93c5a5ab72a745c0f9fffe2fe58db205/producer-secret +1 -0
  146. data/server/instances/10/notifications/93c5a5ab72a745c0f9fffe2fe58db205/subscription.xml +27 -0
  147. data/server/instances/10/notifications/a8db1498388588bddf518878263fd898/consumer-secret +1 -0
  148. data/server/instances/10/notifications/a8db1498388588bddf518878263fd898/producer-secret +1 -0
  149. data/server/instances/10/notifications/a8db1498388588bddf518878263fd898/subscription.xml +27 -0
  150. data/server/instances/10/notifications/b534f057c1c97f65e68f59427958e78d/consumer-secret +1 -0
  151. data/server/instances/10/notifications/b534f057c1c97f65e68f59427958e78d/producer-secret +1 -0
  152. data/server/instances/10/notifications/b534f057c1c97f65e68f59427958e78d/subscription.xml +27 -0
  153. data/server/instances/10/notifications/bb3d69ee3df32f3b5cb69a51d1af8ae4/consumer-secret +1 -0
  154. data/server/instances/10/notifications/bb3d69ee3df32f3b5cb69a51d1af8ae4/producer-secret +1 -0
  155. data/server/instances/10/notifications/bb3d69ee3df32f3b5cb69a51d1af8ae4/subscription.xml +27 -0
  156. data/server/instances/10/notifications/bc597391804363834987804436b8b63b/consumer-secret +1 -0
  157. data/server/instances/10/notifications/bc597391804363834987804436b8b63b/producer-secret +1 -0
  158. data/server/instances/10/notifications/bc597391804363834987804436b8b63b/subscription.xml +27 -0
  159. data/server/instances/10/notifications/bf2f6599eebcd9a08e47bdafd4a67660/consumer-secret +1 -0
  160. data/server/instances/10/notifications/bf2f6599eebcd9a08e47bdafd4a67660/producer-secret +1 -0
  161. data/server/instances/10/notifications/bf2f6599eebcd9a08e47bdafd4a67660/subscription.xml +27 -0
  162. data/server/instances/10/notifications/db9cf0ae80bd61e6124c382b992a1550/consumer-secret +1 -0
  163. data/server/instances/10/notifications/db9cf0ae80bd61e6124c382b992a1550/producer-secret +1 -0
  164. data/server/instances/10/notifications/db9cf0ae80bd61e6124c382b992a1550/subscription.xml +27 -0
  165. data/server/instances/10/notifications/e528089610c991500eb2e8b094f6f169/consumer-secret +1 -0
  166. data/server/instances/10/notifications/e528089610c991500eb2e8b094f6f169/producer-secret +1 -0
  167. data/server/instances/10/notifications/e528089610c991500eb2e8b094f6f169/subscription.xml +27 -0
  168. data/server/instances/10/notifications/e7d3ca382d26b5f5eba00c40c29827da/consumer-secret +1 -0
  169. data/server/instances/10/notifications/e7d3ca382d26b5f5eba00c40c29827da/producer-secret +1 -0
  170. data/server/instances/10/notifications/e7d3ca382d26b5f5eba00c40c29827da/subscription.xml +27 -0
  171. data/server/instances/10/notifications/ebdc914fde6fe299143ae4601c142738/consumer-secret +1 -0
  172. data/server/instances/10/notifications/ebdc914fde6fe299143ae4601c142738/producer-secret +1 -0
  173. data/server/instances/10/notifications/ebdc914fde6fe299143ae4601c142738/subscription.xml +27 -0
  174. data/server/instances/10/notifications/f26b2b9efc10b9259647cf1a2b934694/consumer-secret +1 -0
  175. data/server/instances/10/notifications/f26b2b9efc10b9259647cf1a2b934694/producer-secret +1 -0
  176. data/server/instances/10/notifications/f26b2b9efc10b9259647cf1a2b934694/subscription.xml +27 -0
  177. data/server/instances/10/notifications/f4e1d7808171fe7c5fab4a99145ea185/consumer-secret +1 -0
  178. data/server/instances/10/notifications/f4e1d7808171fe7c5fab4a99145ea185/producer-secret +1 -0
  179. data/server/instances/10/notifications/f4e1d7808171fe7c5fab4a99145ea185/subscription.xml +27 -0
  180. data/server/instances/10/notifications/f7e947a1b4b32f3dad5debd44fc3236b/consumer-secret +1 -0
  181. data/server/instances/10/notifications/f7e947a1b4b32f3dad5debd44fc3236b/producer-secret +1 -0
  182. data/server/instances/10/notifications/f7e947a1b4b32f3dad5debd44fc3236b/subscription.xml +27 -0
  183. data/server/instances/10/notifications/fbf5d0ae050a50e8a2fca6bc60f5b8d6/consumer-secret +1 -0
  184. data/server/instances/10/notifications/fbf5d0ae050a50e8a2fca6bc60f5b8d6/producer-secret +1 -0
  185. data/server/instances/10/notifications/fbf5d0ae050a50e8a2fca6bc60f5b8d6/subscription.xml +27 -0
  186. data/server/instances/10/properties.xml +388 -0
  187. data/server/instances/11/notifications/134c18da209261bc409ccd137b2e46d3/consumer-secret +1 -0
  188. data/server/instances/11/notifications/134c18da209261bc409ccd137b2e46d3/producer-secret +1 -0
  189. data/server/instances/11/notifications/134c18da209261bc409ccd137b2e46d3/subscription.xml +27 -0
  190. data/server/instances/11/notifications/48862f47f66e8229582bc91fbc38a512/consumer-secret +1 -0
  191. data/server/instances/11/notifications/48862f47f66e8229582bc91fbc38a512/producer-secret +1 -0
  192. data/server/instances/11/notifications/48862f47f66e8229582bc91fbc38a512/subscription.xml +5 -0
  193. data/server/instances/11/properties.xml +517 -0
  194. data/server/instances/2/notifications/0bbfabbebf46b850383b4e1d7bd926e3/consumer-secret +1 -0
  195. data/server/instances/2/notifications/0bbfabbebf46b850383b4e1d7bd926e3/producer-secret +1 -0
  196. data/server/instances/2/notifications/0bbfabbebf46b850383b4e1d7bd926e3/subscription.xml +27 -0
  197. data/server/instances/2/notifications/1d426895d19caa1471c713e80cc3c845/consumer-secret +1 -0
  198. data/server/instances/2/notifications/1d426895d19caa1471c713e80cc3c845/producer-secret +1 -0
  199. data/server/instances/2/notifications/1d426895d19caa1471c713e80cc3c845/subscription.xml +27 -0
  200. data/server/instances/2/notifications/292c8983aa798f0c5ced5ddc4b58abe4/consumer-secret +1 -0
  201. data/server/instances/2/notifications/292c8983aa798f0c5ced5ddc4b58abe4/producer-secret +1 -0
  202. data/server/instances/2/notifications/292c8983aa798f0c5ced5ddc4b58abe4/subscription.xml +27 -0
  203. data/server/instances/2/notifications/332c3026c8ad3075b092bd7e7a2b4f71/consumer-secret +1 -0
  204. data/server/instances/2/notifications/332c3026c8ad3075b092bd7e7a2b4f71/producer-secret +1 -0
  205. data/server/instances/2/notifications/332c3026c8ad3075b092bd7e7a2b4f71/subscription.xml +27 -0
  206. data/server/instances/2/notifications/d377446918808d23d03291fc1140883c/consumer-secret +1 -0
  207. data/server/instances/2/notifications/d377446918808d23d03291fc1140883c/producer-secret +1 -0
  208. data/server/instances/2/notifications/d377446918808d23d03291fc1140883c/subscription.xml +27 -0
  209. data/server/instances/2/notifications/d5b65c7cbff5d259e4ee8405190ec558/consumer-secret +1 -0
  210. data/server/instances/2/notifications/d5b65c7cbff5d259e4ee8405190ec558/producer-secret +1 -0
  211. data/server/instances/2/notifications/d5b65c7cbff5d259e4ee8405190ec558/subscription.xml +27 -0
  212. data/server/instances/2/notifications/d7ee4fedabb402dc43986dfa199e6768/consumer-secret +1 -0
  213. data/server/instances/2/notifications/d7ee4fedabb402dc43986dfa199e6768/producer-secret +1 -0
  214. data/server/instances/2/notifications/d7ee4fedabb402dc43986dfa199e6768/subscription.xml +5 -0
  215. data/server/instances/2/properties.xml +517 -0
  216. data/server/instances/3/notifications/27195e2503deaf25b3291394fe97985c/consumer-secret +1 -0
  217. data/server/instances/3/notifications/27195e2503deaf25b3291394fe97985c/producer-secret +1 -0
  218. data/server/instances/3/notifications/27195e2503deaf25b3291394fe97985c/subscription.xml +5 -0
  219. data/server/instances/3/notifications/6cec45935d78709a4aa6622491006f4b/consumer-secret +1 -0
  220. data/server/instances/3/notifications/6cec45935d78709a4aa6622491006f4b/producer-secret +1 -0
  221. data/server/instances/3/notifications/6cec45935d78709a4aa6622491006f4b/subscription.xml +27 -0
  222. data/server/instances/3/notifications/755542b2fb8d0c8fb9add29e012ec707/consumer-secret +1 -0
  223. data/server/instances/3/notifications/755542b2fb8d0c8fb9add29e012ec707/producer-secret +1 -0
  224. data/server/instances/3/notifications/755542b2fb8d0c8fb9add29e012ec707/subscription.xml +27 -0
  225. data/server/instances/3/properties.xml +517 -0
  226. data/server/instances/4/notifications/151e90db818eb5812905257a8eb7cea4/consumer-secret +1 -0
  227. data/server/instances/4/notifications/151e90db818eb5812905257a8eb7cea4/producer-secret +1 -0
  228. data/server/instances/4/notifications/151e90db818eb5812905257a8eb7cea4/subscription.xml +5 -0
  229. data/server/instances/4/notifications/a89df398fcc088c067c39ae3974ec57f/consumer-secret +1 -0
  230. data/server/instances/4/notifications/a89df398fcc088c067c39ae3974ec57f/producer-secret +1 -0
  231. data/server/instances/4/notifications/a89df398fcc088c067c39ae3974ec57f/subscription.xml +27 -0
  232. data/server/instances/4/properties.xml +517 -0
  233. data/server/instances/5/notifications/02ebbf888bd3efd11924f4c416d784e4/consumer-secret +1 -0
  234. data/server/instances/5/notifications/02ebbf888bd3efd11924f4c416d784e4/producer-secret +1 -0
  235. data/server/instances/5/notifications/02ebbf888bd3efd11924f4c416d784e4/subscription.xml +27 -0
  236. data/server/instances/5/notifications/0b9589d847cccf768013b6082893bce6/consumer-secret +1 -0
  237. data/server/instances/5/notifications/0b9589d847cccf768013b6082893bce6/producer-secret +1 -0
  238. data/server/instances/5/notifications/0b9589d847cccf768013b6082893bce6/subscription.xml +5 -0
  239. data/server/instances/5/properties.xml +517 -0
  240. data/server/instances/6/notifications/23da9f5c4548f384d625e6d12b3ebe2d/consumer-secret +1 -0
  241. data/server/instances/6/notifications/23da9f5c4548f384d625e6d12b3ebe2d/producer-secret +1 -0
  242. data/server/instances/6/notifications/23da9f5c4548f384d625e6d12b3ebe2d/subscription.xml +5 -0
  243. data/server/instances/6/notifications/282e7077e9c5b9972413cc92a6dcffc3/consumer-secret +1 -0
  244. data/server/instances/6/notifications/282e7077e9c5b9972413cc92a6dcffc3/producer-secret +1 -0
  245. data/server/instances/6/notifications/282e7077e9c5b9972413cc92a6dcffc3/subscription.xml +27 -0
  246. data/server/instances/6/notifications/7e57d7438db8210766eab6873124dc02/consumer-secret +1 -0
  247. data/server/instances/6/notifications/7e57d7438db8210766eab6873124dc02/producer-secret +1 -0
  248. data/server/instances/6/notifications/7e57d7438db8210766eab6873124dc02/subscription.xml +27 -0
  249. data/server/instances/6/properties.xml +517 -0
  250. data/server/instances/7/notifications/7276b795b5ed2f6638473526d9b1b1e1/consumer-secret +1 -0
  251. data/server/instances/7/notifications/7276b795b5ed2f6638473526d9b1b1e1/producer-secret +1 -0
  252. data/server/instances/7/notifications/7276b795b5ed2f6638473526d9b1b1e1/subscription.xml +27 -0
  253. data/server/instances/7/notifications/f3fbbf27fcbcc02a9f8a614326461a5c/consumer-secret +1 -0
  254. data/server/instances/7/notifications/f3fbbf27fcbcc02a9f8a614326461a5c/producer-secret +1 -0
  255. data/server/instances/7/notifications/f3fbbf27fcbcc02a9f8a614326461a5c/subscription.xml +5 -0
  256. data/server/instances/7/properties.xml +517 -0
  257. data/server/instances/8/notifications/2854ed5a8f97a33d31f908f67544ec62/consumer-secret +1 -0
  258. data/server/instances/8/notifications/2854ed5a8f97a33d31f908f67544ec62/producer-secret +1 -0
  259. data/server/instances/8/notifications/2854ed5a8f97a33d31f908f67544ec62/subscription.xml +27 -0
  260. data/server/instances/8/notifications/595259518a5cb2ce286bb39840f7a64c/consumer-secret +1 -0
  261. data/server/instances/8/notifications/595259518a5cb2ce286bb39840f7a64c/producer-secret +1 -0
  262. data/server/instances/8/notifications/595259518a5cb2ce286bb39840f7a64c/subscription.xml +5 -0
  263. data/server/instances/8/properties.xml +517 -0
  264. data/server/instances/9/notifications/54e96913d66f1dd69ec82d2b52268232/consumer-secret +1 -0
  265. data/server/instances/9/notifications/54e96913d66f1dd69ec82d2b52268232/producer-secret +1 -0
  266. data/server/instances/9/notifications/54e96913d66f1dd69ec82d2b52268232/subscription.xml +5 -0
  267. data/server/instances/9/notifications/5debc1fd138fdc80940cd5647003ed45/consumer-secret +1 -0
  268. data/server/instances/9/notifications/5debc1fd138fdc80940cd5647003ed45/producer-secret +1 -0
  269. data/server/instances/9/notifications/5debc1fd138fdc80940cd5647003ed45/subscription.xml +27 -0
  270. data/server/instances/9/properties.xml +517 -0
  271. data/server/resources/properties.init +351 -0
  272. data/server/resources/properties.schema.active +79 -0
  273. data/server/resources/properties.schema.finished +79 -0
  274. data/server/resources/properties.schema.inactive +79 -0
  275. data/server/resources/topics.xml +55 -0
  276. data/server/server.rb +25 -0
  277. data/server/todo.txt +20 -0
  278. data/test/delete.rb +27 -0
  279. data/test/load.rb +55 -0
  280. data/test/testset.xml +297 -0
  281. metadata +382 -0
@@ -0,0 +1,146 @@
1
+ $(document).ready(function() {
2
+ $('#main .tabbehind button').hide();
3
+
4
+ // save buttons shown or not //{{{
5
+ $('#main table.tabbar td.tab:not(.switch):not(.tabbehind)').click(function(event){
6
+ var me = $(event.target).parents('td.tab');
7
+ if (me.attr('id') == 'tabdetails') {
8
+ $('#main .tabbehind button').show();
9
+ } else {
10
+ $('#main .tabbehind button').hide();
11
+ }
12
+ }); //}}}
13
+
14
+ // New entry //{{{
15
+ $('#main .header button').live('click',function(){
16
+ var node = new_entry($(this).parents('div.tabbed'));
17
+ node.addClass('indent');
18
+ }); //}}}
19
+
20
+ // Delete entries //{{{
21
+ $('#main td.del a').live('click',function(event){
22
+ var top = $(event.target).parents('div.tabbed');
23
+ remove_entry($("input",$(event.target).parents('tr')).get(0),false);
24
+ mark_main_save(top);
25
+ return false;
26
+ }); //}}}
27
+
28
+ // Save entries //{{{
29
+ $('#main .tabbehind button').click(function(event){
30
+ save_main($(event.target).parents('div.tabbed'));
31
+ }); //}}}
32
+
33
+ $('#dat_details input.pair_name, #dat_details input.prop_value, #dat_details textarea.prop_value, #dat_details select.prop_value, #dat_details input.pair_value').live('keyup',function(e){ mark_main_save($(e.target).parents('div.tabbed')); });
34
+ });
35
+
36
+ function mark_main_save(top) { //{{{
37
+ var visid = $('table.tabbar td.tab',top).not('.switch').not('.inactive').attr('id').replace(/tab/,'');
38
+ var tab = $('#dat_' + visid);
39
+ var details = serialize_details(tab).serializeXML();
40
+
41
+ if (details != save[visid]) {
42
+ $('table.tabbar .tabbehind button',top).addClass('highlight');
43
+ } else {
44
+ $('table.tabbar .tabbehind button',top).removeClass('highlight');
45
+ }
46
+ } //}}}
47
+ function save_main(top) { //{{{
48
+ var visid = $('table.tabbar td.tab',top).not('.switch').not('.inactive').attr('id').replace(/tab/,'');
49
+ var tab = $('#dat_' + visid);
50
+ var node = graphrealization.description.get_node_by_svg_id($('input.pname_svgid').val());
51
+ var details = serialize_details(tab).serializeXML();
52
+ if (details != save[visid]) {
53
+ save[visid] = details;
54
+ $('table.tabbar .tabbehind button',top).removeClass('highlight');
55
+
56
+ var newn = serialize_details(tab).attr('svg-id',$('input.pname_svgid').val());
57
+ if (newn.children().length == 0) {
58
+ newn.append(node.children());
59
+ }
60
+ node.replaceWith(newn);
61
+ $('table.tabbar .tabbehind button:nth-child(2)',top).removeClass('highlight');
62
+
63
+ save_description();
64
+ }
65
+ } //}}}
66
+
67
+ function save_description() {
68
+ var serxml = graphrealization.description.get_description();
69
+ var url = $("input[name=current-instance]").val();
70
+ $.ajax({
71
+ type: "PUT",
72
+ url: url + "/properties/values/description/",
73
+ data: ({'content': '<content>' + serxml + '</content>'}),
74
+ });
75
+ }
76
+
77
+ function serialize_details(parent) { //{{{
78
+ var ele = $('input.pname_element',parent).val();
79
+ var xml = $X('<' + ele + ' xmlns="http://cpee.org/ns/description/1.0"/>');
80
+ switch(ele) {
81
+ case 'call':
82
+ xml.attr('id',$('input.pname_id').val());
83
+ xml.attr('endpoint',$('input.pname_endpoint').val());
84
+
85
+ var para = $X('<parameters xmlns="http://cpee.org/ns/description/1.0"/>');
86
+ xml.append(para);
87
+
88
+ if ($('input.pname_method',parent).length > 0) {
89
+ var pars = $X('<parameters xmlns="http://cpee.org/ns/description/1.0"/>');
90
+ var meth = $X('<method xmlns="http://cpee.org/ns/description/1.0"/>');
91
+ meth.text($('input.pname_method',parent).val());
92
+ var labl = $X('<label xmlns="http://cpee.org/ns/description/1.0"/>');
93
+ labl.text($('input.pname_label',parent).val());
94
+ para.append(labl);
95
+ para.append(meth);
96
+ para.append(pars);
97
+ $('tr.pair',parent).each(function(){
98
+ var nam = $('input.pair_name',this).val();
99
+ var val = $('input.pair_value',this).val();
100
+ var par = $X('<' + nam + ' xmlns="http://cpee.org/ns/description/1.0"/>');
101
+ par.text(val);
102
+ pars.append(par);
103
+ });
104
+ }
105
+
106
+ if ($('textarea.pname_manipulate',parent).length > 0) {
107
+ var mani = $X('<manipulate xmlns="http://cpee.org/ns/description/1.0"/>');
108
+ mani.text($('textarea.pname_manipulate',parent).val());
109
+ xml.append(mani);
110
+ }
111
+ break;
112
+ case 'manipulate':
113
+ xml.attr('id',$('input.pname_id').val());
114
+ if ($('textarea.pname_manipulate',parent).length > 0) {
115
+ xml.text($('textarea.pname_manipulate',parent).val());
116
+ }
117
+ break;
118
+ case 'loop':
119
+ xml.attr($('select.pname_mode').val(),$('input.pname_condition').val());
120
+ break;
121
+ case 'choose':
122
+ break;
123
+ case 'alternative':
124
+ xml.attr('condition',$('input.pname_condition').val());
125
+ break;
126
+ case 'critical':
127
+ xml.attr('sid',$('input.pname_sid').val());
128
+ break;
129
+ case 'parallel':
130
+ if (parseInt($('input.pname_wait').val()) > -1) {
131
+ xml.attr('wait',$('input.pname_wait').val());
132
+ }
133
+ break;
134
+ case 'parallel_branch':
135
+ if ($('input.pname_pass',parent).length > 0) {
136
+ xml.attr('pass',$('input.pname_pass').val());
137
+ }
138
+ if ($('input.pname_local',parent).length > 0) {
139
+ xml.attr('local',$('input.pname_local').val());
140
+ }
141
+ break;
142
+ // TODO group
143
+ }
144
+
145
+ return xml;
146
+ } //}}}
@@ -0,0 +1,927 @@
1
+ var running = false;
2
+ var load;
3
+ var graphrealization;
4
+ var subscription;
5
+ var subscription_state = 'less';
6
+ var save = {};
7
+ save['state']= undefined;
8
+ save['dsl'] = undefined;
9
+ save['endpoints'] = undefined;
10
+ save['dataelements'] = undefined;
11
+ save['details'] = undefined;
12
+ var node_state = {};
13
+ var sub_more = 'topic' + '=' + 'running' + '&' +// {{{
14
+ 'events' + '=' + 'activity_calling,activity_manipulating,activity_failed,activity_done' + '&' +
15
+ 'topic' + '=' + 'running' + '&' +
16
+ 'votes' + '=' + 'syncing_after' + '&' +
17
+ 'topic' + '=' + 'properties/description' + '&' +
18
+ 'events' + '=' + 'change,error' + '&' +
19
+ 'topic' + '=' + 'properties/position' + '&' +
20
+ 'events' + '=' + 'change' + '&' +
21
+ 'topic' + '=' + 'properties/state' + '&' +
22
+ 'events' + '=' + 'change' + '&' +
23
+ 'topic' + '=' + 'properties/dataelements' + '&' +
24
+ 'events' + '=' + 'change' + '&' +
25
+ 'topic' + '=' + 'properties/endpoints' + '&' +
26
+ 'events' + '=' + 'change' + '&' +
27
+ 'topic' + '=' + 'properties/handlers' + '&' +
28
+ 'events' + '=' + 'change';// }}}
29
+ var sub_less = 'topic' + '=' + 'running' + '&' +// {{{
30
+ 'events' + '=' + 'activity_calling,activity_manipulating,activity_failed,activity_done' + '&' +
31
+ 'topic' + '=' + 'properties/position' + '&' +
32
+ 'events' + '=' + 'change' + '&' +
33
+ 'topic' + '=' + 'properties/description' + '&' +
34
+ 'events' + '=' + 'change,error' + '&' +
35
+ 'topic' + '=' + 'properties/state' + '&' +
36
+ 'events' + '=' + 'change' + '&' +
37
+ 'topic' + '=' + 'properties/dataelements' + '&' +
38
+ 'events' + '=' + 'change' + '&' +
39
+ 'topic' + '=' + 'properties/endpoints' + '&' +
40
+ 'events' + '=' + 'change' + '&' +
41
+ 'topic' + '=' + 'properties/handlers' + '&' +
42
+ 'events' + '=' + 'change';// }}}
43
+
44
+ $(document).ready(function() {// {{{
45
+ $("input[name=base-url]").val(location.protocol + "//" + location.host + ":9298/");
46
+ $("button[name=base]").click(create_instance);
47
+ $("button[name=instance]").click(monitor_instance);
48
+ $("button[name=loadtestset]").click(load_testset);
49
+ $("button[name=loadtestsetfile]").click(load_testsetfile);
50
+ $("button[name=savetestset]").click(function(){ get_testset(); });
51
+ $("button[name=savesvg]").click(function(){ get_svg(); });
52
+ $("input[name=votecontinue]").click(check_subscription);
53
+ $("input[name=votestop]").click(check_subscription);
54
+
55
+ $.ajax({
56
+ url: "testsets/index.xml",
57
+ dataType: 'xml',
58
+ success: function(res){
59
+ $('testset',res).each(function(){
60
+ var ts = $(this).text();
61
+ $('select[name=testset-names]').append(
62
+ $("<option></option>").attr("value",ts).text(ts)
63
+ );
64
+ });
65
+ }
66
+ });
67
+
68
+ var q = $.parseQuery();
69
+ if (q.monitor) {
70
+ $("input[name=instance-url]").val(q.monitor);
71
+ ui_toggle_vis_tab($("#instance td.switch"));
72
+ monitor_instance();
73
+ }
74
+ if (q.load) {
75
+ load = q.load;
76
+ ui_toggle_vis_tab($("#instance td.switch"));
77
+ create_instance();
78
+ }
79
+ });// }}}
80
+
81
+ function check_subscription() { // {{{
82
+ var url = $("input[name=current-instance]").val();
83
+ var num = 0;
84
+ if ($("input[name=votecontinue]").is(':checked')) num += 1;
85
+ if ($("input[name=votestop]").is(':checked')) num += 1;
86
+ if (num > 0 && subscription_state == 'less') {
87
+ $.ajax({
88
+ type: "PUT",
89
+ url: url + "/notifications/subscriptions/" + subscription,
90
+ data: (
91
+ 'message-uid' + '=' + 'xxx' + '&' +
92
+ sub_more + '&' +
93
+ 'fingerprint-with-producer-secret' + '=' + 'xxx'
94
+ )
95
+ });
96
+ subscription_state = 'more';
97
+ }
98
+ if (num == 0 && subscription_state == 'more') {
99
+ $.ajax({
100
+ type: "PUT",
101
+ url: url + "/notifications/subscriptions/" + subscription,
102
+ data: (
103
+ 'message-uid' + '=' + 'xxx' + '&' +
104
+ sub_less + '&' +
105
+ 'fingerprint-with-producer-secret' + '=' + 'xxx'
106
+ )
107
+ });
108
+ subscription_state = 'less';
109
+ format_visual_vote_clear();
110
+ }
111
+ }// }}}
112
+
113
+ function create_instance() {// {{{
114
+ var name = load ? load : prompt("Instance name?", "Enter name here");
115
+ if (name != null) {
116
+ if (name.match(/\S/)) {
117
+ var base = $("input[name=base-url]").val();
118
+ $.ajax({
119
+ type: "POST",
120
+ url: base,
121
+ dataType: "text",
122
+ data: "name=" + name,
123
+ success: function(res){
124
+ $("input[name=instance-url]").val((base + "//" + res + "/").replace(/\/+/g,"/").replace(/:\//,"://"));
125
+ if (load) monitor_instance();
126
+ },
127
+ error: function(a,b,c) {
128
+ alert("No CPEE running.");
129
+ }
130
+ });
131
+ } else {
132
+ alert("An instance name is necessary!");
133
+ }
134
+ }
135
+ }// }}}
136
+
137
+ function monitor_instance() {// {{{
138
+ var url = $("input[name=instance-url]").val();
139
+
140
+ $('#main .tabbehind button').hide();
141
+ $('#dat_details').empty();
142
+
143
+ $.ajax({
144
+ type: "GET",
145
+ url: url + "/properties/schema/",
146
+ success: function(res){
147
+ $(".tabbed.hidden").removeClass("hidden");
148
+ $(".tabbed .tab.hidden").removeClass("hidden");
149
+
150
+ // Change url to return to current instance when reloading
151
+ $("input[name=current-instance]").val(url);
152
+ $("#current-instance").html("<a href='" + url + "' target='_blank'>" + url + "</a>");
153
+ history.replaceState({}, '', '?monitor='+url);
154
+
155
+ ui_tab_click($("#tabinstance")[0]);
156
+
157
+ $.ajax({
158
+ type: "POST",
159
+ url: url + "/notifications/subscriptions/",
160
+ data: sub_less,
161
+ success: function(res){
162
+ res = res.unserialize();
163
+ $.each(res,function(a,b){
164
+ if (b[0] == 'key') {
165
+ subscription = b[1];
166
+ }
167
+ });
168
+ append_to_log("monitoring", "id", subscription);
169
+ var Socket = "MozWebSocket" in window ? MozWebSocket : WebSocket;
170
+ ws = new Socket(url.replace(/http/,'ws') + "/notifications/subscriptions/" + subscription + "/ws/");
171
+ ws.onopen = function() {
172
+ append_to_log("monitoring", "opened", "");
173
+ };
174
+ ws.onmessage = function(e) {
175
+ data = e.data.parseXML();
176
+ if ($('event > topic',data).length > 0) {
177
+ switch($('event > topic',data).text()) {
178
+ case 'properties/dataelements':
179
+ monitor_instance_dataelements();
180
+ break;
181
+ case 'properties/description':
182
+ monitor_instance_dsl();
183
+ break;
184
+ case 'properties/endpoints':
185
+ monitor_instance_endpoints();
186
+ break;
187
+ case 'properties/state':
188
+ monitor_instance_state_change(JSON.parse($('event > notification',data).text()).state);
189
+ break;
190
+ case 'properties/position':
191
+ monitor_instance_pos_change($('event > notification',data).text());
192
+ break;
193
+ case 'running':
194
+ monitor_instance_running($('event > notification',data).text(),$('event > event',data).text());
195
+ break;
196
+ }
197
+ append_to_log("event", $('event > topic',data).text() + "/" + $('event > event',data).text(), $('event > notification',data).text());
198
+ }
199
+ if ($('vote > topic',data).length > 0) {
200
+ var notification = $('vote > notification',data).text();
201
+ append_to_log("vote", $('vote > topic',data).text() + "/" + $('vote > vote',data).text(), notification);
202
+ monitor_instance_vote_add(notification);
203
+ }
204
+ };
205
+ ws.onclose = function() {
206
+ append_to_log("monitoring", "closed", "server down i assume.");
207
+ };
208
+ if (load) load_testset();
209
+ }
210
+ });
211
+
212
+ monitor_instance_dataelements();
213
+ monitor_instance_endpoints();
214
+ monitor_instance_dsl();
215
+ monitor_instance_state();
216
+ },
217
+ error: function(a,b,c) {
218
+ alert("This ain't no CPEE instance");
219
+ }
220
+ });
221
+ }// }}}
222
+
223
+ function monitor_instance_dataelements() {// {{{
224
+ var url = $("input[name=current-instance]").val();
225
+ $.ajax({
226
+ type: "GET",
227
+ url: url + "/properties/values/dataelements/",
228
+ success: function(res){
229
+ var values = $("value > *",res);
230
+ var temp = {};
231
+ values.each(function() {
232
+ temp[this.nodeName] = format_text($(this).text());
233
+ });
234
+ var temp_xml = serialize_hash(temp);
235
+
236
+ if (temp_xml != save['dataelements']) {
237
+ save['dataelements'] = temp_xml;
238
+ var ctv = $("#dat_dataelements");
239
+ ctv.empty();
240
+ $.each(temp,function(a,b){
241
+ var node = $("#dat_template_pair tr").clone(true);
242
+ $('.pair_name',node).val(a);
243
+ $('.pair_value',node).val(b);
244
+ ctv.append(node);
245
+ });
246
+ }
247
+ }
248
+ });
249
+ } // }}}
250
+
251
+ function monitor_instance_endpoints() {// {{{
252
+ var url = $("input[name=current-instance]").val();
253
+ $.ajax({
254
+ type: "GET",
255
+ url: url + "/properties/values/endpoints/",
256
+ success: function(res){
257
+ var values = $("value > *",res);
258
+ var temp = {}
259
+ values.each(function(){
260
+ temp[this.nodeName] = $(this).text();
261
+ });
262
+ var temp_xml = serialize_hash(temp);
263
+
264
+ if (temp_xml != save['endpoints']) {
265
+ save['endpoints'] = temp_xml;
266
+ var ctv = $("#dat_endpoints");
267
+ ctv.empty();
268
+ $.each(temp,function(a,b){
269
+ var node = $("#dat_template_pair tr").clone(true);
270
+ $('.pair_name',node).val(a);
271
+ $('.pair_value',node).val(b);
272
+ ctv.append(node);
273
+ });
274
+ ctv.append(temp);
275
+ }
276
+ }
277
+ });
278
+ }// }}}
279
+
280
+ function monitor_instance_dsl() {// {{{
281
+ var url = $("input[name=current-instance]").val();
282
+ $.ajax({
283
+ type: "GET",
284
+ dataType: "text",
285
+ url: url + "/properties/values/dsl/",
286
+ success: function(res){
287
+ if (res != save['dsl']) {
288
+ save['dsl'] = res;
289
+ var ctv = $("#areadsl");
290
+ ctv.empty();
291
+
292
+ res = format_code(res,false,true);
293
+ res = res.replace(/activity\s+:([A-Za-z][a-zA-Z0-9_]+)/g,"<span class='activities' id=\"activity-$1\">activity :$1</span>");
294
+ res = res.replace(/activity\s+\[:([A-Za-z][a-zA-Z0-9_]+)([^\]]*\])/g,"<span class='activities' id=\"activity-$1\">activity [:$1$2</span>");
295
+
296
+ ctv.append(res);
297
+ $.ajax({
298
+ type: "GET",
299
+ url: url + "/properties/values/description/",
300
+ success: function(res){
301
+ graphrealization = new WfAdaptor(CPEE);
302
+ graphrealization.set_svg_container($('#graphcanvas'));
303
+ graphrealization.set_description($(res), true);
304
+ graphrealization.notify = function(svgid) {
305
+ save_description();
306
+ manifestation.events.click(svgid,undefined);
307
+ };
308
+
309
+ monitor_instance_pos();
310
+ }
311
+ });
312
+ }
313
+ }
314
+ });
315
+ }// }}}
316
+
317
+ function monitor_instance_state() {// {{{
318
+ var url = $("input[name=current-instance]").val();
319
+ $.ajax({
320
+ type: "GET",
321
+ url: url + "/properties/values/state/",
322
+ dataType: "text",
323
+ success: function(res){
324
+ monitor_instance_state_change(res);
325
+ }
326
+ });
327
+ }// }}}
328
+
329
+ function monitor_instance_pos() {// {{{
330
+ var url = $("input[name=current-instance]").val();
331
+ $.ajax({
332
+ type: "GET",
333
+ url: url + "/properties/values/positions/",
334
+ success: function(res){
335
+ var values = $("value > *",res);
336
+ format_visual_clear();
337
+ values.each(function(){
338
+ var what = this.nodeName;
339
+ format_visual_add(what,"passive");
340
+ });
341
+ }
342
+ });
343
+ }// }}}
344
+
345
+ function monitor_instance_running(notification,event) {// {{{
346
+ if (save['state'] == "stopping") return;
347
+ var parts = JSON.parse(notification);
348
+ if (event == "activity_calling")
349
+ format_visual_add(parts.activity,"active")
350
+ if (event == "activity_done")
351
+ format_visual_remove(parts.activity,"active")
352
+ } // }}}
353
+ function monitor_instance_state_change(notification) { //{{{
354
+ if (notification == "ready" || notification == "stopped" || notification == "running") {
355
+ $("#state button").removeAttr('disabled');
356
+ }
357
+ if (notification != save['state']) {
358
+ save['state'] = notification;
359
+
360
+ var ctv = $("#state");
361
+ ctv.empty();
362
+
363
+ if (notification == "stopped") {
364
+ format_visual_clear();
365
+ monitor_instance_pos();
366
+ }
367
+ if (notification == "running") {
368
+ format_visual_clear();
369
+ }
370
+
371
+ var but = "";
372
+ if (notification == "ready" || notification == "stopped") {
373
+ but = "<td>⇒</td><td><button onclick='$(this).attr(\"disabled\",\"disabled\");start_instance();'>start</button></td>";
374
+ }
375
+ if (notification == "running") {
376
+ but = "<td>⇒</td><td><button onclick='$(this).attr(\"disabled\",\"disabled\");stop_instance();'>stop</button></td>";
377
+ }
378
+
379
+ ctv.append("<tr><td>State:</td><td>" + notification + "</td>" + but + "</tr>");
380
+ }
381
+ } //}}}
382
+ function monitor_instance_pos_change(notification) {// {{{
383
+ var parts = JSON.parse(notification);
384
+ if (parts['unmark']) {
385
+ $.each(parts['unmark'],function(a,b){
386
+ format_visual_remove(b,"passive")
387
+ });
388
+ }
389
+ if (parts['at']) {
390
+ $.each(parts['at'],function(a,b){
391
+ format_visual_add(b,"passive")
392
+ });
393
+ }
394
+ } // }}}
395
+
396
+ function monitor_instance_vote_add(notification) {// {{{
397
+ var parts = JSON.parse(notification);
398
+ var ctv = $("#votes");
399
+
400
+ var astr = "<tr id='vote_to_continue-" + parts.activity + "-" + parts.callback + "'><td>Activity:</td><td>" + parts.activity + "</td><td>⇒</td>";
401
+ if ($("input[name=votecontinue]").is(':checked'))
402
+ astr += "<td><button onclick='$(this).attr(\"disabled\",\"disabled\");monitor_instance_vote_remove(\"" + parts.activity + "\",\"" + parts.callback + "\",\"true\");'>vote to continue</button></td>";
403
+ if ($("input[name=votestop]").is(':checked'))
404
+ astr += "<td><button onclick='$(this).attr(\"disabled\",\"disabled\");monitor_instance_vote_remove(\"" + parts.activity + "\",\"" + parts.callback + "\",\"false\");'>vote to stop</button></td>";
405
+ astr += "</tr>";
406
+ ctv.append(astr);
407
+ format_visual_add(parts.activity,"vote")
408
+ }// }}}
409
+ function monitor_instance_vote_remove(activity,callback,value) {//{{{
410
+ var url = $("input[name=current-instance]").val();
411
+ $.ajax({
412
+ type: "PUT",
413
+ url: url + "/callbacks/" + callback,
414
+ data: ({'continue': value}),
415
+ error: report_failure
416
+ });
417
+ format_visual_remove(activity,"vote");
418
+ $('#vote_to_continue-' + activity + '-' + callback).remove();
419
+ }//}}}
420
+
421
+ function start_instance() {// {{{
422
+ var url = $("input[name=current-instance]").val();
423
+ $.ajax({
424
+ type: "PUT",
425
+ url: url + "/properties/values/state",
426
+ data: ({value: "running"}),
427
+ error: report_failure
428
+ });
429
+ }// }}}
430
+ function stop_instance() {// {{{
431
+ var url = $("input[name=current-instance]").val();
432
+ $.ajax({
433
+ type: "PUT",
434
+ url: url + "/properties/values/state",
435
+ data: ({value: "stopping"}),
436
+ error: report_failure
437
+ });
438
+ }// }}}
439
+
440
+ function get_testset() {// {{{
441
+ var url = $("input[name=current-instance]").val();
442
+
443
+ var testset = $X('<testset/>');
444
+
445
+ $.ajax({
446
+ type: "GET",
447
+ url: url + "/properties/values/dataelements/",
448
+ success: function(res){
449
+ var pars = $X('<dataelements/>');
450
+ pars.append($(res.documentElement).children());
451
+ testset.append(pars);
452
+ $.ajax({
453
+ type: "GET",
454
+ url: url + "/properties/values/handlerwrapper/",
455
+ success: function(res){
456
+ var pars = $X('<handlerwrapper>' + res + '</handlerwrapper>');
457
+ testset.append(pars);
458
+ $.ajax({
459
+ type: "GET",
460
+ url: url + "/properties/values/endpoints/",
461
+ success: function(res){
462
+ var pars = $X('<endpoints/>');
463
+ pars.append($(res.documentElement).children());
464
+ testset.append(pars);
465
+ $.ajax({
466
+ type: "GET",
467
+ url: url + "/properties/values/positions/",
468
+ success: function(res){
469
+ var pars = $X('<positions/>');
470
+ pars.append($(res.documentElement).children());
471
+ testset.append(pars);
472
+ $.ajax({
473
+ type: "GET",
474
+ url: url + "/properties/values/description/",
475
+ success: function(res){
476
+ testset.append($(res.documentElement));
477
+ $.ajax({
478
+ type: "GET",
479
+ url: url + "/properties/values/transformation/",
480
+ success: function(res){
481
+ var pars = $X('<transformation/>');
482
+ pars.append($(res.documentElement));
483
+ testset.append(pars);
484
+
485
+ var base = $("input[name=current-instance]").val().replace(/[^\/]+\/?$/,'');
486
+ var params = { mimetype: 'text/xml' };
487
+
488
+ $('#saveform').attr('action',base + 'downloadify/testset.xml?' + $.param(params));
489
+ $('#saveform input').val(testset.serializeXML());
490
+ $('#saveform').submit();
491
+ },
492
+ error: report_failure
493
+ });
494
+ },
495
+ error: report_failure
496
+ });
497
+ },
498
+ error: report_failure
499
+ });
500
+ },
501
+ error: report_failure
502
+ });
503
+ },
504
+ error: report_failure
505
+ });
506
+ },
507
+ error: report_failure
508
+ });
509
+ }// }}}
510
+ function get_svg() {// {{{
511
+ var base = $("input[name=current-instance]").val().replace(/[^\/]+\/?$/,'');
512
+ var params = { mimetype: 'image/svg+xml' };
513
+
514
+ $('#saveform').attr('action',base + 'downloadify/graph.svg?' + $.param(params));
515
+ var gc = $('#graphcanvas').clone();
516
+ $.ajax({
517
+ type: "GET",
518
+ url: "lib/wfadaptor.css",
519
+ success: function(res){
520
+ gc.prepend($X('<style xmlns="http://www.w3.org/2000/svg" type="text/css"><![CDATA[' + res + ']]></style>'));
521
+ $('#saveform input').val(gc.serializeXML());
522
+ $('#saveform').submit();
523
+ }
524
+ });
525
+ }// }}}
526
+ function set_testset (testset) {// {{{
527
+ var url = $("input[name=current-instance]").val();
528
+
529
+ $.ajax({
530
+ type: "GET",
531
+ url: url + "/notifications/subscriptions/",
532
+ success: function(res){
533
+ var rcount = 0;
534
+ var values = $("subscriptions > subscription[url]",res);
535
+ var vals = [];
536
+ values.each(function(){
537
+ vals.push($(this).attr('url'));
538
+ });
539
+ load_testset_handlers(url,testset,vals);
540
+ },
541
+ error: report_failure
542
+ });
543
+
544
+ $.ajax({
545
+ type: "GET",
546
+ url: url + "/properties/values/dataelements/",
547
+ success: function(res){
548
+ var rcount = 0;
549
+ var values = $("value > *",res);
550
+ var length = values.length;
551
+ values.each(function(){
552
+ var name = this.nodeName;
553
+ $.ajax({
554
+ type: "DELETE",
555
+ url: url + "/properties/values/dataelements/" + name,
556
+ success: function(){
557
+ rcount += 1;
558
+ if (rcount == length)
559
+ load_testset_dataelements(url,testset);
560
+ },
561
+ error: report_failure
562
+ });
563
+ });
564
+ if (length == 0)
565
+ load_testset_dataelements(url,testset);
566
+ },
567
+ error: report_failure
568
+ });
569
+
570
+ $.ajax({
571
+ type: "GET",
572
+ url: url + "/properties/values/endpoints/",
573
+ success: function(res){
574
+ var rcount = 0;
575
+ var values = $("value > *",res);
576
+ var length = values.length;
577
+ values.each(function(){
578
+ var name = this.nodeName;
579
+ $.ajax({
580
+ type: "DELETE",
581
+ url: url + "/properties/values/endpoints/" + name,
582
+ success: function(){
583
+ rcount += 1;
584
+ if (rcount == length)
585
+ load_testset_endpoints(url,testset);
586
+ },
587
+ error: report_failure
588
+ });
589
+ });
590
+ if (length == 0)
591
+ load_testset_endpoints(url,testset);
592
+ },
593
+ error: report_failure
594
+ });
595
+
596
+ $.ajax({
597
+ type: "GET",
598
+ url: url + "/properties/values/positions/",
599
+ success: function(res){
600
+ var rcount = 0;
601
+ var values = $("value > *",res);
602
+ var length = values.length;
603
+ values.each(function(){
604
+ var name = this.nodeName;
605
+ $.ajax({
606
+ type: "DELETE",
607
+ url: url + "/properties/values/positions/" + name,
608
+ success: function(){
609
+ rcount += 1;
610
+ if (rcount == length)
611
+ load_testset_pos(url,testset);
612
+ },
613
+ error: report_failure
614
+ });
615
+ });
616
+ if (length == 0)
617
+ load_testset_pos(url,testset);
618
+ },
619
+ error: report_failure
620
+ });
621
+
622
+ $.ajax({
623
+ type: "GET",
624
+ url: url + "/properties/values/transformation/",
625
+ success: function(res){
626
+ var values = $("not-existing",res);
627
+ $("testset > transformation > *",testset).each(function(){
628
+ var val = "<content>" + $(this).serializeXML() + "</content>";
629
+ if (values.length > 0) {
630
+ $.ajax({
631
+ type: "POST",
632
+ url: url + "/properties/values/",
633
+ data: ({property: "transformation"}),
634
+ success: function() {
635
+ $.ajax({
636
+ type: "PUT",
637
+ data: ({content: val}),
638
+ url: url + "/properties/values/transformation",
639
+ success: function() {
640
+ load_testset_des(url,testset);
641
+ },
642
+ });
643
+ },
644
+ error: report_failure
645
+ });
646
+ } else {
647
+ $.ajax({
648
+ type: "PUT",
649
+ url: url + "/properties/values/transformation",
650
+ data: ({content: val}),
651
+ success: function() { load_testset_des(url,testset); },
652
+ error: report_failure
653
+ });
654
+ }
655
+ });
656
+ },
657
+ error: report_failure
658
+ });
659
+
660
+ $.ajax({
661
+ type: "PUT",
662
+ url: url + "/properties/values/handlerwrapper",
663
+ success: function() { load_testset_hw(url,testset); },
664
+ error: report_failure
665
+ });
666
+ }// }}}
667
+ function load_testsetfile() { //{{{
668
+ if (running) return;
669
+ if (typeof window.FileReader !== 'function') {
670
+ alert('FileReader not yet supportet');
671
+ return;
672
+ }
673
+ var files = $('#testsetfile').get(0).files;
674
+ var reader = new FileReader();
675
+ reader.onload = function(){
676
+ set_testset(reader.result.parseXML());
677
+ running = false;
678
+ }
679
+ reader.onerror = function(){ running = false; }
680
+ reader.onabort = function(){ running = false; }
681
+ reader.readAsText(files[0]);
682
+ } //}}}
683
+ function load_testset() {// {{{
684
+ if (running) return;
685
+ running = true;
686
+ save['dsl'] = null; // reload dsl and position under all circumstances
687
+
688
+ $('#main .tabbehind button').hide();
689
+ $('#dat_details').empty();
690
+
691
+ var name = load ? load : $("select[name=testset-names]").val();
692
+
693
+ $.ajax({
694
+ cache: false,
695
+ dataType: 'xml',
696
+ url: "testsets/" + name + ".xml",
697
+ success: function(res){
698
+ document.title = name;
699
+ set_testset(res);
700
+ }
701
+ });
702
+ running = false;
703
+ }// }}}
704
+
705
+ function load_testset_des(url,testset) {// {{{
706
+ $("testset > description",testset).each(function(){
707
+ var val = "<content>" + $(this).serializeXML() + "</content>";
708
+ $.ajax({
709
+ type: "PUT",
710
+ url: url + "/properties/values/description",
711
+ data: ({content: val}),
712
+ error: report_failure
713
+ });
714
+ });
715
+ } // }}}
716
+ function load_testset_hw(url,testset) {// {{{
717
+ $("testset > handlerwrapper",testset).each(function(){
718
+ var val = $(this).text();
719
+ $.ajax({
720
+ type: "PUT",
721
+ url: url + "/properties/values/handlerwrapper",
722
+ data: ({value: val}),
723
+ error: report_failure
724
+ });
725
+ });
726
+ } // }}}
727
+ function load_testset_dataelements(url,testset) {// {{{
728
+ $("testset > dataelements > *",testset).each(function(){
729
+ var val = $(this).serializeXML();
730
+ $.ajax({
731
+ type: "POST",
732
+ url: url + "/properties/values/dataelements/",
733
+ data: ({value: val}),
734
+ error: report_failure
735
+ });
736
+ });
737
+ }// }}}
738
+ function load_testset_endpoints(url,testset) {// {{{
739
+ $("testset > endpoints > *",testset).each(function(){
740
+ var val = $(this).serializeXML();
741
+ $.ajax({
742
+ type: "POST",
743
+ url: url + "/properties/values/endpoints/",
744
+ data: ({value: val}),
745
+ error: report_failure
746
+ });
747
+ });
748
+ }// }}}
749
+ function load_testset_pos(url,testset) {// {{{
750
+ $("testset > positions > *",testset).each(function(){
751
+ var val = $(this).serializeXML();
752
+ $.ajax({
753
+ type: "POST",
754
+ url: url + "/properties/values/positions/",
755
+ data: ({value: val}),
756
+ error: report_failure
757
+ });
758
+ });
759
+ }// }}}
760
+ function load_testset_handlers(url,testset,vals) {// {{{
761
+ $("testset > handlers > *",testset).each(function(){
762
+ var han = this;
763
+ var suburl = $(han).attr('url');
764
+ if ($.inArray(suburl,vals) == -1) {
765
+ var inp = "url="+encodeURIComponent(suburl);
766
+ $("*",han).each(function(){
767
+ inp += "&topic=" + $(this).attr('topic');
768
+ inp += "&" + this.nodeName + "=" + $(this).text();
769
+ });
770
+ $.ajax({
771
+ type: "POST",
772
+ url: url + "/notifications/subscriptions/",
773
+ data: inp
774
+ });
775
+ }
776
+ });
777
+ }// }}}
778
+
779
+ function format_visual_add(what,cls) {//{{{
780
+ if (node_state[what] == undefined)
781
+ node_state[what] = {};
782
+ if (node_state[what][cls] == undefined)
783
+ node_state[what][cls] = 0;
784
+ node_state[what][cls] += 1;
785
+ format_visual_set(what);
786
+ }//}}}
787
+ function format_visual_remove(what,cls) {//{{{
788
+ if (node_state[what] == undefined)
789
+ node_state[what] = {};
790
+ if (node_state[what][cls] == undefined)
791
+ node_state[what][cls] = 0;
792
+ node_state[what][cls] -= 1;
793
+ format_visual_set(what);
794
+ }//}}}
795
+ function format_visual_set(what) {//{{{
796
+ if (node_state[what] != undefined) {
797
+ if (node_state[what]['vote'] == undefined) node_state[what]['vote'] = 0;
798
+ if (node_state[what]['active'] == undefined) node_state[what]['active'] = 0;
799
+ if (node_state[what]['passive'] == undefined) node_state[what]['passive'] = 0;
800
+
801
+ var votes = node_state[what]['vote'];
802
+ var actives = node_state[what]['active'];
803
+ var passives = node_state[what]['passive'];
804
+
805
+ if (actives > 0 && votes > 0)
806
+ $('g[element-id="' + what + '"] .super .colon').each(function(a,b){
807
+ b.setAttribute('class','colon necessary');
808
+ });
809
+ else
810
+ $('g[element-id="' + what + '"] .super .colon').each(function(a,b){
811
+ b.setAttribute('class','colon');
812
+ });
813
+ if (actives > 0)
814
+ $('g[element-id="' + what + '"] .super .active').each(function(a,b){
815
+ b.setAttribute('class','active necessary');
816
+ var txt = b.childNodes[0];
817
+ txt.nodeValue = actives;
818
+ });
819
+ else
820
+ $('g[element-id="' + what + '"] .super .active').each(function(a,b){
821
+ b.setAttribute('class','active');
822
+ });
823
+ if (votes > 0)
824
+ $('g[element-id="' + what + '"] .super .vote').each(function(a,b){
825
+ b.setAttribute('class','vote necessary');
826
+ var txt = b.childNodes[0];
827
+ txt.nodeValue = votes;
828
+ });
829
+ else
830
+ $('g[element-id="' + what + '"] .super .vote').each(function(a,b){
831
+ b.setAttribute('class','vote');
832
+ });
833
+
834
+ $.each(['#activity-' + what, 'g[element-id="' + what + '"] g'],function(i,t){
835
+ $(t).each(function(a,b){
836
+ if (actives > 0) vs = 'active';
837
+ else if (votes > 0) vs = 'vote';
838
+ else if (passives > 0) vs = 'passive';
839
+ else vs = '';
840
+ b.setAttribute("class",'activities ' + vs);
841
+ });
842
+ });
843
+ }
844
+
845
+ }//}}}
846
+ function format_visual_clear() {//{{{
847
+ node_state = {};
848
+ $('.super .active').each(function(a,b){b.setAttribute("class","active");});
849
+ $('.super .passive').each(function(a,b){b.setAttribute("class","passive");});
850
+ $('.super .vote').each(function(a,b){b.setAttribute("class","vote");});
851
+ $('.super .colon').each(function(a,b){b.setAttribute("class","colon");});
852
+ $('.activities').each(function(a,b){b.setAttribute("class","activities");});
853
+ $("#votes").empty();
854
+ }//}}}
855
+ function format_visual_vote_clear() {//{{{
856
+ node_state = {};
857
+ $('.super .vote').each(function(a,b){b.setAttribute("class","vote");});
858
+ $("#votes").empty();
859
+ }//}}}
860
+
861
+ function format_code(res,skim,lnums) {// {{{
862
+ try {
863
+ res = res.replace(/&/g,'&amp;');
864
+ res = res.replace(/</g,'&lt;');
865
+ res = res.replace(/>/g,'&gt;');
866
+ res = res.replace(/\t/g,' ');
867
+ res = res.replace(/\t/g,' ');
868
+ res = res.replace(/\r/g,'');
869
+ res = res.replace(/\s*$/gm,'');
870
+ res = res.replace(/^(\s*\n)*/m,'');
871
+
872
+ if (res.match(/\S/)) {
873
+ if (skim) format_text_skim(res);
874
+
875
+ var m;
876
+ var l = 1;
877
+ while (m = res.match(/^ +|^(?!<div style=)|^$/m)) {
878
+ m = m[0];
879
+ var tm = (m.length + 2) * 0.6 + 2 * 0.6 + 4 * 0.6;
880
+ var ln = (lnums ? $.sprintf("%03d",l) + ':&#160;' : '');
881
+ res = res.replace(/^ +|^(?!<div style=)|^$/m,"<div style='text-indent:-" + tm + "em;margin-left:" + tm + "em'>" + ln + "&#160;".repeat(m.length));
882
+ l++;
883
+ }
884
+ res = res.replace(/ /g," &#160;");
885
+ res = res.replace(/\n$/g,"\n<div>&#160;");
886
+ res = res.replace(/\n|$/g,"</div>\n");
887
+ }
888
+ } catch(e) {
889
+ alert(e.toString());
890
+ }
891
+ return res;
892
+ }// }}}
893
+ function format_text(res) {// {{{
894
+ res = res.replace(/&/g,'&amp;');
895
+ res = res.replace(/</g,'&lt;');
896
+ res = res.replace(/>/g,'&gt;');
897
+ return res;
898
+ }// }}}
899
+ function format_text_skim(res) {// {{{
900
+ var l = res.match(/^ */);
901
+ l = l[0].length;
902
+ res = res.replace(new RegExp("^ {" + l + "}",'mg'),'');
903
+ return res;
904
+ }// }}}
905
+
906
+ function serialize_hash(ary) { //{{{
907
+ var xml = $X('<content/>');
908
+ $.each(ary,function(k,v) {
909
+ if (k.match(/^[a-zA-Z][a-zA-Z0-9_]*$/)) {
910
+ xml.append($X('<' + k + '>' + v + '</' + k + '>'));
911
+ }
912
+ });
913
+ return xml.serializeXML();
914
+ } //}}}
915
+
916
+ function append_to_log(what,type,message) {//{{{
917
+ var d = new Date();
918
+ message = message.replace(/,\"/g,', "');
919
+ message = message.replace(/,\{/g,', {');
920
+ message = message.replace(/,\[/g,', [');
921
+ message = message.replace(/:\"/g,': "');
922
+ message = message.replace(/:\{/g,': {');
923
+ message = message.replace(/:\[/g,': [');
924
+ $("#dat_log").append("<tr><td class='fixed'><a title=\"" + d.strftime("[%d/%b/%Y %H:%M:%S]") + "\">D</a></td><td class='fixed'>&#160;-&#160;</td><td class='fixed'><a title=\"" + what + "\">T</a></td><td class='fixed'>&#160;-&#160;</td><td class='fixed'>" + type + "</td><td class='fixed'>&#160;-&#160;</td><td class='long'>" + message + "</td></tr>");
925
+ }//}}}
926
+
927
+ function report_failure(){}