chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1373127 - in /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl: DocumentVersionImpl.java VersionedDocumentImpl.java
Date Tue, 14 Aug 2012 21:38:17 GMT
Author: jens
Date: Tue Aug 14 21:38:16 2012
New Revision: 1373127

URL: http://svn.apache.org/viewvc?rev=1373127&view=rev
Log:
InMemory fix bug do not use older names in version history on checkout 

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/VersionedDocumentImpl.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java?rev=1373127&r1=1373126&r2=1373127&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java
Tue Aug 14 21:38:16 2012
@@ -284,5 +284,9 @@ public class DocumentVersionImpl extends
       return true;
     }
 
+    public void rename(String newName) {
+    	super.rename(newName);
+    	fContainer.setName(newName);
+    }
 
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/VersionedDocumentImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/VersionedDocumentImpl.java?rev=1373127&r1=1373126&r2=1373127&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/VersionedDocumentImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/VersionedDocumentImpl.java
Tue Aug 14 21:38:16 2012
@@ -131,6 +131,9 @@ public class VersionedDocumentImpl exten
     public DocumentVersion getLatestVersion(boolean major) {
 
         DocumentVersion latest = null;
+        if (fVersions.size() == 0)
+        	return null;
+        
         if (major) {
             for (DocumentVersion ver : fVersions) {
                 if (ver.isMajor()) {
@@ -200,6 +203,13 @@ public class VersionedDocumentImpl exten
         fIsCheckedOut = false;
         fCheckedOutUser = null;
         fVersions.remove(pwc);
+        if (fVersions.size() > 0) {
+        	String nameLatestVer = getLatestVersion(false).getName();
+        	if (!getName().equals(nameLatestVer)) {
+        		setName(nameLatestVer);
+        	}        	
+        }
+
         if (deleteInObjectStore)
             fObjStore.removeVersion(pwc);
     }



Mime
View raw message