chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1781387 - in /chemistry/opencmis/trunk/chemistry-opencmis-client: chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/ chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/
Date Thu, 02 Feb 2017 12:57:25 GMT
Author: fmui
Date: Thu Feb  2 12:57:24 2017
New Revision: 1781387

URL: http://svn.apache.org/viewvc?rev=1781387&view=rev
Log:
added isVersionSeriesPrivateWorkingCopy() to Document

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/DocumentProperties.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/DocumentImpl.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java?rev=1781387&r1=1781386&r2=1781387&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java
Thu Feb  2 12:57:24 2017
@@ -57,6 +57,23 @@ public interface Document extends Fileab
      */
     boolean isVersionable();
 
+    /**
+     * Determines whether this document is the PWC in the version series or not.
+     * 
+     * The evaluation is based on the properties
+     * {@code cmis:isVersionSeriesCheckedOut},
+     * {@code cmis:isPrivateWorkingCopy}, and
+     * {@code cmis:versionSeriesCheckedOutId} and works for all CMIS versions.
+     * 
+     * @return {@code true} if it is the PWC, {@code false} if it is not the
+     *         PWC, or {@code null} if it can't be determined
+     * 
+     * @see DocumentProperties#isPrivateWorkingCopy()
+     * 
+     * @cmis 1.0
+     */
+    Boolean isVersionSeriesPrivateWorkingCopy();
+
     // object service
 
     /**

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/DocumentProperties.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/DocumentProperties.java?rev=1781387&r1=1781386&r2=1781387&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/DocumentProperties.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/DocumentProperties.java
Thu Feb  2 12:57:24 2017
@@ -85,6 +85,8 @@ public interface DocumentProperties {
      *         hasn't been requested, hasn't been provided by the repository, or
      *         the property value isn't set
      * 
+     * @see Document#isVersionSeriesPrivateWorkingCopy()
+     * 
      * @cmis 1.1
      */
     Boolean isPrivateWorkingCopy();

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/DocumentImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/DocumentImpl.java?rev=1781387&r1=1781386&r2=1781387&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/DocumentImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/DocumentImpl.java
Thu Feb  2 12:57:24 2017
@@ -83,6 +83,31 @@ public class DocumentImpl extends Abstra
         return Boolean.TRUE.equals(getDocumentType().isVersionable());
     }
 
+    @Override
+    public Boolean isVersionSeriesPrivateWorkingCopy() {
+        if (Boolean.FALSE.equals(getDocumentType().isVersionable())) {
+            return false;
+        }
+
+        Boolean isCheckedOut = isVersionSeriesCheckedOut();
+        if (Boolean.FALSE.equals(isCheckedOut)) {
+            return false;
+        }
+
+        Boolean isPWC = isPrivateWorkingCopy();
+        if (isPWC != null) {
+            return isPWC;
+        }
+
+        String vsCoId = getVersionSeriesCheckedOutId();
+        if (vsCoId == null) {
+            // we don't know ...
+            return null;
+        }
+
+        return vsCoId.equals(getId());
+    }
+
     // properties
 
     @Override
@@ -620,7 +645,8 @@ public class DocumentImpl extends Abstra
     }
 
     @Override
-    public ObjectId checkIn(boolean major, Map<String, ?> properties, ContentStream
contentStream, String checkinComment) {
+    public ObjectId checkIn(boolean major, Map<String, ?> properties, ContentStream
contentStream,
+            String checkinComment) {
         return this.checkIn(major, properties, contentStream, checkinComment, null, null,
null);
     }
 }



Mime
View raw message