cpee 2.1.20 → 2.1.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cockpit/css/ui.css +1 -1
- data/cockpit/templates/Coopis 2010.xml +8 -3
- data/cockpit/templates/IUPC arXiv:1104.3609 P34 1.xml +15 -8
- data/cockpit/templates/IUPC arXiv:1104.3609 P34 2.xml +15 -8
- data/cockpit/templates/IUPC arXiv:1104.3609 P34 3.xml +15 -8
- data/cockpit/templates/Track Test Local.xml +2 -1
- data/cockpit/templates/Track Test.xml +2 -1
- data/cockpit/templates/UR-VUE 2020 Manual Adjust.xml +5 -0
- data/cockpit/templates/UR-VUE 2020 Solution Baseline.xml +6 -8
- data/cockpit/templates/UR-VUE 2020 Solution NN.xml +6 -8
- data/cockpit/templates/UR-VUE 2020 Solution View.xml +5 -8
- data/cockpit/templates/UR-VUE 2020.xml +1 -8
- data/cockpit/templates/Worklist.xml +3 -1
- data/cockpit/themes/compact/rngs/call.rng +110 -108
- data/cockpit/themes/compact/rngs/callmanipulate.rng +90 -87
- data/cockpit/themes/compact/rngs/parallel_branch.rng +1 -7
- data/cockpit/themes/compact/theme.js +136 -118
- data/cockpit/themes/control/rngs/call.rng +110 -108
- data/cockpit/themes/control/rngs/callmanipulate.rng +90 -87
- data/cockpit/themes/control/rngs/parallel_branch.rng +1 -7
- data/cockpit/themes/control/theme.js +149 -131
- data/cockpit/themes/default/rngs/call.rng +110 -108
- data/cockpit/themes/default/rngs/callmanipulate.rng +90 -87
- data/cockpit/themes/default/rngs/parallel_branch.rng +1 -7
- data/cockpit/themes/default/theme.js +136 -118
- data/cockpit/themes/extended/rngs/call.rng +110 -108
- data/cockpit/themes/extended/rngs/callmanipulate.rng +90 -87
- data/cockpit/themes/extended/rngs/parallel_branch.rng +1 -7
- data/cockpit/themes/extended/theme.js +136 -118
- data/cockpit/themes/model/rngs/call.rng +24 -22
- data/cockpit/themes/model/rngs/callmanipulate.rng +28 -26
- data/cockpit/themes/model/theme.js +114 -96
- data/cockpit/themes/packed/rngs/call.rng +110 -108
- data/cockpit/themes/packed/rngs/callmanipulate.rng +90 -87
- data/cockpit/themes/packed/rngs/parallel_branch.rng +1 -7
- data/cockpit/themes/packed/theme.js +136 -118
- data/cockpit/themes/preset/rngs/call.rng +110 -108
- data/cockpit/themes/preset/rngs/callmanipulate.rng +90 -87
- data/cockpit/themes/preset/rngs/parallel_branch.rng +1 -7
- data/cockpit/themes/preset/theme.js +136 -118
- data/cpee.gemspec +2 -1
- data/server/executionhandlers/ruby/connection.rb +27 -12
- data/tools/cpee +13 -6
- metadata +16 -2
@@ -13,6 +13,7 @@
|
|
13
13
|
# <http://www.gnu.org/licenses/>.
|
14
14
|
|
15
15
|
require 'charlock_holmes'
|
16
|
+
require 'mimemagic'
|
16
17
|
require 'base64'
|
17
18
|
|
18
19
|
class ConnectionWrapper < WEEL::ConnectionWrapperBase
|
@@ -199,7 +200,7 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
|
|
199
200
|
@controller.notify("status/change", :'activity-uuid' => @handler_activity_uuid, :endpoint => @handler_endpoint, :label => @label, :activity => @handler_position, :id => status.id, :message => status.message)
|
200
201
|
end
|
201
202
|
unless changed_dataelements.nil? || changed_dataelements.empty?
|
202
|
-
de = dataelements.slice(*changed_dataelements).transform_values { |v| enc = detect_encoding(v); (enc == '
|
203
|
+
de = dataelements.slice(*changed_dataelements).transform_values { |v| enc = detect_encoding(v); (enc == 'OTHER' ? v.inspect : (v.encode('UTF-8',enc) rescue convert_to_base64(v))) }
|
203
204
|
@controller.notify("dataelements/change", :'activity-uuid' => @handler_activity_uuid, :endpoint => @handler_endpoint, :label => @label, :activity => @handler_position, :changed => changed_dataelements, :values => de)
|
204
205
|
end
|
205
206
|
unless changed_endpoints.nil? || changed_endpoints.empty?
|
@@ -245,19 +246,25 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
|
|
245
246
|
|
246
247
|
def detect_encoding(text)
|
247
248
|
if text.is_a? String
|
248
|
-
|
249
|
-
|
250
|
-
res[:encoding]
|
249
|
+
if text.valid_encoding? && text.encoding.name == 'UTF-8'
|
250
|
+
'UTF-8'
|
251
251
|
else
|
252
|
-
|
252
|
+
res = CharlockHolmes::EncodingDetector.detect(text)
|
253
|
+
if res.is_a?(Hash) && res[:type] == :text && res[:ruby_encoding] != "binary"
|
254
|
+
res[:encoding]
|
255
|
+
elsif res.is_a?(Hash) && res[:type] == :binary
|
256
|
+
'BINARY'
|
257
|
+
else
|
258
|
+
'ISO-8859-1'
|
259
|
+
end
|
253
260
|
end
|
254
261
|
else
|
255
|
-
'
|
262
|
+
'OTHER'
|
256
263
|
end
|
257
264
|
end
|
258
265
|
|
259
266
|
def convert_to_base64(text)
|
260
|
-
'data:application/octet-stream;base64,' + Base64::
|
267
|
+
('data:' + MimeMagic.by_magic(text).type + ';base64,' + Base64::encode64(text)) rescue ('data:application/octet-stream;base64,' + Base64::encode64(text))
|
261
268
|
end
|
262
269
|
|
263
270
|
def structurize_result(result)
|
@@ -266,20 +273,28 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
|
|
266
273
|
{ 'name' => r.name, 'data' => r.value }
|
267
274
|
elsif r.is_a? Riddl::Parameter::Complex
|
268
275
|
res = if r.mimetype == 'application/json'
|
269
|
-
JSON::parse(r.value.read) rescue nil
|
276
|
+
ttt = JSON::parse(r.value.read) rescue nil
|
277
|
+
if ttt.nil?
|
278
|
+
''
|
279
|
+
else
|
280
|
+
enc = detect_encoding(ttt)
|
281
|
+
enc == 'OTHER' ? ttt.inspect : (ttt.encode('UTF-8',enc) rescue convert_to_base64(ttt))
|
282
|
+
end
|
270
283
|
elsif r.mimetype == 'text/plain' || r.mimetype == 'text/html'
|
271
284
|
ttt = r.value.read
|
272
285
|
ttt = ttt.to_f if ttt == ttt.to_f.to_s
|
273
286
|
ttt = ttt.to_i if ttt == ttt.to_i.to_s
|
274
|
-
ttt
|
287
|
+
enc = detect_encoding(ttt)
|
288
|
+
enc == 'OTHER' ? ttt.inspect : (ttt.encode('UTF-8',enc) rescue convert_to_base64(ttt))
|
275
289
|
else
|
276
|
-
r.value.read
|
290
|
+
convert_to_base64(r.value.read)
|
291
|
+
r.value.rewind
|
277
292
|
end
|
278
|
-
|
293
|
+
|
279
294
|
tmp = {
|
280
295
|
'name' => r.name == '' ? 'result' : r.name,
|
281
296
|
'mimetype' => r.mimetype,
|
282
|
-
'data' =>
|
297
|
+
'data' => res.to_s
|
283
298
|
}
|
284
299
|
r.value.rewind
|
285
300
|
tmp
|
data/tools/cpee
CHANGED
@@ -116,13 +116,20 @@ elsif command == 'convert'
|
|
116
116
|
doc.root.prepend('x:executionhandler','ruby')
|
117
117
|
end
|
118
118
|
end rescue nil
|
119
|
+
doc.find('//d:parallel_branch/@pass').delete_all!
|
120
|
+
doc.find('//d:parallel_branch/@local').delete_all!
|
121
|
+
doc.find('//d:call').each do |c|
|
122
|
+
c.find('d:annotations').first.add c.find('d:parameters/d:_context_data_analysis')
|
123
|
+
c.find('d:annotations').first.add c.find('d:parameters/d:_report')
|
124
|
+
if c.find('d:documentation').empty?
|
125
|
+
node = c.add('d:documentation')
|
126
|
+
node.add c.find('d:input')
|
127
|
+
node.add c.find('d:output')
|
128
|
+
node.add c.find('d:implementation')
|
129
|
+
node.add c.find('d:code[d:description]')
|
130
|
+
end
|
131
|
+
end
|
119
132
|
doc.find('//x:handlerwrapper').delete_all!
|
120
|
-
doc.find('//x:start_url').each do |e|
|
121
|
-
e.text = 'https://cpee.org/flow/start/url/'
|
122
|
-
end rescue nil
|
123
|
-
doc.find('//x:start_git').each do |e|
|
124
|
-
e.text = 'https://cpee.org/flow/start/git/'
|
125
|
-
end rescue nil
|
126
133
|
doc.find('//d:finalize | //d:update | //d:prepare | //d:rescue').each do |e|
|
127
134
|
if e.parent.qname.name != 'code'
|
128
135
|
n = e.parent
|
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.1.
|
4
|
+
version: 2.1.24
|
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: 2021-
|
13
|
+
date: 2021-11-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: riddl
|
@@ -116,6 +116,20 @@ dependencies:
|
|
116
116
|
- - "~>"
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '0'
|
119
|
+
- !ruby/object:Gem::Dependency
|
120
|
+
name: mimemagic
|
121
|
+
requirement: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - "~>"
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
type: :runtime
|
127
|
+
prerelease: false
|
128
|
+
version_requirements: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - "~>"
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
119
133
|
description: see http://cpee.org
|
120
134
|
email: juergen.mangler@gmail.com
|
121
135
|
executables:
|