cpee 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e789aa5259bacd7b1a1cd8e9c819e078c4acc084983e727347b051c8f861956d
4
- data.tar.gz: eb7cbc79394315d929140f424e0f3d02ee11766cb4275433437d0fe8f49dfd8d
3
+ metadata.gz: b71f98dc26ff6f1cfed69fc184651d7fd01175bee56c77df2f92df10a8db1a3e
4
+ data.tar.gz: 6b023b74f885fc91e81b1ad27040998eea19e7098cb899f3555e5c1c3e11cf38
5
5
  SHA512:
6
- metadata.gz: e06026cedecdf072de2db0a66f2083f72e83a638d672543509f7f02af50c1aac06a1c20baef44afc20a9112b245f756b73da0d84ed38293981f07396dd076aa2
7
- data.tar.gz: ca785378c81867e507086938e449ef78c3d00d737eedc078541c8cd67e64d20573d51145a2e841bd2e70858c5d628e17ae6ccc4f607cc27aa4468b2ff122ab43
6
+ metadata.gz: fd458b2163ef367cde6ac05fa4e178b93f0ad06d5a01cbfc44bf32d921e7675e667a13fd7956e19eac89b064b47908beb815f23d127201d3bf6ac5e7a081c7cd
7
+ data.tar.gz: f003121ae2244ba0e0608d56cc628f99a05a57e101fb806d1adce44225cc762fc7bb7354c51e3f2bee3bcabb46cfe6200fb7f6a0a3599b16c0a75ffd1f83c7d4
@@ -784,7 +784,7 @@ function save_testsetfile() {// {{{
784
784
  var def = new $.Deferred();
785
785
  def.done(function(name,testset) {
786
786
  var ct = new Date();
787
- $('#savetestsetfile').attr('download',name + '_' + ct.strftime("%Y-%m-%dT%H%M%S%z") + '.xml');
787
+ $('#savetestsetfile').attr('download',name + '.xml');
788
788
  $('#savetestsetfile').attr('href','data:application/xml;charset=utf-8;base64,' + $B64(testset.serializePrettyXML()));
789
789
  document.getElementById('savetestsetfile').click();
790
790
  });
@@ -811,6 +811,11 @@ function get_testset(deferred) {// {{{
811
811
  $('testset > dslx',testset).remove();
812
812
  testset.append($X('<transformation xmlns="http://cpee.org/ns/properties/2.0"><description type="copy"/><dataelements type="none"/><endpoints type="none"/></transformation>'));
813
813
  var name = $('testset > attributes > info',testset).text();
814
+ $('[xmlns]',testset).each((idx,ele) => {
815
+ if (ele.parentNode.namespaceURI == ele.getAttribute('xmlns')) {
816
+ ele.removeAttribute('xmlns');
817
+ }
818
+ });
814
819
  deferred.resolve(name,testset);
815
820
  },
816
821
  error: function() { deferred.reject(); report_failure(); }
@@ -33,6 +33,7 @@
33
33
  <script type="text/javascript" src="/js_libs/underscore.min.js"></script>
34
34
  <script type="text/javascript" src="/js_libs/jquery.caret.min.js"></script>
35
35
  <script type="text/javascript" src="/js_libs/jquery.cookie.js"></script>
36
+
36
37
  <script type="text/javascript" src="/js_libs/relaxngui.js"></script>
37
38
 
38
39
  <script type="text/javascript" src="/js_libs/ui.js"></script>
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee"
3
- s.version = "2.0.1"
3
+ s.version = "2.0.2"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0"
6
6
  s.summary = "Preliminary release of cloud process execution engine (cpee.org). If you just need workflow execution, without a rest service exposing it, then use WEEL."
@@ -259,12 +259,13 @@ module CPEE
259
259
  opts = @a[0]
260
260
  redis = opts[:redis]
261
261
  id = @r[0].to_i
262
- unless redis.exists("instance:#{id}/state")
262
+ unless redis.exists?("instance:#{id}/state")
263
263
  @status = 404
264
264
  return
265
265
  end
266
+ empt = redis.keys("instance:#{id}/*").to_a
266
267
  redis.multi do |multi|
267
- multi.del redis.keys("instance:#{id}/*").to_a
268
+ multi.del empt
268
269
  multi.zrem 'instances', id
269
270
  end
270
271
  end
@@ -220,8 +220,11 @@ module CPEE
220
220
  Process.detach pid
221
221
  when 'stopping'
222
222
  pid = File.read(exe + '.pid') rescue nil
223
- if pid
223
+ if pid && (Process.kill(0, pid) rescue false)
224
224
  Process.kill('HUP', pid.to_i) rescue nil
225
+ else
226
+ File.unlink(exe + '.pid') rescue nil
227
+ PutState::set id, opts, 'stopped'
225
228
  end
226
229
  else
227
230
  ### Most probably this is never needed. Lets see.
data/tools/cpee CHANGED
@@ -30,7 +30,7 @@ end
30
30
  ARGV.options { |opt|
31
31
  opt.summary_indent = ' ' * 2
32
32
  opt.summary_width = 15
33
- opt.banner = "Usage:\n#{opt.summary_indent}#{File.basename($0)} [options] ui | cpui DIR | new DIR | archive DIR URL | start URL | delete! URL | abandon URL\n"
33
+ opt.banner = "Usage:\n#{opt.summary_indent}#{File.basename($0)} [options] convert | ui | cpui DIR | new DIR | archive DIR URL | start URL | delete! URL | abandon URL\n"
34
34
  opt.on("Options:")
35
35
  opt.on("--help", "-h", "This text") { puts opt; exit }
36
36
  opt.on("")
@@ -47,10 +47,13 @@ ARGV.options { |opt|
47
47
  opt.on(wrap("[cpui DIR] scaffolds a sample html client. New versions might require manual merging if you changed something."))
48
48
  opt.on("")
49
49
  opt.on(wrap("[ui] starts a simple static web server with the ui on http://localhost:8080. Use [cpui DIR] if you want stuff in apache or nginx."))
50
+ opt.on("")
51
+ opt.on(wrap("[convert] converts all testsets in the current directory to cpee2."))
50
52
  opt.parse!
51
53
  }
52
54
  if (ARGV.length == 0) ||
53
55
  (ARGV.length == 1 && ARGV[0] != 'ui') ||
56
+ (ARGV.length == 1 && ARGV[0] != 'convert') ||
54
57
  (ARGV.length == 2 && !(%w(abandon start delete! cpui new).include?(ARGV[0]))) ||
55
58
  (ARGV.length == 3 && ARGV[0] != 'archive') ||
56
59
  (ARGV.length > 3)
@@ -99,6 +102,29 @@ elsif command == 'cpui'
99
102
  puts "Directory already exists."
100
103
  end
101
104
  end
105
+ elsif command == 'convert'
106
+ Dir['*.xml'].each do |f|
107
+ XML::Smart.modify(f) do |doc|
108
+ doc.register_namespace 'd', 'http://cpee.org/ns/description/1.0'
109
+ doc.register_namespace 'p', 'http://riddl.org/ns/common-patterns/properties/1.0'
110
+ doc.register_namespace 'x', 'http://cpee.org/ns/properties/2.0'
111
+ if doc.root.qname.name == 'testset'
112
+ doc.root.namespaces[nil] = 'http://cpee.org/ns/properties/2.0'
113
+ doc.root.namespace = nil
114
+
115
+ doc.find('//x:start_url').each do |e|
116
+ e.text = 'https://centurio.work/flow-test/start/url/'
117
+ end rescue nil
118
+ doc.find('//x:start_git').each do |e|
119
+ e.text = 'https://centurio.work/flow-test/start/git/'
120
+ end rescue nil
121
+
122
+ doc.find('//p:*').each do |e|
123
+ e.namespaces.delete_all!
124
+ end rescue nil
125
+ end
126
+ end
127
+ end
102
128
  elsif command == 'archive'
103
129
  p2 = File.join(p2,'*') if p2 =~ /([a-zA-Z]|\/)$/
104
130
  base = File.dirname(p2)
@@ -139,11 +165,12 @@ elsif command == 'archive'
139
165
  prop = Typhoeus.get(File.join(base,name.to_s,'properties','/'))
140
166
  if prop.success?
141
167
  xprop = XML::Smart::string(prop.response_body)
142
- xprop.register_namespace 'p', 'http://riddl.org/ns/common-patterns/properties/1.0'
168
+ xprop.register_namespace 'p', 'http://cpee.org/ns/properties/2.0'
143
169
  if ["finished","abandoned"].include?(xprop.find("string(/p:properties/p:state)"))
144
170
  uuid = xprop.find("string(/p:properties/p:attributes/p:uuid)")
145
171
  id = name.to_s
146
172
  File.write(File.join(p1,uuid + '.xml'),prop.response_body) if prop.headers['Content-Type'] =~ /^(text|application)\/xml/
173
+ p File.join(base,name.to_s,'/')
147
174
  Typhoeus.delete(File.join(base,name.to_s,'/'))
148
175
  end
149
176
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpee
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: tools
12
12
  cert_chain: []
13
- date: 2020-10-06 00:00:00.000000000 Z
13
+ date: 2020-10-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: riddl