cmis_server 1.2.1 → 1.3.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/app/controllers/cmis_server/atom_pub/entries_controller.rb +2 -1
- data/app/controllers/cmis_server/atom_pub/folder_collection_controller.rb +55 -11
- data/app/controllers/cmis_server/atom_pub/query_controller.rb +44 -16
- data/app/controllers/cmis_server/atom_pub/service_documents_controller.rb +1 -1
- data/app/services/cmis_server/discovery_service.rb +58 -9
- data/app/services/cmis_server/navigation_service.rb +62 -3
- data/app/services/cmis_server/object_service.rb +112 -13
- data/app/views/cmis_server/atom_pub/entries/_cmis_folder_links.atom_entry.builder +1 -1
- data/app/views/cmis_server/atom_pub/entries/_object_entry.atom_entry.builder +4 -3
- data/app/views/cmis_server/atom_pub/entries/type_entry.atom_entry.builder +1 -1
- data/app/views/cmis_server/atom_pub/feeds/feed.atom_feed.builder +3 -0
- data/app/views/cmis_server/atom_pub/query_results_feed.atom_feed.builder +59 -0
- data/app/views/cmis_server/atom_pub/queryable_types_feed.atom_feed.builder +35 -0
- data/app/views/cmis_server/atom_pub/service_documents/_workspace.atom_service.builder +1 -1
- data/config/initializers/cmis_core_configuration.rb +31 -8
- data/lib/cmis_server/atom_pub/entry_parser.rb +57 -22
- data/lib/cmis_server/cmis_object.rb +32 -2
- data/lib/cmis_server/configuration.rb +4 -3
- data/lib/cmis_server/connectors/CORE_CONNECTOR_QUERIES.md +180 -0
- data/lib/cmis_server/connectors/core_connector.rb +189 -69
- data/lib/cmis_server/constants.rb +3 -2
- data/lib/cmis_server/document_adapter.rb +135 -0
- data/lib/cmis_server/document_object.rb +1 -1
- data/lib/cmis_server/engine.rb +95 -0
- data/lib/cmis_server/exceptions.rb +19 -0
- data/lib/cmis_server/folder_adapter.rb +126 -0
- data/lib/cmis_server/property.rb +40 -4
- data/lib/cmis_server/query/parser.rb +11 -0
- data/lib/cmis_server/query/{parser.racc.rb → parser_racc.rb} +2 -2
- data/lib/cmis_server/query/{parser.rex.rb → parser_rex.rb} +6 -1
- data/lib/cmis_server/query/simple_parser.rb +276 -0
- data/lib/cmis_server/query/statement.rb +3 -389
- data/lib/cmis_server/query/statement.rb.bak +395 -0
- data/lib/cmis_server/query.rb +11 -2
- data/lib/cmis_server/renderable_collection.rb +23 -2
- data/lib/cmis_server/repository.rb +1 -1
- data/lib/cmis_server/version.rb +1 -1
- data/lib/cmis_server.rb +13 -0
- metadata +12 -4
@@ -1,395 +1,9 @@
|
|
1
1
|
module CmisServer
|
2
|
-
|
3
2
|
module Query
|
4
|
-
|
5
3
|
module Statement
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
# def accept(visitor)
|
10
|
-
# klass = self.class.ancestors.find do |ancestor|
|
11
|
-
# visitor.respond_to?("visit_#{demodulize(ancestor.name)}")
|
12
|
-
# end
|
13
|
-
#
|
14
|
-
# if klass
|
15
|
-
# visitor.__send__("visit_#{demodulize(klass.name)}", self)
|
16
|
-
# else
|
17
|
-
# raise "No visitor for #{self.class.name}"
|
18
|
-
# end
|
19
|
-
# end
|
20
|
-
#
|
21
|
-
# def to_sql
|
22
|
-
# SQLVisitor.new.visit(self)
|
23
|
-
# end
|
24
|
-
|
25
|
-
private
|
26
|
-
|
27
|
-
def demodulize(str)
|
28
|
-
str.split('::')[-1]
|
29
|
-
end
|
30
|
-
|
4
|
+
class Table
|
5
|
+
# Classe simple pour la compatibilité
|
31
6
|
end
|
32
|
-
|
33
|
-
class CmisQuery < Node
|
34
|
-
def initialize(query_expression, order_by)
|
35
|
-
@query_expression = query_expression
|
36
|
-
@order_by = order_by
|
37
|
-
end
|
38
|
-
|
39
|
-
attr_reader :query_expression
|
40
|
-
attr_reader :order_by
|
41
|
-
end
|
42
|
-
|
43
|
-
class Select < Node
|
44
|
-
def initialize(select_list,from,where)
|
45
|
-
@select_list=select_list
|
46
|
-
@from=from
|
47
|
-
@where=where
|
48
|
-
end
|
49
|
-
attr_reader :select_list, :from, :where
|
50
|
-
end
|
51
|
-
|
52
|
-
class All < Node
|
53
|
-
|
54
|
-
def initialize(table=nil)
|
55
|
-
@column=table
|
56
|
-
end
|
57
|
-
|
58
|
-
attr_reader :table
|
59
|
-
end
|
60
|
-
|
61
|
-
class SelectList < Node
|
62
|
-
|
63
|
-
def initialize(columns)
|
64
|
-
@columns = Array(columns)
|
65
|
-
end
|
66
|
-
|
67
|
-
attr_reader :columns
|
68
|
-
|
69
|
-
end
|
70
|
-
|
71
|
-
class As < Node
|
72
|
-
|
73
|
-
def initialize(value, column)
|
74
|
-
@value = value
|
75
|
-
@column = column
|
76
|
-
end
|
77
|
-
|
78
|
-
attr_reader :value
|
79
|
-
attr_reader :column
|
80
|
-
|
81
|
-
end
|
82
|
-
|
83
|
-
class QualifiedColumn < Node
|
84
|
-
|
85
|
-
def initialize(column, table, secondary_table=nil)
|
86
|
-
@table = table
|
87
|
-
@column = column
|
88
|
-
end
|
89
|
-
|
90
|
-
attr_reader :table
|
91
|
-
attr_reader :column
|
92
|
-
|
93
|
-
end
|
94
|
-
|
95
|
-
class FromClause < Node
|
96
|
-
|
97
|
-
def initialize(tables)
|
98
|
-
@tables = Array(tables)
|
99
|
-
end
|
100
|
-
|
101
|
-
attr_reader :tables
|
102
|
-
|
103
|
-
end
|
104
|
-
|
105
|
-
class WhereClause < Node
|
106
|
-
|
107
|
-
def initialize(search_condition)
|
108
|
-
@search_condition = search_condition
|
109
|
-
end
|
110
|
-
|
111
|
-
attr_reader :search_condition
|
112
|
-
|
113
|
-
def to_h
|
114
|
-
search_condition.to_h
|
115
|
-
end
|
116
|
-
|
117
|
-
end
|
118
|
-
|
119
|
-
class OrderBy < Node
|
120
|
-
|
121
|
-
def initialize(sort_specification)
|
122
|
-
@sort_specification = Array(sort_specification)
|
123
|
-
end
|
124
|
-
|
125
|
-
attr_reader :sort_specification
|
126
|
-
|
127
|
-
end
|
128
|
-
|
129
|
-
class JoinedTable < Node
|
130
|
-
|
131
|
-
def initialize(left, right)
|
132
|
-
@left = left
|
133
|
-
@right = right
|
134
|
-
end
|
135
|
-
|
136
|
-
attr_reader :left
|
137
|
-
attr_reader :right
|
138
|
-
|
139
|
-
end
|
140
|
-
|
141
|
-
class QualifiedJoin < JoinedTable
|
142
|
-
|
143
|
-
def initialize(left, right, search_condition)
|
144
|
-
super(left, right)
|
145
|
-
@search_condition = search_condition
|
146
|
-
end
|
147
|
-
|
148
|
-
attr_reader :search_condition
|
149
|
-
|
150
|
-
end
|
151
|
-
|
152
|
-
class InnerJoin < QualifiedJoin
|
153
|
-
end
|
154
|
-
|
155
|
-
class LeftJoin < QualifiedJoin
|
156
|
-
end
|
157
|
-
|
158
|
-
class LeftOuterJoin < QualifiedJoin
|
159
|
-
end
|
160
|
-
|
161
|
-
class ComparisonPredicate < Node
|
162
|
-
|
163
|
-
def initialize(left, right)
|
164
|
-
@left = left
|
165
|
-
@right = right
|
166
|
-
end
|
167
|
-
|
168
|
-
attr_reader :left
|
169
|
-
attr_reader :right
|
170
|
-
|
171
|
-
end
|
172
|
-
|
173
|
-
class Is < ComparisonPredicate
|
174
|
-
end
|
175
|
-
|
176
|
-
class Like < ComparisonPredicate
|
177
|
-
end
|
178
|
-
|
179
|
-
class In < ComparisonPredicate
|
180
|
-
end
|
181
|
-
|
182
|
-
class QuantifiedIn < ComparisonPredicate
|
183
|
-
end
|
184
|
-
|
185
|
-
class InValueList < Node
|
186
|
-
|
187
|
-
def initialize(values)
|
188
|
-
@values = values
|
189
|
-
end
|
190
|
-
|
191
|
-
attr_reader :values
|
192
|
-
|
193
|
-
end
|
194
|
-
|
195
|
-
class FolderPredicate
|
196
|
-
|
197
|
-
def initialize(folder_id, qualifier=nil)
|
198
|
-
@folder_id = folder_id
|
199
|
-
@qualifier = qualifier
|
200
|
-
end
|
201
|
-
|
202
|
-
attr_reader :folder_id
|
203
|
-
attr_reader :qualifier
|
204
|
-
|
205
|
-
end
|
206
|
-
|
207
|
-
class InFolder < FolderPredicate
|
208
|
-
end
|
209
|
-
|
210
|
-
class InTree < FolderPredicate
|
211
|
-
end
|
212
|
-
|
213
|
-
class InColumnList < Node
|
214
|
-
|
215
|
-
def initialize(columns)
|
216
|
-
@columns = columns
|
217
|
-
end
|
218
|
-
|
219
|
-
attr_reader :columns
|
220
|
-
|
221
|
-
end
|
222
|
-
|
223
|
-
class Between < Node
|
224
|
-
|
225
|
-
def initialize(left, min, max)
|
226
|
-
@left = left
|
227
|
-
@min = min
|
228
|
-
@max = max
|
229
|
-
end
|
230
|
-
|
231
|
-
attr_reader :left
|
232
|
-
attr_reader :min
|
233
|
-
attr_reader :max
|
234
|
-
|
235
|
-
end
|
236
|
-
|
237
|
-
class SearchCondition < Node
|
238
|
-
|
239
|
-
def initialize(left, right)
|
240
|
-
@left = left
|
241
|
-
@right = right
|
242
|
-
end
|
243
|
-
|
244
|
-
attr_reader :left
|
245
|
-
attr_reader :right
|
246
|
-
|
247
|
-
end
|
248
|
-
|
249
|
-
class Or < SearchCondition
|
250
|
-
end
|
251
|
-
|
252
|
-
class And < SearchCondition
|
253
|
-
|
254
|
-
def to_h
|
255
|
-
self.left.to_h.merge(self.right.to_h)
|
256
|
-
end
|
257
|
-
|
258
|
-
end
|
259
|
-
|
260
|
-
|
261
|
-
class GreaterOrEquals < ComparisonPredicate
|
262
|
-
end
|
263
|
-
|
264
|
-
class LessOrEquals < ComparisonPredicate
|
265
|
-
end
|
266
|
-
|
267
|
-
class Greater < ComparisonPredicate
|
268
|
-
end
|
269
|
-
|
270
|
-
class Less < ComparisonPredicate
|
271
|
-
end
|
272
|
-
|
273
|
-
class Equals < ComparisonPredicate
|
274
|
-
def to_h
|
275
|
-
{self.left.to_cmis_where_key => self.right.value}
|
276
|
-
end
|
277
|
-
|
278
|
-
end
|
279
|
-
|
280
|
-
class QuantifiedComparison < ComparisonPredicate
|
281
|
-
end
|
282
|
-
|
283
|
-
class Identifier < Node
|
284
|
-
|
285
|
-
def initialize(name)
|
286
|
-
@name = name
|
287
|
-
end
|
288
|
-
|
289
|
-
def to_cmis_where_key
|
290
|
-
CmisServer::Id.new(self.name).to_method_name.to_sym
|
291
|
-
end
|
292
|
-
|
293
|
-
attr_reader :name
|
294
|
-
alias_method :value, :name
|
295
|
-
|
296
|
-
end
|
297
|
-
|
298
|
-
class Table < Identifier
|
299
|
-
end
|
300
|
-
|
301
|
-
class Column < Identifier
|
302
|
-
end
|
303
|
-
|
304
|
-
class FolderId < Identifier
|
305
|
-
end
|
306
|
-
|
307
|
-
|
308
|
-
class Score < Node
|
309
|
-
end
|
310
|
-
|
311
|
-
class True < Node
|
312
|
-
end
|
313
|
-
|
314
|
-
class False < Node
|
315
|
-
end
|
316
|
-
|
317
|
-
class Null < Node
|
318
|
-
end
|
319
|
-
|
320
|
-
class Literal < Node
|
321
|
-
|
322
|
-
def initialize(value)
|
323
|
-
@value = value
|
324
|
-
end
|
325
|
-
|
326
|
-
attr_reader :value
|
327
|
-
|
328
|
-
end
|
329
|
-
|
330
|
-
class DateTime < Literal
|
331
|
-
end
|
332
|
-
|
333
|
-
class Date < Literal
|
334
|
-
end
|
335
|
-
|
336
|
-
class String < Literal
|
337
|
-
end
|
338
|
-
|
339
|
-
class ApproximateFloat < Node
|
340
|
-
|
341
|
-
def initialize(mantissa, exponent)
|
342
|
-
@mantissa = mantissa
|
343
|
-
@exponent = exponent
|
344
|
-
end
|
345
|
-
|
346
|
-
attr_reader :mantissa
|
347
|
-
attr_reader :exponent
|
348
|
-
|
349
|
-
end
|
350
|
-
|
351
|
-
class Float < Literal
|
352
|
-
end
|
353
|
-
|
354
|
-
class Integer < Literal
|
355
|
-
end
|
356
|
-
|
357
|
-
class Unary < Node
|
358
|
-
|
359
|
-
def initialize(value)
|
360
|
-
@value = value
|
361
|
-
end
|
362
|
-
|
363
|
-
attr_reader :value
|
364
|
-
|
365
|
-
end
|
366
|
-
|
367
|
-
class Not < Unary
|
368
|
-
end
|
369
|
-
|
370
|
-
class UnaryPlus < Unary
|
371
|
-
end
|
372
|
-
|
373
|
-
class UnaryMinus < Unary
|
374
|
-
end
|
375
|
-
|
376
|
-
class OrderSpecification < Node
|
377
|
-
|
378
|
-
def initialize(column)
|
379
|
-
@column = column
|
380
|
-
end
|
381
|
-
|
382
|
-
attr_reader :column
|
383
|
-
|
384
|
-
end
|
385
|
-
|
386
|
-
class Ascending < OrderSpecification
|
387
|
-
end
|
388
|
-
|
389
|
-
class Descending < OrderSpecification
|
390
|
-
end
|
391
|
-
|
392
7
|
end
|
393
8
|
end
|
394
|
-
end
|
395
|
-
|
9
|
+
end
|