1
|
|
|
<?php |
2
|
|
|
namespace Dkd\PhpCmis\Bindings\Browser; |
3
|
|
|
|
4
|
|
|
/** |
5
|
|
|
* This file is part of php-cmis-lib. |
6
|
|
|
* |
7
|
|
|
* (c) Sascha Egerer <[email protected]> |
8
|
|
|
* |
9
|
|
|
* For the full copyright and license information, please view the LICENSE |
10
|
|
|
* file that was distributed with this source code. |
11
|
|
|
*/ |
12
|
|
|
|
13
|
|
|
use Dkd\PhpCmis\Constants; |
14
|
|
|
use Dkd\PhpCmis\Data\AclInterface; |
15
|
|
|
use GuzzleHttp\Stream\StreamInterface; |
16
|
|
|
use Dkd\PhpCmis\Data\ExtensionDataInterface; |
17
|
|
|
use Dkd\PhpCmis\Data\ObjectDataInterface; |
18
|
|
|
use Dkd\PhpCmis\Data\PropertiesInterface; |
19
|
|
|
use Dkd\PhpCmis\VersioningServiceInterface; |
20
|
|
|
use Dkd\PhpCmis\Enum\IncludeRelationships; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Versioning Service Browser Binding client. |
24
|
|
|
*/ |
25
|
|
|
class VersioningService extends AbstractBrowserBindingService implements VersioningServiceInterface |
26
|
|
|
{ |
27
|
|
|
/** |
28
|
|
|
* Reverses the effect of a check-out. |
29
|
|
|
* |
30
|
|
|
* @param string $repositoryId the identifier for the repository |
31
|
|
|
* @param string $objectId the identifier for the PWC |
32
|
|
|
* @param ExtensionDataInterface|null $extension |
33
|
|
|
*/ |
34
|
|
|
public function cancelCheckOut($repositoryId, $objectId, ExtensionDataInterface $extension = null) |
35
|
|
|
{ |
36
|
|
|
// TODO: Implement cancelCheckOut() method. |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Checks-in the private working copy (PWC) document. |
41
|
|
|
* |
42
|
|
|
* @param string $repositoryId the identifier for the repository |
43
|
|
|
* @param string $objectId input: the identifier for the PWC, |
44
|
|
|
* output: the identifier for the newly created version document |
45
|
|
|
* @param boolean $major indicator if the new version should become a major (<code>true</code>) or minor |
46
|
|
|
* (<code>false</code>) version |
47
|
|
|
* @param PropertiesInterface|null $properties the property values that must be applied to the |
48
|
|
|
* newly created document object |
49
|
|
|
* @param StreamInterface|null $contentStream the content stream that must be stored |
50
|
|
|
* for the newly created document object |
51
|
|
|
* @param string|null $checkinComment a version comment |
52
|
|
|
* @param string[] $policies a list of policy IDs that must be applied to the newly created document object |
53
|
|
|
* @param AclInterface|null $addAces a list of ACEs that must be added to the newly created document object |
54
|
|
|
* @param AclInterface|null $removeAces a list of ACEs that must be removed from the newly created document object |
55
|
|
|
* @param ExtensionDataInterface|null $extension |
56
|
|
|
*/ |
57
|
|
|
public function checkIn( |
58
|
|
|
$repositoryId, |
59
|
|
|
$objectId, |
60
|
|
|
$major = true, |
61
|
|
|
PropertiesInterface $properties = null, |
62
|
|
|
StreamInterface $contentStream = null, |
63
|
|
|
$checkinComment = null, |
64
|
|
|
array $policies = array(), |
65
|
|
|
AclInterface $addAces = null, |
66
|
|
|
AclInterface $removeAces = null, |
67
|
|
|
ExtensionDataInterface $extension = null |
68
|
|
|
) { |
69
|
|
|
// TODO: Implement checkIn() method. |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* Create a private working copy of the document. |
74
|
|
|
* |
75
|
|
|
* @param string $repositoryId the identifier for the repository |
76
|
|
|
* @param string $objectId input: the identifier for the document that should be checked out, |
77
|
|
|
* output: the identifier for the newly created PWC |
78
|
|
|
* @param ExtensionDataInterface|null $extension |
79
|
|
|
* @param boolean|null $contentCopied output: indicator if the content of the original |
80
|
|
|
* document has been copied to the PWC |
81
|
|
|
*/ |
82
|
|
|
public function checkOut( |
83
|
|
|
$repositoryId, |
84
|
|
|
& $objectId, |
85
|
|
|
ExtensionDataInterface $extension = null, |
86
|
|
|
$contentCopied = null |
87
|
|
|
) { |
88
|
|
|
// TODO: Implement checkOut() method. |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* Returns the list of all document objects in the specified version series, |
93
|
|
|
* sorted by the property "cmis:creationDate" descending. |
94
|
|
|
* |
95
|
|
|
* @param string $repositoryId the identifier for the repository |
96
|
|
|
* @param string $objectId the identifier for the object |
97
|
|
|
* @param string $versionSeriesId the identifier for the object |
98
|
|
|
* @param string|null $filter a comma-separated list of query names that defines which properties must be |
99
|
|
|
* returned by the repository (default is repository specific) |
100
|
|
|
* @param boolean $includeAllowableActions if <code>true</code>, then the repository must return the allowable |
101
|
|
|
* actions for the objects (default is <code>false</code>) |
102
|
|
|
* @param ExtensionDataInterface|null $extension |
103
|
|
|
* @return ObjectDataInterface[] the complete version history of the version series |
104
|
|
|
*/ |
105
|
|
|
public function getAllVersions( |
106
|
|
|
$repositoryId, |
107
|
|
|
$objectId, |
108
|
|
|
$versionSeriesId, |
109
|
|
|
$filter = null, |
110
|
|
|
$includeAllowableActions = false, |
111
|
|
|
ExtensionDataInterface $extension = null |
112
|
|
|
) { |
113
|
|
|
// TODO: Implement getAllVersions() method. |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* Get the latest document object in the version series. |
118
|
|
|
* |
119
|
|
|
* @param string $repositoryId the identifier for the repository |
120
|
|
|
* @param string $objectId |
121
|
|
|
* @param string $versionSeriesId |
122
|
|
|
* @param boolean $major |
123
|
|
|
* @param string|null $filter a comma-separated list of query names that defines which properties must be |
124
|
|
|
* returned by the repository (default is repository specific) |
125
|
|
|
* @param boolean $includeAllowableActions |
126
|
|
|
* @param IncludeRelationships|null $includeRelationships indicates what relationships in which the objects |
127
|
|
|
* participate must be returned (default is <code>IncludeRelationships::NONE</code>) |
128
|
|
|
* @param string $renditionFilter indicates what set of renditions the repository must return whose kind |
129
|
|
|
* matches this filter (default is "cmis:none") |
130
|
|
|
* @param boolean $includePolicyIds if <code>true</code>, then the repository must return the policy ids for |
131
|
|
|
* the object (default is <code>false</code>) |
132
|
|
|
* @param boolean $includeAcl if <code>true</code>, then the repository must return the ACL for the object |
133
|
|
|
* (default is <code>false</code>) |
134
|
|
|
* @param ExtensionDataInterface|null $extension |
135
|
|
|
* @return ObjectDataInterface |
136
|
|
|
*/ |
137
|
|
View Code Duplication |
public function getObjectOfLatestVersion( |
138
|
|
|
$repositoryId, |
139
|
|
|
$objectId, |
140
|
|
|
$versionSeriesId, |
141
|
|
|
$major = false, |
142
|
|
|
$filter = null, |
143
|
|
|
$includeAllowableActions = false, |
144
|
|
|
IncludeRelationships $includeRelationships = null, |
145
|
|
|
$renditionFilter = Constants::RENDITION_NONE, |
146
|
|
|
$includePolicyIds = false, |
147
|
|
|
$includeAcl = false, |
148
|
|
|
ExtensionDataInterface $extension = null |
149
|
|
|
) { |
150
|
|
|
// TODO: Implement getObjectOfLatestVersion() method. |
151
|
|
|
} |
152
|
|
|
|
153
|
|
|
/** |
154
|
|
|
* Get a subset of the properties for the latest document object in the version series. |
155
|
|
|
* |
156
|
|
|
* @param string $repositoryId the identifier for the repository |
157
|
|
|
* @param string $objectId The identifier for the object |
158
|
|
|
* @param string $versionSeriesId The identifier for the version series. |
159
|
|
|
* @param boolean $major If <code>true</code>, then the repository MUST return the properties for the latest |
160
|
|
|
* major version object in the version series. |
161
|
|
|
* If <code>false</code>, the repository MUST return the properties for the latest |
162
|
|
|
* (major or non-major) version object in the version series. |
163
|
|
|
* @param string|null $filter a comma-separated list of query names that defines which properties must be |
164
|
|
|
* returned by the repository (default is repository specific) |
165
|
|
|
* @param ExtensionDataInterface|null $extension |
166
|
|
|
* @return PropertiesInterface |
167
|
|
|
*/ |
168
|
|
|
public function getPropertiesOfLatestVersion( |
169
|
|
|
$repositoryId, |
170
|
|
|
$objectId, |
171
|
|
|
$versionSeriesId, |
172
|
|
|
$major = false, |
173
|
|
|
$filter = null, |
174
|
|
|
ExtensionDataInterface $extension = null |
175
|
|
|
) { |
176
|
|
|
// TODO: Implement getPropertiesOfLatestVersion() method. |
177
|
|
|
} |
178
|
|
|
} |
179
|
|
|
|