cpee 2.1.14 → 2.1.19

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 41c8af6dfe0026a757a1cb1d3627415773aabf2e99712ac77207de2f518fbf0e
4
- data.tar.gz: 8b02404db658a5e2a6219e5b3843cee54beed9df08356d615c504bd56851b61d
3
+ metadata.gz: bfcea35b5af1c0944e0ef51f370febe9bb9596c7d43dff4d4aeaf679c70be29f
4
+ data.tar.gz: 53b9636942a7fa4a3408717151c53975d6ca34712337f00ecd65214a975f292d
5
5
  SHA512:
6
- metadata.gz: 04104b072172fa082b879e414f6ffec58d21fe99be5ec18a7fd3a070947139cf30d7f02e377b34bcd8e61cc9f5afef1570971224c4786e5338ab9c02c11cd50f
7
- data.tar.gz: 3cb492d19adf14b727c6ce14cd4edd2dcca0da1819502b63b20a68a249ce78a5c803b19c18a23d9051f00734cbb161cd0e9eac2ecb9efec2ce3d667cfa663440
6
+ metadata.gz: 372a9a4a84164a833e94e97c9371b081550511806bf977fb5b78acca93f62b4fbbad45e288d48a0a5dd5b6ec5228d01e2fe0bfb2f5f4f89ca0a4a034a4290580
7
+ data.tar.gz: 9dba028bc84297ae212cbc7bfd377d754eb38c78c2f53e8e542b0669567b23fb7456957d1adb40048fdfcb7f871b439421cd5bb3e1d04420514a77c501cadb33
@@ -1366,7 +1366,16 @@ function append_to_log(what,type,message) {//{{{
1366
1366
  message = message.replace(/:\"/g,': "');
1367
1367
  message = message.replace(/:\{/g,': {');
1368
1368
  message = message.replace(/:\[/g,': [');
1369
- $("#dat_log").prepend("<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>");
1369
+ message = message.replace(/&/g, '&amp;');
1370
+ message = message.replace(/</g, '&lt;');
1371
+ message = message.replace(/>/g, '&gt;');
1372
+ message = message.replace(/"/g, '&quot;');
1373
+ message = message.replace(/'/g, '&apos;');
1374
+ if (type == 'description/change') {
1375
+ $("#dat_log").prepend("<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'>... check in persistent log ...</td></tr>");
1376
+ } else {
1377
+ $("#dat_log").prepend("<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>");
1378
+ }
1370
1379
  var dle = $("#dat_log").children();
1371
1380
  if (dle.length > 100) {
1372
1381
  dle.slice(100).each((k,ele) => {
data/cpee.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee"
3
- s.version = "2.1.14"
3
+ s.version = "2.1.19"
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."
@@ -13,6 +13,7 @@
13
13
  # <http://www.gnu.org/licenses/>.
14
14
 
15
15
  require 'charlock_holmes'
16
+ require 'base64'
16
17
 
17
18
  class ConnectionWrapper < WEEL::ConnectionWrapperBase
18
19
  def self::loop_guard(arguments,id,count) # {{{
@@ -197,11 +198,12 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
197
198
  unless status.nil?
198
199
  @controller.notify("status/change", :'activity-uuid' => @handler_activity_uuid, :endpoint => @handler_endpoint, :label => @label, :activity => @handler_position, :id => status.id, :message => status.message)
199
200
  end
200
- unless changed_dataelements.nil?
201
- @controller.notify("dataelements/change", :'activity-uuid' => @handler_activity_uuid, :endpoint => @handler_endpoint, :label => @label, :activity => @handler_position, :changed => changed_dataelements, :values => dataelements)
201
+ unless changed_dataelements.nil? || changed_dataelements.empty?
202
+ de = dataelements.slice(*changed_dataelements).transform_values { |v| enc = detect_encoding(v); (enc == 'BINARY' ? convert_to_base64(v) : (enc == 'UTF-8' ? v : v.encode('UTF-8',enc))) }
203
+ @controller.notify("dataelements/change", :'activity-uuid' => @handler_activity_uuid, :endpoint => @handler_endpoint, :label => @label, :activity => @handler_position, :changed => changed_dataelements, :values => de)
202
204
  end
203
- unless changed_endpoints.nil?
204
- @controller.notify("endpoints/change", :'activity-uuid' => @handler_activity_uuid, :endpoint => @handler_endpoint, :label => @label, :activity => @handler_position, :changed => changed_endpoints, :values => endpoints)
205
+ unless changed_endpoints.nil? || changed_endpoints.empty?
206
+ @controller.notify("endpoints/change", :'activity-uuid' => @handler_activity_uuid, :endpoint => @handler_endpoint, :label => @label, :activity => @handler_position, :changed => changed_endpoints, :values => endpoints.slice(*changed_endpoints))
205
207
  end
206
208
  end # }}}
207
209
 
@@ -241,12 +243,21 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
241
243
  result
242
244
  end
243
245
 
244
- def detected_encoding(text)
245
- CharlockHolmes::EncodingDetector.detect(text)[:encoding] || 'ISO-8859-1'
246
+ def detect_encoding(text)
247
+ if text.is_a? String
248
+ res = CharlockHolmes::EncodingDetector.detect(text)
249
+ if res.is_a?(Hash) && res[:type] == :text && res[:encoding].match(/(ISO|UTF-8)/)
250
+ res[:encoding]
251
+ else
252
+ 'BINARY'
253
+ end
254
+ else
255
+ 'UTF-8'
256
+ end
246
257
  end
247
258
 
248
- def convert_to_utf8(text)
249
- CharlockHolmes::Converter.convert(text, detected_encoding(text), "UTF-8")
259
+ def convert_to_base64(text)
260
+ 'data:application/octet-stream;base64,' + Base64::urlsafe_encode64(text)
250
261
  end
251
262
 
252
263
  def structurize_result(result)
@@ -264,10 +275,11 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
264
275
  else
265
276
  r.value.read
266
277
  end
278
+ enc = detect_encoding(res)
267
279
  tmp = {
268
280
  'name' => r.name == '' ? 'result' : r.name,
269
281
  'mimetype' => r.mimetype,
270
- 'data' => res
282
+ 'data' => (enc == 'BINARY' ? convert_to_base64(res) : (enc == 'UTF-8' ? res : res.encode('UTF-8',enc)))
271
283
  }
272
284
  r.value.rewind
273
285
  tmp
data/tools/server/cpee CHANGED
@@ -4,7 +4,7 @@ require 'cpee/implementation'
4
4
 
5
5
  Riddl::Server.new(CPEE::SERVER, :host => 'localhost', :port => 8298) do |opts|
6
6
  opts[:instances] = File.join(__dir__,'instances')
7
- opts[:executionhandlers = File.join(__dir__,'executionhandlers')
7
+ opts[:executionhandlers] = File.join(__dir__,'executionhandlers')
8
8
  opts[:notifications_init] = File.join(__dir__,'resources','notifications')
9
9
  opts[:properties_init] = File.join(__dir__,'resources','properties.init')
10
10
 
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.14
4
+ version: 2.1.19
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-08-02 00:00:00.000000000 Z
13
+ date: 2021-10-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: riddl
@@ -675,7 +675,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
675
675
  - !ruby/object:Gem::Version
676
676
  version: '0'
677
677
  requirements: []
678
- rubygems_version: 3.1.6
678
+ rubygems_version: 3.2.22
679
679
  signing_key:
680
680
  specification_version: 4
681
681
  summary: Preliminary release of cloud process execution engine (cpee.org). If you