1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package org.apache.chemistry.opencmis.commons.spi;
20
21 import java.util.List;
22
23 import org.apache.chemistry.opencmis.commons.data.Acl;
24 import org.apache.chemistry.opencmis.commons.data.ContentStream;
25 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
26 import org.apache.chemistry.opencmis.commons.data.ObjectData;
27 import org.apache.chemistry.opencmis.commons.data.Properties;
28 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
29
30 /**
31 * Versioning Service interface.
32 *
33 * <p>
34 * <em>
35 * See the CMIS 1.0 and CMIS 1.1 specifications for details on the operations, parameters,
36 * exceptions and the domain model.
37 * </em>
38 * </p>
39 */
40 public interface VersioningService {
41 /**
42 * Create a private working copy of the document.
43 *
44 * @param repositoryId
45 * the identifier for the repository
46 * @param objectId
47 * input: the identifier for the document that should be checked
48 * out, output: the identifier for the newly created PWC
49 * @param extension
50 * extension data
51 * @param contentCopied
52 * output: indicator if the content of the original document has
53 * been copied to the PWC
54 */
55 void checkOut(String repositoryId, Holder<String> objectId, ExtensionsData extension, Holder<Boolean> contentCopied);
56
57 /**
58 * Reverses the effect of a check-out.
59 *
60 * @param repositoryId
61 * the identifier for the repository
62 * @param objectId
63 * the identifier for the PWC
64 * @param extension
65 * extension data
66 */
67 void cancelCheckOut(String repositoryId, String objectId, ExtensionsData extension);
68
69 /**
70 * Checks-in the private working copy (PWC) document.
71 *
72 * The stream in {@code contentStream} is consumed but not closed by this
73 * method.
74 *
75 * @param repositoryId
76 * the identifier for the repository
77 * @param objectId
78 * input: the identifier for the PWC, output: the identifier for
79 * the newly created version document
80 * @param major
81 * indicator if the new version should become a major (
82 * {@code true}) or minor ({@code false}) version
83 * @param properties
84 * <em>(optional)</em> the property values that must be applied
85 * to the newly created document object
86 * @param contentStream
87 * <em>(optional)</em> the content stream that must be stored for
88 * the newly created document object
89 * @param checkinComment
90 * <em>(optional)</em> a version comment
91 * @param policies
92 * <em>(optional)</em> a list of policy IDs that must be applied
93 * to the newly created document object
94 * @param addAces
95 * <em>(optional)</em> a list of ACEs that must be added to the
96 * newly created document object
97 * @param removeAces
98 * <em>(optional)</em> a list of ACEs that must be removed from
99 * the newly created document object
100 * @param extension
101 * extension data
102 */
103 void checkIn(String repositoryId, Holder<String> objectId, Boolean major, Properties properties,
104 ContentStream contentStream, String checkinComment, List<String> policies, Acl addAces, Acl removeAces,
105 ExtensionsData extension);
106
107 /**
108 * Get the latest document object in the version series.
109 *
110 * @param repositoryId
111 * the identifier for the repository
112 * @param objectId
113 * the identifier for the object
114 * @param versionSeriesId
115 * the version series ID
116 * @param filter
117 * <em>(optional)</em> a comma-separated list of query names that
118 * defines which properties must be returned by the repository
119 * (default is repository specific)
120 * @param extension
121 * extension data
122 * @return the document object
123 */
124 ObjectData getObjectOfLatestVersion(String repositoryId, String objectId, String versionSeriesId, Boolean major,
125 String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
126 String renditionFilter, Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension);
127
128 /**
129 * Get a subset of the properties for the latest document object in the
130 * version series.
131 *
132 * @param repositoryId
133 * the identifier for the repository
134 * @param objectId
135 * the identifier for the object
136 * @param versionSeriesId
137 * the version series ID
138 * @param filter
139 * <em>(optional)</em> a comma-separated list of query names that
140 * defines which properties must be returned by the repository
141 * (default is repository specific)
142 * @param extension
143 * extension data
144 * @return the document properties
145 */
146 Properties getPropertiesOfLatestVersion(String repositoryId, String objectId, String versionSeriesId,
147 Boolean major, String filter, ExtensionsData extension);
148
149 /**
150 * Returns the list of all document objects in the specified version series,
151 * sorted by the property "cmis:creationDate" descending.
152 *
153 * Either the {@code objectId} or the {@code versionSeriesId} parameter must
154 * be set.
155 *
156 * @param repositoryId
157 * the identifier for the repository
158 * @param objectId
159 * the identifier for the object
160 * @param versionSeriesId
161 * the identifier for the object
162 * @param filter
163 * <em>(optional)</em> a comma-separated list of query names that
164 * defines which properties must be returned by the repository
165 * (default is repository specific)
166 * @param includeAllowableActions
167 * <em>(optional)</em> if {@code true}, then the repository must
168 * return the allowable actions for the objects (default is
169 * {@code false})
170 * @param extension
171 * extension data
172 * @return the complete version history of the version series
173 */
174 List<ObjectData> getAllVersions(String repositoryId, String objectId, String versionSeriesId, String filter,
175 Boolean includeAllowableActions, ExtensionsData extension);
176 }