Skip to content

Commit c019f41

Browse files
authored
Merge pull request #324 from openkm/issue/323
Document Service end point does not consider the "increment" field du…
2 parents 1b19602 + bd25915 commit c019f41

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/main/java/com/openkm/rest/endpoint/DocumentService.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ public Version checkin(List<Attachment> atts) throws GenericException {
296296
String docId = null;
297297
String comment = null;
298298
InputStream is = null;
299+
int increment = -1;
299300

300301
for (Attachment att : atts) {
301302
if ("docId".equals(att.getContentDisposition().getParameter("name"))) {
@@ -304,11 +305,20 @@ public Version checkin(List<Attachment> atts) throws GenericException {
304305
comment = att.getObject(String.class);
305306
} else if ("content".equals(att.getContentDisposition().getParameter("name"))) {
306307
is = att.getDataHandler().getInputStream();
308+
} else if ("increment".equals(att.getContentDisposition().getParameter("name"))) {
309+
increment = Integer.parseInt(att.getObject(String.class));
307310
}
308311
}
309312

310313
DocumentModule dm = ModuleManager.getDocumentModule();
311-
Version version = dm.checkin(null, docId, is, comment);
314+
Version version;
315+
316+
if (increment >= 0) {
317+
version = dm.checkin(null, docId, is, comment, increment);
318+
} else {
319+
version = dm.checkin(null, docId, is, comment);
320+
}
321+
312322
IOUtils.closeQuietly(is);
313323
log.debug("checkin: {}", version);
314324
return version;

0 commit comments

Comments
 (0)