cpee-frames 1.0.5 → 2.0.0
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 +4 -4
- data/cpee-frames.gemspec +1 -1
- data/lib/cpee-frames/frames.xml +0 -8
- data/lib/cpee-frames/implementation.rb +40 -63
- data/lib/cpee-frames/ui/template.html +12 -16
- data/lib/cpee-frames/ui/tutorial.html +89 -108
- data/server/frames +2 -0
- data/tools/cpee-frames +5 -5
- data/ui/examples/button.html +48 -0
- data/ui/examples/questions.css +23 -0
- data/ui/examples/questions.html +238 -0
- data/ui/examples/spinner.html +34 -0
- data/ui/examples/text.css +1 -0
- data/ui/examples/text.html +21 -0
- data/ui/js/frames.js +17 -0
- data/ui/js/ui.js +12 -127
- metadata +10 -11
- data/lib/cpee-frames/ui/framedata.html +0 -57
- data/lib/cpee-frames/ui/menu.html +0 -66
- data/lib/cpee-frames/ui/test.html +0 -52
- data/ui/js/frame_data.js +0 -55
- data/ui/js/test.js +0 -61
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 307042175036cde47b123d2754cdd44a8348f41a14560f32790d533a7c6ce6f7
|
|
4
|
+
data.tar.gz: f1e6c989dad86242bab7086e3f9eba0233b3f7883d2ff473dfce439caeb8d379
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 16b54380b6ef43d0b0448c0776afe1ceaa1b8e434135a2b8aae380b55984482f4d1069bbf03f28f550bcb14f5cbabe8ba7a577ffb229db35230cb1d288a2c4e6
|
|
7
|
+
data.tar.gz: 06c4ffce6e21dbd1327540090badc22a396ef6105ca37ff7d18aebfeb80eb01af53a1e572db1c09b9fed9a52d184eb3e7056e7803178172ec40143866d485c13
|
data/cpee-frames.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.name = "cpee-frames"
|
|
3
|
-
s.version = "
|
|
3
|
+
s.version = "2.0.0"
|
|
4
4
|
s.platform = Gem::Platform::RUBY
|
|
5
5
|
s.license = "GPL-3.0"
|
|
6
6
|
s.summary = "Dashboard management service with UI and backend for the cpee.org family of workflow management tools"
|
data/lib/cpee-frames/frames.xml
CHANGED
|
@@ -31,8 +31,6 @@
|
|
|
31
31
|
<parameter name="ly" type="nonNegativeInteger"/>
|
|
32
32
|
<parameter name="x_amount" type="nonNegativeInteger"/>
|
|
33
33
|
<parameter name="y_amount" type="nonNegativeInteger"/>
|
|
34
|
-
<parameter name="button" type="string"/>
|
|
35
|
-
<parameter name="style" type="string"/>
|
|
36
34
|
<parameter name="urls" type="string"/>
|
|
37
35
|
<parameter name="default" type="string"/>
|
|
38
36
|
</message>
|
|
@@ -42,8 +40,6 @@
|
|
|
42
40
|
<parameter name="ly" type="nonNegativeInteger"/>
|
|
43
41
|
<parameter name="x_amount" type="nonNegativeInteger"/>
|
|
44
42
|
<parameter name="y_amount" type="nonNegativeInteger"/>
|
|
45
|
-
<parameter name="button" type="string"/>
|
|
46
|
-
<parameter name="style" type="string"/>
|
|
47
43
|
<parameter name="urls" type="string"/>
|
|
48
44
|
<parameter name="default" type="string"/>
|
|
49
45
|
</message>
|
|
@@ -126,10 +122,6 @@
|
|
|
126
122
|
<post />
|
|
127
123
|
</resource>
|
|
128
124
|
|
|
129
|
-
<resource relative="test">
|
|
130
|
-
<put in="string"/>
|
|
131
|
-
</resource>
|
|
132
|
-
|
|
133
125
|
<resource relative='handler'>
|
|
134
126
|
<post />
|
|
135
127
|
<resource relative='sse'>
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
#
|
|
3
3
|
# This file is part of CPEE-FRAMES.
|
|
4
4
|
#
|
|
5
|
-
# CPEE-FRAMES is free software: you can redistribute it and/or
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
5
|
+
# CPEE-FRAMES is free software: you can redistribute it and/or modify it under
|
|
6
|
+
# the terms of the GNU General Public License as published by the Free Software
|
|
7
|
+
# Foundation, either version 3 of the License, or (at your option) any later
|
|
8
|
+
# version.
|
|
9
9
|
#
|
|
10
|
-
# CPEE-FRAMES is distributed in the hope that it will be useful,
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
10
|
+
# CPEE-FRAMES is distributed in the hope that it will be useful, but WITHOUT
|
|
11
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
12
|
+
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
13
|
+
# details.
|
|
14
14
|
#
|
|
15
15
|
# You should have received a copy of the GNU General Public License along with
|
|
16
16
|
# CPEE-FRAMES (file LICENSE in the main directory). If not, see
|
|
@@ -39,7 +39,6 @@ module CPEE
|
|
|
39
39
|
return true
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
|
|
43
42
|
# https://coderwall.com/p/atyfyq/ruby-string-to-boolean
|
|
44
43
|
# showbutton
|
|
45
44
|
refine String do #{{{
|
|
@@ -66,15 +65,7 @@ module CPEE
|
|
|
66
65
|
|
|
67
66
|
class Get < Riddl::Implementation #{{{
|
|
68
67
|
def response
|
|
69
|
-
|
|
70
|
-
Riddl::Parameter::Complex.new('ui','text/html',File.open(File.join(__dir__,'ui','test.html')))
|
|
71
|
-
elsif @r[0] == 'menu'
|
|
72
|
-
Riddl::Parameter::Complex.new('ui','text/html',File.open(File.join(__dir__,'ui','menu.html')))
|
|
73
|
-
elsif @r[0] == 'framedata'
|
|
74
|
-
Riddl::Parameter::Complex.new('ui','text/html',File.open(File.join(__dir__,'ui','framedata.html')))
|
|
75
|
-
else
|
|
76
|
-
Riddl::Parameter::Complex.new('ui','text/html',File.open(File.join(__dir__,'ui','template.html')))
|
|
77
|
-
end
|
|
68
|
+
Riddl::Parameter::Complex.new('ui','text/html',File.open(File.join(__dir__,'ui','template.html')))
|
|
78
69
|
end
|
|
79
70
|
end #}}}
|
|
80
71
|
|
|
@@ -109,7 +100,7 @@ module CPEE
|
|
|
109
100
|
file = File.read(path)
|
|
110
101
|
data_hash = JSON::parse(file)
|
|
111
102
|
|
|
112
|
-
#check if new frame overlaps others if it does, delete overlapped frames
|
|
103
|
+
# check if new frame overlaps others if it does, delete overlapped frames
|
|
113
104
|
data_hash["data"].each do | c |
|
|
114
105
|
if CPEE::Frames::overlap?(c['lx'], c['ly'], c['rx'], c['ry'], @p[1].value.to_i, @p[2].value.to_i, (@p[1].value.to_i + @p[3].value.to_i - 1), (@p[2].value.to_i + @p[4].value.to_i - 1))
|
|
115
106
|
data_hash["data"].delete(c)
|
|
@@ -117,29 +108,27 @@ module CPEE
|
|
|
117
108
|
end
|
|
118
109
|
|
|
119
110
|
#check if url is set
|
|
120
|
-
if @p[
|
|
121
|
-
urls = JSON::parse(@p[
|
|
111
|
+
if @p[5].value != ""
|
|
112
|
+
urls = JSON::parse(@p[5].value);
|
|
122
113
|
|
|
123
|
-
if @p[
|
|
124
|
-
hash = {lx: @p[1].value.to_i, ly: @p[2].value.to_i, rx: (@p[1].value.to_i + @p[3].value.to_i - 1), ry: (@p[2].value.to_i + @p[4].value.to_i - 1), url: urls,
|
|
114
|
+
if @p[6].value == ""
|
|
115
|
+
hash = {lx: @p[1].value.to_i, ly: @p[2].value.to_i, rx: (@p[1].value.to_i + @p[3].value.to_i - 1), ry: (@p[2].value.to_i + @p[4].value.to_i - 1), url: urls, default: "{}", callback: @h['CPEE_CALLBACK']};
|
|
125
116
|
else
|
|
126
|
-
hash = {lx: @p[1].value.to_i, ly: @p[2].value.to_i, rx: (@p[1].value.to_i + @p[3].value.to_i - 1), ry: (@p[2].value.to_i + @p[4].value.to_i - 1), url: urls,
|
|
117
|
+
hash = {lx: @p[1].value.to_i, ly: @p[2].value.to_i, rx: (@p[1].value.to_i + @p[3].value.to_i - 1), ry: (@p[2].value.to_i + @p[4].value.to_i - 1), url: urls, default: JSON::parse(@p[6].value), callback: @h['CPEE_CALLBACK']};
|
|
127
118
|
end
|
|
128
119
|
|
|
129
|
-
data_hash[
|
|
120
|
+
data_hash['data'].push(hash)
|
|
130
121
|
File.write(path, JSON.dump(data_hash))
|
|
131
122
|
|
|
132
|
-
#only send active url to client
|
|
123
|
+
# only send active url to client
|
|
133
124
|
infofile = File.join(data_dir,@r.last,'info.json')
|
|
134
125
|
infojson = JSON::parse(File.read(infofile))
|
|
135
126
|
hash["url"] = urls.find{ |h| h['lang'] == infojson["lang"]}['url']
|
|
136
127
|
|
|
137
|
-
|
|
138
128
|
@a[0].send(JSON.dump(hash))
|
|
139
129
|
else
|
|
140
130
|
File.write(path, JSON.dump(data_hash))
|
|
141
|
-
hash = {lx: @p[1].value.to_i, ly: @p[2].value.to_i, rx: (@p[1].value.to_i + @p[3].value.to_i - 1), ry: (@p[2].value.to_i + @p[4].value.to_i - 1), url: "empty",
|
|
142
|
-
|
|
131
|
+
hash = {lx: @p[1].value.to_i, ly: @p[2].value.to_i, rx: (@p[1].value.to_i + @p[3].value.to_i - 1), ry: (@p[2].value.to_i + @p[4].value.to_i - 1), url: "empty", default: "{}", callback: @h['CPEE_CALLBACK']};
|
|
143
132
|
|
|
144
133
|
@a[0].send(JSON.dump(hash))
|
|
145
134
|
end
|
|
@@ -155,37 +144,35 @@ module CPEE
|
|
|
155
144
|
file = File.read(path)
|
|
156
145
|
data_hash = JSON::parse(file)
|
|
157
146
|
|
|
158
|
-
#check if new frame overlaps others if it does, delete overlapped frames
|
|
147
|
+
# check if new frame overlaps others if it does, delete overlapped frames
|
|
159
148
|
data_hash["data"].each do | c |
|
|
160
149
|
if CPEE::Frames::overlap?(c['lx'], c['ly'], c['rx'], c['ry'], @p[1].value.to_i, @p[2].value.to_i, (@p[1].value.to_i + @p[3].value.to_i - 1), (@p[2].value.to_i + @p[4].value.to_i - 1))
|
|
161
150
|
data_hash["data"].delete(c)
|
|
162
151
|
end
|
|
163
152
|
end
|
|
164
153
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
hash = {lx: @p[1].value.to_i, ly: @p[2].value.to_i, rx: (@p[1].value.to_i + @p[3].value.to_i - 1), ry: (@p[2].value.to_i + @p[4].value.to_i - 1), url: urls, showbutton: @p[5].value, style: @p[6].value, default: "{}", callback: @h['CPEE_CALLBACK']};
|
|
154
|
+
# check if url is set
|
|
155
|
+
if @p[5].value != ""
|
|
156
|
+
urls = JSON::parse(@p[5].value);
|
|
157
|
+
if @p[6].value == ""
|
|
158
|
+
hash = {lx: @p[1].value.to_i, ly: @p[2].value.to_i, rx: (@p[1].value.to_i + @p[3].value.to_i - 1), ry: (@p[2].value.to_i + @p[4].value.to_i - 1), url: urls, default: "{}", callback: @h['CPEE_CALLBACK']};
|
|
171
159
|
else
|
|
172
|
-
hash = {lx: @p[1].value.to_i, ly: @p[2].value.to_i, rx: (@p[1].value.to_i + @p[3].value.to_i - 1), ry: (@p[2].value.to_i + @p[4].value.to_i - 1), url: urls,
|
|
160
|
+
hash = {lx: @p[1].value.to_i, ly: @p[2].value.to_i, rx: (@p[1].value.to_i + @p[3].value.to_i - 1), ry: (@p[2].value.to_i + @p[4].value.to_i - 1), url: urls, default: JSON::parse(@p[6].value), callback: @h['CPEE_CALLBACK']};
|
|
173
161
|
end
|
|
174
|
-
data_hash[
|
|
162
|
+
data_hash['data'].push(hash)
|
|
175
163
|
File.write(path, JSON.dump(data_hash))
|
|
176
164
|
|
|
177
|
-
#only send active url to client
|
|
165
|
+
# only send active url to client
|
|
178
166
|
infofile = File.join(data_dir,@r.last,'info.json')
|
|
179
167
|
infojson = JSON::parse(File.read(infofile))
|
|
180
168
|
hash["url"] = urls.find{ |h| h['lang'] == infojson["lang"]}['url']
|
|
181
169
|
|
|
182
170
|
File.write(File.join(data_dir,@r.last,'callback'),@h['CPEE_CALLBACK'])
|
|
183
171
|
|
|
184
|
-
|
|
185
172
|
@a[0].send(JSON.dump(hash))
|
|
186
173
|
else
|
|
187
174
|
File.write(path, JSON.dump(data_hash))
|
|
188
|
-
hash = {lx: @p[1].value.to_i, ly: @p[2].value.to_i, rx: (@p[1].value.to_i + @p[3].value.to_i - 1), ry: (@p[2].value.to_i + @p[4].value.to_i - 1), url: "empty",
|
|
175
|
+
hash = {lx: @p[1].value.to_i, ly: @p[2].value.to_i, rx: (@p[1].value.to_i + @p[3].value.to_i - 1), ry: (@p[2].value.to_i + @p[4].value.to_i - 1), url: "empty", default: "{}", callback: @h['CPEE_CALLBACK']};
|
|
189
176
|
|
|
190
177
|
File.write(File.join(data_dir,@r.last,'callback'),@h['CPEE_CALLBACK'])
|
|
191
178
|
|
|
@@ -224,7 +211,6 @@ module CPEE
|
|
|
224
211
|
data_dir = @a[1]
|
|
225
212
|
pp "in delete"
|
|
226
213
|
if cbu = File.read(File.join(data_dir,@r.last,'callback'))
|
|
227
|
-
pp "XYZ"
|
|
228
214
|
send = { 'operation' => @p[0].value }
|
|
229
215
|
case send['operation']
|
|
230
216
|
when 'result'
|
|
@@ -235,11 +221,11 @@ module CPEE
|
|
|
235
221
|
Typhoeus.put(cbu, body: JSON::generate(send), headers: { 'content-type' => 'application/json'})
|
|
236
222
|
end
|
|
237
223
|
|
|
238
|
-
#File.unlink(File.join(data_dir,@r.last,'callback')) rescue nil
|
|
239
|
-
#File.unlink(File.join(data_dir,@r.last,'cpeeinstance.url')) rescue nil
|
|
240
|
-
#File.unlink(File.join(data_dir,@r.last,'style.url')) rescue nil
|
|
241
|
-
#File.unlink(File.join(data_dir,@r.last,'document.xml')) rescue nil
|
|
242
|
-
#File.unlink(File.join(data_dir,@r.last,'info.json')) rescue nil
|
|
224
|
+
# File.unlink(File.join(data_dir,@r.last,'callback')) rescue nil
|
|
225
|
+
# File.unlink(File.join(data_dir,@r.last,'cpeeinstance.url')) rescue nil
|
|
226
|
+
# File.unlink(File.join(data_dir,@r.last,'style.url')) rescue nil
|
|
227
|
+
# File.unlink(File.join(data_dir,@r.last,'document.xml')) rescue nil
|
|
228
|
+
# File.unlink(File.join(data_dir,@r.last,'info.json')) rescue nil
|
|
243
229
|
|
|
244
230
|
@a[0].send('reset')
|
|
245
231
|
nil
|
|
@@ -255,7 +241,7 @@ module CPEE
|
|
|
255
241
|
infofile = File.join(data_dir,@r[-2],'info.json')
|
|
256
242
|
infojson = JSON::parse(File.read(infofile))
|
|
257
243
|
|
|
258
|
-
#remove not used languages
|
|
244
|
+
# remove not used languages
|
|
259
245
|
file = JSON::parse(File.read(fname))
|
|
260
246
|
|
|
261
247
|
file["data"].each do |child|
|
|
@@ -325,7 +311,7 @@ module CPEE
|
|
|
325
311
|
fname = File.join(data_dir,@r[-2],'info.json')
|
|
326
312
|
if File.exist? fname
|
|
327
313
|
infojson = JSON::parse(File.read(fname))
|
|
328
|
-
Riddl::Parameter::Complex.new('value','application/json',infojson["langs"])
|
|
314
|
+
Riddl::Parameter::Complex.new('value','application/json',JSON::generate(infojson["langs"]))
|
|
329
315
|
else
|
|
330
316
|
@status = 404
|
|
331
317
|
end
|
|
@@ -382,12 +368,6 @@ module CPEE
|
|
|
382
368
|
end
|
|
383
369
|
end #}}}
|
|
384
370
|
|
|
385
|
-
class OutputTest < Riddl::Implementation #{{{
|
|
386
|
-
def response
|
|
387
|
-
puts "Test"
|
|
388
|
-
end
|
|
389
|
-
end #}}}
|
|
390
|
-
|
|
391
371
|
class Handler < Riddl::Implementation #{{{
|
|
392
372
|
def response
|
|
393
373
|
data_dir = @a[1]
|
|
@@ -428,7 +408,7 @@ module CPEE
|
|
|
428
408
|
end
|
|
429
409
|
end #}}}
|
|
430
410
|
|
|
431
|
-
class
|
|
411
|
+
class SSE_Handler < Riddl::SSEImplementation #{{{
|
|
432
412
|
def onopen
|
|
433
413
|
signals = @a[0]
|
|
434
414
|
signals.add self
|
|
@@ -506,7 +486,7 @@ module CPEE
|
|
|
506
486
|
on resource 'handler' do
|
|
507
487
|
run Handler, opts[:signals2]["handler"], opts[:data_dir] if post
|
|
508
488
|
on resource 'sse' do
|
|
509
|
-
run
|
|
489
|
+
run SSE_Handler, opts[:signals2]["handler"] if sse
|
|
510
490
|
end
|
|
511
491
|
end
|
|
512
492
|
|
|
@@ -520,21 +500,18 @@ module CPEE
|
|
|
520
500
|
run GetLangs, opts[:data_dir] if get
|
|
521
501
|
run SetLang, opts[:signals][idx], opts[:data_dir] if post 'lang'
|
|
522
502
|
end
|
|
523
|
-
on resource 'style.url' do
|
|
524
|
-
run GetStyle, opts[:data_dir] if get
|
|
525
|
-
end
|
|
526
503
|
on resource 'cpeeinstance.url' do
|
|
527
504
|
run GetCpeeInstance, opts[:data_dir] if get
|
|
528
505
|
end
|
|
506
|
+
on resource 'style.url' do
|
|
507
|
+
run GetStyle, opts[:data_dir] if get
|
|
508
|
+
end
|
|
529
509
|
on resource 'info.json' do
|
|
530
510
|
run GetInfo, opts[:data_dir] if get
|
|
531
511
|
end
|
|
532
512
|
on resource 'frames.json' do
|
|
533
513
|
run GetFrames, opts[:data_dir] if get
|
|
534
514
|
end
|
|
535
|
-
on resource 'test' do
|
|
536
|
-
run OutputTest if put
|
|
537
|
-
end
|
|
538
515
|
|
|
539
516
|
on resource 'dataelements.json' do
|
|
540
517
|
run SetDataElements, opts[:data_dir] if post
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
This file is part of
|
|
2
|
+
This file is part of CPEE-FRAMES.
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
CPEE-FRAMES is free software: you can redistribute it and/or modify it under
|
|
5
|
+
the terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
Foundation, either version 3 of the License, or (at your option) any later
|
|
7
|
+
version.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
CPEE-FRAMES is distributed in the hope that it will be useful, but WITHOUT
|
|
10
|
+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
+
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
12
|
+
details.
|
|
13
13
|
|
|
14
14
|
You should have received a copy of the GNU General Public License along with
|
|
15
|
-
|
|
15
|
+
CPEE-FRAMES (file LICENSE in the main directory). If not, see
|
|
16
16
|
<http://www.gnu.org/licenses/>.
|
|
17
17
|
-->
|
|
18
18
|
|
|
@@ -46,17 +46,13 @@
|
|
|
46
46
|
<link rel="icon" type="image/png" sizes="96x96" href="../css/favicon-96x96.png">
|
|
47
47
|
<link rel="icon" type="image/png" sizes="16x16" href="../css/favicon-16x16.png">
|
|
48
48
|
|
|
49
|
-
<!-- Forms
|
|
50
|
-
<script src='https://centurio.work/out/forms/js/formio.full.min.js'></script>
|
|
51
|
-
-->
|
|
52
49
|
<script>
|
|
53
50
|
if (location.href.match(/\/$/) == null) {
|
|
54
51
|
location.href = location.href + '/';
|
|
55
|
-
|
|
52
|
+
}
|
|
56
53
|
</script>
|
|
57
54
|
</head>
|
|
58
55
|
<body is="x-ui">
|
|
59
|
-
<div id="container">
|
|
60
|
-
</div>
|
|
56
|
+
<div id="container"></div>
|
|
61
57
|
</body>
|
|
62
58
|
</html>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
This file is part of
|
|
2
|
+
This file is part of CPEE-FRAMES.
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
CPEE-FRAMES is free software: you can redistribute it and/or modify it under
|
|
5
|
+
the terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
Foundation, either version 3 of the License, or (at your option) any later
|
|
7
|
+
version.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
CPEE-FRAMES is distributed in the hope that it will be useful, but WITHOUT
|
|
10
|
+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
+
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
12
|
+
details.
|
|
13
13
|
|
|
14
14
|
You should have received a copy of the GNU General Public License along with
|
|
15
|
-
|
|
15
|
+
CPEE-FRAMES (file LICENSE in the main directory). If not, see
|
|
16
16
|
<http://www.gnu.org/licenses/>.
|
|
17
17
|
-->
|
|
18
18
|
|
|
@@ -45,126 +45,107 @@
|
|
|
45
45
|
</script>
|
|
46
46
|
</head>
|
|
47
47
|
<body is="x-ui">
|
|
48
|
-
<div id="container">
|
|
49
|
-
|
|
50
48
|
First Steps:<br>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
<li>define Endpoint: *adapt to your needs*</li>
|
|
54
|
-
<ul>
|
|
55
|
-
<li>init: https-post://centurio.work/out/frames/</li>
|
|
56
|
-
<li>frames: https-put://centurio.work/out/frames/</li>
|
|
57
|
-
</ul>
|
|
58
|
-
<li>define Data Element: (url where your frame will be reached)</li>
|
|
59
|
-
<ul>
|
|
60
|
-
<li><a href="getConfigs">check if frame is not already in use </a></li>
|
|
61
|
-
<li>frameID: YourFrameName</a></li>
|
|
62
|
-
</ul>
|
|
63
|
-
<li>Create Init Activity</li>
|
|
64
|
-
<ul>
|
|
65
|
-
<li>Create a new "Service Call with Script"</li>
|
|
66
|
-
<li>Set the Endpoint to "init"</li>
|
|
67
|
-
<li>Set your arguments e.g. width: 10, height:10, languge: de-at and some title</li>
|
|
68
|
-
<li>Set the Prepare Code to: "endpoints.init = File.join(endpoints.init,data.frameID)" where data.frameID is the name from the variable we created before</li>
|
|
69
|
-
</ul>
|
|
70
|
-
<li>Create Frame Activity</li>
|
|
71
|
-
<ul>
|
|
72
|
-
<li>Create a new "Service Call with Script"</li>
|
|
73
|
-
<li>Set the Endpoint to "frames"</li>
|
|
74
|
-
<li>Set your argument Type to "Set UI and contion" (default option)
|
|
75
|
-
<li>Set your other arguments e.g. DisplacementLeft:0, top:0, width:10, Height:10</li>
|
|
76
|
-
<li>In Section "Form Url" click on the button "New Language"</li>
|
|
77
|
-
<li>Define the URL that should be displayed</li>
|
|
78
|
-
<li>Set the Prepare Code to: "endpoints.frames = File.join(endpoints.frames,data.frameID)" where data.frameID is the name from the variable we created before</li>
|
|
49
|
+
<ul>
|
|
79
50
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
<li>
|
|
51
|
+
<li>Define endpoints: *adapt to your needs*. The brackets are necessary</li>
|
|
52
|
+
<ul>
|
|
53
|
+
<li>init: https-post://{your.server}/out/frames/{YourFrameName}</li>
|
|
54
|
+
<li>frames: https-put://{your.server}/out/frames/{YourFrameName}</li>
|
|
55
|
+
<li><a href="getConfigs">Check if YourFrameName is not already in use</a></li>
|
|
56
|
+
</ul>
|
|
57
|
+
<li>Create <strong>Init</strong> activity</li>
|
|
58
|
+
<ul>
|
|
59
|
+
<li>Create a new "Service Call with Script"</li>
|
|
60
|
+
<li>Set the Endpoint to "init"</li>
|
|
61
|
+
<li>Set your arguments, e.g., width: 10, height:10, languge: de-at and some title</li>
|
|
83
62
|
</ul>
|
|
63
|
+
<li>Create <strong>Frame</strong> activity</li>
|
|
64
|
+
<ul>
|
|
65
|
+
<li>Create a new "Service Call with Script"</li>
|
|
66
|
+
<li>Set the Endpoint to "frames"</li>
|
|
67
|
+
<li>Set your argument Type to "Set UI and contion" (default option)
|
|
68
|
+
<li>Set your other arguments, e.g., displacement left:0, top:0, width:10, height:10</li>
|
|
69
|
+
<li>In section "Page URL" click on the button "New Page/Language"</li>
|
|
70
|
+
<li>Define the URL that should be displayed</li>
|
|
71
|
+
<li>Add parameters, that are sent to the displayed page. You have to include https://cpee.org/out/frames/js/frames.js in the displayed HTML. Then you can access <em>cpee.data</em> and <em>cpee.callback</em></li>
|
|
72
|
+
</ul>
|
|
73
|
+
<li>Execute your Process</li>
|
|
74
|
+
<li>Open your frame URL - add (YourFrameName) to the URL currently open in this browser window</li>
|
|
75
|
+
</ul>
|
|
84
76
|
|
|
77
|
+
Other Steps:<br>
|
|
78
|
+
<ul>
|
|
85
79
|
|
|
86
|
-
|
|
80
|
+
<li>My new frame site process runs through once and then its done</li>
|
|
87
81
|
<ul>
|
|
88
|
-
|
|
89
|
-
<li>
|
|
90
|
-
<ul>
|
|
91
|
-
<li>Use an endless loop within your proces engine</li>
|
|
92
|
-
<li>Be aware that in case you do not wait for input at some point your loop will run a gazillion times per second!!!</li>
|
|
93
|
-
</ul>
|
|
94
|
-
<li>Ohhh nooo i forgot the process engine instance that drives my frames application</li>
|
|
95
|
-
<ul>
|
|
96
|
-
<li>In the case your site is not empty</li>
|
|
97
|
-
<ul>
|
|
98
|
-
<li>Inspect the site (ctrl+shift+c)</li>
|
|
99
|
-
<li>Find one of your iframes</li>
|
|
100
|
-
<li>Arguments "name" or "id" will give you the instance ID</li>
|
|
101
|
-
</ul>
|
|
102
|
-
<li>In the case your site is empty</li>
|
|
103
|
-
<ul>
|
|
104
|
-
<li>HAHA</li>
|
|
105
|
-
<li>Nah its not that bad, look in your process engine and best thing to do is to use the design service next time</li>
|
|
106
|
-
</ul>
|
|
107
|
-
</ul>
|
|
82
|
+
<li>Use an endless loop within your proces engine</li>
|
|
83
|
+
<li>Be aware that in case you do not wait for input at some point your loop will run a gazillion times per second!!!</li>
|
|
108
84
|
</ul>
|
|
109
|
-
|
|
110
|
-
There are more Ohter Steps?<br>
|
|
85
|
+
<li>Ohhh nooo i forgot the process engine instance that drives my frames application</li>
|
|
111
86
|
<ul>
|
|
112
|
-
<li>
|
|
113
|
-
<ul>
|
|
114
|
-
<li>Create a new "Service Call with Script"</li>
|
|
115
|
-
<li>Set the Endpoint to "frames"</li>
|
|
116
|
-
<li>Set your argument Type to "Set UI and wait for input"
|
|
117
|
-
<li>Set your other arguments e.g. DisplacementLeft:0, top:0, width:10, Height:10</li>
|
|
118
|
-
<li>In Section "Form Url" click on the button "New Language"</li>
|
|
119
|
-
<li>Define the URL that should be displayed</li>
|
|
120
|
-
<li>Set the Prepare Code to: "endpoints.frames = File.join(endpoints.frames,data.frameID)" where data.frameID is the name from the variable we created before</li>
|
|
121
|
-
<li>Set the Finalize Code to: "data.yourDataElementName = result</li>
|
|
122
|
-
<li>How to return data from your Frame? see Step2 (below)</li>
|
|
123
|
-
</ul>
|
|
124
|
-
<li>My Frame needs to Return something to the process engine Step2</li>
|
|
125
|
-
<ul>
|
|
126
|
-
<li>You have some fancy html site that wants to send oodles of data back to centurio</li>
|
|
127
|
-
<li>Within your frame call the javascript function parent.sendJson(window.name,yourJsonDataHere)</li>
|
|
128
|
-
<li>All you need to change is define "yourJsonDataHere"</li>
|
|
129
|
-
</ul>
|
|
130
|
-
<li>I want to delete some frames</li>
|
|
87
|
+
<li>In the case your site is not empty</li>
|
|
131
88
|
<ul>
|
|
132
|
-
<li>
|
|
133
|
-
<li>
|
|
134
|
-
<li>
|
|
135
|
-
<li>Set your other arguments e.g. DisplacementLeft:0, top:0, width:10, Height:10 to match the frames you would like to delete</li>
|
|
136
|
-
<li>Set the Prepare Code to: "endpoints.frames = File.join(endpoints.frames,data.frameID)" where data.frameID is the name from the variable we created before</li>
|
|
137
|
-
<li>Thats it</li>
|
|
89
|
+
<li>Inspect the site (ctrl+shift+c)</li>
|
|
90
|
+
<li>Find one of your iframes</li>
|
|
91
|
+
<li>The attribute "id" contains the callback URL, which contains your instance ID</li>
|
|
138
92
|
</ul>
|
|
139
|
-
<li>
|
|
93
|
+
<li>In the case your site is empty</li>
|
|
140
94
|
<ul>
|
|
141
|
-
<li>
|
|
95
|
+
<li>You did something wrong</li>
|
|
142
96
|
</ul>
|
|
143
97
|
</ul>
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
I Would like to use the Forms service:<br>
|
|
148
|
-
<ul>
|
|
149
|
-
<li>Will be described soon ;)</li>
|
|
150
98
|
</ul>
|
|
151
99
|
|
|
152
|
-
|
|
100
|
+
More Helpful Tips:<br>
|
|
153
101
|
<ul>
|
|
154
|
-
<li>
|
|
102
|
+
<li>Tip A: My process engine needs to receive something from a frame</li>
|
|
103
|
+
<ul>
|
|
104
|
+
<li>Create a new task "Service Call with Scripts"</li>
|
|
105
|
+
<li>Set the endpoint to "frames"</li>
|
|
106
|
+
<li>Set your argument type to "Set UI and wait for input"</li>
|
|
107
|
+
<li>Set your other arguments, e.g., displacement left:0, top:0, width:10, height:10</li>
|
|
108
|
+
<li>In section "Page URL" click on the button "New Page/Language"</li>
|
|
109
|
+
<li>Define the URL that should be displayed</li>
|
|
110
|
+
<li>Set the Finalize to: "data.yourDataElementName = result"</li>
|
|
111
|
+
<li>How to return data from your frame? See Tip B below</li>
|
|
112
|
+
</ul>
|
|
113
|
+
<li>Tip B: My Frame needs to return something to the process engine</li>
|
|
114
|
+
<ul>
|
|
115
|
+
<li>You have some fancy HTML site that wants to send oodles of data back to your cpee</li>
|
|
116
|
+
<li>Include https://cpee.org/out/frames/js/frames.js in your fancy HTML</li>
|
|
117
|
+
<li>Within your fancy HTML call the javascript function cpee_callback(cpee.callback,yourJsonDataHere)</li>
|
|
118
|
+
<li>All you need to change is define "yourJsonDataHere"</li>
|
|
119
|
+
</ul>
|
|
120
|
+
<li>Tip C: I want to delete some frames</li>
|
|
121
|
+
<ul>
|
|
122
|
+
<li>Create a new task "Service Call with Script"</li>
|
|
123
|
+
<li>Set the endpoint to "frames"</li>
|
|
124
|
+
<li>Set your argument type to "Set UI and continue" (default option)</li>
|
|
125
|
+
<li>Set your other arguments, e.g., displacement left:0, top:0, width:10, height:10 to match the frames you would like to delete</li>
|
|
126
|
+
<li>Execute</li>
|
|
127
|
+
</ul>
|
|
128
|
+
<li>Tip D: I want to access the data that i sent to my fancy HTML</li>
|
|
129
|
+
<ul>
|
|
130
|
+
<li>You have some fancy HTML site that serves as a template and wants to display oodles of data sent from the cpee</li>
|
|
131
|
+
<li>Include https://cpee.org/out/frames/js/frames.js in your fancy HTML</li>
|
|
132
|
+
<li>Access the data with <em>cpee.data</em>. Its JSON</li>
|
|
133
|
+
<li>Be careful. If you want to access the <em>cpee.data</em> you can only do so after the data is received. For jquery use <em>$(document).on('cpee:message',()=>{...})</em> instead of <em>$(document).ready(()=>{...})</em></li>
|
|
134
|
+
</ul>
|
|
155
135
|
</ul>
|
|
156
136
|
|
|
157
|
-
|
|
158
|
-
Other questions you could have: (note this is not other steps!)<br>
|
|
137
|
+
Questions:
|
|
159
138
|
<ul>
|
|
160
|
-
<li>
|
|
139
|
+
<li>Question: Do i need to delete a frame in order to create one at that position?</li>
|
|
140
|
+
<ul>
|
|
141
|
+
<li>Nope, when one frame overlaps one or multiple frames, the overlapped ones will be deleted automatically</li>
|
|
142
|
+
</ul>
|
|
143
|
+
<li>Question: I want to do a circular iframe. Can I?</li>
|
|
161
144
|
<ul>
|
|
162
145
|
<li>Why?</li>
|
|
163
|
-
<li>
|
|
146
|
+
<li>No!</li>
|
|
147
|
+
<li>You have to manage this within your fancy HTML</li>
|
|
164
148
|
</ul>
|
|
165
149
|
</ul>
|
|
166
|
-
|
|
167
|
-
</div>
|
|
168
|
-
|
|
169
150
|
</body>
|
|
170
151
|
</html>
|
data/server/frames
CHANGED
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
|
|
19
19
|
if File.exist?(File.join(__dir__,'..','lib','cpee-frames','implementation.rb'))
|
|
20
20
|
require_relative File.join(__dir__,'..','lib','cpee-frames','implementation')
|
|
21
|
+
elsif File.exist?(File.join(Dir.home,'Projects','cpee-frames','lib','cpee-frames','implementation.rb'))
|
|
22
|
+
require_relative File.join(Dir.home, 'Projects','cpee-frames','lib','cpee-frames','implementation')
|
|
21
23
|
else
|
|
22
24
|
require 'cpee-frames/implementation'
|
|
23
25
|
end
|
data/tools/cpee-frames
CHANGED
|
@@ -47,14 +47,14 @@ exname = File.basename($0)
|
|
|
47
47
|
|
|
48
48
|
ARGV.options { |opt|
|
|
49
49
|
opt.summary_indent = ' ' * 2
|
|
50
|
-
opt.summary_width =
|
|
51
|
-
opt.banner = "Usage:\n#{opt.summary_indent}#{exname} new [DIR] |
|
|
50
|
+
opt.summary_width = 11
|
|
51
|
+
opt.banner = "Usage:\n#{opt.summary_indent}#{exname} new [DIR] | cpui [DIR]\n"
|
|
52
52
|
opt.on("Options:")
|
|
53
53
|
opt.on("--help", "-h", "This text") { puts opt; exit }
|
|
54
54
|
opt.on("")
|
|
55
|
-
opt.on(wrap("new [DIR]
|
|
55
|
+
opt.on(wrap("new [DIR] scaffolds a sample frames. It has built-in documentation.",78,14,0))
|
|
56
56
|
opt.on("")
|
|
57
|
-
opt.on(wrap("
|
|
57
|
+
opt.on(wrap("cpui [DIR] scaffolds css/js directors that are use by the UI into your webserver dir.",78,14,0))
|
|
58
58
|
opt.parse!
|
|
59
59
|
}
|
|
60
60
|
if (ARGV.length != 2)
|
|
@@ -72,7 +72,7 @@ if command == 'new'
|
|
|
72
72
|
else
|
|
73
73
|
puts 'Directory already exists.'
|
|
74
74
|
end
|
|
75
|
-
elsif command == '
|
|
75
|
+
elsif command == 'cpui'
|
|
76
76
|
if !File.exist?(dir)
|
|
77
77
|
FileUtils.cp_r(File.join(curpath,'..','ui'),dir)
|
|
78
78
|
else
|