jungle_path 0.0.5 → 0.0.6
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/lib/jungle_path/api/helpers/standard_apis.rb +1 -1
- data/lib/jungle_path/app/api/custom.rb +1 -1
- data/lib/jungle_path/app/schemas/schema.rb +83 -82
- data/lib/jungle_path/app/web_apps/public/query/documents/node_tree.txt +336 -0
- data/lib/jungle_path/app/web_apps/public/query/documents/query_api_documentation.txt +138 -0
- data/lib/jungle_path/app/web_apps/public/query/documents/schema_tree.txt +12 -0
- data/lib/jungle_path/app/web_apps/public/query/documents/schema_tree_template.txt +9 -0
- data/lib/jungle_path/authentication/auth_provider/default.rb +15 -7
- data/lib/jungle_path/authentication/data_provider/default.rb +0 -17
- data/lib/jungle_path/version.rb +1 -1
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ee8786f075f8d4f693e15c682d51d87ca0651ce
|
4
|
+
data.tar.gz: 458e1ee7faf30c2acfd2d3b19b22f8ac48f364f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d37fe1cfbd16e0942dd497626d72f60a3a09e7cc4a5b12e5b724b750d907db5340ff847a2e253557f2adf81a466963dd6ff931e7423884f29febd61835afa5f0
|
7
|
+
data.tar.gz: 2ea39035f32dde0e6436385762050238c5f488cb45a7452a90af35c55c515771b7b0ef8cefc2fa74be7cb18d794f63ebe782c52fc254bb778792422f61fe8799
|
@@ -32,7 +32,7 @@ module JunglePath
|
|
32
32
|
# todo: pass generated node tree instead of models:
|
33
33
|
#engine = Query::Engine.new(Schema::Base.models, current_user, apply_limit_offset_to_sql)
|
34
34
|
node_tree = current_auth.schema_node_tree
|
35
|
-
puts "node_tree: #{node_tree.to_str}."
|
35
|
+
#puts "node_tree: #{node_tree.to_str}."
|
36
36
|
engine = Query::Engine.new(node_tree, current_identity, apply_limit_offset_to_sql)
|
37
37
|
puts "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
|
38
38
|
q = engine.get_query_from_string(query)
|
@@ -53,7 +53,7 @@ module Server
|
|
53
53
|
|
54
54
|
get '/query/schema_tree' do
|
55
55
|
#root = Gen.gen_node_tree(Schema::Base.models)
|
56
|
-
template_file = File.join(
|
56
|
+
template_file = File.join(jungle.application.public_dir, 'query/documents/schema_tree_template.txt')
|
57
57
|
template = File.read(template_file)
|
58
58
|
|
59
59
|
node_tree = current_auth.schema_node_tree
|
@@ -8,95 +8,96 @@ require 'jungle_path/schema/db'
|
|
8
8
|
require 'jungle_path/schema/auth'
|
9
9
|
|
10
10
|
# application tables examples:
|
11
|
+
module Schema
|
12
|
+
class Answer < Schema::Base
|
13
|
+
self.description = ""
|
14
|
+
define(
|
15
|
+
[:id, :primary_key],
|
16
|
+
[:question_id, :foreign_key, :question],
|
17
|
+
[:description, :string],
|
18
|
+
[:is_correct, :boolean],
|
19
|
+
[:audit_user]
|
20
|
+
)
|
21
|
+
end
|
11
22
|
|
12
|
-
class
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
class Practice < Schema::Base
|
24
|
-
self.description = ""
|
25
|
-
define(
|
26
|
-
[:id, :primary_key],
|
27
|
-
[:user_id, :foreign_key, :user],
|
28
|
-
[:notes, :string],
|
29
|
-
[:random_question_order, :boolean],
|
30
|
-
[:random_answer_order, :boolean],
|
31
|
-
[:audit_user]
|
32
|
-
)
|
33
|
-
end
|
23
|
+
class Practice < Schema::Base
|
24
|
+
self.description = ""
|
25
|
+
define(
|
26
|
+
[:id, :primary_key],
|
27
|
+
[:user_id, :foreign_key, :user],
|
28
|
+
[:notes, :string],
|
29
|
+
[:random_question_order, :boolean],
|
30
|
+
[:random_answer_order, :boolean],
|
31
|
+
[:audit_user]
|
32
|
+
)
|
33
|
+
end
|
34
34
|
|
35
|
-
class PracticeQuiz < Schema::Base
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
35
|
+
class PracticeQuiz < Schema::Base
|
36
|
+
self.description = ""
|
37
|
+
define(
|
38
|
+
[:practice_id, :foreign_key, :practice, :primary_key],
|
39
|
+
[:quiz_id, :foreign_key, :quiz, :primary_key],
|
40
|
+
[:audit_user]
|
41
|
+
)
|
42
|
+
def self.plural_table_name
|
43
|
+
"practice_quizzes"
|
44
|
+
end
|
44
45
|
end
|
45
|
-
end
|
46
46
|
|
47
|
-
class PracticeQuestion < Schema::Base
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
end
|
47
|
+
class PracticeQuestion < Schema::Base
|
48
|
+
self.description = ""
|
49
|
+
define(
|
50
|
+
[:practice_id, :foreign_key, :practice, :primary_key],
|
51
|
+
[:question_id, :foreign_key, :question, :primary_key],
|
52
|
+
[:note, :string],
|
53
|
+
[:audit_user]
|
54
|
+
)
|
55
|
+
end
|
56
56
|
|
57
|
-
class PracticeAnswer < Schema::Base
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
end
|
57
|
+
class PracticeAnswer < Schema::Base
|
58
|
+
self.description = ""
|
59
|
+
define(
|
60
|
+
[:practice_id, :foreign_key, :practice, :primary_key],
|
61
|
+
[:answer_id, :foreign_key, :answer, :primary_key],
|
62
|
+
[:label, :string],
|
63
|
+
[:selected, :boolean],
|
64
|
+
[:audit_user]
|
65
|
+
)
|
66
|
+
end
|
67
67
|
|
68
|
-
class Question < Schema::Base
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
end
|
68
|
+
class Question < Schema::Base
|
69
|
+
self.description = ""
|
70
|
+
define(
|
71
|
+
[:id, :primary_key],
|
72
|
+
[:quiz_id, :foreign_key, :quiz],
|
73
|
+
[:name, :string],
|
74
|
+
[:description, :string],
|
75
|
+
[:audit_user]
|
76
|
+
)
|
77
|
+
end
|
78
78
|
|
79
|
-
class Quiz < Schema::Base
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
79
|
+
class Quiz < Schema::Base
|
80
|
+
self.description = ""
|
81
|
+
define(
|
82
|
+
[:id, :primary_key],
|
83
|
+
[:name, :string],
|
84
|
+
[:description, :string],
|
85
|
+
[:private, :boolean, :default, true],
|
86
|
+
[:audit_user]
|
87
|
+
)
|
88
|
+
def self.plural_table_name
|
89
|
+
"quizzes"
|
90
|
+
end
|
90
91
|
end
|
91
|
-
end
|
92
92
|
|
93
|
-
class Log < Schema::Base
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
93
|
+
class Log < Schema::Base
|
94
|
+
define(
|
95
|
+
[:id, :primary_key],
|
96
|
+
[:set_id, :integer],
|
97
|
+
[:name, :string],
|
98
|
+
[:type, :string],
|
99
|
+
[:item, :string, :secure],
|
100
|
+
[:timestamp, :timestamp]
|
101
|
+
)
|
102
|
+
end
|
102
103
|
end
|
@@ -0,0 +1,336 @@
|
|
1
|
+
[application root]/config/environment.rb file was not found, defaulting to configatron.environment.name == 'dev'.
|
2
|
+
to override, create file ./config/environment.rb with one line like this:
|
3
|
+
configatron.environment.name = 'stage' # valid environments may be: 'dev', 'stage' or 'prod' or whatever you want to use :)
|
4
|
+
application root dir: /home/mxvanzant/dev/tg/datahub/code/server
|
5
|
+
application public dir: /home/mxvanzant/dev/tg/datahub/code/server/public
|
6
|
+
[application root]/config/config.rb file was loaded.
|
7
|
+
root
|
8
|
+
activity
|
9
|
+
id
|
10
|
+
parent -> activity
|
11
|
+
name
|
12
|
+
type
|
13
|
+
sub_type
|
14
|
+
due_date
|
15
|
+
completion_date
|
16
|
+
done
|
17
|
+
is_root
|
18
|
+
opportunity -> opportunity
|
19
|
+
percent_complete
|
20
|
+
status_code
|
21
|
+
created_at
|
22
|
+
created_by_user -> user
|
23
|
+
updated_at
|
24
|
+
updated_by_user -> user
|
25
|
+
company_activity <= company_activity.activity
|
26
|
+
contact_activity <= contact_activity.activity
|
27
|
+
siebel_activity <= siebel_activity.activity
|
28
|
+
address
|
29
|
+
id
|
30
|
+
address_line_1
|
31
|
+
address_line_2
|
32
|
+
address_line_3
|
33
|
+
street
|
34
|
+
unit
|
35
|
+
city
|
36
|
+
state
|
37
|
+
zip
|
38
|
+
country
|
39
|
+
created_at
|
40
|
+
created_by_user -> user
|
41
|
+
updated_at
|
42
|
+
updated_by_user -> user
|
43
|
+
address_raw_address <= address_raw_address.address
|
44
|
+
company_address <= company_address.address
|
45
|
+
contact_address <= contact_address.address
|
46
|
+
opportunity <= opportunity.address
|
47
|
+
address_raw_address
|
48
|
+
address -> address
|
49
|
+
raw_address -> raw_address
|
50
|
+
created_at
|
51
|
+
created_by_user -> user
|
52
|
+
updated_at
|
53
|
+
updated_by_user -> user
|
54
|
+
company
|
55
|
+
id
|
56
|
+
name
|
57
|
+
created_at
|
58
|
+
created_by_user -> user
|
59
|
+
updated_at
|
60
|
+
updated_by_user -> user
|
61
|
+
company_activity <= company_activity.company
|
62
|
+
company_address <= company_address.company
|
63
|
+
company_contact <= company_contact.company
|
64
|
+
opportunity <= opportunity.company
|
65
|
+
siebel_company <= siebel_company.company
|
66
|
+
company_activity
|
67
|
+
company -> company
|
68
|
+
activity -> activity
|
69
|
+
created_at
|
70
|
+
created_by_user -> user
|
71
|
+
updated_at
|
72
|
+
updated_by_user -> user
|
73
|
+
company_address
|
74
|
+
company -> company
|
75
|
+
address -> address
|
76
|
+
created_at
|
77
|
+
created_by_user -> user
|
78
|
+
updated_at
|
79
|
+
updated_by_user -> user
|
80
|
+
company_contact
|
81
|
+
company -> company
|
82
|
+
contact -> contact
|
83
|
+
created_at
|
84
|
+
created_by_user -> user
|
85
|
+
updated_at
|
86
|
+
updated_by_user -> user
|
87
|
+
contact
|
88
|
+
id
|
89
|
+
first_name
|
90
|
+
last_name
|
91
|
+
email
|
92
|
+
phone
|
93
|
+
job_title
|
94
|
+
user -> user
|
95
|
+
created_at
|
96
|
+
created_by_user -> user
|
97
|
+
updated_at
|
98
|
+
updated_by_user -> user
|
99
|
+
company_contact <= company_contact.contact
|
100
|
+
contact_activity <= contact_activity.contact
|
101
|
+
contact_address <= contact_address.contact
|
102
|
+
opportunity_contact <= opportunity_contact.contact
|
103
|
+
siebel_contact <= siebel_contact.contact
|
104
|
+
contact_activity
|
105
|
+
contact_activity_id
|
106
|
+
contact -> contact
|
107
|
+
activity -> activity
|
108
|
+
code
|
109
|
+
created_at
|
110
|
+
created_by_user -> user
|
111
|
+
updated_at
|
112
|
+
updated_by_user -> user
|
113
|
+
contact_address
|
114
|
+
contact -> contact
|
115
|
+
address -> address
|
116
|
+
created_at
|
117
|
+
created_by_user -> user
|
118
|
+
updated_at
|
119
|
+
updated_by_user -> user
|
120
|
+
log
|
121
|
+
id
|
122
|
+
set_id
|
123
|
+
name
|
124
|
+
type
|
125
|
+
item
|
126
|
+
timestamp
|
127
|
+
opportunity
|
128
|
+
id
|
129
|
+
name
|
130
|
+
description
|
131
|
+
status_code
|
132
|
+
address -> address
|
133
|
+
company -> company
|
134
|
+
effect_date
|
135
|
+
created_at
|
136
|
+
created_by_user -> user
|
137
|
+
updated_at
|
138
|
+
updated_by_user -> user
|
139
|
+
activity <= activity.opportunity
|
140
|
+
opportunity_contact <= opportunity_contact.opportunity
|
141
|
+
siebel_opportunity <= siebel_opportunity.opportunity
|
142
|
+
opportunity_contact
|
143
|
+
opportunity -> opportunity
|
144
|
+
contact -> contact
|
145
|
+
created_at
|
146
|
+
created_by_user -> user
|
147
|
+
updated_at
|
148
|
+
updated_by_user -> user
|
149
|
+
raw_address
|
150
|
+
id
|
151
|
+
address_line_1
|
152
|
+
address_line_2
|
153
|
+
address_line_3
|
154
|
+
street
|
155
|
+
unit
|
156
|
+
city
|
157
|
+
state
|
158
|
+
zip
|
159
|
+
country
|
160
|
+
created_at
|
161
|
+
created_by_user -> user
|
162
|
+
updated_at
|
163
|
+
updated_by_user -> user
|
164
|
+
address_raw_address <= address_raw_address.raw_address
|
165
|
+
siebel_address <= siebel_address.raw_address
|
166
|
+
role
|
167
|
+
id
|
168
|
+
name
|
169
|
+
description
|
170
|
+
created_at
|
171
|
+
created_by_user -> user
|
172
|
+
updated_at
|
173
|
+
updated_by_user -> user
|
174
|
+
user_role <= user_role.role
|
175
|
+
siebel_activity
|
176
|
+
siebel_id
|
177
|
+
parent_siebel -> siebel_activity
|
178
|
+
activity -> activity
|
179
|
+
siebel_company -> siebel_company
|
180
|
+
siebel_contact -> siebel_contact
|
181
|
+
siebel_owner_contact -> siebel_contact
|
182
|
+
siebel_opportunity -> siebel_opportunity
|
183
|
+
created_at
|
184
|
+
created_by_siebel_id
|
185
|
+
updated_at
|
186
|
+
updated_by_siebel_id
|
187
|
+
siebel_contact_activity <= siebel_contact_activity.siebel_activity
|
188
|
+
siebel_address
|
189
|
+
siebel_id
|
190
|
+
raw_address -> raw_address
|
191
|
+
created_at
|
192
|
+
created_by_siebel_id
|
193
|
+
updated_at
|
194
|
+
updated_by_siebel_id
|
195
|
+
siebel_company_address <= siebel_company_address.siebel_address
|
196
|
+
siebel_contact_address <= siebel_contact_address.siebel_address
|
197
|
+
siebel_opportunity <= siebel_opportunity.siebel_address
|
198
|
+
siebel_company
|
199
|
+
siebel_id
|
200
|
+
company -> company
|
201
|
+
created_at
|
202
|
+
created_by_siebel_id
|
203
|
+
updated_at
|
204
|
+
updated_by_siebel_id
|
205
|
+
siebel_activity <= siebel_activity.siebel_company
|
206
|
+
siebel_company_address <= siebel_company_address.siebel_company
|
207
|
+
siebel_company_contact <= siebel_company_contact.siebel_company
|
208
|
+
siebel_opportunity <= siebel_opportunity.siebel_company
|
209
|
+
siebel_company_address
|
210
|
+
siebel_company -> siebel_company
|
211
|
+
siebel_address -> siebel_address
|
212
|
+
created_at
|
213
|
+
created_by_siebel_id
|
214
|
+
updated_at
|
215
|
+
updated_by_siebel_id
|
216
|
+
siebel_company_contact
|
217
|
+
siebel_company -> siebel_company
|
218
|
+
siebel_contact -> siebel_contact
|
219
|
+
created_at
|
220
|
+
created_by_siebel_id
|
221
|
+
updated_at
|
222
|
+
updated_by_siebel_id
|
223
|
+
siebel_contact
|
224
|
+
siebel_id
|
225
|
+
contact -> contact
|
226
|
+
created_at
|
227
|
+
created_by_siebel_id
|
228
|
+
updated_at
|
229
|
+
updated_by_siebel_id
|
230
|
+
siebel_activity <= siebel_activity.siebel_contact
|
231
|
+
siebel_activity <= siebel_activity.siebel_owner_contact
|
232
|
+
siebel_company_contact <= siebel_company_contact.siebel_contact
|
233
|
+
siebel_contact_activity <= siebel_contact_activity.siebel_contact
|
234
|
+
siebel_contact_address <= siebel_contact_address.siebel_contact
|
235
|
+
siebel_opportunity_contact <= siebel_opportunity_contact.siebel_contact
|
236
|
+
siebel_contact_activity
|
237
|
+
siebel_contact_activity_id
|
238
|
+
siebel_contact -> siebel_contact
|
239
|
+
siebel_activity -> siebel_activity
|
240
|
+
created_at
|
241
|
+
created_by_siebel_id
|
242
|
+
updated_at
|
243
|
+
updated_by_siebel_id
|
244
|
+
siebel_contact_address
|
245
|
+
siebel_contact -> siebel_contact
|
246
|
+
siebel_address -> siebel_address
|
247
|
+
created_at
|
248
|
+
created_by_siebel_id
|
249
|
+
updated_at
|
250
|
+
updated_by_siebel_id
|
251
|
+
siebel_opportunity
|
252
|
+
siebel_id
|
253
|
+
opportunity -> opportunity
|
254
|
+
siebel_address -> siebel_address
|
255
|
+
siebel_company -> siebel_company
|
256
|
+
created_at
|
257
|
+
created_by_siebel_id
|
258
|
+
updated_at
|
259
|
+
updated_by_siebel_id
|
260
|
+
siebel_activity <= siebel_activity.siebel_opportunity
|
261
|
+
siebel_opportunity_contact <= siebel_opportunity_contact.siebel_opportunity
|
262
|
+
siebel_opportunity_contact
|
263
|
+
siebel_opportunity -> siebel_opportunity
|
264
|
+
siebel_contact -> siebel_contact
|
265
|
+
created_at
|
266
|
+
created_by_siebel_id
|
267
|
+
updated_at
|
268
|
+
updated_by_siebel_id
|
269
|
+
siebel_user
|
270
|
+
siebel_id
|
271
|
+
user -> user
|
272
|
+
user_name
|
273
|
+
password
|
274
|
+
created_at
|
275
|
+
created_by_siebel_id
|
276
|
+
updated_at
|
277
|
+
updated_by_siebel_id
|
278
|
+
user
|
279
|
+
id
|
280
|
+
name
|
281
|
+
first_name
|
282
|
+
last_name
|
283
|
+
user_name
|
284
|
+
email
|
285
|
+
phone
|
286
|
+
sms_verification_code
|
287
|
+
hash
|
288
|
+
key
|
289
|
+
activation_key
|
290
|
+
active
|
291
|
+
is_valid
|
292
|
+
password_reset_code
|
293
|
+
created_at
|
294
|
+
created_by_user -> user
|
295
|
+
updated_at
|
296
|
+
updated_by_user -> user
|
297
|
+
activity <= activity.created_by_user
|
298
|
+
activity <= activity.updated_by_user
|
299
|
+
address <= address.created_by_user
|
300
|
+
address <= address.updated_by_user
|
301
|
+
address_raw_address <= address_raw_address.created_by_user
|
302
|
+
address_raw_address <= address_raw_address.updated_by_user
|
303
|
+
company <= company.created_by_user
|
304
|
+
company <= company.updated_by_user
|
305
|
+
company_activity <= company_activity.created_by_user
|
306
|
+
company_activity <= company_activity.updated_by_user
|
307
|
+
company_address <= company_address.created_by_user
|
308
|
+
company_address <= company_address.updated_by_user
|
309
|
+
company_contact <= company_contact.created_by_user
|
310
|
+
company_contact <= company_contact.updated_by_user
|
311
|
+
contact <= contact.user
|
312
|
+
contact <= contact.created_by_user
|
313
|
+
contact <= contact.updated_by_user
|
314
|
+
contact_activity <= contact_activity.created_by_user
|
315
|
+
contact_activity <= contact_activity.updated_by_user
|
316
|
+
contact_address <= contact_address.created_by_user
|
317
|
+
contact_address <= contact_address.updated_by_user
|
318
|
+
opportunity <= opportunity.created_by_user
|
319
|
+
opportunity <= opportunity.updated_by_user
|
320
|
+
opportunity_contact <= opportunity_contact.created_by_user
|
321
|
+
opportunity_contact <= opportunity_contact.updated_by_user
|
322
|
+
raw_address <= raw_address.created_by_user
|
323
|
+
raw_address <= raw_address.updated_by_user
|
324
|
+
role <= role.created_by_user
|
325
|
+
role <= role.updated_by_user
|
326
|
+
siebel_user <= siebel_user.user
|
327
|
+
user_role <= user_role.user
|
328
|
+
user_role <= user_role.created_by_user
|
329
|
+
user_role <= user_role.updated_by_user
|
330
|
+
user_role
|
331
|
+
user -> user
|
332
|
+
role -> role
|
333
|
+
created_at
|
334
|
+
created_by_user -> user
|
335
|
+
updated_at
|
336
|
+
updated_by_user -> user
|
@@ -0,0 +1,138 @@
|
|
1
|
+
Query API:
|
2
|
+
|
3
|
+
POST /query
|
4
|
+
|
5
|
+
The post body must contain a JSON string object named "query":
|
6
|
+
|
7
|
+
{"query": "your query goes here..."}
|
8
|
+
|
9
|
+
Remember to use JSON.stringify:
|
10
|
+
|
11
|
+
JSON.stringify({query: your_query, apply_limit_offset_to_sql: false})
|
12
|
+
|
13
|
+
You may also set "apply_limit_offset_to_sql" to true or false as shown:
|
14
|
+
|
15
|
+
JSON.stringify({query: your_query, apply_limit_offset_to_sql: false})
|
16
|
+
|
17
|
+
Please keep in mind that by setting "apply_limit_offset_to_sql" to false you are
|
18
|
+
potentially going to incur a large performance hit as the [limit] and [offset]
|
19
|
+
query settings will be applied after the entire SQL result set is returned from
|
20
|
+
the database to the application server.
|
21
|
+
|
22
|
+
Query Syntax:
|
23
|
+
|
24
|
+
entity_name(fields)(filter)(sort)[limit][offset]
|
25
|
+
|
26
|
+
Requirements:
|
27
|
+
|
28
|
+
entity_name and (fields) are required.
|
29
|
+
|
30
|
+
(filter) is optional
|
31
|
+
|
32
|
+
(sort) is optional.
|
33
|
+
If (sort) is included, then (filter) must be included.
|
34
|
+
An empty "(filter)" is allowed: "()".
|
35
|
+
|
36
|
+
[limit] is optional
|
37
|
+
If [limit] is included then (sort) must also be included.
|
38
|
+
An empty "(sort)" is allowed: "()".
|
39
|
+
|
40
|
+
[offset] is optional.
|
41
|
+
If [offset] is included then [limit] must also be included.
|
42
|
+
An empty [limit] is not allowed.
|
43
|
+
|
44
|
+
Comments:
|
45
|
+
|
46
|
+
/*this is a multi-line
|
47
|
+
comment*<ml_remove>/
|
48
|
+
|
49
|
+
--this is a single line comment.
|
50
|
+
|
51
|
+
(fields) Syntax:
|
52
|
+
|
53
|
+
(field1, field2, field3, ...)
|
54
|
+
|
55
|
+
Any given field can also be a sub-entity:
|
56
|
+
|
57
|
+
(field1, sub-entity_name(fields)(filter), field3, ...)
|
58
|
+
|
59
|
+
Sub-entities follow the same rules as entities except that (sort), [limit], and [offset] are not allowed.
|
60
|
+
Except that sub-entities may have a trailing "@" attached to their name in which case, the query treats
|
61
|
+
the relationship similar to a "left join" in SQL.
|
62
|
+
|
63
|
+
(filter) Syntax:
|
64
|
+
|
65
|
+
(field operator value connector field operator value connector...)
|
66
|
+
|
67
|
+
(field1 == value and (field2 < value or field2 > value))
|
68
|
+
|
69
|
+
strings and date values should be in single quotes.
|
70
|
+
|
71
|
+
numeric values should not be in quotes.
|
72
|
+
|
73
|
+
Example:
|
74
|
+
|
75
|
+
(id > 10 and id < 1000 and my_date == '2015-08-27' and name == 'abc')
|
76
|
+
|
77
|
+
Valid operators:
|
78
|
+
|
79
|
+
"==" (equal to)
|
80
|
+
"!=" (not equal to)
|
81
|
+
">" (greater than)
|
82
|
+
"<" (less than)
|
83
|
+
">=" (greater than or equal to)
|
84
|
+
"<=" (less than or equal to)
|
85
|
+
"~" (like) Note: You can embed % as in standard sql. Example: "%text%"
|
86
|
+
"=~" (regular expression) Note: Not yet implemented. Example: "/regexp/"
|
87
|
+
"~~" (full text search) Note: Not yet implemented. Example: "full text search query"
|
88
|
+
">>" (in) Example: id >> (1, 2, 3)
|
89
|
+
"<<" (not in) Example: name << ("Tom", "Steve")
|
90
|
+
"is" (is null) Example: name is null
|
91
|
+
"is!" (is not null) Example: name is! null
|
92
|
+
|
93
|
+
Valid connectors:
|
94
|
+
|
95
|
+
"and"
|
96
|
+
"or"
|
97
|
+
|
98
|
+
Grouping:
|
99
|
+
|
100
|
+
"(" and ")" can be used for grouping.
|
101
|
+
|
102
|
+
(sort) Syntax:
|
103
|
+
|
104
|
+
(field1, field2, ...)
|
105
|
+
(field1 asc, field2 desc, ...)
|
106
|
+
(field1, sub-entity_name.field2, ...)
|
107
|
+
|
108
|
+
You cannot include the entity_name in sorts, but sub-entity names are required as qualifiers for their field names.
|
109
|
+
|
110
|
+
[limit] Syntax:
|
111
|
+
|
112
|
+
[integer]
|
113
|
+
|
114
|
+
Example:
|
115
|
+
|
116
|
+
[10]
|
117
|
+
|
118
|
+
[offset] Syntax:
|
119
|
+
|
120
|
+
[integer]
|
121
|
+
|
122
|
+
Example:
|
123
|
+
|
124
|
+
[10]
|
125
|
+
|
126
|
+
Full Query Examples:
|
127
|
+
|
128
|
+
1:
|
129
|
+
|
130
|
+
user(id, name, first_name, last_name, user_name, email, phone, hash, active)
|
131
|
+
|
132
|
+
2:
|
133
|
+
|
134
|
+
siebel_user(
|
135
|
+
siebel_id,
|
136
|
+
user_name,
|
137
|
+
password
|
138
|
+
)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Query Schema Tree:
|
2
|
+
|
3
|
+
Notes:
|
4
|
+
Use a code-folding text editor for easy viewing/browsing. Atom is highly recommended. Sublime will also work well.
|
5
|
+
Entities are shown under "root". (Do not include "root" in your queries.)
|
6
|
+
Fields and Sub-entities are nested under entities.
|
7
|
+
Sub-entities have "->", "<-", or "<=" symbols linking them to their corresponding entities.
|
8
|
+
"->" and "<-" identify one to one relationships.
|
9
|
+
"<=" identifies a one to many relationship. as in: one <= many.
|
10
|
+
|
11
|
+
|
12
|
+
root
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Query Schema Tree:
|
2
|
+
|
3
|
+
Notes:
|
4
|
+
Use a code-folding text editor for easy viewing/browsing. Atom is highly recommended. Sublime will also work well.
|
5
|
+
Entities are shown under "root". (Do not include "root" in your queries.)
|
6
|
+
Fields and Sub-entities are nested under entities.
|
7
|
+
Sub-entities have "->", "<-", or "<=" symbols linking them to their corresponding entities.
|
8
|
+
"->" and "<-" identify one to one relationships.
|
9
|
+
"<=" identifies a one to many relationship. as in: one <= many.
|
@@ -4,28 +4,36 @@ module JunglePath
|
|
4
4
|
class Default
|
5
5
|
def authenticate request, data_provider, no_cache=false
|
6
6
|
puts "JunglePath::Authentication::AuthProvider::Default.authenticate"
|
7
|
-
#data_provider = JunglePath::Authentication::DataProvider::Default.new unless data_provider
|
8
7
|
remote_user = request.env['REMOTE_USER']
|
9
8
|
remote_password = request.env['REMOTE_PASSWORD']
|
10
9
|
puts "remote_user: #{remote_user}."
|
11
10
|
puts "remote_password: #{remote_password}."
|
12
11
|
identity = basic_authentication(data_provider, remote_user, remote_password, no_cache)
|
13
|
-
|
12
|
+
identity = basic_authentication(data_provider, remote_user, remote_password, true) unless identity and identity.valid?
|
13
|
+
identity
|
14
14
|
end
|
15
15
|
|
16
16
|
def basic_authentication data_provider, remote_user, remote_password, no_cache=false
|
17
17
|
identity, assume_identity = parse_identities(remote_user, remote_password)
|
18
|
+
|
18
19
|
puts "identity: #{identity}"
|
19
20
|
puts "assume_identity: #{assume_identity}"
|
20
|
-
|
21
|
+
|
22
|
+
#valid = false
|
23
|
+
|
21
24
|
identity = authenticate_identity(data_provider, identity, no_cache)
|
22
25
|
puts "authenticated identity: #{identity}."
|
23
26
|
identity = authorize_identity(data_provider, identity, no_cache)
|
24
27
|
puts "authorized identity: #{identity}."
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
28
|
+
|
29
|
+
if identity and identity.valid? and assume_identity
|
30
|
+
assume_identity = authenticate_identity(data_provider, assume_identity, no_cache)
|
31
|
+
puts "authenticated assume_identity: #{assume_identity}."
|
32
|
+
assume_identity = authorize_identity(data_provider, assume_identity, no_cache)
|
33
|
+
puts "authorized assume_identity: #{assume_identity}."
|
34
|
+
#valid = (assume_identity and assume_identity.valid?) or (identity and identity.valid?)
|
35
|
+
return assume_identity if assume_identity.valid?
|
36
|
+
end
|
29
37
|
identity
|
30
38
|
end
|
31
39
|
|
@@ -97,23 +97,6 @@ module JunglePath
|
|
97
97
|
filters
|
98
98
|
end
|
99
99
|
|
100
|
-
|
101
|
-
# def get_query_filters(identity, no_cache=false)
|
102
|
-
# filters = []
|
103
|
-
# @role_query_filters.call(identity).each do |key, filter|
|
104
|
-
# puts "role_query_filters: key/filter: #{key}/#{filter}"
|
105
|
-
# filters << filter
|
106
|
-
# end
|
107
|
-
# @restriction_query_filters.call(identity).each do |key, filter|
|
108
|
-
# puts "restriction_query_filters: key/filter: #{key}/#{filter}"
|
109
|
-
# filters << filter
|
110
|
-
# end
|
111
|
-
# @user_query_filters.call(identity).each do |key, filter|
|
112
|
-
# puts "user_query_filters: key/filter: #{key}/#{filter}"
|
113
|
-
# filters << filter
|
114
|
-
# end
|
115
|
-
# filters
|
116
|
-
# end
|
117
100
|
end
|
118
101
|
end
|
119
102
|
end
|
data/lib/jungle_path/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jungle_path
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael VanZant
|
@@ -86,6 +86,10 @@ files:
|
|
86
86
|
- lib/jungle_path/app/services/email.rb
|
87
87
|
- lib/jungle_path/app/services/sms.rb
|
88
88
|
- lib/jungle_path/app/web_apps/public/index.html
|
89
|
+
- lib/jungle_path/app/web_apps/public/query/documents/node_tree.txt
|
90
|
+
- lib/jungle_path/app/web_apps/public/query/documents/query_api_documentation.txt
|
91
|
+
- lib/jungle_path/app/web_apps/public/query/documents/schema_tree.txt
|
92
|
+
- lib/jungle_path/app/web_apps/public/query/documents/schema_tree_template.txt
|
89
93
|
- lib/jungle_path/app/ztools/db/migrations/000_root.rb
|
90
94
|
- lib/jungle_path/app/ztools/zbootstrapdata.rb
|
91
95
|
- lib/jungle_path/app/ztools/zcreatedb.rb
|