-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathRepositoryInterface.php
More file actions
615 lines (554 loc) · 19.9 KB
/
RepositoryInterface.php
File metadata and controls
615 lines (554 loc) · 19.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
<?php
namespace PHPCR;
/**
* The entry point into the content repository.
*
* The Repository object is usually acquired through an implementation of the
* RepositoryFactoryInterface.
*
* <strong>PHPCR Note:</strong> This interface has been simplified compared to
* JCR:
*
* - getDescriptor returns array on multivalue, single variable otherwise
* - removed isSingleValueDescriptor
* - removed getDescriptorValue and getDescriptorValues as ValueInterface has
* been dropped. Use getDescriptor to get the variable value.
*
* @license http://www.apache.org/licenses Apache License Version 2.0, January 2004
* @license http://opensource.org/licenses/MIT MIT License
*
* @api
*/
interface RepositoryInterface
{
/**#@+
* @var string
*/
/**
* The descriptor key for the version of the specification this repository
* implements.
*
* For JCR 2.0 the value of this descriptor is the string "2.0".
*
* @api
*/
public const SPEC_VERSION_DESC = 'jcr.specification.version';
/**
* The descriptor key for the name of the specification this repository
* implements.
*
* For JCR 2.0 the value of this descriptor is the string "Content
* Repository for Java Technology API".
*
* @api
*/
public const SPEC_NAME_DESC = 'jcr.specification.name';
/**
* The descriptor key for the name of the repository vendor.
*
* The descriptor returned for this key is a String.
*
* @api
*/
public const REP_VENDOR_DESC = 'jcr.repository.vendor';
/**
* The descriptor key for the URL of the repository vendor.
*
* The descriptor returned for this key is a String.
*
* @api
*/
public const REP_VENDOR_URL_DESC = 'jcr.repository.vendor.url';
/**
* The descriptor key for the name of this repository implementation.
*
* The descriptor returned for this key is a String.
*
* @api
*/
public const REP_NAME_DESC = 'jcr.repository.name';
/**
* The descriptor key for the version of this repository implementation.
*
* The descriptor returned for this key is a String.
*
* @api
*/
public const REP_VERSION_DESC = 'jcr.repository.version';
/**
* Key to a boolean descriptor. Returns true if and only if repository
* content can be updated through the JCR API (as opposed to having
* read-only access).
*
* @api
*/
public const WRITE_SUPPORTED = 'write.supported';
/**
* Key to a String descriptor. Returns one of the following
* RepositoryInterface constants indicating the stability of identifiers:.
*
* - IDENTIFIER_STABILITY_METHOD_DURATION - Identifiers may change between
* method calls.
* - IDENTIFIER_STABILITY_SAVE_DURATION - Identifiers are guaranteed stable
* within a single save/refresh cycle.
* - IDENTIFIER_STABILITY_SESSION_DURATION - Identifiers are guaranteed
* stable within a single session.
* - IDENTIFIER_STABILITY_INDEFINITE_DURATION - Identifiers are guaranteed
* to be stable forever.
*
* @api
*/
public const IDENTIFIER_STABILITY = 'identifier.stability';
/**
* One of four possible values for the descriptor IDENTIFIER_STABILITY.
* Indicates that identifiers may change between method calls.
*
* @api
*/
public const IDENTIFIER_STABILITY_METHOD_DURATION = 'identifier.stability.method.duration';
/**
* One of four possible values for the descriptor IDENTIFIER_STABILITY.
* Indicates that identifiers are guaranteed stable within a single
* save/refresh cycle.
*
* @api
*/
public const IDENTIFIER_STABILITY_SAVE_DURATION = 'identifier.stability.save.duration';
/**
* One of four possible values for the descriptor IDENTIFIER_STABILITY.
* Indicates that identifiers are guaranteed stable within a single
* session.
*
* @api
*/
public const IDENTIFIER_STABILITY_SESSION_DURATION = 'identifier.stability.session.duration';
/**
* One of four possible values for the descriptor IDENTIFIER_STABILITY.
* Indicates that identifiers are guaranteed to be stable forever.
*
* @api
*/
public const IDENTIFIER_STABILITY_INDEFINITE_DURATION = 'identifier.stability.indefinite.duration';
/**
* Key to a boolean descriptor. Returns true if and only if XML export is
* supported.
*
* @api
*/
public const OPTION_XML_EXPORT_SUPPORTED = 'option.xml.export.supported';
/**
* Key to a boolean descriptor. Returns true if and only if XML import is
* supported.
*
* @api
*/
public const OPTION_XML_IMPORT_SUPPORTED = 'option.xml.import.supported';
/**
* Key to a boolean descriptor. Returns true if and only if unfiled content
* is supported.
*
* @api
*/
public const OPTION_UNFILED_CONTENT_SUPPORTED = 'option.unfiled.content.supported';
/**
* Key to a boolean descriptor. Returns true if and only if full versioning
* is supported.
*
* @api
*/
public const OPTION_VERSIONING_SUPPORTED = 'option.versioning.supported';
/**
* Key to a boolean descriptor. Returns true if and only if simple
* versioning is supported.
*
* @api
*/
public const OPTION_SIMPLE_VERSIONING_SUPPORTED = 'option.simple.versioning.supported';
/**
* Key to a boolean descriptor. Returns true if and only if activities are
* supported.
*
* @api
*/
public const OPTION_ACTIVITIES_SUPPORTED = 'option.activities.supported';
/**
* Key to a boolean descriptor. Returns true if and only if configurations
* and baselines are supported.
*
* @api
*/
public const OPTION_BASELINES_SUPPORTED = 'option.baselines.supported';
/**
* Key to a boolean descriptor. Returns true if and only if access control
* is supported.
*
* @api
*/
public const OPTION_ACCESS_CONTROL_SUPPORTED = 'option.access.control.supported';
/**
* Key to a boolean descriptor. Returns true if and only if locking is
* supported.
*
* @api
*/
public const OPTION_LOCKING_SUPPORTED = 'option.locking.supported';
/**
* Key to a boolean descriptor. Returns true if and only if asynchronous
* observation is supported.
*
* @api
*/
public const OPTION_OBSERVATION_SUPPORTED = 'option.observation.supported';
/**
* Key to a boolean descriptor. Returns true if and only if journaled
* observation is supported.
*
* @api
*/
public const OPTION_JOURNALED_OBSERVATION_SUPPORTED = 'option.journaled.observation.supported';
/**
* Key to a boolean descriptor. Returns true if and only if retention and
* hold are supported.
*
* @api
*/
public const OPTION_RETENTION_SUPPORTED = 'option.retention.supported';
/**
* Key to a boolean descriptor. Returns true if and only if lifecycles are
* supported.
*
* @api
*/
public const OPTION_LIFECYCLE_SUPPORTED = 'option.lifecycle.supported';
/**
* Key to a boolean descriptor. Returns true if and only if transactions
* are supported.
*
* @api
*/
public const OPTION_TRANSACTIONS_SUPPORTED = 'option.transactions.supported';
/**
* Key to a boolean descriptor. Returns true if and only if workspace
* management is supported.
*
* @api
*/
public const OPTION_WORKSPACE_MANAGEMENT_SUPPORTED = 'option.workspace.management.supported';
/**
* Key to a boolean descriptor. Returns true if and only if the primary
* node type of an existing node can be updated.
*
* @api
*/
public const OPTION_UPDATE_PRIMARY_NODETYPE_SUPPORTED = 'option.update.primary.nodetype.supported';
/**
* Key to a boolean descriptor. Returns true if and only if the mixin node
* types of an existing node can be added and removed.
*
* @api
*/
public const OPTION_UPDATE_MIXIN_NODETYPES_SUPPORTED = 'option.update.mixin.nodetypes.supported';
/**
* Key to a boolean descriptor. Returns true if and only if the creation of
* shareable nodes is supported.
*
* @api
*/
public const OPTION_SHAREABLE_NODES_SUPPORTED = 'option.shareable.nodes.supported';
/**
* Key to a boolean descriptor. Returns true if and only if node type
* management is supported.
*
* @api
*/
public const OPTION_NODE_TYPE_MANAGEMENT_SUPPORTED = 'option.node.type.management.supported';
/**
* Key to a boolean descriptor. Returns true if and only if node and
* property with same name is supported.
*
* @api
*/
public const OPTION_NODE_AND_PROPERTY_WITH_SAME_NAME_SUPPORTED = 'option.node.and.property.with.same.name.supported';
/**
* Key to string descriptor. Returns one of the following
* RepositoryInterface constants indicating the level of support for node
* type inheritance:.
*
* - NODE_TYPE_MANAGEMENT_INHERITANCE_MINIMAL Registration of primary node
* types is limited to those which have only nt:base as supertype.
* Registration of mixin node types is limited to those without any
* supertypes.
*
* - NODE_TYPE_MANAGEMENT_INHERITANCE_SINGLE Registration of primary node
* types is limited to those with exactly one supertype. Registration
* of mixin node types is limited to those with at most one supertype.
*
* - NODE_TYPE_MANAGEMENT_INHERITANCE_MULTIPLE Primary node types can be
* registered with one or more supertypes. Mixin node types can be
* registered with zero or more supertypes.
*
* @api
*/
public const NODE_TYPE_MANAGEMENT_INHERITANCE = 'node.type.management.inheritance';
/**
* One of three possible values for the descriptor
* NODE_TYPE_MANAGEMENT_INHERITANCE.
*
* Indicates that registration of primary node types is limited to those
* which have only nt:base as supertype. Registration of mixin node types
* is limited to those without any supertypes.
*
* @api
*/
public const NODE_TYPE_MANAGEMENT_INHERITANCE_MINIMAL = 'node.type.management.inheritance.minimal';
/**
* One of three possible values for the descriptor
* NODE_TYPE_MANAGEMENT_INHERITANCE.
*
* Indicates that registration of primary node types is limited to those
* with exactly one supertype. Registration of mixin node types is limited
* to those with at most one supertype.
*
* @api
*/
public const NODE_TYPE_MANAGEMENT_INHERITANCE_SINGLE = 'node.type.management.inheritance.single';
/**
* One of three possible values for the descriptor
* NODE_TYPE_MANAGEMENT_INHERITANCE.
*
* Indicates that primary node types can be registered with one or more
* supertypes. Mixin node types can be registered with zero or more
* supertypes.
*
* @api
*/
public const NODE_TYPE_MANAGEMENT_INHERITANCE_MULTIPLE = 'node.type.management.inheritance.multiple';
/**
* Key to a boolean descriptor. Returns true if and only if override of
* inherited property or child node definitions is supported.
*
* @api
*/
public const NODE_TYPE_MANAGEMENT_OVERRIDES_SUPPORTED = 'node.type.management.overrides.supported';
/**
* Key to a boolean descriptor. Returns true if and only if primary items
* are supported.
*
* @api
*/
public const NODE_TYPE_MANAGEMENT_PRIMARY_ITEM_NAME_SUPPORTED = 'node.type.management.primary.item.name.supported';
/**
* Key to a boolean descriptor. Returns true if and only if preservation of
* child node ordering is supported.
*
* @api
*/
public const NODE_TYPE_MANAGEMENT_ORDERABLE_CHILD_NODES_SUPPORTED = 'node.type.management.orderable.child.nodes.supported';
/**
* Key to a boolean descriptor. Returns true if and only if residual
* property and child node definitions are supported.
*
* @api
*/
public const NODE_TYPE_MANAGEMENT_RESIDUAL_DEFINITIONS_SUPPORTED = 'node.type.management.residual.definitions.supported';
/**
* Key to a boolean descriptor. Returns true if and only if autocreated
* properties and child nodes are supported.
*
* @api
*/
public const NODE_TYPE_MANAGEMENT_AUTOCREATED_DEFINITIONS_SUPPORTED = 'node.type.management.autocreated.definitions.supported';
/**
* Key to a boolean descriptor. Returns true if and only if same-name
* sibling child nodes are supported.
*
* @api
*/
public const NODE_TYPE_MANAGEMENT_SAME_NAME_SIBLINGS_SUPPORTED = 'node.type.management.same.name.siblings.supported';
/**
* Key to an integer[] descriptor. Returns an array holding the
* PropertyType constants for the property types (including
* UNDEFINED, if supported) that a registered node type can specify, or a
* zero-length array if registered node types cannot specify property
* definitions.
*
* @api
*/
public const NODE_TYPE_MANAGEMENT_PROPERTY_TYPES = 'node.type.management.property.types';
/**
* Key to a boolean descriptor. Returns true if and only if multivalue
* properties are supported.
*
* @api
*/
public const NODE_TYPE_MANAGEMENT_MULTIVALUED_PROPERTIES_SUPPORTED = 'node.type.management.multivalued.properties.supported';
/**
* Key to a boolean descriptor. Returns true if and only if registration of
* a node types with more than one BINARY property is permitted.
*
* @api
*/
public const NODE_TYPE_MANAGEMENT_MULTIPLE_BINARY_PROPERTIES_SUPPORTED = 'node.type.management.multiple.binary.properties.supported';
/**
* Key to a boolean descriptor. Returns true if and only value-constraints
* are supported.
*
* @api
*/
public const NODE_TYPE_MANAGEMENT_VALUE_CONSTRAINTS_SUPPORTED = 'node.type.management.value.constraints.supported';
/**
* Key to boolean descriptor. Indicates that you can change node definitions
* that are in-use by existing nodes.
*
* Note: JCR 2.0 had a typo with both the constant name and the value
* (suported instead of supported). PHPCR implementations talking with legacy
* backends should not break on this issue.
*
* @api
*/
public const NODE_TYPE_MANAGEMENT_UPDATE_IN_USE_SUPPORTED = 'node.type.management.update.in.use.supported';
/**
* Key to a string[] descriptor. Returns an array holding the constants
* representing the supported query languages, or a zero-length if query is
* not supported.
*
* @api
*/
public const QUERY_LANGUAGES = 'query.languages';
/**
* Key to a boolean descriptor. Returns true if and only if stored queries
* are supported.
*
* @api
*/
public const QUERY_STORED_QUERIES_SUPPORTED = 'query.stored.queries.supported';
/**
* Key to a boolean descriptor. Returns true if and only if full-text
* search is supported.
*
* @api
*/
public const QUERY_FULL_TEXT_SEARCH_SUPPORTED = 'query.full.text.search.supported';
/**
* Key to String descriptor. Returns one of the following
* RepositoryInterface constants indicating the level of support for joins
* in queries:.
*
* - QUERY_JOINS_NONE - Joins are not supported. Queries are limited to a
* single selector.
* - QUERY_JOINS_INNER - Inner joins are supported.
* - QUERY_JOINS_INNER_OUTER - Inner and outer joins are supported.
*
* @api
*/
public const QUERY_JOINS = 'query.joins';
/**
* One of three possible values for the descriptor QUERY_JOINS . Indicates
* that joins are not supported. Queries are limited to a single selector.
*
* @api
*/
public const QUERY_JOINS_NONE = 'query.joins.none';
/**
* One of three possible values for the descriptor QUERY_JOINS . Indicates
* that inner joins are supported.
*
* @api
*/
public const QUERY_JOINS_INNER = 'query.joins.inner';
/**
* One of three possible values for the descriptor QUERY_JOINS . Indicates
* that inner and outer joins are supported.
*
* @api
*/
public const QUERY_JOINS_INNER_OUTER = 'query.joins.inner.outer';
/**
* Key to a boolean descriptor. Returns true if
* and only if query cancellation is supported.
*
* @since JCR 2.1
*/
public const QUERY_CANCEL_SUPPORTED = 'query.cancel.supported';
/**
* Authenticates the user using the supplied credentials.
*
* If workspaceName is recognized as the name of an existing workspace in
* the repository and authorization to access that workspace is granted,
* then a new Session object is returned. The format of the string
* workspaceName depends upon the implementation. If credentials is null,
* it is assumed that authentication is handled by a mechanism external to
* the repository itself and that the repository implementation exists
* within a context (for example, an application server) that allows it to
* handle authorization of the request for access to the specified
* workspace.
*
* If workspaceName is null, a default workspace is automatically selected
* by the repository implementation. This may, for example, be the "home
* workspace" of the user whose credentials were passed, though this is
* entirely up to the configuration and implementation of the repository.
* Alternatively, it may be a "null workspace" that serves only to provide
* the method WorkspaceInterface::getAccessibleWorkspaceNames(), allowing
* the client to select from among available "real" workspaces.
*
* <b>Note:</b> The Java API defines this method with multiple differing
* signatures.
*
* @param CredentialsInterface $credentials The credentials of the
* user
* @param string $workspaceName the name of a workspace
*
* @return SessionInterface a valid session for the user to access
* the repository
*
* @throws LoginException if authentication or authorization (for
* the specified workspace) fails
* @throws NoSuchWorkspaceException if the specified workspaceName
* is not recognized
* @throws RepositoryException if another error occurs
*
* @api
*/
public function login(?CredentialsInterface $credentials = null, $workspaceName = null);
/**
* All descriptor keys available for this implementation.
*
* Both, the standard descriptors defined by the string constants in this
* interface and any implementation-specific descriptors. Used in
* conjunction with getDescriptor($key) to query information about this
* repository implementation.
*
* @return string[]
*
* @api
*/
public function getDescriptorKeys();
/**
* Determines if the given identifier is a standard descriptor.
*
* Returns true if $key is a standard descriptor defined by the string
* constants in this interface and false if it is either a valid
* implementation-specific key or not a valid key.
*
* @param string $key a descriptor key
*
* @return bool whether $key is a standard descriptor
*
* @api
*/
public function isStandardDescriptor($key);
/**
* Get the value(s) for this key.
*
* If this is documented as a boolean property, this method returns a
* boolean, otherwise a string.
*
* @param string $key a descriptor key
*
* @return mixed a descriptor value in string or boolean form or an array
* of strings or booleans for multivalue descriptors
*
* @api
*/
public function getDescriptor($key);
}