1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace POData\Common; |
4
|
|
|
|
5
|
|
|
use POData\OperationContext\HTTPRequestMethod; |
6
|
|
|
use POData\Providers\Query\QueryType; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Class Messages helps to format error messages |
10
|
|
|
* @package POData\Common |
11
|
|
|
*/ |
12
|
|
|
class Messages |
13
|
|
|
{ |
14
|
|
|
/** |
15
|
|
|
* Format message for unterminated string literal error |
16
|
|
|
* |
17
|
|
|
* @param int $pos Position of unterminated string literal in the text |
18
|
|
|
* @param string $text The text with unterminated string literal |
19
|
|
|
* |
20
|
|
|
* @return string The formatted message |
21
|
|
|
*/ |
22
|
|
|
public static function expressionLexerUnterminatedStringLiteral($pos, $text) |
23
|
|
|
{ |
24
|
|
|
return 'Unterminated string literal at position ' . $pos . ' in ' . $text; |
25
|
|
|
} |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* Format message for digit expected error |
29
|
|
|
* |
30
|
|
|
* @param int $pos Position at which digit is expected |
31
|
|
|
* |
32
|
|
|
* @return string The formatted message |
33
|
|
|
*/ |
34
|
|
|
public static function expressionLexerDigitExpected($pos) |
35
|
|
|
{ |
36
|
|
|
return 'Digit expected at position ' . $pos; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Format message for syntax error |
41
|
|
|
* |
42
|
|
|
* @param int $pos Position at which syntax error found |
43
|
|
|
* |
44
|
|
|
* @return string The formatted message |
45
|
|
|
*/ |
46
|
|
|
public static function expressionLexerSyntaxError($pos) |
47
|
|
|
{ |
48
|
|
|
return 'Syntax Error at position ' . $pos; |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* Format message for invalid character error |
53
|
|
|
* |
54
|
|
|
* @param string $ch The invalid character found |
55
|
|
|
* @param int $pos Position at which invalid character found |
56
|
|
|
* |
57
|
|
|
* @return string The formatted message |
58
|
|
|
*/ |
59
|
|
|
public static function expressionLexerInvalidCharacter($ch, $pos) |
60
|
|
|
{ |
61
|
|
|
return "Invalid character '$ch' at position $pos"; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* Format message for an operator's incompatible operands types |
66
|
|
|
* |
67
|
|
|
* @param string $operator The operator |
68
|
|
|
* @param string $str The operand list separated by comma |
69
|
|
|
* @param string $pos Position at which operator with incompatible operands found |
70
|
|
|
* |
71
|
|
|
* |
72
|
|
|
* @return string The formatted message |
73
|
|
|
*/ |
74
|
|
|
public static function expressionParserInCompatibleTypes($operator, $str, $pos) |
75
|
|
|
{ |
76
|
|
|
return "Operator '$operator' incompatible with operand types $str at position $pos"; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* Format message for an unsupported null operation |
81
|
|
|
* |
82
|
|
|
* @param string $operator The operator |
83
|
|
|
* @param int $pos Position at which operator with null operands found |
84
|
|
|
* |
85
|
|
|
* @return string The formatted message |
86
|
|
|
*/ |
87
|
|
|
public static function expressionParserOperatorNotSupportNull($operator, $pos) |
88
|
|
|
{ |
89
|
|
|
return "The operator '$operator' at position $pos is not supported for the 'null' literal; only equality checks are supported"; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* Format message for an unsupported guid operation |
94
|
|
|
* |
95
|
|
|
* @param string $operator The operator |
96
|
|
|
* @param int $pos Position at which operator with guid operands found |
97
|
|
|
* |
98
|
|
|
* @return string The formatted message |
99
|
|
|
*/ |
100
|
|
|
public static function expressionParserOperatorNotSupportGuid($operator, $pos) |
101
|
|
|
{ |
102
|
|
|
return "The operator '$operator' at position $pos is not supported for the Edm.Guid ; only equality checks are supported"; |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* Format message for an unsupported binary operation |
107
|
|
|
* |
108
|
|
|
* @param string $operator The operator |
109
|
|
|
* @param int $pos Position at which operator with binary operands found |
110
|
|
|
* |
111
|
|
|
* @return string The formatted message |
112
|
|
|
*/ |
113
|
|
|
public static function expressionParserOperatorNotSupportBinary($operator, $pos) |
114
|
|
|
{ |
115
|
|
|
return "The operator '$operator' at position $pos is not supported for the Edm.Binary ; only equality checks are supported"; |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
/** |
119
|
|
|
* Format message for an unrecognized literal |
120
|
|
|
* |
121
|
|
|
* @param string $type The expected literal type |
122
|
|
|
* @param string $literal The malformed literal |
123
|
|
|
* @param int $pos Position at which literal found |
124
|
|
|
* |
125
|
|
|
* @return string The formatted message |
126
|
|
|
*/ |
127
|
|
|
public static function expressionParserUnrecognizedLiteral($type, $literal, $pos) |
128
|
|
|
{ |
129
|
|
|
return "Unrecognized '$type' literal '$literal' in position '$pos'."; |
130
|
|
|
} |
131
|
|
|
|
132
|
|
|
/** |
133
|
|
|
* Format message for an unknown function-call |
134
|
|
|
* |
135
|
|
|
* @param string $str The unknown function name |
136
|
|
|
* @param int $pos Position at which unknown function-call found |
137
|
|
|
* |
138
|
|
|
* @return string The formatted message |
139
|
|
|
*/ |
140
|
|
|
public static function expressionParserUnknownFunction($str, $pos) |
141
|
|
|
{ |
142
|
|
|
return "Unknown function '$str' at position $pos"; |
143
|
|
|
} |
144
|
|
|
|
145
|
|
|
/** |
146
|
|
|
* Format message for non-boolean filter expression |
147
|
|
|
* |
148
|
|
|
* @return string The formatted message |
149
|
|
|
*/ |
150
|
|
|
public static function expressionParser2BooleanRequired() |
151
|
|
|
{ |
152
|
|
|
return 'Expression of type \'System.Boolean\' expected at position 0'; |
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
/** |
156
|
|
|
* Format message for unexpected expression |
157
|
|
|
* |
158
|
|
|
* @param string $expressionClassName Name of the unexpected expression |
159
|
|
|
* |
160
|
|
|
* @return string The formatted message |
161
|
|
|
*/ |
162
|
|
|
public static function expressionParser2UnexpectedExpression($expressionClassName) |
163
|
|
|
{ |
164
|
|
|
return "Unexpected expression of type \'$expressionClassName\' found"; |
165
|
|
|
} |
166
|
|
|
|
167
|
|
|
/** |
168
|
|
|
* Format a message to show error when expression contains sub-property access of non-primitive property. |
169
|
|
|
* |
170
|
|
|
* @return string The message |
171
|
|
|
*/ |
172
|
|
|
public static function expressionParser2NonPrimitivePropertyNotAllowed() |
173
|
|
|
{ |
174
|
|
|
return 'This data service does not support non-primitive types in the expression'; |
175
|
|
|
} |
176
|
|
|
|
177
|
|
|
/** |
178
|
|
|
* Format message for not applicable function error |
179
|
|
|
* |
180
|
|
|
* @param string $functionName The name of the function called |
181
|
|
|
* @param string $protoTypes Prototype of the functions considered |
182
|
|
|
* @param int $position Position at which function-call found |
183
|
|
|
* |
184
|
|
|
* @return string The formatted message |
185
|
|
|
*/ |
186
|
|
|
public static function expressionLexerNoApplicableFunctionsFound($functionName, |
187
|
|
|
$protoTypes, |
188
|
|
|
$position |
189
|
|
|
) { |
190
|
|
|
return "No applicable function found for '$functionName' at position $position with the specified arguments. The functions considered are: $protoTypes"; |
191
|
|
|
} |
192
|
|
|
|
193
|
|
|
/** |
194
|
|
|
* Format message for property not found error |
195
|
|
|
* |
196
|
|
|
* @param string $property The name of the property |
197
|
|
|
* @param string $type The parent type in which property searched for |
198
|
|
|
* @param int $position Position at which property mentioned |
199
|
|
|
* |
200
|
|
|
* @return string The formatted message |
201
|
|
|
*/ |
202
|
|
|
public static function expressionLexerNoPropertyInType($property, $type, $position) |
203
|
|
|
{ |
204
|
|
|
return "No property '$property' exists in type '$type' at position $position"; |
205
|
|
|
} |
206
|
|
|
|
207
|
|
|
|
208
|
|
|
/** |
209
|
|
|
* Format a message to show error when target resource property |
210
|
|
|
* argument is not null or instance of ResourceProperty |
211
|
|
|
* |
212
|
|
|
* @param string $argumentName The name of the target resource property argument |
213
|
|
|
* |
214
|
|
|
* @return string The formatted message |
215
|
|
|
*/ |
216
|
|
|
public static function resourceAssociationSetPropertyMustBeNullOrInstanceofResourceProperty($argumentName) |
217
|
|
|
{ |
218
|
|
|
return "The argument '$argumentName' must be either null or instance of 'ResourceProperty"; |
219
|
|
|
} |
220
|
|
|
|
221
|
|
|
/** |
222
|
|
|
* Format a message when a property is used as |
223
|
|
|
* navigation property of a resource type which is actually not |
224
|
|
|
* |
225
|
|
|
* @param string $propertyName Property |
226
|
|
|
* @param string $resourceTypeName Resource type |
227
|
|
|
* |
228
|
|
|
* @return string The formatted message |
229
|
|
|
*/ |
230
|
|
|
public static function resourceAssociationSetEndPropertyMustBeNavigationProperty($propertyName, $resourceTypeName) |
231
|
|
|
{ |
232
|
|
|
return "The property $propertyName must be a navigation property of the resource type $resourceTypeName"; |
233
|
|
|
} |
234
|
|
|
|
235
|
|
|
/** |
236
|
|
|
* Format a message for showing the error when a resource type is |
237
|
|
|
* not assignable to resource set |
238
|
|
|
* |
239
|
|
|
* @param string $resourceTypeName Resource type |
240
|
|
|
* @param string $resourceSetName Resource set name |
241
|
|
|
* |
242
|
|
|
* @return string The formatted message |
243
|
|
|
*/ |
244
|
|
|
public static function resourceAssociationSetEndResourceTypeMustBeAssignableToResourceSet($resourceTypeName, $resourceSetName) |
245
|
|
|
{ |
246
|
|
|
return "The resource type $resourceTypeName must be assignable to the resource set $resourceSetName"; |
247
|
|
|
} |
248
|
|
|
|
249
|
|
|
/** |
250
|
|
|
* Format a message for showing the error when trying to |
251
|
|
|
* create an association set with both null resource property |
252
|
|
|
* |
253
|
|
|
* @return string The formatted message |
254
|
|
|
*/ |
255
|
|
|
public static function resourceAssociationSetResourcePropertyCannotBeBothNull() |
256
|
|
|
{ |
257
|
|
|
return 'Both the resource property of the association set cannot be null'; |
258
|
|
|
} |
259
|
|
|
|
260
|
|
|
/** |
261
|
|
|
* Format a message for showing the error when trying to |
262
|
|
|
* create a self referencing bidirectional association |
263
|
|
|
* |
264
|
|
|
* @return string The formatted message |
265
|
|
|
*/ |
266
|
|
|
public static function resourceAssociationSetSelfReferencingAssociationCannotBeBiDirectional() |
267
|
|
|
{ |
268
|
|
|
return 'Bidirectional self referencing association is not allowed'; |
269
|
|
|
} |
270
|
|
|
|
271
|
|
|
/** |
272
|
|
|
* Format a message to show error when target resource property argument is |
273
|
|
|
* not null or instance of ResourceProperty |
274
|
|
|
* |
275
|
|
|
* @param string $argumentName The name of the target resource property argument |
276
|
|
|
* |
277
|
|
|
* @return string The formatted message |
278
|
|
|
*/ |
279
|
|
|
public static function resourceAssociationTypeEndPropertyMustBeNullOrInstanceofResourceProperty($argumentName) |
280
|
|
|
{ |
281
|
|
|
return "The argument '$argumentName' must be either null or instance of 'ResourceProperty"; |
282
|
|
|
} |
283
|
|
|
|
284
|
|
|
/** |
285
|
|
|
* Error message to show when both from and to property arguments are null |
286
|
|
|
* |
287
|
|
|
* @return string The error message |
288
|
|
|
*/ |
289
|
|
|
public static function resourceAssociationTypeEndBothPropertyCannotBeNull() |
290
|
|
|
{ |
291
|
|
|
return 'Both to and from property argument to ResourceAssociationTypeEnd constructor cannot be null'; |
292
|
|
|
} |
293
|
|
|
|
294
|
|
|
/** |
295
|
|
|
* Format a message to show error when resourceset reference is |
296
|
|
|
* used in $filter query option |
297
|
|
|
* |
298
|
|
|
* @param string $property The resourceset property used in query |
299
|
|
|
* @param string $parentProperty The parent resource of property |
300
|
|
|
* @param int $pos Postion at which resource set has been used |
301
|
|
|
* |
302
|
|
|
* @return string The formatted message |
303
|
|
|
*/ |
304
|
|
|
public static function expressionParserEntityCollectionNotAllowedInFilter($property, $parentProperty, $pos) |
305
|
|
|
{ |
306
|
|
|
return "The '$property' is an entity collection property of '$parentProperty' (position: $pos), which cannot be used in \$filter query option"; |
307
|
|
|
} |
308
|
|
|
|
309
|
|
|
/** |
310
|
|
|
* Format a message to show error when a non-integer value passed to |
311
|
|
|
* a function, which expects integer parameter |
312
|
|
|
* |
313
|
|
|
* @param mixed $argument The non-integer argument |
314
|
|
|
* @param string $functionName The name of function |
315
|
|
|
* |
316
|
|
|
* @return string The formatted message |
317
|
|
|
*/ |
318
|
|
|
public static function commonArgumentShouldBeInteger($argument, $functionName) |
319
|
|
|
{ |
320
|
|
|
return "The argument to the function '$functionName' should be integer, non-integer value '$argument' passed"; |
321
|
|
|
} |
322
|
|
|
|
323
|
|
|
/** |
324
|
|
|
* Format a message to show error when a negative value passed to a |
325
|
|
|
* function, which expects non-negative parameter |
326
|
|
|
* |
327
|
|
|
* @param mixed $argument The negative argument |
328
|
|
|
* @param string $functionName The name of function |
329
|
|
|
* |
330
|
|
|
* @return string The formatted message |
331
|
|
|
*/ |
332
|
|
|
public static function commonArgumentShouldBeNonNegative($argument, $functionName) |
333
|
|
|
{ |
334
|
|
|
return "The argument to the function '$functionName' should be non-negative, negative value '$argument' passed"; |
335
|
|
|
} |
336
|
|
|
|
337
|
|
|
/** |
338
|
|
|
* Format a message to show error when a function expect a |
339
|
|
|
* valid EdmPrimitiveType enum value, but it is not |
340
|
|
|
* |
341
|
|
|
* @param string $argumentName The argument name |
342
|
|
|
* @param string $functionName The function name |
343
|
|
|
* |
344
|
|
|
* @return string The formatted message |
345
|
|
|
*/ |
346
|
|
|
public static function commonNotValidPrimitiveEDMType($argumentName, $functionName) |
347
|
|
|
{ |
348
|
|
|
return "The argument '$argumentName' to $functionName is not a valid EdmPrimitiveType Enum value"; |
349
|
|
|
} |
350
|
|
|
/** |
351
|
|
|
* Error message to show when both page size and |
352
|
|
|
* result collection size are specified |
353
|
|
|
* |
354
|
|
|
* @return string The message |
355
|
|
|
*/ |
356
|
|
|
public static function configurationMaxResultAndPageSizeMutuallyExclusive() |
357
|
|
|
{ |
358
|
|
|
return 'Specification of \'entity set page size\' is mutually exclusive with the specification of \'maximum result per collection\' in configuration'; |
359
|
|
|
} |
360
|
|
|
|
361
|
|
|
/** |
362
|
|
|
* Format a message to show error when configuration expects a |
363
|
|
|
* name as resource set name but it is not |
364
|
|
|
* |
365
|
|
|
* @param string $name The unresolved name |
366
|
|
|
* |
367
|
|
|
* @return string The formatted message |
368
|
|
|
*/ |
369
|
|
|
public static function configurationResourceSetNameNotFound($name) |
370
|
|
|
{ |
371
|
|
|
return "The given name '$name' was not found in the entity sets"; |
372
|
|
|
} |
373
|
|
|
|
374
|
|
|
/** |
375
|
|
|
* Format a message to show error when a function argument expected to |
376
|
|
|
* EntitySetRights enum value but it is not |
377
|
|
|
* |
378
|
|
|
* @param string $argument The argument name |
379
|
|
|
* @param string $functionName The function name |
380
|
|
|
* |
381
|
|
|
* @return string The formatted message |
382
|
|
|
*/ |
383
|
|
|
public static function configurationRightsAreNotInRange($argument, $functionName) |
384
|
|
|
{ |
385
|
|
|
return "The argument '$argument' of '$functionName' should be EntitySetRights enum value"; |
386
|
|
|
} |
387
|
|
|
|
388
|
|
|
|
389
|
|
|
|
390
|
|
|
/** |
391
|
|
|
* A message to show error when service developer disabled count request and |
392
|
|
|
* client requested for count. |
393
|
|
|
* |
394
|
|
|
* @return string The message |
395
|
|
|
*/ |
396
|
|
|
public static function configurationCountNotAccepted() |
397
|
|
|
{ |
398
|
|
|
return 'The ability of the data service to return row count information is disabled. To enable this functionality, set the ServiceConfiguration.AcceptCountRequests property to true.'; |
399
|
|
|
} |
400
|
|
|
|
401
|
|
|
/** |
402
|
|
|
* Format a message to show error when a tyring to set a |
403
|
|
|
* base class for primitive type |
404
|
|
|
* |
405
|
|
|
* @return string The message |
406
|
|
|
*/ |
407
|
|
|
public static function resourceTypeNoBaseTypeForPrimitive() |
408
|
|
|
{ |
409
|
|
|
return 'Primitive type cannot have base type'; |
410
|
|
|
} |
411
|
|
|
|
412
|
|
|
/** |
413
|
|
|
* Format a message to show error when tyring to |
414
|
|
|
* set a primitive type as abstract |
415
|
|
|
* |
416
|
|
|
* @return string The message |
417
|
|
|
*/ |
418
|
|
|
public static function resourceTypeNoAbstractForPrimitive() |
419
|
|
|
{ |
420
|
|
|
return "Primitive type cannot be abstract"; |
421
|
|
|
} |
422
|
|
|
|
423
|
|
|
/** |
424
|
|
|
* Format a message to show error when a primitive instance type |
425
|
|
|
* is not IType implementation |
426
|
|
|
* |
427
|
|
|
* @param string $argument The name of instance type argument |
428
|
|
|
* |
429
|
|
|
* @return string The message |
430
|
|
|
*/ |
431
|
|
|
public static function resourceTypeTypeShouldImplementIType($argument) |
432
|
|
|
{ |
433
|
|
|
return "For primitive type the '$argument' argument should be an 'IType' implementor instance"; |
434
|
|
|
} |
435
|
|
|
|
436
|
|
|
/** |
437
|
|
|
* Format a message to show error when instance type of a |
438
|
|
|
* complex or entity type is not instance of ReflectionClass |
439
|
|
|
* |
440
|
|
|
* @param string $argument The name of instance type argument |
441
|
|
|
* |
442
|
|
|
* @return string The message |
443
|
|
|
*/ |
444
|
|
|
public static function resourceTypeTypeShouldReflectionClass($argument) |
445
|
|
|
{ |
446
|
|
|
return "For entity type the '$argument' argument should be an 'ReflectionClass' instance"; |
447
|
|
|
} |
448
|
|
|
|
449
|
|
|
/** |
450
|
|
|
* Format a message to show error when an entity type missing key properties |
451
|
|
|
* |
452
|
|
|
* @param string $entityName The name of instance type argument |
453
|
|
|
* |
454
|
|
|
* @return string The formatted message |
455
|
|
|
*/ |
456
|
|
|
public static function resourceTypeMissingKeyPropertiesForEntity($entityName) |
457
|
|
|
{ |
458
|
|
|
return "The entity type '$entityName' does not have any key properties. Please make sure the key properties are defined for this entity type"; |
459
|
|
|
} |
460
|
|
|
|
461
|
|
|
/** |
462
|
|
|
* The message to show error when trying to add |
463
|
|
|
* property to 'Primitive' resource type |
464
|
|
|
* |
465
|
|
|
* @return string The message |
466
|
|
|
*/ |
467
|
|
|
public static function resourceTypeNoAddPropertyForPrimitive() |
468
|
|
|
{ |
469
|
|
|
return 'Properties cannot be added to ResourceType instances with a ResourceTypeKind equal to \'Primitive\''; |
470
|
|
|
} |
471
|
|
|
|
472
|
|
|
/** |
473
|
|
|
* The message to show error when trying to |
474
|
|
|
* add key property to non-entity resource type |
475
|
|
|
* |
476
|
|
|
* @return string The message |
477
|
|
|
*/ |
478
|
|
|
public static function resourceTypeKeyPropertiesOnlyOnEntityTypes() |
479
|
|
|
{ |
480
|
|
|
return 'Key properties can only be added to ResourceType instances with a ResourceTypeKind equal to \'EntityType\''; |
481
|
|
|
} |
482
|
|
|
|
483
|
|
|
/** |
484
|
|
|
* The message to show error when trying to add an |
485
|
|
|
* etag property to non-entity resource type |
486
|
|
|
* |
487
|
|
|
* @return string The message |
488
|
|
|
*/ |
489
|
|
|
public static function resourceTypeETagPropertiesOnlyOnEntityTypes() |
490
|
|
|
{ |
491
|
|
|
return 'ETag properties can only be added to ResourceType instances with a ResourceTypeKind equal to \'EntityType\''; |
492
|
|
|
} |
493
|
|
|
|
494
|
|
|
/** |
495
|
|
|
* Format a message to show error for |
496
|
|
|
* duplication of resource property on resource type |
497
|
|
|
* |
498
|
|
|
* @param string $propertyName The property name |
499
|
|
|
* @param string $resourceTypeName The rtesource type name |
500
|
|
|
* |
501
|
|
|
* @return string The formatted message |
502
|
|
|
*/ |
503
|
|
|
public static function resourceTypePropertyWithSameNameAlreadyExists($propertyName, $resourceTypeName) |
504
|
|
|
{ |
505
|
|
|
return "Property with same name '$propertyName' already exists in type '$resourceTypeName'. Please make sure that there is no property with the same name defined in one of the ancestor types"; |
506
|
|
|
} |
507
|
|
|
|
508
|
|
|
/** |
509
|
|
|
* The message to show error when trying to add a key property to derived type |
510
|
|
|
* |
511
|
|
|
* @return string The message |
512
|
|
|
*/ |
513
|
|
|
public static function resourceTypeNoKeysInDerivedTypes() |
514
|
|
|
{ |
515
|
|
|
return 'Key properties cannot be defined in derived types'; |
516
|
|
|
} |
517
|
|
|
|
518
|
|
|
/** |
519
|
|
|
* The message to show error when trying to set a non-entity resource type as MLE |
520
|
|
|
* |
521
|
|
|
* @return string The message |
522
|
|
|
*/ |
523
|
|
|
public static function resourceTypeHasStreamAttributeOnlyAppliesToEntityType() |
524
|
|
|
{ |
525
|
|
|
return 'Cannot apply the HasStreamAttribute, HasStreamAttribute is only applicable to entity types'; |
526
|
|
|
} |
527
|
|
|
|
528
|
|
|
/** |
529
|
|
|
* The message to show error when trying to add a named stream on non-entity type |
530
|
|
|
* |
531
|
|
|
* @return string The message |
532
|
|
|
*/ |
533
|
|
|
public static function resourceTypeNamedStreamsOnlyApplyToEntityType() |
534
|
|
|
{ |
535
|
|
|
return 'Named streams can only be added to entity types'; |
536
|
|
|
} |
537
|
|
|
|
538
|
|
|
/** |
539
|
|
|
* Format a message to show error for |
540
|
|
|
* duplication of named stream property on resource type |
541
|
|
|
* |
542
|
|
|
* @param string $namedStreamName The named stream name |
543
|
|
|
* @param string $resourceTypeName The resource Property |
544
|
|
|
* |
545
|
|
|
* @return string The formatted message |
546
|
|
|
*/ |
547
|
|
|
public static function resourceTypeNamedStreamWithSameNameAlreadyExists($namedStreamName, $resourceTypeName) |
548
|
|
|
{ |
549
|
|
|
return "Named stream with the name '$namedStreamName' already exists in type '$resourceTypeName'. Please make sure that there is no named stream with the same name defined in one of the ancestor types"; |
550
|
|
|
} |
551
|
|
|
|
552
|
|
|
/** |
553
|
|
|
* Format a message to show error for invalid ResourcePropertyKind enum argument |
554
|
|
|
* |
555
|
|
|
* @param string $argumentName The argument name |
556
|
|
|
* |
557
|
|
|
* @return string The formatted message |
558
|
|
|
*/ |
559
|
|
|
public static function resourcePropertyInvalidKindParameter($argumentName) |
560
|
|
|
{ |
561
|
|
|
return "The argument '$argumentName' is not a valid ResourcePropertyKind enum value or valid combination of ResourcePropertyKind enum values"; |
562
|
|
|
} |
563
|
|
|
|
564
|
|
|
/** |
565
|
|
|
* Format a message to show error when ResourcePropertyKind and ResourceType's ResourceTypeKind mismatches |
566
|
|
|
* |
567
|
|
|
* @param string $resourcePropertyKindArgName The ResourcePropertyKind argument name |
568
|
|
|
* @param string $resourceTypeArgName The ResourceType argument name |
569
|
|
|
* |
570
|
|
|
* @return string The formatted message |
571
|
|
|
*/ |
572
|
|
|
public static function resourcePropertyPropertyKindAndResourceTypeKindMismatch($resourcePropertyKindArgName, $resourceTypeArgName) |
573
|
|
|
{ |
574
|
|
|
return "The '$resourcePropertyKindArgName' parameter does not match with the type of the resource type in parameter '$resourceTypeArgName'"; |
575
|
|
|
} |
576
|
|
|
|
577
|
|
|
/** |
578
|
|
|
* The error message to show when tyring to |
579
|
|
|
* associate resource set with non-entity |
580
|
|
|
* |
581
|
|
|
* @return string The message |
582
|
|
|
*/ |
583
|
|
|
public static function resourceSetContainerMustBeAssociatedWithEntityType() |
584
|
|
|
{ |
585
|
|
|
return 'The ResourceTypeKind property of a ResourceType instance associated with a ResourceSet must be equal to \'EntityType\''; |
586
|
|
|
} |
587
|
|
|
|
588
|
|
|
/** |
589
|
|
|
* The error message to show when IQueryProvider::getExpressionProvider |
590
|
|
|
* method returns empty or null |
591
|
|
|
* |
592
|
|
|
* @return string The message |
593
|
|
|
*/ |
594
|
|
|
public static function providersWrapperExpressionProviderMustNotBeNullOrEmpty() |
595
|
|
|
{ |
596
|
|
|
return 'The value returned by IQueryProvider::getExpressionProvider method must not be null or empty'; |
597
|
|
|
} |
598
|
|
|
|
599
|
|
|
/** |
600
|
|
|
* The error message to show when IQueryProvider::getExpressionProvider |
601
|
|
|
* method returns non-object or an object which does not implement IExpressionProvider |
602
|
|
|
* |
603
|
|
|
* @return string The message |
604
|
|
|
*/ |
605
|
|
|
public static function providersWrapperInvalidExpressionProviderInstance() |
606
|
|
|
{ |
607
|
|
|
return 'The value returned by IQueryProvider::getExpressionProvider method must be an implementation of IExpressionProvider'; |
608
|
|
|
} |
609
|
|
|
|
610
|
|
|
/** |
611
|
|
|
* The error message to show when IMetadataProvider::getContainerName |
612
|
|
|
* method returns empty container name |
613
|
|
|
* |
614
|
|
|
* @return string The message |
615
|
|
|
*/ |
616
|
|
|
public static function providersWrapperContainerNameMustNotBeNullOrEmpty() |
617
|
|
|
{ |
618
|
|
|
return 'The value returned by IMetadataProvider::getContainerName method must not be null or empty'; |
619
|
|
|
} |
620
|
|
|
|
621
|
|
|
/** |
622
|
|
|
* The error message to show when |
623
|
|
|
* IMetadataProvider::getContainerNamespace |
624
|
|
|
* method returns empty container name |
625
|
|
|
* |
626
|
|
|
* @return string The message |
627
|
|
|
*/ |
628
|
|
|
public static function providersWrapperContainerNamespaceMustNotBeNullOrEmpty() |
629
|
|
|
{ |
630
|
|
|
return 'The value returned by IMetadataProvider::getContainerNamespace method must not be null or empty'; |
631
|
|
|
} |
632
|
|
|
|
633
|
|
|
/** |
634
|
|
|
* Format a message to show error when |
635
|
|
|
* more than one entity set with the same name found |
636
|
|
|
* |
637
|
|
|
* @param string $entitySetName The name of the entity set |
638
|
|
|
* |
639
|
|
|
* @return string The formatted message |
640
|
|
|
*/ |
641
|
|
|
public static function providersWrapperEntitySetNameShouldBeUnique($entitySetName) |
642
|
|
|
{ |
643
|
|
|
return "More than one entity set with the name '$entitySetName' was found. Entity set names must be unique"; |
644
|
|
|
} |
645
|
|
|
|
646
|
|
|
/** |
647
|
|
|
* Format a message to show error when |
648
|
|
|
* more than one entity type with the same name found |
649
|
|
|
* |
650
|
|
|
* @param string $entityTypeName The name of the entity type |
651
|
|
|
* |
652
|
|
|
* @return string The formatted message |
653
|
|
|
*/ |
654
|
|
|
public static function providersWrapperEntityTypeNameShouldBeUnique($entityTypeName) |
655
|
|
|
{ |
656
|
|
|
return "More than one entity type with the name '$entityTypeName' was found. Entity type names must be unique."; |
657
|
|
|
} |
658
|
|
|
|
659
|
|
|
/** |
660
|
|
|
* Format a message to show error when IDSMP::getResourceSet |
661
|
|
|
* returns inconsistent instance of ResourceSet |
662
|
|
|
* |
663
|
|
|
* @param string $resourceSetName Name of the resource set |
664
|
|
|
* @param string $resourceTypeName Name of the resource type |
665
|
|
|
* @param string $resourcePropertyName Name of the navigation property |
666
|
|
|
* |
667
|
|
|
* @return string The formatted message |
668
|
|
|
*/ |
669
|
|
|
public static function providersWrapperIDSMPGetResourceSetReturnsInvalidResourceSet($resourceSetName, $resourceTypeName, $resourcePropertyName) |
670
|
|
|
{ |
671
|
|
|
return "IDSMP::GetResourceSet retruns invalid instance of ResourceSet when invoked with params {ResourceSet with name $resourceSetName, ResourceType with name $resourceTypeName, ResourceProperty with name $resourcePropertyName}."; |
672
|
|
|
} |
673
|
|
|
|
674
|
|
|
/** |
675
|
|
|
* |
676
|
|
|
* @param string $methodName method name |
677
|
|
|
* |
678
|
|
|
* @return string The message |
679
|
|
|
*/ |
680
|
|
|
public static function queryProviderReturnsNonQueryResult($methodName) |
681
|
|
|
{ |
682
|
|
|
return "The implementation of the method $methodName must return a QueryResult instance."; |
683
|
|
|
} |
684
|
|
|
|
685
|
|
|
|
686
|
|
|
/** |
687
|
|
|
* |
688
|
|
|
* @param string $methodName method name |
689
|
|
|
* @param QueryType $queryType |
690
|
|
|
* |
691
|
|
|
* @return string The message |
692
|
|
|
*/ |
693
|
|
|
public static function queryProviderResultCountMissing($methodName, QueryType $queryType) |
694
|
|
|
{ |
695
|
|
|
return "The implementation of the method $methodName must return a QueryResult instance with a count for queries of type $queryType."; |
696
|
|
|
} |
697
|
|
|
|
698
|
|
|
|
699
|
|
|
/** |
700
|
|
|
* |
701
|
|
|
* @param string $methodName method name |
702
|
|
|
* @param QueryType $queryType |
703
|
|
|
* |
704
|
|
|
* @return string The message |
705
|
|
|
*/ |
706
|
|
|
public static function queryProviderResultsMissing($methodName, QueryType $queryType) |
707
|
|
|
{ |
708
|
|
|
return "The implementation of the method $methodName must return a QueryResult instance with an array of results for queries of type $queryType."; |
709
|
|
|
} |
710
|
|
|
|
711
|
|
|
/** |
712
|
|
|
* Format a message to show error when IDSMP::getResourceFromResourceSet |
713
|
|
|
* returns an instnce which is not an instance of expected entity instance. |
714
|
|
|
* |
715
|
|
|
* @param string $entityTypeName The name of expected entity type. |
716
|
|
|
* @param string $methodName Method name |
717
|
|
|
* |
718
|
|
|
* @return string The formatted message |
719
|
|
|
*/ |
720
|
|
|
public static function providersWrapperIDSQPMethodReturnsUnExpectedType($entityTypeName, $methodName) |
721
|
|
|
{ |
722
|
|
|
return 'The implementation of the method ' . $methodName . ' must return an instance of type described by resource set\'s type(' . $entityTypeName .') or null if resource does not exists'; |
723
|
|
|
} |
724
|
|
|
|
725
|
|
|
/** |
726
|
|
|
* A message to show error when IDSQP::getResourceFromResourceSet |
727
|
|
|
* returns an entity instance with null key properties. |
728
|
|
|
* |
729
|
|
|
* @param string $methodName Method name |
730
|
|
|
* |
731
|
|
|
* @return string The message |
732
|
|
|
*/ |
733
|
|
|
public static function providersWrapperIDSQPMethodReturnsInstanceWithNullKeyProperties($methodName) |
734
|
|
|
{ |
735
|
|
|
return 'The ' . $methodName . ' implementation returns an entity with null key propert(y|ies)'; |
736
|
|
|
} |
737
|
|
|
|
738
|
|
|
/** |
739
|
|
|
* A message to show error when IDSQP::getResourceFromResourceSet |
740
|
|
|
* returns an entity instance with keys |
741
|
|
|
* not matching with the expected keys in the uri predicate. |
742
|
|
|
* |
743
|
|
|
* @param string $methodName Method name |
744
|
|
|
* |
745
|
|
|
* @return string The message |
746
|
|
|
*/ |
747
|
|
|
public static function providersWrapperIDSQPMethodReturnsInstanceWithNonMatchingKeys($methodName) |
748
|
|
|
{ |
749
|
|
|
return 'The ' . $methodName . ' implementation returns an instance with non-matching key'; |
750
|
|
|
} |
751
|
|
|
|
752
|
|
|
/** |
753
|
|
|
* The error message to show for invalid navigation resource type |
754
|
|
|
* |
755
|
|
|
* @return string The message |
756
|
|
|
*/ |
757
|
|
|
public static function navigationInvalidResourceType() |
758
|
|
|
{ |
759
|
|
|
return 'Only possible Navigation types are Complex and Entity'; |
760
|
|
|
} |
761
|
|
|
|
762
|
|
|
/** |
763
|
|
|
* Format a message to show error when actual number of key values given |
764
|
|
|
* in the key predicate is not matching with the expected number of key values |
765
|
|
|
* |
766
|
|
|
* @param string $segment The segment with key predicate in question |
767
|
|
|
* @param int $expectedCount The expected number of key values |
768
|
|
|
* @param int $actualCount The actual number of key values |
769
|
|
|
* |
770
|
|
|
* @return string The formatted message |
771
|
|
|
*/ |
772
|
|
|
public static function keyDescriptorKeyCountNotMatching($segment, $expectedCount, $actualCount) |
773
|
|
|
{ |
774
|
|
|
return "The predicate in the segment '$segment' expect $expectedCount keys but $actualCount provided"; |
775
|
|
|
} |
776
|
|
|
|
777
|
|
|
/** |
778
|
|
|
* Format a message to show error when a required key is |
779
|
|
|
* missing from key predicate of a segment |
780
|
|
|
* |
781
|
|
|
* @param string $segment The segment with key predicate in question |
782
|
|
|
* @param string $expectedKeys The keys expected by the predicate |
783
|
|
|
* |
784
|
|
|
* @return string The formatted message |
785
|
|
|
*/ |
786
|
|
|
public static function keyDescriptorMissingKeys($segment, $expectedKeys) |
787
|
|
|
{ |
788
|
|
|
return "Missing keys in key predicate for the segment '$segment'. The key predicate expect the keys '$expectedKeys'"; |
789
|
|
|
} |
790
|
|
|
|
791
|
|
|
/** |
792
|
|
|
* Format a message to show error when type of a key given in the |
793
|
|
|
* predicate with named key values does not compatible with the expected type |
794
|
|
|
* |
795
|
|
|
* @param string $segment The segment with key predicate in question |
796
|
|
|
* @param string $keyProperty Name of the key in question |
797
|
|
|
* @param string $expectedType Expected type of the key |
798
|
|
|
* @param string $actualType Actual type of the key |
799
|
|
|
* |
800
|
|
|
* @return string The formatted message |
801
|
|
|
*/ |
802
|
|
|
public static function keyDescriptorInCompatibleKeyType($segment, $keyProperty, $expectedType, $actualType) |
803
|
|
|
{ |
804
|
|
|
return "Syntax error in the segment '$segment'. The value of key property '$keyProperty' should be of type " . $expectedType . ", given " . $actualType; |
805
|
|
|
} |
806
|
|
|
|
807
|
|
|
/** |
808
|
|
|
* Format a message to show error when type of a key given in the predicate |
809
|
|
|
* with positional key values does not compatible with the expected type |
810
|
|
|
* |
811
|
|
|
* @param String $segment The segment with key predicate in question |
812
|
|
|
* @param String $keyProperty The Key property |
813
|
|
|
* @param Int $position The position of key |
814
|
|
|
* @param String $expectedType Expected type of the key |
815
|
|
|
* @param String $actualType Actual type of the key |
816
|
|
|
* |
817
|
|
|
* @return string The formatted message |
818
|
|
|
*/ |
819
|
|
|
public static function keyDescriptorInCompatibleKeyTypeAtPosition($segment, $keyProperty, $position, $expectedType, $actualType) |
820
|
|
|
{ |
821
|
|
|
return "Syntax error in the segment '$segment'. The value of key property '$keyProperty' at position $position should be of type " . $expectedType . ", given " . $actualType; |
822
|
|
|
} |
823
|
|
|
|
824
|
|
|
/** |
825
|
|
|
* Format a message to show error when trying to access |
826
|
|
|
* KeyDescriptor::_validatedNamedValues before |
827
|
|
|
* invoking KeyDescriptor::validate function |
828
|
|
|
* |
829
|
|
|
* @return string The message |
830
|
|
|
*/ |
831
|
|
|
public static function keyDescriptorValidateNotCalled() |
832
|
|
|
{ |
833
|
|
|
return "Invoking KeyDescriptor::getValidatedNamedValues requires KeyDescriptor::validate to be called before"; |
834
|
|
|
} |
835
|
|
|
|
836
|
|
|
/** |
837
|
|
|
* Message to show error when there is a syntax error in the query |
838
|
|
|
* |
839
|
|
|
* @return string The message |
840
|
|
|
*/ |
841
|
|
|
public static function syntaxError() |
842
|
|
|
{ |
843
|
|
|
return 'Bad Request - Error in query syntax'; |
844
|
|
|
} |
845
|
|
|
|
846
|
|
|
/** |
847
|
|
|
* Format a message to show error when given url is malformed |
848
|
|
|
* |
849
|
|
|
* @param string $url The malformed url |
850
|
|
|
* |
851
|
|
|
* @return string The formatted message |
852
|
|
|
*/ |
853
|
|
|
public static function urlMalformedUrl($url) |
854
|
|
|
{ |
855
|
|
|
return "Bad Request - The url '$url' is malformed"; |
856
|
|
|
} |
857
|
|
|
|
858
|
|
|
/** |
859
|
|
|
* Format a message to show error when segment with |
860
|
|
|
* multiple positional keys present in the request uri |
861
|
|
|
* |
862
|
|
|
* @param string $segment The segment with multiple positional keys |
863
|
|
|
* |
864
|
|
|
* @return string The formatted message |
865
|
|
|
*/ |
866
|
|
|
public static function segmentParserKeysMustBeNamed($segment) |
867
|
|
|
{ |
868
|
|
|
return "Segments with multiple key values must specify them in 'name=value' form. For the segment $segment use named keys"; |
869
|
|
|
} |
870
|
|
|
|
871
|
|
|
/** |
872
|
|
|
* Format a message to show error when a leaft segment |
873
|
|
|
* ($batch, $value, $metadata, $count, a bag property, |
874
|
|
|
* a named media resource or void service operation) is followed by a segment |
875
|
|
|
* |
876
|
|
|
* @param string $leafSegment The leaf segment |
877
|
|
|
* |
878
|
|
|
* @return string The formatted message |
879
|
|
|
*/ |
880
|
|
|
public static function segmentParserMustBeLeafSegment($leafSegment) |
881
|
|
|
{ |
882
|
|
|
return "The request URI is not valid. The segment '$leafSegment' must be the last segment in the URI because it is one of the following: \$batch, \$value, \$metadata, \$count, a bag property, a named media resource, or a service operation that does not return a value."; |
883
|
|
|
} |
884
|
|
|
|
885
|
|
|
/** |
886
|
|
|
* Format a message to show error when a segment follows a post link segment |
887
|
|
|
* |
888
|
|
|
* @param string $postPostLinkSegment The segment following post link segment |
889
|
|
|
* |
890
|
|
|
* @return string The formatted message |
891
|
|
|
*/ |
892
|
|
|
public static function segmentParserNoSegmentAllowedAfterPostLinkSegment($postPostLinkSegment) |
893
|
|
|
{ |
894
|
|
|
return "The request URI is not valid. The segment '$postPostLinkSegment' is not valid. Since the uri contains the \$links segment, there must be only one segment specified after that."; |
895
|
|
|
} |
896
|
|
|
|
897
|
|
|
/** |
898
|
|
|
* Format a message to show error when a segment otherthan |
899
|
|
|
* $value is followed by primitive segment |
900
|
|
|
* |
901
|
|
|
* @param string $segment The segment follows |
902
|
|
|
* primitive property segment |
903
|
|
|
* @param string $primitivePropertySegment The primitive property segment |
904
|
|
|
* |
905
|
|
|
* @return string The formatted message |
906
|
|
|
*/ |
907
|
|
|
public static function segmentParserOnlyValueSegmentAllowedAfterPrimitivePropertySegment($segment, $primitivePropertySegment) |
908
|
|
|
{ |
909
|
|
|
return "The segment '$segment' in the request URI is not valid. Since the segment '$primitivePropertySegment' refers to a primitive type property, the only supported value from the next segment is '\$value'."; |
910
|
|
|
} |
911
|
|
|
|
912
|
|
|
/** |
913
|
|
|
* Format a message to show error when try to query a collection segment |
914
|
|
|
* |
915
|
|
|
* @param string $collectionSegment The segment representing collection |
916
|
|
|
* |
917
|
|
|
* @return string The formatted message |
918
|
|
|
*/ |
919
|
|
|
public static function segmentParserCannotQueryCollection($collectionSegment) |
920
|
|
|
{ |
921
|
|
|
return "The request URI is not valid. Since the segment '$collectionSegment' refers to a collection, this must be the last segment in the request URI. All intermediate segments must refer to a single resource."; |
922
|
|
|
} |
923
|
|
|
|
924
|
|
|
/** |
925
|
|
|
* Format a message to show error when a count segment is followed by singleton |
926
|
|
|
* |
927
|
|
|
* @param string $segment The singleton segment |
928
|
|
|
* |
929
|
|
|
* @return string The formatted message |
930
|
|
|
*/ |
931
|
|
|
public static function segmentParserCountCannotFollowSingleton($segment) |
932
|
|
|
{ |
933
|
|
|
return "The request URI is not valid, since the segment '$segment' refers to a singleton, and the segment '\$count' can only follow a resource collection."; |
934
|
|
|
} |
935
|
|
|
|
936
|
|
|
/** |
937
|
|
|
* Format a message to show error when a link segment is |
938
|
|
|
* followed by non-entity segment |
939
|
|
|
* |
940
|
|
|
* @param string $segment The segment follows primitive property segment |
941
|
|
|
* |
942
|
|
|
* @return string The formatted message |
943
|
|
|
*/ |
944
|
|
|
public static function segmentParserLinkSegmentMustBeFollowedByEntitySegment($segment) |
945
|
|
|
{ |
946
|
|
|
return "The request URI is not valid. The segment '$segment' must refer to a navigation property since the previous segment identifier is '\$links'."; |
947
|
|
|
} |
948
|
|
|
|
949
|
|
|
/** |
950
|
|
|
* A message to show error when no segment follows a link segment |
951
|
|
|
* |
952
|
|
|
* @return string The message |
953
|
|
|
*/ |
954
|
|
|
public static function segmentParserMissingSegmentAfterLink() |
955
|
|
|
{ |
956
|
|
|
return "The request URI is not valid. There must a segment specified after the '\$links' segment and the segment must refer to a entity resource."; |
957
|
|
|
} |
958
|
|
|
|
959
|
|
|
/** |
960
|
|
|
* Format a message to show error when a segment |
961
|
|
|
* found on the root which cannot be applied on root |
962
|
|
|
* |
963
|
|
|
* @param string $segment The segment found |
964
|
|
|
* |
965
|
|
|
* @return string The formatted message |
966
|
|
|
*/ |
967
|
|
|
public static function segmentParserSegmentNotAllowedOnRoot($segment) |
968
|
|
|
{ |
969
|
|
|
return "The request URI is not valid, the segment '$segment' cannot be applied to the root of the service"; |
970
|
|
|
} |
971
|
|
|
|
972
|
|
|
/** |
973
|
|
|
* Message to show error when there is a inconsistency while parsing segments |
974
|
|
|
* |
975
|
|
|
* @return string The message |
976
|
|
|
*/ |
977
|
|
|
public static function segmentParserInconsistentTargetKindState() |
978
|
|
|
{ |
979
|
|
|
return "Paring of segments failed for inconsistent target kind state, contact provider"; |
980
|
|
|
} |
981
|
|
|
|
982
|
|
|
/** |
983
|
|
|
* Format a message to show error when expecting a |
984
|
|
|
* property kind not found while paring segments |
985
|
|
|
* |
986
|
|
|
* @param string $expectedKind The exptected property kind as string |
987
|
|
|
* |
988
|
|
|
* @return string |
989
|
|
|
*/ |
990
|
|
|
public static function segmentParserUnExpectedPropertyKind($expectedKind) |
991
|
|
|
{ |
992
|
|
|
return "Paring of segments failed expecting $expectedKind, contact provider"; |
993
|
|
|
} |
994
|
|
|
|
995
|
|
|
/** |
996
|
|
|
* Format a message to show error when trying to apply count on non-resource |
997
|
|
|
* |
998
|
|
|
* @param string $segment The non-resource segment |
999
|
|
|
* |
1000
|
|
|
* @return string The message |
1001
|
|
|
*/ |
1002
|
|
|
public static function segmentParserCountCannotBeApplied($segment) |
1003
|
|
|
{ |
1004
|
|
|
return "The request URI is not valid, \$count cannot be applied to the segment '$segment' since \$count can only follow a resource segment."; |
1005
|
|
|
} |
1006
|
|
|
|
1007
|
|
|
/** |
1008
|
|
|
* Format a message to show error when a resource not found |
1009
|
|
|
* |
1010
|
|
|
* @param string $segment The segment follows primitive property segment |
1011
|
|
|
* |
1012
|
|
|
* @return string The formatted message |
1013
|
|
|
*/ |
1014
|
|
|
public static function uriProcessorResourceNotFound($segment) |
1015
|
|
|
{ |
1016
|
|
|
return "Resource not found for the segment '$segment'"; |
1017
|
|
|
} |
1018
|
|
|
|
1019
|
|
|
/** |
1020
|
|
|
* The message to show error when trying to |
1021
|
|
|
* access a resourceset which is forbidden |
1022
|
|
|
* |
1023
|
|
|
* @return string The message |
1024
|
|
|
*/ |
1025
|
|
|
public static function uriProcessorForbidden() |
1026
|
|
|
{ |
1027
|
|
|
return 'Forbidden'; |
1028
|
|
|
} |
1029
|
|
|
|
1030
|
|
|
/** |
1031
|
|
|
* A message to show error when |
1032
|
|
|
* IMetadataProvider::GetResourceAssociationSet() returns different |
1033
|
|
|
* AssociationSet when called with 'ResourceAssociationSetEnd' instances that |
1034
|
|
|
* are expected to the ends of same association set. |
1035
|
|
|
* |
1036
|
|
|
* @return string The error message |
1037
|
|
|
*/ |
1038
|
|
|
public static function metadataAssociationTypeSetBidirectionalAssociationMustReturnSameResourceAssociationSetFromBothEnd() |
1039
|
|
|
{ |
1040
|
|
|
return 'When the ResourceAssociationSet is bidirectional, IMetadataProvider::getResourceAssociationSet() must return the same ResourceAssociationSet when call from both ends.'; |
1041
|
|
|
} |
1042
|
|
|
|
1043
|
|
|
/** |
1044
|
|
|
* Format a message to show error when multiple ResourceAssociationSets |
1045
|
|
|
* have a ResourceAssociationSetEnd referring to the |
1046
|
|
|
* same EntitySet through the same AssociationType. |
1047
|
|
|
* |
1048
|
|
|
* @param string $resourceSet1Name Name of the first association set |
1049
|
|
|
* @param string $resourceSet2Name Name of the second association set |
1050
|
|
|
* @param string $entitySetName Name of the entity set |
1051
|
|
|
* |
1052
|
|
|
* @return string The formatted message |
1053
|
|
|
*/ |
1054
|
|
|
public static function metadataAssociationTypeSetMultipleAssociationSetsForTheSameAssociationTypeMustNotReferToSameEndSets($resourceSet1Name, $resourceSet2Name, $entitySetName) |
1055
|
|
|
{ |
1056
|
|
|
return "ResourceAssociationSets '$resourceSet1Name' and '$resourceSet2Name' have a ResourceAssociationSetEnd referring to the same EntitySet '$entitySetName' through the same AssociationType. Make sure that if two or more AssociationSets refer to the same AssociationType, the ends must not refer to the same EntitySet. (this could happen if multiple entity sets have entity types that have a common ancestor and the ancestor has a property of derived entity types)"; |
1057
|
|
|
} |
1058
|
|
|
|
1059
|
|
|
/** |
1060
|
|
|
* Format a message to show error when IDSMP::getDerivedTypes returns a |
1061
|
|
|
* type which is not null or array of ResourceType |
1062
|
|
|
* |
1063
|
|
|
* @param string $resourceTypeName Resource type name |
1064
|
|
|
* |
1065
|
|
|
* @return string The formatted message |
1066
|
|
|
*/ |
1067
|
|
|
public static function metadataAssociationTypeSetInvalidGetDerivedTypesReturnType($resourceTypeName) |
1068
|
|
|
{ |
1069
|
|
|
return "Return type of IDSMP::getDerivedTypes should be either null or array of 'ResourceType', check implementation of IDSMP::getDerivedTypes for the resource type '$resourceTypeName'."; |
1070
|
|
|
} |
1071
|
|
|
|
1072
|
|
|
/** |
1073
|
|
|
* Format a message to show error when entity type of an entity set has a |
1074
|
|
|
* derived type with named stream property(ies). |
1075
|
|
|
* |
1076
|
|
|
* @param string $entitySetName The entity set name |
1077
|
|
|
* @param string $derivedTypeName The full name of the derived type |
1078
|
|
|
* |
1079
|
|
|
* @return string The formatted message |
1080
|
|
|
*/ |
1081
|
|
|
public static function metadataResourceTypeSetNamedStreamsOnDerivedEntityTypesNotSupported($entitySetName, $derivedTypeName) |
1082
|
|
|
{ |
1083
|
|
|
return "Named streams are not supported on derived entity types. Entity Set '$entitySetName' has a instance of type '$derivedTypeName', which is an derived entity type and has named streams. Please remove all named streams from type '$derivedTypeName'."; |
1084
|
|
|
} |
1085
|
|
|
|
1086
|
|
|
/** |
1087
|
|
|
* Format a message to show error when complex type having derived type |
1088
|
|
|
* is used as item type of a bag property |
1089
|
|
|
* |
1090
|
|
|
* @param string $complexTypeName The name of the bag's complex type |
1091
|
|
|
* having derived type |
1092
|
|
|
* |
1093
|
|
|
* @return string The formatted message |
1094
|
|
|
*/ |
1095
|
|
|
public static function metadataResourceTypeSetBagOfComplexTypeWithDerivedTypes($complexTypeName) |
1096
|
|
|
{ |
1097
|
|
|
return "Complex type '$complexTypeName' has derived types and is used as the item type in a bag. Only bags containing complex types without derived types are supported."; |
1098
|
|
|
} |
1099
|
|
|
|
1100
|
|
|
/** |
1101
|
|
|
* Message to show error when expecting entity or |
1102
|
|
|
* complex type, but a different type found |
1103
|
|
|
* |
1104
|
|
|
* @return string The error message |
1105
|
|
|
*/ |
1106
|
|
|
public static function metadataWriterExpectingEntityOrComplexResourceType() |
1107
|
|
|
{ |
1108
|
|
|
return 'Unexpected resource type found, expecting either ResourceTypeKind::ENTITY or ResourceTypeKind::COMPLEX'; |
1109
|
|
|
} |
1110
|
|
|
|
1111
|
|
|
/** |
1112
|
|
|
* Format a message to show error when no association set |
1113
|
|
|
* found for a navigation property |
1114
|
|
|
* |
1115
|
|
|
* @param string $navigationPropertyName The name of the navigation property. |
1116
|
|
|
* @param string $resourceTypeName The resource type on which the |
1117
|
|
|
* navigation property is defined. |
1118
|
|
|
* |
1119
|
|
|
* @return string The formatted message |
1120
|
|
|
*/ |
1121
|
|
|
public static function metadataWriterNoResourceAssociationSetForNavigationProperty($navigationPropertyName, $resourceTypeName) |
1122
|
|
|
{ |
1123
|
|
|
return "No visible ResourceAssociationSet found for navigation property '$navigationPropertyName' on type '$resourceTypeName'. There must be at least one ResourceAssociationSet for each navigation property."; |
1124
|
|
|
} |
1125
|
|
|
|
1126
|
|
|
/** |
1127
|
|
|
* Message to show error when type of 'ExpandedProjectionNode::addNode' |
1128
|
|
|
* parameter is neither ProjectionNode nor ExpandedProjectionNode |
1129
|
|
|
* |
1130
|
|
|
* @return string The error message |
1131
|
|
|
*/ |
1132
|
|
|
public static function expandedProjectionNodeArgumentTypeShouldBeProjection() |
1133
|
|
|
{ |
1134
|
|
|
return 'The argument to ExpandedProjectionNode::addNode should be either ProjectionNode or ExpandedProjectionNode'; |
1135
|
|
|
} |
1136
|
|
|
|
1137
|
|
|
/** |
1138
|
|
|
* Format a message to show error when parser failed to |
1139
|
|
|
* resolve a property in select or expand path |
1140
|
|
|
* |
1141
|
|
|
* @param string $resourceTypeName The name of resource type |
1142
|
|
|
* @param string $propertyName Sub path segment, that comes after |
1143
|
|
|
* the segment of type $resourceTypeName |
1144
|
|
|
* @param boolean $isSelect True if error found while parsing select |
1145
|
|
|
* clause, false for expand |
1146
|
|
|
* |
1147
|
|
|
* @return string The formatted message |
1148
|
|
|
*/ |
1149
|
|
|
public static function expandProjectionParserPropertyNotFound($resourceTypeName, $propertyName, $isSelect) |
1150
|
|
|
{ |
1151
|
|
|
$clause = $isSelect ? 'select' : 'expand'; |
1152
|
|
|
return "Error in the $clause clause. Type '$resourceTypeName' does not have a property named '$propertyName'."; |
1153
|
|
|
} |
1154
|
|
|
|
1155
|
|
|
/** |
1156
|
|
|
* Format a message to show error when expand path |
1157
|
|
|
* contain non-navigation property. |
1158
|
|
|
* |
1159
|
|
|
* @param string $resourceTypeName The resource type name |
1160
|
|
|
* @param string $propertyName The proeprty name |
1161
|
|
|
* |
1162
|
|
|
* @return string The formatted message |
1163
|
|
|
*/ |
1164
|
|
|
public static function expandProjectionParserExpandCanOnlyAppliedToEntity($resourceTypeName, $propertyName) |
1165
|
|
|
{ |
1166
|
|
|
return "Error in the expand clause. Expand path can contain only navigation property, the property '$propertyName' defined in '$resourceTypeName' is not a navigation property"; |
1167
|
|
|
} |
1168
|
|
|
|
1169
|
|
|
/** |
1170
|
|
|
* Format a message to show error when a primitive property is used as |
1171
|
|
|
* navigation property in select clause |
1172
|
|
|
* |
1173
|
|
|
* @param string $resourceTypeName The resource type on which the |
1174
|
|
|
* primitive property defined |
1175
|
|
|
* @param string $primitvePropertyName The primitive property used as |
1176
|
|
|
* navigation property |
1177
|
|
|
* |
1178
|
|
|
* @return string The formatted message |
1179
|
|
|
*/ |
1180
|
|
|
public static function expandProjectionParserPrimitivePropertyUsedAsNavigationProperty($resourceTypeName, $primitvePropertyName) |
1181
|
|
|
{ |
1182
|
|
|
return "Property '$primitvePropertyName' on type '$resourceTypeName' is of primitive type and cannot be used as a navigation property."; |
1183
|
|
|
} |
1184
|
|
|
|
1185
|
|
|
/** |
1186
|
|
|
* Format a message to show error when a complex type is used as |
1187
|
|
|
* navigation property in select clause |
1188
|
|
|
* |
1189
|
|
|
* @param string $resourceTypeName The name of the resource type on which |
1190
|
|
|
* complex property is defined |
1191
|
|
|
* @param string $complextTypeName The name of complex type |
1192
|
|
|
* |
1193
|
|
|
* @return string The formatted message |
1194
|
|
|
*/ |
1195
|
|
|
public static function expandProjectionParserComplexPropertyAsInnerSelectSegment($resourceTypeName, $complextTypeName) |
1196
|
|
|
{ |
1197
|
|
|
return "select doesn't support selection of properties of complex type. The property '$complextTypeName' on type '$resourceTypeName' is a complex type."; |
1198
|
|
|
} |
1199
|
|
|
|
1200
|
|
|
/** |
1201
|
|
|
* Format a message to show error when a bag type is used as |
1202
|
|
|
* navigation property in select clause |
1203
|
|
|
* |
1204
|
|
|
* @param string $resourceTypeName The name of the resource type on which |
1205
|
|
|
* bag property is defined |
1206
|
|
|
* @param string $bagPropertyName The name of the bag property |
1207
|
|
|
* |
1208
|
|
|
* @return string The formatted message |
1209
|
|
|
*/ |
1210
|
|
|
public static function expandProjectionParserBagPropertyAsInnerSelectSegment($resourceTypeName, $bagPropertyName) |
1211
|
|
|
{ |
1212
|
|
|
return "The selection from property '$bagPropertyName' on type '$resourceTypeName' is not valid. The select query option does not support selection items from a bag property."; |
1213
|
|
|
} |
1214
|
|
|
|
1215
|
|
|
/** |
1216
|
|
|
* Message to show error when parser come across a type which is expected |
1217
|
|
|
* to be Entity type, but actually it is not |
1218
|
|
|
* |
1219
|
|
|
* @return string The message |
1220
|
|
|
*/ |
1221
|
|
|
public static function expandProjectionParserUnexpectedPropertyType() |
1222
|
|
|
{ |
1223
|
|
|
return 'Property type unexpected, expecting navigation property (ResourceReference or ResourceTypeReference).'; |
1224
|
|
|
} |
1225
|
|
|
|
1226
|
|
|
/** |
1227
|
|
|
* Format a message to show error when found selection traversal of a |
1228
|
|
|
* navigation property with out expansion |
1229
|
|
|
* |
1230
|
|
|
* @param string $propertyName The navigation property in select path |
1231
|
|
|
* which is not in expand path |
1232
|
|
|
* |
1233
|
|
|
* @return string The formatted message |
1234
|
|
|
*/ |
1235
|
|
|
public static function expandProjectionParserPropertyWithoutMatchingExpand($propertyName) |
1236
|
|
|
{ |
1237
|
|
|
return 'Only navigation properties specified in expand option can be travered in select option,In order to treaverse the navigation property \'' . $propertyName . '\', it should be first expanded'; |
1238
|
|
|
} |
1239
|
|
|
|
1240
|
|
|
/** |
1241
|
|
|
* Message to show error when the orderByPathSegments argument found as |
1242
|
|
|
* not a non-empty array |
1243
|
|
|
* |
1244
|
|
|
* @return string The message |
1245
|
|
|
*/ |
1246
|
|
|
public static function orderByInfoPathSegmentsArgumentShouldBeNonEmptyArray() |
1247
|
|
|
{ |
1248
|
|
|
return 'The argument orderByPathSegments should be a non-empty array'; |
1249
|
|
|
} |
1250
|
|
|
|
1251
|
|
|
/** |
1252
|
|
|
* Message to show error when the navigationPropertiesUsedInTheOrderByClause |
1253
|
|
|
* argument found as neither null or a non-empty array |
1254
|
|
|
* |
1255
|
|
|
* @return string The message |
1256
|
|
|
*/ |
1257
|
|
|
public static function orderByInfoNaviUsedArgumentShouldBeNullOrNonEmptyArray() |
1258
|
|
|
{ |
1259
|
|
|
return 'The argument navigationPropertiesUsedInTheOrderByClause should be either null or a non-empty array'; |
1260
|
|
|
} |
1261
|
|
|
|
1262
|
|
|
/** |
1263
|
|
|
* Message to show error when the orderBySubPathSegments argument found as |
1264
|
|
|
* not a non-empty array |
1265
|
|
|
* |
1266
|
|
|
* @return string The message |
1267
|
|
|
*/ |
1268
|
|
|
public static function orderByPathSegmentOrderBySubPathSegmentArgumentShouldBeNonEmptyArray() |
1269
|
|
|
{ |
1270
|
|
|
return 'The argument orderBySubPathSegments should be a non-empty array'; |
1271
|
|
|
} |
1272
|
|
|
|
1273
|
|
|
/** |
1274
|
|
|
* Format a message to show error when parser failed to resolve a |
1275
|
|
|
* property in orderby path |
1276
|
|
|
* |
1277
|
|
|
* @param string $resourceTypeName The name of resource type |
1278
|
|
|
* @param string $propertyName Sub path segment, that comes after the |
1279
|
|
|
* segment of type $resourceTypeName |
1280
|
|
|
* |
1281
|
|
|
* @return string The formatted message |
1282
|
|
|
*/ |
1283
|
|
|
public static function orderByParserPropertyNotFound($resourceTypeName, $propertyName) |
1284
|
|
|
{ |
1285
|
|
|
return "Error in the 'orderby' clause. Type '$resourceTypeName' does not have a property named '$propertyName'."; |
1286
|
|
|
} |
1287
|
|
|
|
1288
|
|
|
/** |
1289
|
|
|
* Format a message to show error when found a bag property used |
1290
|
|
|
* in orderby clause |
1291
|
|
|
* |
1292
|
|
|
* @param string $bagPropertyName The name of the bag property |
1293
|
|
|
* |
1294
|
|
|
* @return string The formatted message |
1295
|
|
|
*/ |
1296
|
|
|
public static function orderByParserBagPropertyNotAllowed($bagPropertyName) |
1297
|
|
|
{ |
1298
|
|
|
return "orderby clause does not support Bag property in the path, the property '$bagPropertyName' is a bag property"; |
1299
|
|
|
} |
1300
|
|
|
|
1301
|
|
|
/** |
1302
|
|
|
* Format a message to show error when found a primitve property used as |
1303
|
|
|
* intermediate segment in orderby clause |
1304
|
|
|
* |
1305
|
|
|
* @param string $propertyName The name of primitive property |
1306
|
|
|
* |
1307
|
|
|
* @return string The formatted message |
1308
|
|
|
*/ |
1309
|
|
|
public static function orderByParserPrimitiveAsIntermediateSegment($propertyName) |
1310
|
|
|
{ |
1311
|
|
|
return "The primitive property '$propertyName' cannnot be used as intermediate segment, it should be last segment"; |
1312
|
|
|
} |
1313
|
|
|
|
1314
|
|
|
/** |
1315
|
|
|
* Format a message to show error when found binary property used as sort key |
1316
|
|
|
* |
1317
|
|
|
* @param string $binaryPropertyName The name of binary property |
1318
|
|
|
* |
1319
|
|
|
* @return string The formatted message |
1320
|
|
|
*/ |
1321
|
|
|
public static function orderByParserSortByBinaryPropertyNotAllowed($binaryPropertyName) |
1322
|
|
|
{ |
1323
|
|
|
return "Binary property is not allowed in orderby clause, '$binaryPropertyName'"; |
1324
|
|
|
} |
1325
|
|
|
|
1326
|
|
|
/** |
1327
|
|
|
* Format a message to show error when found a resource set reference |
1328
|
|
|
* property in the oriderby clause |
1329
|
|
|
* |
1330
|
|
|
* @param string $propertyName The name of resource set reference property |
1331
|
|
|
* @param string $definedType Defined type |
1332
|
|
|
* |
1333
|
|
|
* @return string The formatted message |
1334
|
|
|
*/ |
1335
|
|
|
public static function orderByParserResourceSetReferenceNotAllowed($propertyName, $definedType) |
1336
|
|
|
{ |
1337
|
|
|
return "Navigation property points to a collection cannot be used in orderby clause, The property '$propertyName' defined on type '$definedType' is such a property"; |
1338
|
|
|
} |
1339
|
|
|
|
1340
|
|
|
/** |
1341
|
|
|
* Format a message to show error when a navigation property is used as |
1342
|
|
|
* sort key in orderby clause |
1343
|
|
|
* |
1344
|
|
|
* @param string $navigationPropertyName The name of the navigation property |
1345
|
|
|
* |
1346
|
|
|
* @return string The formatted message |
1347
|
|
|
*/ |
1348
|
|
|
public static function orderByParserSortByNavigationPropertyIsNotAllowed($navigationPropertyName) |
1349
|
|
|
{ |
1350
|
|
|
return "Navigation property cannot be used as sort key, '$navigationPropertyName'"; |
1351
|
|
|
} |
1352
|
|
|
|
1353
|
|
|
/** |
1354
|
|
|
* Format a message to show error when a complex property is used as |
1355
|
|
|
* sort key in orderby clause |
1356
|
|
|
* |
1357
|
|
|
* @param string $complexPropertyName The name of the complex property |
1358
|
|
|
* |
1359
|
|
|
* @return string The formatted message |
1360
|
|
|
*/ |
1361
|
|
|
public static function orderByParserSortByComplexPropertyIsNotAllowed($complexPropertyName) |
1362
|
|
|
{ |
1363
|
|
|
return "Complex property cannot be used as sort key, the property '$complexPropertyName' is a complex property"; |
1364
|
|
|
} |
1365
|
|
|
|
1366
|
|
|
/** |
1367
|
|
|
* Message to show error when orderby parser found unexpected state |
1368
|
|
|
* |
1369
|
|
|
* @return string The error message |
1370
|
|
|
*/ |
1371
|
|
|
public static function orderByParserUnExpectedState() |
1372
|
|
|
{ |
1373
|
|
|
return 'Unexpected state while parsing orderby clause'; |
1374
|
|
|
} |
1375
|
|
|
|
1376
|
|
|
/** |
1377
|
|
|
* Message to show error when orderby parser come across a type |
1378
|
|
|
* which is not expected |
1379
|
|
|
* |
1380
|
|
|
* @return string The message |
1381
|
|
|
*/ |
1382
|
|
|
public static function orderByParserUnexpectedPropertyType() |
1383
|
|
|
{ |
1384
|
|
|
return 'Property type unexpected'; |
1385
|
|
|
} |
1386
|
|
|
|
1387
|
|
|
/** |
1388
|
|
|
* Format a message to show error when the orderby parser fails to |
1389
|
|
|
* create an instance of request uri resource type |
1390
|
|
|
* |
1391
|
|
|
* @return string The formatted message |
1392
|
|
|
*/ |
1393
|
|
|
public static function orderByParserFailedToCreateDummyObject() |
1394
|
|
|
{ |
1395
|
|
|
return 'OrderBy Parser failed to create dummy object from request uri resource type'; |
1396
|
|
|
} |
1397
|
|
|
|
1398
|
|
|
/** |
1399
|
|
|
* Format a message to show error when orderby parser failed to |
1400
|
|
|
* access some of the properties of dummy object |
1401
|
|
|
* |
1402
|
|
|
* @param string $propertyName Property name |
1403
|
|
|
* @param string $parentObjectName Parent object name |
1404
|
|
|
* |
1405
|
|
|
* @return string The formatted message |
1406
|
|
|
*/ |
1407
|
|
|
public static function orderByParserFailedToAccessOrInitializeProperty($propertyName, $parentObjectName) |
1408
|
|
|
{ |
1409
|
|
|
return "OrderBy parser failed to access or initialize the property $propertyName of $parentObjectName"; |
1410
|
|
|
} |
1411
|
|
|
|
1412
|
|
|
/** |
1413
|
|
|
* Format a message to show error when data service failed to |
1414
|
|
|
* access some of the properties of dummy object |
1415
|
|
|
* |
1416
|
|
|
* @param string $propertyName Property name |
1417
|
|
|
* @param string $parentObjectName Parent object name |
1418
|
|
|
* |
1419
|
|
|
* @return string The formatted message |
1420
|
|
|
*/ |
1421
|
|
|
public static function failedToAccessProperty($propertyName, $parentObjectName) |
1422
|
|
|
{ |
1423
|
|
|
return "Data Service failed to access or initialize the property $propertyName of $parentObjectName"; |
1424
|
|
|
} |
1425
|
|
|
|
1426
|
|
|
/** |
1427
|
|
|
* Message to show error when found empty anscestor list. |
1428
|
|
|
* |
1429
|
|
|
* @return string The message |
1430
|
|
|
*/ |
1431
|
|
|
public static function orderByLeafNodeArgumentShouldBeNonEmptyArray() |
1432
|
|
|
{ |
1433
|
|
|
return 'There should be atleast one anscestor for building the sort function'; |
1434
|
|
|
} |
1435
|
|
|
|
1436
|
|
|
/** |
1437
|
|
|
* Format a message to show error when found a invalid property name |
1438
|
|
|
* |
1439
|
|
|
* @param string $resourceTypeName The name of the resource type |
1440
|
|
|
* @param string $propertyName The name of the property |
1441
|
|
|
* |
1442
|
|
|
* @return string The formatted message |
1443
|
|
|
*/ |
1444
|
|
|
public static function badRequestInvalidPropertyNameSpecified($resourceTypeName, $propertyName) |
1445
|
|
|
{ |
1446
|
|
|
return "Error processing request stream. The property name '$propertyName' specified for type '$resourceTypeName' is not valid. (Check the resource set of the navigation property '$propertyName' is visible)"; |
1447
|
|
|
} |
1448
|
|
|
|
1449
|
|
|
/** |
1450
|
|
|
* Message to show error when parameter collection to |
1451
|
|
|
* AnonymousFunction constructor includes parameter that does not start with '$' |
1452
|
|
|
* |
1453
|
|
|
* @return string The message |
1454
|
|
|
*/ |
1455
|
|
|
public static function anonymousFunctionParameterShouldStartWithDollarSymbol() |
1456
|
|
|
{ |
1457
|
|
|
return 'The parameter names in parameter array should start with dollar symbol'; |
1458
|
|
|
} |
1459
|
|
|
|
1460
|
|
|
/** |
1461
|
|
|
* Format a message to show error when skiptoken parser fails |
1462
|
|
|
* to parse due to syntax error. |
1463
|
|
|
* |
1464
|
|
|
* @param string $skipToken Skip token |
1465
|
|
|
* |
1466
|
|
|
* @return string The formatted message |
1467
|
|
|
*/ |
1468
|
|
|
public static function skipTokenParserSyntaxError($skipToken) |
1469
|
|
|
{ |
1470
|
|
|
return "Bad Request - Error in the syntax of skiptoken '$skipToken'"; |
1471
|
|
|
} |
1472
|
|
|
|
1473
|
|
|
/** |
1474
|
|
|
* Message to show error when orderByInfo argument to SkipTokenParser is |
1475
|
|
|
* non null and not an instance of OrderByInfo |
1476
|
|
|
* |
1477
|
|
|
* @return string The message |
1478
|
|
|
*/ |
1479
|
|
|
public static function skipTokenParserUnexpectedTypeOfOrderByInfoArg() |
1480
|
|
|
{ |
1481
|
|
|
return 'The argument orderByInfo should be either null ot instance of OrderByInfo class'; |
1482
|
|
|
} |
1483
|
|
|
|
1484
|
|
|
/** |
1485
|
|
|
* Format a message to show error when number of keys in the |
1486
|
|
|
* skiptoken does not matches with the number of keys required for ordering. |
1487
|
|
|
* |
1488
|
|
|
* @param int $skipTokenValuesCount Number of keys in the skiptoken |
1489
|
|
|
* @param string $skipToken The skiptoken as string |
1490
|
|
|
* @param int $expectedCount Expected number of skiptoken keys |
1491
|
|
|
* |
1492
|
|
|
* @return string The formatted message |
1493
|
|
|
*/ |
1494
|
|
|
public static function skipTokenParserSkipTokenNotMatchingOrdering($skipTokenValuesCount, $skipToken, $expectedCount) |
1495
|
|
|
{ |
1496
|
|
|
return "The number of keys '$skipTokenValuesCount' in skip token with value '$skipToken' did not match the number of ordering constraints '$expectedCount' for the resource type."; |
1497
|
|
|
} |
1498
|
|
|
|
1499
|
|
|
/** |
1500
|
|
|
* Format a message to show error when skiptoken parser |
1501
|
|
|
* found null value for key. |
1502
|
|
|
* |
1503
|
|
|
* @param string $skipToken The skiptoken as string |
1504
|
|
|
* |
1505
|
|
|
* @return string The formatted message |
1506
|
|
|
*/ |
1507
|
|
|
public static function skipTokenParserNullNotAllowedForKeys($skipToken) |
1508
|
|
|
{ |
1509
|
|
|
return "The skiptoken value $skipToken contain null value for key"; |
1510
|
|
|
} |
1511
|
|
|
|
1512
|
|
|
/** |
1513
|
|
|
* Format a message to show error when skiptoken parser found values in |
1514
|
|
|
* skiptoken which is not compatible with the |
1515
|
|
|
* type of corresponding orderby constraint. |
1516
|
|
|
* |
1517
|
|
|
* @param string $skipToken Skip token |
1518
|
|
|
* @param string $expectedTypeName Expected type name |
1519
|
|
|
* @param int $position Position |
1520
|
|
|
* @param string $typeProvidedInSkipTokenName The type provided in |
1521
|
|
|
* skip token name |
1522
|
|
|
* |
1523
|
|
|
* @return string The formatted message |
1524
|
|
|
*/ |
1525
|
|
|
public static function skipTokenParserInCompatibleTypeAtPosition($skipToken, $expectedTypeName, $position, $typeProvidedInSkipTokenName) |
1526
|
|
|
{ |
1527
|
|
|
return "The skiptoken value '$skipToken' contain a value of type '$typeProvidedInSkipTokenName' at position $position which is not compatible with the type '$expectedTypeName' of corresponding orderby constraint."; |
1528
|
|
|
} |
1529
|
|
|
|
1530
|
|
|
/** |
1531
|
|
|
* Format a message to show error when one of the argument orderByPaths or |
1532
|
|
|
* orderByValues is set and not both. |
1533
|
|
|
* |
1534
|
|
|
* @param string $orderByPathsVarName Name of the argument |
1535
|
|
|
* holding orderByPathSegment |
1536
|
|
|
* @param string $orderByValuesVarName Name of the argument holding |
1537
|
|
|
* skip token values corresponding |
1538
|
|
|
* to orderby paths |
1539
|
|
|
* |
1540
|
|
|
* @return string The formatted message |
1541
|
|
|
*/ |
1542
|
|
|
public static function skipTokenInfoBothOrderByPathAndOrderByValuesShouldBeSetOrNotSet($orderByPathsVarName, $orderByValuesVarName) |
1543
|
|
|
{ |
1544
|
|
|
return "Either both the arguments $orderByPathsVarName and $orderByValuesVarName should be null or not-null"; |
1545
|
|
|
} |
1546
|
|
|
|
1547
|
|
|
/** |
1548
|
|
|
* Format a message to show error when internalSkipTokenInfo failed to |
1549
|
|
|
* access some of the properties of key object |
1550
|
|
|
* |
1551
|
|
|
* @param string $propertyName Property name |
1552
|
|
|
* |
1553
|
|
|
* @return string The formatted message |
1554
|
|
|
*/ |
1555
|
|
|
public static function internalSkipTokenInfoFailedToAccessOrInitializeProperty($propertyName) |
1556
|
|
|
{ |
1557
|
|
|
return "internalSkipTokenInfo failed to access or initialize the property $propertyName"; |
1558
|
|
|
} |
1559
|
|
|
|
1560
|
|
|
/** |
1561
|
|
|
* Format a message to show error when found a non-array passed to |
1562
|
|
|
* InternalSkipTokenInfo::search function. |
1563
|
|
|
* |
1564
|
|
|
* @param string $argumentName The name of the argument expected to be array |
1565
|
|
|
* |
1566
|
|
|
* @return string The formatted message |
1567
|
|
|
*/ |
1568
|
|
|
public static function internalSkipTokenInfoBinarySearchRequireArray($argumentName) |
1569
|
|
|
{ |
1570
|
|
|
return "The argument '$argumentName' should be an array to perfrom binary search"; |
1571
|
|
|
} |
1572
|
|
|
|
1573
|
|
|
/** |
1574
|
|
|
* Format a message to show error when client requested version is |
1575
|
|
|
* lower than the version required to intercept the response. |
1576
|
|
|
* |
1577
|
|
|
* @param string $requestedVersion The client requested version. |
1578
|
|
|
* @param string $requiredVersion The minimum version required to |
1579
|
|
|
* intercept the response. |
1580
|
|
|
* |
1581
|
|
|
* @return string The formatted message |
1582
|
|
|
*/ |
1583
|
|
|
public static function requestVersionTooLow($requestedVersion, $requiredVersion) |
1584
|
|
|
{ |
1585
|
|
|
return "Request version '$requestedVersion' is not supported for the request payload. The only supported version is '$requiredVersion'."; |
1586
|
|
|
} |
1587
|
|
|
|
1588
|
|
|
/** |
1589
|
|
|
* Format a message to show error when version required to intercept |
1590
|
|
|
* the response is greater than the configured maximum protocol version. |
1591
|
|
|
* |
1592
|
|
|
* @param string $requiredVersion Required version |
1593
|
|
|
* @param string $configuredVersion Configured version |
1594
|
|
|
* |
1595
|
|
|
* @return string The formatted message |
1596
|
|
|
*/ |
1597
|
|
|
public static function requestVersionIsBiggerThanProtocolVersion($requiredVersion, $configuredVersion) |
1598
|
|
|
{ |
1599
|
|
|
return "The response requires that version $requiredVersion of the protocol be used, but the MaxProtocolVersion of the data service is set to $configuredVersion."; |
1600
|
|
|
} |
1601
|
|
|
|
1602
|
|
|
/** |
1603
|
|
|
* Format a message to show error when value of DataServiceVersion or |
1604
|
|
|
* MaxDataServiceVersion is invalid. |
1605
|
|
|
* |
1606
|
|
|
* @param string $versionAsString String value of the version |
1607
|
|
|
* @param string $headerName Header name |
1608
|
|
|
* |
1609
|
|
|
* @return string The formatted message |
1610
|
|
|
*/ |
1611
|
|
|
public static function requestDescriptionInvalidVersionHeader($versionAsString, $headerName) |
1612
|
|
|
{ |
1613
|
|
|
return "The header $headerName has malformed version value $versionAsString"; |
1614
|
|
|
} |
1615
|
|
|
|
1616
|
|
|
/** |
1617
|
|
|
* Format a message to show error when value of DataServiceVersion or |
1618
|
|
|
* MaxDataServiceVersion is invalid. |
1619
|
|
|
* |
1620
|
|
|
* @param string $requestHeaderName Name of the request header |
1621
|
|
|
* @param string $requestedVersion Requested version |
1622
|
|
|
* @param string $availableVersions Available versions |
1623
|
|
|
* |
1624
|
|
|
* @return string The formatted message |
1625
|
|
|
*/ |
1626
|
|
|
public static function requestDescriptionUnSupportedVersion($requestHeaderName, $requestedVersion, $availableVersions) |
1627
|
|
|
{ |
1628
|
|
|
return "The version value $requestedVersion in the header $requestHeaderName is not supported, available versions are $availableVersions"; |
1629
|
|
|
} |
1630
|
|
|
|
1631
|
|
|
/** |
1632
|
|
|
* Format a message to show error when the requested uri is not |
1633
|
|
|
* based on the configured base service uri. |
1634
|
|
|
* |
1635
|
|
|
* @param string $requestUri The uri requested by the client. |
1636
|
|
|
* @param string $serviceUri The base service uri. |
1637
|
|
|
* |
1638
|
|
|
* @return string The formatted message |
1639
|
|
|
*/ |
1640
|
|
|
public static function uriProcessorRequestUriDoesNotHaveTheRightBaseUri($requestUri, $serviceUri) |
1641
|
|
|
{ |
1642
|
|
|
return "The URI '$requestUri' is not valid since it is not based on '$serviceUri'"; |
1643
|
|
|
} |
1644
|
|
|
|
1645
|
|
|
/** |
1646
|
|
|
* Message to show error when query prcocessor found |
1647
|
|
|
* invalid value for $format option. |
1648
|
|
|
* |
1649
|
|
|
* @return string The message |
1650
|
|
|
*/ |
1651
|
|
|
public static function queryProcessorInvalidValueForFormat() |
1652
|
|
|
{ |
1653
|
|
|
return 'Invalid $format query option - the only acceptable values are "json" and "atom"'; |
1654
|
|
|
} |
1655
|
|
|
|
1656
|
|
|
/** |
1657
|
|
|
* Message to show error when query processor found odata query option |
1658
|
|
|
* in the request uri which is not applicable for the |
1659
|
|
|
* resource targeted by the resource path. |
1660
|
|
|
* |
1661
|
|
|
* @return string The message |
1662
|
|
|
*/ |
1663
|
|
|
public static function queryProcessorNoQueryOptionsApplicable() |
1664
|
|
|
{ |
1665
|
|
|
return 'Query options $select, $expand, $filter, $orderby, $inlinecount, $skip, $skiptoken and $top are not supported by this request method or cannot be applied to the requested resource.'; |
1666
|
|
|
} |
1667
|
|
|
|
1668
|
|
|
/** |
1669
|
|
|
* Message to show error when query processor found $filter option in the |
1670
|
|
|
* request uri but is not applicable for the resource targeted by the |
1671
|
|
|
* resource path. |
1672
|
|
|
* |
1673
|
|
|
* @return string The message |
1674
|
|
|
*/ |
1675
|
|
|
public static function queryProcessorQueryFilterOptionNotApplicable() |
1676
|
|
|
{ |
1677
|
|
|
return 'Query option $filter cannot be applied to the requested resource.'; |
1678
|
|
|
} |
1679
|
|
|
|
1680
|
|
|
/** |
1681
|
|
|
* Message to show error when query processor found any $orderby, |
1682
|
|
|
* $inlinecount, $skip or $top options in the request uri but is not |
1683
|
|
|
* applicable for the resource targeted by the resource path. |
1684
|
|
|
* |
1685
|
|
|
* @return string The message |
1686
|
|
|
*/ |
1687
|
|
|
public static function queryProcessorQuerySetOptionsNotApplicable() |
1688
|
|
|
{ |
1689
|
|
|
return 'Query options $orderby, $inlinecount, $skip and $top cannot be applied to the requested resource.'; |
1690
|
|
|
} |
1691
|
|
|
|
1692
|
|
|
/** |
1693
|
|
|
* Message to show error when query processor found skiptoken option in the |
1694
|
|
|
* request uri but is not applicable for the resource targeted by the |
1695
|
|
|
* resource path. |
1696
|
|
|
* |
1697
|
|
|
* @return string The message |
1698
|
|
|
*/ |
1699
|
|
|
public static function queryProcessorSkipTokenNotAllowed() |
1700
|
|
|
{ |
1701
|
|
|
return 'Query option $skiptoken cannot be applied to the requested resource.'; |
1702
|
|
|
} |
1703
|
|
|
|
1704
|
|
|
/** |
1705
|
|
|
* Message to show error when query processor found $expand option in the |
1706
|
|
|
* request uri but is not applicable for the resource targeted by the |
1707
|
|
|
* resource path. |
1708
|
|
|
* |
1709
|
|
|
* @return string The message |
1710
|
|
|
*/ |
1711
|
|
|
public static function queryProcessorQueryExpandOptionNotApplicable() |
1712
|
|
|
{ |
1713
|
|
|
return 'Query option $expand cannot be applied to the requested resource.'; |
1714
|
|
|
} |
1715
|
|
|
|
1716
|
|
|
/** |
1717
|
|
|
* Message to show error when query processor found usage of $inline count |
1718
|
|
|
* option for a resource path ending with $count |
1719
|
|
|
* |
1720
|
|
|
* @return string The message |
1721
|
|
|
*/ |
1722
|
|
|
public static function queryProcessorInlineCountWithValueCount() |
1723
|
|
|
{ |
1724
|
|
|
return '$inlinecount cannot be applied to the resource segment $count'; |
1725
|
|
|
} |
1726
|
|
|
|
1727
|
|
|
/** |
1728
|
|
|
* Message to show error when value of $inlinecount option found invalid. |
1729
|
|
|
* |
1730
|
|
|
* @return string The message |
1731
|
|
|
*/ |
1732
|
|
|
public static function queryProcessorInvalidInlineCountOptionError() |
1733
|
|
|
{ |
1734
|
|
|
return 'Unknown $inlinecount option, only "allpages" and "none" are supported'; |
1735
|
|
|
} |
1736
|
|
|
|
1737
|
|
|
/** |
1738
|
|
|
* Format a message to show error when query processor found invalid |
1739
|
|
|
* value for a query option. |
1740
|
|
|
* |
1741
|
|
|
* @param string $argName The name of the argument |
1742
|
|
|
* @param string $argValue The value of the argument |
1743
|
|
|
* |
1744
|
|
|
* @return string The formatted message |
1745
|
|
|
*/ |
1746
|
|
|
public static function queryProcessorIncorrectArgumentFormat($argName, $argValue) |
1747
|
|
|
{ |
1748
|
|
|
return "Incorrect format for $argName argument '$argValue'"; |
1749
|
|
|
} |
1750
|
|
|
|
1751
|
|
|
/** |
1752
|
|
|
* Format a message to show error when query processor found $skiptoken |
1753
|
|
|
* in the request uri targetting to a resource for which paging is not |
1754
|
|
|
* enabled. |
1755
|
|
|
* |
1756
|
|
|
* @param string $resourceSetName The name of the resource set. |
1757
|
|
|
* |
1758
|
|
|
* @return string The formatted message |
1759
|
|
|
*/ |
1760
|
|
|
public static function queryProcessorSkipTokenCannotBeAppliedForNonPagedResourceSet($resourceSetName) |
1761
|
|
|
{ |
1762
|
|
|
return "\$skiptoken cannot be applied to the resource set '$resourceSetName', since paging is not enabled for this resource set"; |
1763
|
|
|
} |
1764
|
|
|
|
1765
|
|
|
/** |
1766
|
|
|
* Format a message to show error when query processor found $select |
1767
|
|
|
* or $expand which cannot be applied to resource targeted by the |
1768
|
|
|
* request uri. |
1769
|
|
|
* |
1770
|
|
|
* @param string $queryItem Query item |
1771
|
|
|
* |
1772
|
|
|
* @return string The formatted message |
1773
|
|
|
*/ |
1774
|
|
|
public static function queryProcessorSelectOrExpandOptionNotApplicable($queryItem) |
1775
|
|
|
{ |
1776
|
|
|
return "Query option $queryItem cannot be applied to the requested resource"; |
1777
|
|
|
} |
1778
|
|
|
|
1779
|
|
|
/** |
1780
|
|
|
* Message to show error when query processor found $select clause but which is |
1781
|
|
|
* disabled by the service developer. |
1782
|
|
|
* |
1783
|
|
|
* @return string The message |
1784
|
|
|
*/ |
1785
|
|
|
public static function configurationProjectionsNotAccepted() |
1786
|
|
|
{ |
1787
|
|
|
return 'The ability to use the $select query option to define a projection in a data service query is disabled. To enable this functionality, call ServiceConfiguration::setAcceptProjectionRequests method with argument as true.'; |
1788
|
|
|
} |
1789
|
|
|
|
1790
|
|
|
|
1791
|
|
|
/** |
1792
|
|
|
* Message to show error service implementation returns null for IMetadataProvider or IQueryProvider. |
1793
|
|
|
* |
1794
|
|
|
* @return string The message |
1795
|
|
|
*/ |
1796
|
|
|
public static function providersWrapperNull() |
1797
|
|
|
{ |
1798
|
|
|
return 'For custom providers, GetService should not return null for both IMetadataProvider and IQueryProvider types.'; |
1799
|
|
|
} |
1800
|
|
|
|
1801
|
|
|
/** |
1802
|
|
|
* Message to show when service implementation does not provide a valid IMetadataProvider. |
1803
|
|
|
* |
1804
|
|
|
* @return string The message |
1805
|
|
|
*/ |
1806
|
|
|
public static function invalidMetadataInstance() |
1807
|
|
|
{ |
1808
|
|
|
return 'IService.GetMetdataProvider returns invalid object.'; |
1809
|
|
|
} |
1810
|
|
|
|
1811
|
|
|
/** |
1812
|
|
|
* Message to show when service implementation does not provide a valid IQueryProvider. |
1813
|
|
|
* |
1814
|
|
|
* |
1815
|
|
|
* @return string The message |
1816
|
|
|
*/ |
1817
|
|
|
public static function invalidQueryInstance() |
1818
|
|
|
{ |
1819
|
|
|
return 'IService.getQueryProvider returns invalid object.'; |
1820
|
|
|
} |
1821
|
|
|
|
1822
|
|
|
/** |
1823
|
|
|
* Message to show error when IStreamProvider.GetStreamETag returns invalid etag value. |
1824
|
|
|
* |
1825
|
|
|
* @return string The message |
1826
|
|
|
*/ |
1827
|
|
|
public static function streamProviderWrapperGetStreamETagReturnedInvalidETagFormat() |
1828
|
|
|
{ |
1829
|
|
|
return 'The method \'IStreamProvider.GetStreamETag\' returned an entity tag with invalid format.'; |
1830
|
|
|
} |
1831
|
|
|
|
1832
|
|
|
/** |
1833
|
|
|
* Message to show error when IStreamProvider.GetStreamContentType returns null or empty string. |
1834
|
|
|
* |
1835
|
|
|
* @return string The message |
1836
|
|
|
*/ |
1837
|
|
|
public static function streamProviderWrapperGetStreamContentTypeReturnsEmptyOrNull() |
1838
|
|
|
{ |
1839
|
|
|
return 'The method \'IStreamProvider.GetStreamContentType\' must not return a null or empty string.'; |
1840
|
|
|
} |
1841
|
|
|
|
1842
|
|
|
/** |
1843
|
|
|
* Message to show error when IStreamProvider.GetReadStream non stream. |
1844
|
|
|
* |
1845
|
|
|
* @return string The message |
1846
|
|
|
*/ |
1847
|
|
|
public static function streamProviderWrapperInvalidStreamFromGetReadStream() |
1848
|
|
|
{ |
1849
|
|
|
return 'IStreamProvider.GetReadStream() must return a valid readable stream.'; |
1850
|
|
|
} |
1851
|
|
|
|
1852
|
|
|
/** |
1853
|
|
|
* Message to show error when IStreamProvider.GetReadStreamUri returns relative uri. |
1854
|
|
|
* |
1855
|
|
|
* @return string The message |
1856
|
|
|
*/ |
1857
|
|
|
public static function streamProviderWrapperGetReadStreamUriMustReturnAbsoluteUriOrNull() |
1858
|
|
|
{ |
1859
|
|
|
return 'The method IStreamProvider.GetReadStreamUri must return an absolute Uri or null.'; |
1860
|
|
|
} |
1861
|
|
|
|
1862
|
|
|
/** |
1863
|
|
|
* Message to show error when data service does not implement IDSSP or IDSSP2 interfaces. |
1864
|
|
|
* |
1865
|
|
|
* @return string The message |
1866
|
|
|
*/ |
1867
|
|
|
public static function streamProviderWrapperMustImplementIStreamProviderToSupportStreaming() |
1868
|
|
|
{ |
1869
|
|
|
return 'To support streaming, the data service must implement IServiceProvider::GetService() to return an implementation of IStreamProvider or IStreamProvider2'; |
1870
|
|
|
} |
1871
|
|
|
|
1872
|
|
|
/** |
1873
|
|
|
* Message to show error when try to configure data service version as 2 for which named stream is defined. |
1874
|
|
|
* |
1875
|
|
|
* @return string The message |
1876
|
|
|
*/ |
1877
|
|
|
public static function streamProviderWrapperMaxProtocolVersionMustBeV3OrAboveToSupportNamedStreams() |
1878
|
|
|
{ |
1879
|
|
|
return 'To support named streams, the MaxProtocolVersion of the data service must be set to ProtocolVersion.V3 or above.'; |
1880
|
|
|
} |
1881
|
|
|
|
1882
|
|
|
/** |
1883
|
|
|
* Message to show error when data service does not provide implementation of IDDSP2 for which named stream is defined. |
1884
|
|
|
* |
1885
|
|
|
* @return string The message |
1886
|
|
|
*/ |
1887
|
|
|
public static function streamProviderWrapperMustImplementStreamProvider2ToSupportNamedStreams() |
1888
|
|
|
{ |
1889
|
|
|
return 'To support named streams, the data service must implement IServiceProvider.GetService() to return an implementation of IStreamProvider2 or the data source must implement IStreamProvider2.'; |
1890
|
|
|
} |
1891
|
|
|
|
1892
|
|
|
/** |
1893
|
|
|
* Message to show error when IDSSP/IDSSP2 implementation methods try to set etag or content type. |
1894
|
|
|
* |
1895
|
|
|
* @param string $methodName Method name |
1896
|
|
|
* |
1897
|
|
|
* @return string The formatted message |
1898
|
|
|
*/ |
1899
|
|
|
public static function streamProviderWrapperMustNotSetContentTypeAndEtag($methodName) |
1900
|
|
|
{ |
1901
|
|
|
return "The method $methodName must not set the HTTP response headers 'Content-Type' and 'ETag'"; |
1902
|
|
|
} |
1903
|
|
|
|
1904
|
|
|
/** |
1905
|
|
|
* Message to show error when IServiceProvider.GetService implementation returns invaild object when request for |
1906
|
|
|
* IStreamProvider implementation. |
1907
|
|
|
* |
1908
|
|
|
* @return string The message |
1909
|
|
|
*/ |
1910
|
|
|
public static function streamProviderWrapperInvalidStreamInstance() |
1911
|
|
|
{ |
1912
|
|
|
return 'return \'IServiceProvider.GetService for IStreamProvider returns invalid object.'; |
1913
|
|
|
} |
1914
|
|
|
|
1915
|
|
|
/** |
1916
|
|
|
* Message to show error when IServiceProvider.GetService implementation returns invaild object when request for |
1917
|
|
|
* IStreamProvider2 implementation. |
1918
|
|
|
* |
1919
|
|
|
* @return string The message |
1920
|
|
|
*/ |
1921
|
|
|
public static function streamProviderWrapperInvalidStream2Instance() |
1922
|
|
|
{ |
1923
|
|
|
return 'return \'IServiceProvider.GetService for IStreamProvider2 returns invalid object.'; |
1924
|
|
|
} |
1925
|
|
|
|
1926
|
|
|
/** |
1927
|
|
|
* Format a message to show error when object model serializer found |
1928
|
|
|
* in-inconsistency in resource type and current runtime information. |
1929
|
|
|
* |
1930
|
|
|
* @param string $typeName The name of the resource type for which |
1931
|
|
|
* serializer found inconsistency. |
1932
|
|
|
* |
1933
|
|
|
* @return string The formatted message. |
1934
|
|
|
*/ |
1935
|
|
|
public static function badProviderInconsistentEntityOrComplexTypeUsage($typeName) |
1936
|
|
|
{ |
1937
|
|
|
return "Internal Server Error. The type '$typeName' has inconsistent metadata and runtime type info."; |
1938
|
|
|
} |
1939
|
|
|
|
1940
|
|
|
/** |
1941
|
|
|
* Format a message to show error when object model serializer |
1942
|
|
|
* found null key value. |
1943
|
|
|
* |
1944
|
|
|
* @param string $resourceTypeName The name of the resource type of the |
1945
|
|
|
* instance with null key. |
1946
|
|
|
* @param string $keyName Name of the key with null value. |
1947
|
|
|
* |
1948
|
|
|
* @return string The formatted message. |
1949
|
|
|
*/ |
1950
|
|
|
public static function badQueryNullKeysAreNotSupported($resourceTypeName, $keyName) |
1951
|
|
|
{ |
1952
|
|
|
return "The serialized resource of type $resourceTypeName has a null value in key member '$keyName'. Null values are not supported in key members."; |
1953
|
|
|
} |
1954
|
|
|
|
1955
|
|
|
/** |
1956
|
|
|
* Format a message to show error when object model serializer failed to |
1957
|
|
|
* access some of the properties of a type instance. |
1958
|
|
|
* |
1959
|
|
|
* @param string $propertyName The name of the property in question. |
1960
|
|
|
* @param string $parentObjectName The entity instance in question. |
1961
|
|
|
* |
1962
|
|
|
* @return string The formatted message |
1963
|
|
|
*/ |
1964
|
|
|
public static function objectModelSerializerFailedToAccessProperty($propertyName, $parentObjectName) |
1965
|
|
|
{ |
1966
|
|
|
return "objectModelSerializer failed to access or initialize the property $propertyName of $parentObjectName, Please contact provider"; |
1967
|
|
|
} |
1968
|
|
|
|
1969
|
|
|
/** |
1970
|
|
|
* Format a message to show error when object model serializer found loop |
1971
|
|
|
* a in complex property instance. |
1972
|
|
|
* |
1973
|
|
|
* @param string $complexPropertyName The name of the complex property with loop. |
1974
|
|
|
* |
1975
|
|
|
* @return string The formatted message |
1976
|
|
|
*/ |
1977
|
|
|
public static function objectModelSerializerLoopsNotAllowedInComplexTypes($complexPropertyName) |
1978
|
|
|
{ |
1979
|
|
|
return 'A circular loop was detected while serializing the property \''. $complexPropertyName . '\'. You must make sure that loops are not present in properties that return a bag or complex type.'; |
1980
|
|
|
} |
1981
|
|
|
|
1982
|
|
|
/** |
1983
|
|
|
* Message to show error when the requested resource instance |
1984
|
|
|
* cannot be serialized to requested format. |
1985
|
|
|
* |
1986
|
|
|
* @return string The message |
1987
|
|
|
*/ |
1988
|
|
|
public static function unsupportedMediaType() |
1989
|
|
|
{ |
1990
|
|
|
return 'Unsupported media type requested.'; |
1991
|
|
|
} |
1992
|
|
|
|
1993
|
|
|
/** |
1994
|
|
|
* Message to show error when media type header found malformed. |
1995
|
|
|
* |
1996
|
|
|
* @return string The message |
1997
|
|
|
*/ |
1998
|
|
|
public static function httpProcessUtilityMediaTypeRequiresSemicolonBeforeParameter() |
1999
|
|
|
{ |
2000
|
|
|
return "Media type requires a ';' character before a parameter definition."; |
2001
|
|
|
} |
2002
|
|
|
|
2003
|
|
|
/** |
2004
|
|
|
* Message to show error when media header value misses type segment. |
2005
|
|
|
* |
2006
|
|
|
* @return string The message |
2007
|
|
|
*/ |
2008
|
|
|
public static function httpProcessUtilityMediaTypeUnspecified() |
2009
|
|
|
{ |
2010
|
|
|
return 'Media type is unspecified.'; |
2011
|
|
|
} |
2012
|
|
|
|
2013
|
|
|
/** |
2014
|
|
|
* Message to show error when media header value misses slash after type. |
2015
|
|
|
* |
2016
|
|
|
* @return string The message |
2017
|
|
|
*/ |
2018
|
|
|
public static function httpProcessUtilityMediaTypeRequiresSlash() |
2019
|
|
|
{ |
2020
|
|
|
return "Media type requires a '/' character."; |
2021
|
|
|
} |
2022
|
|
|
|
2023
|
|
|
/** |
2024
|
|
|
* Message to show error when media header value misses sub-type. |
2025
|
|
|
* |
2026
|
|
|
* @return string The message |
2027
|
|
|
*/ |
2028
|
|
|
public static function httpProcessUtilityMediaTypeRequiresSubType() |
2029
|
|
|
{ |
2030
|
|
|
return 'Media type requires a subtype definition.'; |
2031
|
|
|
} |
2032
|
|
|
|
2033
|
|
|
/** |
2034
|
|
|
* Message to show error when media type misses parameter value. |
2035
|
|
|
* |
2036
|
|
|
* @return string The message |
2037
|
|
|
*/ |
2038
|
|
|
public static function httpProcessUtilityMediaTypeMissingValue() |
2039
|
|
|
{ |
2040
|
|
|
return 'Media type is missing a parameter value.'; |
2041
|
|
|
} |
2042
|
|
|
|
2043
|
|
|
/** |
2044
|
|
|
* Format a message to show error when media type parameter value contain escape |
2045
|
|
|
* character but the value is not quoted. |
2046
|
|
|
* |
2047
|
|
|
* @param string $parameterName Name of the parameter |
2048
|
|
|
* |
2049
|
|
|
* @return string The formatted message. |
2050
|
|
|
*/ |
2051
|
|
|
public static function httpProcessUtilityEscapeCharWithoutQuotes($parameterName) |
2052
|
|
|
{ |
2053
|
|
|
return "Value for MIME type parameter '$parameterName' is incorrect because it contained escape characters even though it was not quoted."; |
2054
|
|
|
} |
2055
|
|
|
|
2056
|
|
|
/** |
2057
|
|
|
* Format a message to show error when media type parameter value contain escape |
2058
|
|
|
* character but the value at the end. |
2059
|
|
|
* |
2060
|
|
|
* @param string $parameterName Name of the parameter |
2061
|
|
|
* |
2062
|
|
|
* @return string The formatted message. |
2063
|
|
|
*/ |
2064
|
|
|
public static function httpProcessUtilityEscapeCharAtEnd($parameterName) |
2065
|
|
|
{ |
2066
|
|
|
return "Value for MIME type parameter '$parameterName' is incorrect because it terminated with escape character. Escape characters must always be followed by a character in a parameter value."; |
2067
|
|
|
} |
2068
|
|
|
|
2069
|
|
|
/** |
2070
|
|
|
* Format a message to show error when media parameter |
2071
|
|
|
* value misses closing bracket. |
2072
|
|
|
* |
2073
|
|
|
* @param string $parameterName Name of the parameter |
2074
|
|
|
* |
2075
|
|
|
* @return string The formatted message. |
2076
|
|
|
*/ |
2077
|
|
|
public static function httpProcessUtilityClosingQuoteNotFound($parameterName) |
2078
|
|
|
{ |
2079
|
|
|
return "Value for MIME type parameter '$parameterName' is incorrect because the closing quote character could not be found while the parameter value started with a quote character."; |
2080
|
|
|
} |
2081
|
|
|
|
2082
|
|
|
/** |
2083
|
|
|
* Message to show error when the header found malformed. |
2084
|
|
|
* |
2085
|
|
|
* @return string The formatted message. |
2086
|
|
|
*/ |
2087
|
|
|
public static function httpProcessUtilityMalformedHeaderValue() |
2088
|
|
|
{ |
2089
|
|
|
return 'Malformed value in request header.'; |
2090
|
|
|
} |
2091
|
|
|
|
2092
|
|
|
/** |
2093
|
|
|
* Message to show error when request contains eTag headers |
2094
|
|
|
* but targeted resource type does not have eTag properties defined. |
2095
|
|
|
* |
2096
|
|
|
* @return string The message |
2097
|
|
|
*/ |
2098
|
|
|
public static function noETagPropertiesForType() |
2099
|
|
|
{ |
2100
|
|
|
return 'If-Match or If-None-Match headers cannot be specified if the target type does not have etag properties defined.'; |
2101
|
|
|
} |
2102
|
|
|
|
2103
|
|
|
/** |
2104
|
|
|
* Message to show error when data service found the request eTag |
2105
|
|
|
* does not match with entry eTag. |
2106
|
|
|
* |
2107
|
|
|
* @return string The message |
2108
|
|
|
*/ |
2109
|
|
|
public static function eTagValueDoesNotMatch() |
2110
|
|
|
{ |
2111
|
|
|
return 'The etag value in the request header does not match with the current etag value of the object.'; |
2112
|
|
|
} |
2113
|
|
|
|
2114
|
|
|
/** |
2115
|
|
|
* Format a message to show error when request eTag header has been |
2116
|
|
|
* specified but eTag is not allowed for the targeted resource. |
2117
|
|
|
* |
2118
|
|
|
* @param string $uri Url |
2119
|
|
|
* |
2120
|
|
|
* @return string The formatted message |
2121
|
|
|
*/ |
2122
|
|
|
public static function eTagCannotBeSpecified($uri) |
2123
|
|
|
{ |
2124
|
|
|
return "If-Match or If-None-Match HTTP headers cannot be specified since the URI '$uri' refers to a collection of resources or has a \$count or \$link segment or has a \$expand as one of the query parameters."; |
2125
|
|
|
} |
2126
|
|
|
|
2127
|
|
|
/** |
2128
|
|
|
* Message to show error when data service found presence of both |
2129
|
|
|
* If-Match and if-None-Match headers. |
2130
|
|
|
* |
2131
|
|
|
* @return string The message |
2132
|
|
|
*/ |
2133
|
|
|
public static function bothIfMatchAndIfNoneMatchHeaderSpecified() |
2134
|
|
|
{ |
2135
|
|
|
return "Both If-Match and If-None-Match HTTP headers cannot be specified at the same time. Please specify either one of the headers or none of them."; |
2136
|
|
|
} |
2137
|
|
|
|
2138
|
|
|
/** |
2139
|
|
|
* Message to show error when data service found eTag |
2140
|
|
|
* header for non-existing resource. |
2141
|
|
|
* |
2142
|
|
|
* @return string The message |
2143
|
|
|
*/ |
2144
|
|
|
public static function eTagNotAllowedForNonExistingResource() |
2145
|
|
|
{ |
2146
|
|
|
return 'The resource targeted by the request does not exists, eTag header is not allowed for non-existing resource.'; |
2147
|
|
|
} |
2148
|
|
|
|
2149
|
|
|
/** |
2150
|
|
|
* Message to show error when data service found a request method other than GET. |
2151
|
|
|
* |
2152
|
|
|
* @param HTTPRequestMethod $method Request method |
2153
|
|
|
* |
2154
|
|
|
* @return string The formatted message |
2155
|
|
|
*/ |
2156
|
|
|
public static function onlyReadSupport(HTTPRequestMethod $method) |
2157
|
|
|
{ |
2158
|
|
|
return "This release of library support only GET (read) request, received a request with method $method"; |
2159
|
|
|
} |
2160
|
|
|
|
2161
|
|
|
/** |
2162
|
|
|
* Format a message to show error when the uri that look like pointing to |
2163
|
|
|
* MLE but actaully it is not. |
2164
|
|
|
* |
2165
|
|
|
* @param string $uri Url pointing to MLE |
2166
|
|
|
* |
2167
|
|
|
* @return string The formatted message |
2168
|
|
|
*/ |
2169
|
|
|
public static function badRequestInvalidUriForMediaResource($uri) |
2170
|
|
|
{ |
2171
|
|
|
return "The URI '$uri' is not valid. The segment before '\$value' must be a Media Link Entry or a primitive property."; |
2172
|
|
|
} |
2173
|
|
|
|
2174
|
|
|
/** |
2175
|
|
|
* Format a message to show error when library found non-odata |
2176
|
|
|
* query option begins with $ character. |
2177
|
|
|
* |
2178
|
|
|
* @param string $optionName Name of the query option |
2179
|
|
|
* |
2180
|
|
|
* @return string The formatted message. |
2181
|
|
|
*/ |
2182
|
|
|
public static function hostNonODataOptionBeginsWithSystemCharacter($optionName) |
2183
|
|
|
{ |
2184
|
|
|
return "The query parameter '$optionName' begins with a system-reserved '$' character but is not recognized."; |
2185
|
|
|
} |
2186
|
|
|
|
2187
|
|
|
/** |
2188
|
|
|
* Format a message to show error when library found |
2189
|
|
|
* a query option without value. |
2190
|
|
|
* |
2191
|
|
|
* @param string $optionName Name of the query option |
2192
|
|
|
* |
2193
|
|
|
* @return string The formatted message. |
2194
|
|
|
*/ |
2195
|
|
|
public static function hostODataQueryOptionFoundWithoutValue($optionName) |
2196
|
|
|
{ |
2197
|
|
|
return "Query parameter '$optionName' is specified, but it should be specified with value."; |
2198
|
|
|
} |
2199
|
|
|
|
2200
|
|
|
/** |
2201
|
|
|
* Format a message to show error when library found |
2202
|
|
|
* a query option specified multiple times. |
2203
|
|
|
* |
2204
|
|
|
* @param string $optionName Name of the query option |
2205
|
|
|
* |
2206
|
|
|
* @return string The formatted message. |
2207
|
|
|
*/ |
2208
|
|
|
public static function hostODataQueryOptionCannotBeSpecifiedMoreThanOnce($optionName) |
2209
|
|
|
{ |
2210
|
|
|
return "Query parameter '$optionName' is specified, but it should be specified exactly once."; |
2211
|
|
|
} |
2212
|
|
|
|
2213
|
|
|
/** |
2214
|
|
|
* Message to show error when baseUrl given in service.config.xml is invalid. |
2215
|
|
|
* |
2216
|
|
|
* @param boolean $notEndWithSvcOrHasQuery Base url end with svc or not |
2217
|
|
|
* |
2218
|
|
|
* @return string The message. |
2219
|
|
|
*/ |
2220
|
|
|
public static function hostMalFormedBaseUriInConfig($notEndWithSvcOrHasQuery = false) |
2221
|
|
|
{ |
2222
|
|
|
if ($notEndWithSvcOrHasQuery) { |
2223
|
|
|
return 'Malformed base service uri in the configuration file (should end with .svc, there should not be query or fragment in the base service uri)'; |
2224
|
|
|
} |
2225
|
|
|
|
2226
|
|
|
return 'Malformed base service uri in the configuration file'; |
2227
|
|
|
} |
2228
|
|
|
|
2229
|
|
|
/** |
2230
|
|
|
* Format a message to show error when request uri is not |
2231
|
|
|
* based on configured relative uri. |
2232
|
|
|
* |
2233
|
|
|
* @param string $requestUri The request uri. |
2234
|
|
|
* @param string $relativeUri The relative uri in service.config.xml. |
2235
|
|
|
* |
2236
|
|
|
* @return string The formatted message. |
2237
|
|
|
*/ |
2238
|
|
|
public static function hostRequestUriIsNotBasedOnRelativeUriInConfig($requestUri, $relativeUri) |
2239
|
|
|
{ |
2240
|
|
|
return 'The request uri ' . $requestUri . ' is not valid as it is not based on the configured relative uri ' . $relativeUri; |
2241
|
|
|
} |
2242
|
|
|
|
2243
|
|
|
|
2244
|
|
|
|
2245
|
|
|
} |