chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r946043 - in /incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory: server/ storedobj/api/ storedobj/impl/
Date Wed, 19 May 2010 06:32:22 GMT
Author: jens
Date: Wed May 19 06:32:22 2010
New Revision: 946043

URL: http://svn.apache.org/viewvc?rev=946043&view=rev
Log:
Do some cleanup
Small optimization to fill AtomPub information

Modified:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AtomLinkInfoProvider.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Filing.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/AbstractMultiFilingImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/AbstractSingleFilingImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AtomLinkInfoProvider.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AtomLinkInfoProvider.java?rev=946043&r1=946042&r2=946043&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AtomLinkInfoProvider.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AtomLinkInfoProvider.java
Wed May 19 06:32:22 2010
@@ -116,7 +116,7 @@ public class AtomLinkInfoProvider {
         // Filing
         if (so instanceof Filing) {
             Filing sop = ((Filing) so);
-            objInfo.setHasParent(!sop.getParents().isEmpty());
+            objInfo.setHasParent(sop.hasParent());
         } else {
             objInfo.setHasParent(false);
         }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Filing.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Filing.java?rev=946043&r1=946042&r2=946043&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Filing.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Filing.java
Wed May 19 06:32:22 2010
@@ -44,6 +44,16 @@ public interface Filing {
      * @return list of parent folders
      */
     List<Folder> getParents();
+    
+    /**
+     * usually true except for the root folder, optimized call that just tests
+     * existence to provide information for AtomPub links (much cheaper than
+     * calling getParents() and test for empty result.
+     * 
+     * @return
+     *    true if object has a parent, false if it is a root object
+     */
+    boolean hasParent();
 
     /**
      * Move an object to a different folder. Source and target object are

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/AbstractMultiFilingImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/AbstractMultiFilingImpl.java?rev=946043&r1=946042&r2=946043&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/AbstractMultiFilingImpl.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/AbstractMultiFilingImpl.java
Wed May 19 06:32:22 2010
@@ -103,6 +103,10 @@ public abstract class AbstractMultiFilin
         return fParents;
     }
 
+    public boolean hasParent() {
+      return null != fParents && !fParents.isEmpty();
+    }
+      
     /*
      * (non-Javadoc)
      * 

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/AbstractSingleFilingImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/AbstractSingleFilingImpl.java?rev=946043&r1=946042&r2=946043&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/AbstractSingleFilingImpl.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/AbstractSingleFilingImpl.java
Wed May 19 06:32:22 2010
@@ -82,6 +82,10 @@ public abstract class AbstractSingleFili
         return fParent;
     }
 
+    public boolean hasParent() {
+      return null != fParent;
+    }
+
     public List<Folder> getParents() {
         if (null == fParent)
             return Collections.emptyList();

Modified: incubator/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/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java?rev=946043&r1=946042&r2=946043&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java
Wed May 19 06:32:22 2010
@@ -249,4 +249,8 @@ public class DocumentVersionImpl extends
         return null != fContent;
     }
 
+    public boolean hasParent() {
+      return true;
+    }
+
 }



Mime
View raw message