cpee-resources 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +7 -0
  2. data/AUTHORS +2 -0
  3. data/LICENSE +165 -0
  4. data/README.md +10 -0
  5. data/Rakefile +21 -0
  6. data/cpee-resources.gemspec +24 -0
  7. data/lib/cpee-resources/implementation.rb +136 -0
  8. data/lib/cpee-resources/implementation.xml +92 -0
  9. data/server/data/endpoints/http%3A%2F%2Fcpee.org%2Frdpm%2Fallocation/schema.rng +20 -0
  10. data/server/data/endpoints/http%3A%2F%2Fcpee.org%2Frdpm%2Fallocation/symbol.svg +5 -0
  11. data/server/data/endpoints/https%3A%2F%2Fcpee.org%2Fflow%2Fstart%2Furl%2F/properties.json +3 -0
  12. data/server/data/endpoints/https%3A%2F%2Fcpee.org%2Fflow%2Fstart%2Furl%2F/schema.rng +57 -0
  13. data/server/data/endpoints/https%3A%2F%2Fcpee.org%2Fflow%2Fstart%2Furl%2F/symbol.svg +6 -0
  14. data/server/data/endpoints/https%3A%2F%2Fcpee.org%2Fservices%2Fpowernap.php/schema.rng +5 -0
  15. data/server/data/endpoints/https%3A%2F%2Fcpee.org%2Fservices%2Fpowernap.php/symbol.svg +5 -0
  16. data/server/data/endpoints/https%3A%2F%2Fcpee.org%2Fworklist%2Fserver%2Fmodeller%2F/schema.rng +5 -0
  17. data/server/data/endpoints/https-get%3A%2F%2Flab.bpm.in.tum.de%2Fopcua%2Fread%2F/schema.rng +19 -0
  18. data/server/data/endpoints/https-get%3A%2F%2Flab.bpm.in.tum.de%2Fopcua%2Fwait%2F/schema.rng +34 -0
  19. data/server/data/endpoints/https-get%3A%2F%2Flab.bpm.in.tum.de%2Fopcua%2Fwait%2F/symbol.svg +5 -0
  20. data/server/data/endpoints/https-post%3A%2F%2Fcpee.org%2Fservices%2Ftimeout-auto.php/properties.json +3 -0
  21. data/server/data/endpoints/https-post%3A%2F%2Fcpee.org%2Fservices%2Ftimeout-auto.php/schema.rng +5 -0
  22. data/server/data/endpoints/https-post%3A%2F%2Fcpee.org%2Fservices%2Ftimeout-receive.php/schema.rng +5 -0
  23. data/server/data/endpoints/https-post%3A%2F%2Fcpee.org%2Fservices%2Ftimeout-receive.php/symbol.svg +6 -0
  24. data/server/data/endpoints/https-post%3A%2F%2Fcpee.org%2Fservices%2Ftimeout-send.php/schema.rng +13 -0
  25. data/server/data/endpoints/https-post%3A%2F%2Fcpee.org%2Fservices%2Ftimeout-send.php/symbol.svg +6 -0
  26. data/server/data/endpoints/https-post%3A%2F%2Fcpee.org%2Fservices%2Ftimeout-subprocess.php/properties.json +3 -0
  27. data/server/data/endpoints/https-post%3A%2F%2Fcpee.org%2Fservices%2Ftimeout-subprocess.php/schema.rng +5 -0
  28. data/server/data/endpoints/https-post%3A%2F%2Fcpee.org%2Fservices%2Ftimeout-subprocess.php/symbol.svg +6 -0
  29. data/server/data/endpoints/https-post%3A%2F%2Fcpee.org%2Fservices%2Ftimeout-user.php/properties.json +3 -0
  30. data/server/data/endpoints/https-post%3A%2F%2Fcpee.org%2Fservices%2Ftimeout-user.php/schema.rng +5 -0
  31. data/server/data/endpoints/https-post%3A%2F%2Fcpee.org%2Fservices%2Ftimeout-user.php/symbol.svg +4 -0
  32. data/server/data/endpoints/https-post%3A%2F%2Fcpee.org%2Fservices%2Ftimeout.php/properties.json +4 -0
  33. data/server/data/endpoints/https-post%3A%2F%2Fcpee.org%2Fservices%2Ftimeout.php/schema.rng +5 -0
  34. data/server/data/endpoints/https-post%3A%2F%2Fcpee.org%2Fservices%2Ftimeout.php/symbol.svg +5 -0
  35. data/server/data/endpoints/https-post%3A%2F%2Fcpee.org%2Fworklist%2Fserver%2F/schema.rng +54 -0
  36. data/server/data/endpoints/https-post%3A%2F%2Fcpee.org%2Fworklist%2Fserver%2F/symbol.svg +4 -0
  37. data/server/data/endpoints/https-put%3A%2F%2Flab.bpm.in.tum.de%2Fopcua%2Fexecute%2F/schema.rng +26 -0
  38. data/server/data/endpoints/https-put%3A%2F%2Flab.bpm.in.tum.de%2Fopcua%2Fwrite%2F/schema.rng +22 -0
  39. data/server/data/endpoints/human/schema.rng +1 -0
  40. data/server/data/endpoints/human/symbol.svg +4 -0
  41. data/server/data/endpoints/machine/schema.rng +1 -0
  42. data/server/data/endpoints/motor_gear/properties.json +3 -0
  43. data/server/data/endpoints/motor_gear/schema.rng +8 -0
  44. data/server/data/endpoints/motor_gear/symbol.svg +14 -0
  45. data/server/data/endpoints/motor_hull_sensor/properties.json +3 -0
  46. data/server/data/endpoints/motor_hull_sensor/schema.rng +8 -0
  47. data/server/data/endpoints/motor_hull_sensor/symbol.svg +20 -0
  48. data/server/data/endpoints/motor_start/symbol.svg +10 -0
  49. data/server/data/endpoints/motor_stop/symbol.svg +15 -0
  50. data/server/data/endpoints/plc/schema.rng +1 -0
  51. data/server/data/endpoints/plc/symbol.svg +4 -0
  52. data/server/data/endpoints/receive/properties.json +3 -0
  53. data/server/data/endpoints/receive/schema.rng +8 -0
  54. data/server/data/endpoints/receive/symbol.svg +6 -0
  55. data/server/data/endpoints/robot/new.svg +5 -0
  56. data/server/data/endpoints/robot/properties.json +3 -0
  57. data/server/data/endpoints/robot/schema.rng +13 -0
  58. data/server/data/endpoints/robot/symbol.svg +4 -0
  59. data/server/data/endpoints/robot_subprocess/properties.json +3 -0
  60. data/server/data/endpoints/robot_subprocess/schema.rng +13 -0
  61. data/server/data/endpoints/robot_subprocess/symbol.svg +7 -0
  62. data/server/data/endpoints/send/schema.rng +11 -0
  63. data/server/data/endpoints/send/symbol.svg +6 -0
  64. data/server/data/endpoints/sensor/schema.rng +1 -0
  65. data/server/data/endpoints/sensor/symbol.svg +7 -0
  66. data/server/data/endpoints/subprocess/properties.json +3 -0
  67. data/server/data/endpoints/subprocess/schema.rng +13 -0
  68. data/server/data/endpoints/subprocess/symbol.svg +6 -0
  69. data/server/data/endpoints/wait/symbol.svg +5 -0
  70. data/server/data/modifiers/00_Themes/00_extended/condition.json +3 -0
  71. data/server/data/modifiers/00_Themes/00_extended/patch.xml +6 -0
  72. data/server/data/modifiers/00_Themes/01_preset/condition.json +3 -0
  73. data/server/data/modifiers/00_Themes/01_preset/patch.xml +6 -0
  74. data/server/data/modifiers/00_Themes/02_packed/condition.json +3 -0
  75. data/server/data/modifiers/00_Themes/02_packed/patch.xml +6 -0
  76. data/server/data/modifiers/00_Themes/03_compact/condition.json +3 -0
  77. data/server/data/modifiers/00_Themes/03_compact/patch.xml +6 -0
  78. data/server/data/modifiers/01_Model%20Type/00_CPEE/condition.json +3 -0
  79. data/server/data/modifiers/01_Model%20Type/00_CPEE/patch.xml +11 -0
  80. data/server/data/modifiers/01_Model%20Type/01_Signavio%20BPMN2/condition.json +3 -0
  81. data/server/data/modifiers/01_Model%20Type/01_Signavio%20BPMN2/patch.xml +11 -0
  82. data/server/data/modifiers/01_Model%20Type/02_ChatGPT%20Mermaid/condition.json +3 -0
  83. data/server/data/modifiers/01_Model%20Type/02_ChatGPT%20Mermaid/patch.xml +11 -0
  84. data/server/data/modifiers/01_Model%20Type/03_ChatGPT%20Graphviz/condition.json +3 -0
  85. data/server/data/modifiers/01_Model%20Type/03_ChatGPT%20Graphviz/patch.xml +11 -0
  86. data/server/data/modifiers/02_Execution%20Restriction/00_None/condition.json +3 -0
  87. data/server/data/modifiers/02_Execution%20Restriction/00_None/patch.xml +6 -0
  88. data/server/data/modifiers/02_Execution%20Restriction/01_Only%20One%20Instance/condition.json +3 -0
  89. data/server/data/modifiers/02_Execution%20Restriction/01_Only%20One%20Instance/patch.xml +14 -0
  90. data/server/data/modifiers/02_Execution%20Restriction/01_Only%20One%20Instance/unpatch.xml +5 -0
  91. data/server/data/modifiers/02_Execution%20Restriction/02_Only%20One%20Per%20Resource/condition.json +3 -0
  92. data/server/data/modifiers/02_Execution%20Restriction/02_Only%20One%20Per%20Resource/patch.xml +17 -0
  93. data/server/data/modifiers/02_Execution%20Restriction/02_Only%20One%20Per%20Resource/ui.rng +5 -0
  94. data/server/data/modifiers/02_Execution%20Restriction/02_Only%20One%20Per%20Resource/unpatch.xml +5 -0
  95. data/server/resources +35 -0
  96. data/tools/cpee-resources +66 -0
  97. metadata +154 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 43524a032cc3e24c569fd921589cbbcce2008aafb5349806a544f733141b009f
4
+ data.tar.gz: 5d8018e1dc9ffc4144ad2b9e0213f150968632a46efffdf45dbfd06dcab68d22
5
+ SHA512:
6
+ metadata.gz: b7deb99a187cbec92f46a5fd11c6b04721d1c38eed97b0dc035bdbc30dc5559c53f39b140653ddb785a16f4d80909f6291cebf48631d8796c3184e93dbc4b782
7
+ data.tar.gz: '0876064cfe64638c58b69684cbc08eec3d6260514e8d08b3bc4118b6f980241ac00a671e48afd99379e191d3fa03229970a8644471d4778318c63296bf28f913'
data/AUTHORS ADDED
@@ -0,0 +1,2 @@
1
+ Jürgen Mangler <juergen.mangler@gmail.com>
2
+ Ralph Vigne <ralph.vigne@gmail.com>
data/LICENSE ADDED
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
data/README.md ADDED
@@ -0,0 +1,10 @@
1
+ OS Dependencies:
2
+
3
+ * Windows users can install one of the following operating systems
4
+ * Mac OSX users can use brew: brew install TBD
5
+ * Ubuntu (>=13.10) users can use their package manager: apt-get install build-essential ruby-dev libxml2-dev libxslt-dev libz-dev libssl-dev librasqal-dev libraptor2-dev libicu-dev
6
+ * Fedora (>=22) users can use their package manager: dnf install @buildsys-build @development-tools libxml2-devel libxslt-devel zlib-devel rasqal-devel raptor2-devel libicu-devel
7
+
8
+ Ruby dependencies:
9
+
10
+ * gem install riddl
data/Rakefile ADDED
@@ -0,0 +1,21 @@
1
+ require 'rake'
2
+ require 'rubygems/package_task'
3
+
4
+ spec = eval(File.read('cpee-resources.gemspec'))
5
+ Gem::PackageTask.new(spec) do |pkg|
6
+ pkg.need_zip = true
7
+ pkg.need_tar = true
8
+ FileUtils.mkdir 'pkg' rescue nil
9
+ FileUtils.rm_rf Dir.glob('pkg/*')
10
+ FileUtils.ln_sf "#{pkg.name}.gem", "pkg/#{spec.name}.gem"
11
+ end
12
+
13
+ task :default => [:gem]
14
+
15
+ task :push => :gem do |r|
16
+ `gem push pkg/cpee-resources.gem`
17
+ end
18
+
19
+ task :install => :gem do |r|
20
+ `gem install pkg/cpee-resources.gem`
21
+ end
@@ -0,0 +1,24 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "cpee-resources"
3
+ s.version = "1.0.0"
4
+ s.platform = Gem::Platform::RUBY
5
+ s.license = "LGPL-3.0-or-later"
6
+ s.summary = "Resources list for the cloud process execution engine (cpee.org)"
7
+
8
+ s.description = "see http://cpee.org"
9
+
10
+ s.files = Dir['{server/**/*,tools/**/*,lib/**/*}'] + %w(LICENSE Rakefile cpee-resources.gemspec README.md AUTHORS)
11
+ s.require_path = 'lib'
12
+ s.extra_rdoc_files = ['README.md']
13
+ s.bindir = 'tools'
14
+ s.executables = ['cpee-resources']
15
+
16
+ s.required_ruby_version = '>=2.4.0'
17
+
18
+ s.authors = ['Juergen eTM Mangler','Ralph Vigne']
19
+
20
+ s.email = 'juergen.mangler@gmail.com'
21
+ s.homepage = 'http://cpee.org/'
22
+
23
+ s.add_runtime_dependency 'riddl', '~> 1.0'
24
+ end
@@ -0,0 +1,136 @@
1
+ #!/usr/bin/ruby
2
+ #
3
+ # This file is part of CPEE-RESOURCES.
4
+ #
5
+ # CPEE-RESOURCES is free software: you can redistribute it and/or modify it
6
+ # under the terms of the GNU Lesser General Public License as published by the
7
+ # Free Software Foundation, either version 3 of the License, or (at your
8
+ # option) any later version.
9
+ #
10
+ # CPEE-RESOURCES 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 Lesser General Public License for more
13
+ # details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public License
16
+ # along with CPEE-RESOURCES (file LICENSE in the main directory). If not, see
17
+ # <http://www.gnu.org/licenses/>.
18
+
19
+ require 'rubygems'
20
+ require 'riddl/server'
21
+
22
+ module CPEE
23
+ module Resources
24
+
25
+ SERVER = File.expand_path(File.join(__dir__,'implementation.xml'))
26
+
27
+ class DoExists < Riddl::Implementation #{{{
28
+ def response
29
+ data = @a[1]
30
+ dir = File.join(data,@a[0],Riddl::Protocols::Utils::escape(@r[-1]))
31
+ if Dir.exist?(dir)
32
+ return Riddl::Parameter::Complex.new('exists','text/xml') do
33
+ doc = XML::Smart::string('<resource/>')
34
+ doc.root.add('schema','schema.rng') if File.exist?(File.join(dir,'schema.rng'))
35
+ doc.root.add('symbol','symbol.svg') if File.exist?(File.join(dir,'symbol.svg'))
36
+ doc.root.add('properties','properties.json') if File.exist?(File.join(dir,'properties.json'))
37
+ doc.to_s
38
+ end
39
+ else
40
+ @status = 404
41
+ Riddl::Parameter::Complex.new('exists','text/plain','Existence really is an imperfect tense that never becomes a present. (Friedrich Nietzsche)')
42
+ end
43
+ end
44
+ end #}}}
45
+ class DoModExists < Riddl::Implementation #{{{
46
+ def response
47
+ data = @a[1]
48
+ dir = File.join(data,'modifiers',Riddl::Protocols::Utils::escape(@r[-2]),Riddl::Protocols::Utils::escape(@r[-1]))
49
+ if Dir.exist?(dir)
50
+ Riddl::Parameter::Complex.new('exists','text/xml') do
51
+ doc = XML::Smart::string('<resource/>')
52
+ doc.root.add('patch','patch.xml') if File.exist?(File.join(dir,'patch.xml'))
53
+ doc.root.add('unpatch','unpatch.xml') if File.exist?(File.join(dir,'unpatch.xml'))
54
+ doc.root.add('condition','condition.json') if File.exist?(File.join(dir,'condition.json'))
55
+ doc.root.add('ui','ui.rng') if File.exist?(File.join(dir,'ui.rng'))
56
+ doc.to_s
57
+ end
58
+ else
59
+ @status = 404
60
+ Riddl::Parameter::Complex.new('exists','text/plain','Existence really is an imperfect tense that never becomes a present. (Friedrich Nietzsche)')
61
+ end
62
+ end
63
+ end #}}}
64
+ class DoFile < Riddl::Implementation #{{{
65
+ def response
66
+ data = @a[1]
67
+ file = File.join(data,@a[0],*(@r[@a[2]].map{|e| Riddl::Protocols::Utils::escape(e)}))
68
+ if File.exist?(file)
69
+ Riddl::Parameter::Complex.new(@a[3],@a[4],File.read(file)) if File.exist?(file)
70
+ else
71
+ @status = 404
72
+ Riddl::Parameter::Complex.new('exists','text/plain','Existence really is an imperfect tense that never becomes a present. (Friedrich Nietzsche)')
73
+ end
74
+ end
75
+ end #}}}
76
+ class DoList < Riddl::Implementation #{{{
77
+ def response
78
+ data = @a[1]
79
+ @a[2] ||= 0...0
80
+ dir = File.join(data,@a[0],*(@r[@a[2]].map{|e| Riddl::Protocols::Utils::escape(e)}))
81
+ return Riddl::Parameter::Complex.new('list','text/xml') do
82
+ doc = XML::Smart::string('<resources/>')
83
+ Dir.glob(File.join(dir,'*')).sort.each do |f|
84
+ doc.root.add('resource',File.basename(f))
85
+ end
86
+ doc.to_s
87
+ end
88
+ end
89
+ end #}}}
90
+
91
+ def self::implementation(opts)
92
+ opts[:data_dir] ||= File.expand_path(File.join(__dir__,'data'))
93
+
94
+ Proc.new do
95
+ on resource do
96
+ on resource 'modifiers' do
97
+ run DoList, 'modifiers', opts[:data_dir] if get
98
+ on resource do
99
+ run DoList, 'modifiers', opts[:data_dir], (-1..-1) if get
100
+ on resource do
101
+ run DoModExists, 'modifiers', opts[:data_dir] if get
102
+ on resource 'patch.xml' do
103
+ run DoFile, 'modifiers', opts[:data_dir], (-3..-1), 'testset', 'text/xml' if get
104
+ end
105
+ on resource 'unpatch.xml' do
106
+ run DoFile, 'modifiers', opts[:data_dir], (-3..-1), 'testset', 'text/xml' if get
107
+ end
108
+ on resource 'condition.json' do
109
+ run DoFile, 'modifiers', opts[:data_dir], (-3..-1), 'json', 'application/json' if get
110
+ end
111
+ on resource 'ui.rng' do
112
+ run DoFile, 'modifiers', opts[:data_dir], (-3..-1), 'rng', 'text/xml' if get
113
+ end
114
+ end
115
+ end
116
+ end
117
+ on resource 'endpoints' do
118
+ run DoList, 'endpoints', opts[:data_dir] if get
119
+ on resource do
120
+ run DoExists, 'endpoints', opts[:data_dir] if get
121
+ on resource 'symbol.svg' do
122
+ run DoFile, 'endpoints', opts[:data_dir], (-2..-1), 'svg', 'image/svg+xml' if get
123
+ end
124
+ on resource 'schema.rng' do
125
+ run DoFile, 'endpoints', opts[:data_dir], (-2..-1), 'rng', 'text/xml' if get
126
+ end
127
+ on resource 'properties.json' do
128
+ run DoFile, 'endpoints', opts[:data_dir], (-2..-1), 'json', 'application/json' if get
129
+ end
130
+ end
131
+ end
132
+ end
133
+ end
134
+ end
135
+ end
136
+ end
@@ -0,0 +1,92 @@
1
+ <!--
2
+ This file is part of CPEE-RESOURCES.
3
+
4
+ CPEE-RESOURCES is free software: you can redistribute it and/or modify it
5
+ under the terms of the GNU Lesser General Public License as published by the
6
+ Free Software Foundation, either version 3 of the License, or (at your
7
+ option) any later version.
8
+
9
+ CPEE-RESOURCES 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 Lesser General Public License for
12
+ more details.
13
+
14
+ You should have received a copy of the GNU Lesser General Public License
15
+ along with CPEE-RESOURCES (file LICENSE in the main directory). If not, see
16
+ <http://www.gnu.org/licenses/>.
17
+ -->
18
+
19
+ <description xmlns="http://riddl.org/ns/description/1.0" xmlns:ann="http://riddl.org/ns/annotation/1.0" xmlns:xi="http://www.w3.org/2001/XInclude" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
20
+ <message name="list">
21
+ <parameter name="list" mimetype="*/xml"/>
22
+ </message>
23
+ <message name="exists">
24
+ <choice>
25
+ <parameter name="exists" mimetype="*/xml"/>
26
+ <parameter name="exists" mimetype="text/plain"/>
27
+ </choice>
28
+ </message>
29
+ <message name="testset">
30
+ <choice>
31
+ <parameter name="testset" mimetype="*/xml"/>
32
+ <parameter name="exists" mimetype="text/plain"/>
33
+ </choice>
34
+ </message>
35
+ <message name="symbol">
36
+ <choice>
37
+ <parameter name="svg" mimetype="image/svg+xml"/>
38
+ <parameter name="exists" mimetype="text/plain"/>
39
+ </choice>
40
+ </message>
41
+ <message name="schema">
42
+ <choice>
43
+ <parameter name="rng" mimetype="*/xml"/>
44
+ <parameter name="exists" mimetype="text/plain"/>
45
+ </choice>
46
+ </message>
47
+ <message name="json">
48
+ <choice>
49
+ <parameter name="json" mimetype="application/json"/>
50
+ <parameter name="exists" mimetype="text/plain"/>
51
+ </choice>
52
+ </message>
53
+
54
+ <resource>
55
+ <resource relative='modifiers'>
56
+ <get out="list"/>
57
+ <resource>
58
+ <get out="list"/>
59
+ <resource>
60
+ <get out="exists"/>
61
+ <resource relative="patch.xml">
62
+ <get out="testset"/>
63
+ </resource>
64
+ <resource relative="unpatch.xml">
65
+ <get out="testset"/>
66
+ </resource>
67
+ <resource relative="condition.json">
68
+ <get out="json"/>
69
+ </resource>
70
+ <resource relative="ui.rng">
71
+ <get out="schema"/>
72
+ </resource>
73
+ </resource>
74
+ </resource>
75
+ </resource>
76
+ <resource relative='endpoints'>
77
+ <get out="list"/>
78
+ <resource>
79
+ <get out="exists"/>
80
+ <resource relative="symbol.svg">
81
+ <get out="symbol"/>
82
+ </resource>
83
+ <resource relative="schema.rng">
84
+ <get out="schema"/>
85
+ </resource>
86
+ <resource relative="properties.json">
87
+ <get out="json"/>
88
+ </resource>
89
+ </resource>
90
+ </resource>
91
+ </resource>
92
+ </description>
@@ -0,0 +1,20 @@
1
+ <element rngui:version="1.2" rngui:header="Arguments" name="arguments" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://relaxng.org/ns/structure/1.0" xmlns:rngui="http://rngui.org">
2
+ <element name="resource_url" rngui:label="resource_url">
3
+ <data type="string" rngui:label="url to resource config"/>
4
+ </element>
5
+ <element name="resource_file" rngui:label="resource_file">
6
+ <data type="string" rngui:label="resource file name"/>
7
+ </element>
8
+ <element name="measure" rngui:label="Measure">
9
+ <choice>
10
+ <value>cost</value>
11
+ <value>time</value>
12
+ </choice>
13
+ </element>
14
+ <element name="operator" rngui:label="Operator">
15
+ <choice>
16
+ <value>min</value>
17
+ <value>max</value>
18
+ </choice>
19
+ </element>
20
+ </element>
@@ -0,0 +1,5 @@
1
+ <g xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="15" cy="15" r="14" class="cline stand"/>
3
+ <circle cx="15" cy="15" r="11" class="cline hfill rfill stand"/>
4
+ <path d="m 9,11 7,5 0,-6" class="stand" style="fill: none;"/>
5
+ </g>
@@ -0,0 +1,57 @@
1
+ <element rngui:version="1.2" rngui:header="Arguments" name="arguments" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://relaxng.org/ns/structure/1.0" xmlns:rngui="http://rngui.org">
2
+ <element name="behavior" rngui:label="Mode">
3
+ <choice>
4
+ <value>wait_running</value>
5
+ <value>fork_running</value>
6
+ <value>wait_ready</value>
7
+ <value>fork_ready</value>
8
+ </choice>
9
+ </element>
10
+ <element name="url" rngui:label="Process">
11
+ <data type="string" rngui:label="Link to cpee.org testset"/>
12
+ </element>
13
+ <element name="init" rngui:header="Initialize Data Elements">
14
+ <zeroOrMore rngui:label="New Data Element">
15
+ <element rngui:label='Name'>
16
+ <anyName/>
17
+ <data type="string" rngui:label="Value"/>
18
+ </element>
19
+ </zeroOrMore>
20
+ </element>
21
+ <element name="endpoints" rngui:header="Initialize Endpoints">
22
+ <zeroOrMore rngui:label="New Endpoint">
23
+ <element rngui:label='Name'>
24
+ <anyName/>
25
+ <data type="string" rngui:label="Value"/>
26
+ </element>
27
+ </zeroOrMore>
28
+ </element>
29
+ <element name="attributes" rngui:header="Overwrite Attributes">
30
+ <zeroOrMore rngui:label="New Attribute">
31
+ <element rngui:label='Name'>
32
+ <anyName/>
33
+ <data type="string" rngui:label="Value"/>
34
+ </element>
35
+ </zeroOrMore>
36
+ </element>
37
+ <element name="customization" rngui:header="Task Customization">
38
+ <zeroOrMore rngui:label="For Task">
39
+ <element name="task">
40
+ <element name="id" rngui:label="Task ID">
41
+ <data type="string" rngui:label="e.g. a1"/>
42
+ </element>
43
+ <element name="id" rngui:label="Replace What?">
44
+ <choice>
45
+ <value rngui:label="Properties &gt; Data Stream Handling &gt; Sensors">parameters/stream/sensors</value>
46
+ <value rngui:labid="Properties &gt; Data Stream Handling &gt; Impact Profiles">parameters/stream/ips</value>
47
+ <value rngui:labid="Properties &gt; Reports">parameters/report</value>
48
+ <value rngui:labid="Annotations &gt; Timing">annotations/_timing</value>
49
+ </choice>
50
+ </element>
51
+ <element name="url" rngui:label="Url">
52
+ <data type="string" rngui:label="Link to replacement file"/>
53
+ </element>
54
+ </element>
55
+ </zeroOrMore>
56
+ </element>
57
+ </element>
@@ -0,0 +1,6 @@
1
+ <g xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="1" y="1" width="28" height="28" rx="4" class="hfill rfill cline stand"/>
3
+ <path class="cline hfill rfill stand" d="m 2 22 l 13 0 l 0 -14 l -13 0"/>
4
+ <path class="stand" d="m 5 15 l 6 0"/>
5
+ <path class="stand" d="m 8 12 l 0 6"/>
6
+ </g>
@@ -0,0 +1,5 @@
1
+ <element rngui:version="1.2" rngui:header="Arguments" name="arguments" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://relaxng.org/ns/structure/1.0" xmlns:rngui="http://rngui.org">
2
+ <element name="timeout" rngui:label="Duration">
3
+ <data type="integer" rngui:label="duration in minutes"/>
4
+ </element>
5
+ </element>
@@ -0,0 +1,5 @@
1
+ <g xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="15" cy="15" r="14" class="cline stand"/>
3
+ <circle cx="15" cy="15" r="11" class="cline hfill rfill stand"/>
4
+ <path d="m 9,11 7,5 0,-6" class="stand" style="fill: none;"/>
5
+ </g>
@@ -0,0 +1,5 @@
1
+ <element rngui:version="1.2" rngui:header="Arguments" name="arguments" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://relaxng.org/ns/structure/1.0" xmlns:rngui="http://rngui.org">
2
+ <element name="status" rngui:label="Status">
3
+ <data type="string" rngui:label="Message when no tasks ..."/>
4
+ </element>
5
+ </element>
@@ -0,0 +1,19 @@
1
+ <element rngui:version="1.2" rngui:header="Arguments" name="arguments" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://relaxng.org/ns/structure/1.0" xmlns:rngui="http://rngui.org">
2
+ <element name="endpoint_url" rngui:label="Server">
3
+ <data type="string" rngui:label="opc.tcp://...">
4
+ <param name="pattern">opc\.[a-z]+://.*</param>
5
+ </data>
6
+ </element>
7
+ <element name="namespace_index" rngui:label="Namespace Index" rngui:default="2">
8
+ <data type="nonNegativeInteger" rngui:label="2"/>
9
+ </element>
10
+ <element name="identifier_type" rngui:label="Identifier Type">
11
+ <choice>
12
+ <value>string</value>
13
+ <value>integer</value>
14
+ </choice>
15
+ </element>
16
+ <element name="identifier" rngui:label="Identifier">
17
+ <data type="string" rngui:label="/example/test"/>
18
+ </element>
19
+ </element>
@@ -0,0 +1,34 @@
1
+ <element rngui:version="1.2" rngui:header="Arguments" name="arguments" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://relaxng.org/ns/structure/1.0" xmlns:rngui="http://rngui.org">
2
+ <element name="endpoint_url" rngui:label="Server">
3
+ <data type="string" rngui:label="opc.tcp://...">
4
+ <param name="pattern">opc\.[a-z]+://.*</param>
5
+ </data>
6
+ </element>
7
+ <element name="namespace_index" rngui:label="Namespace Index" rngui:default="2">
8
+ <data type="nonNegativeInteger" rngui:label="2"/>
9
+ </element>
10
+ <element name="identifier_type" rngui:label="Identifier Type">
11
+ <choice>
12
+ <value>string</value>
13
+ <value>integer</value>
14
+ </choice>
15
+ </element>
16
+ <element name="identifier" rngui:label="Identifier">
17
+ <data type="string" rngui:label="/example/test"/>
18
+ </element>
19
+ <optional>
20
+ <element name="from" rngui:label="Change From">
21
+ <data type="string" rngui:label="Value"/>
22
+ </element>
23
+ </optional>
24
+ <optional>
25
+ <element name="to" rngui:label="Change To">
26
+ <data type="string" rngui:label="Value"/>
27
+ </element>
28
+ </optional>
29
+ <optional>
30
+ <element name="timeout" rngui:label="Timeout">
31
+ <data type="float" rngui:label="Seconds"/>
32
+ </element>
33
+ </optional>
34
+ </element>
@@ -0,0 +1,5 @@
1
+ <g xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="15" cy="15" r="14" class="cline stand"/>
3
+ <circle cx="15" cy="15" r="11" class="cline hfill rfill stand"/>
4
+ <path d="m 9,11 7,5 0,-6" class="stand" style="fill: none;"/>
5
+ </g>