chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fguilla...@apache.org
Subject svn commit: r992351 - in /incubator/chemistry/opencmis/trunk: chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/ chemistry-opencmis-server/chemistry-opencmis-server-fileshare...
Date Fri, 03 Sep 2010 16:21:50 GMT
Author: fguillaume
Date: Fri Sep  3 16:21:50 2010
New Revision: 992351

URL: http://svn.apache.org/viewvc?rev=992351&view=rev
Log:
Better constructor for TypeDefinitionListImpl

Modified:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/TypeDefinitionListImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/TypeManager.java

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/TypeDefinitionListImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/TypeDefinitionListImpl.java?rev=992351&r1=992350&r2=992351&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/TypeDefinitionListImpl.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/TypeDefinitionListImpl.java
Fri Sep  3 16:21:50 2010
@@ -26,7 +26,6 @@ import org.apache.chemistry.opencmis.com
 
 /**
  * @author <a href="mailto:fmueller@opentext.com">Florian M&uuml;ller</a>
- * 
  */
 public class TypeDefinitionListImpl extends AbstractExtensionData implements TypeDefinitionList
{
 
@@ -34,11 +33,23 @@ public class TypeDefinitionListImpl exte
     private Boolean fHasMoreItems = Boolean.FALSE;
     private BigInteger fNumItems;
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.opencmis.client.provider.TypeDefintionList#getList()
+    /**
+     * Default constructor.
      */
+    public TypeDefinitionListImpl() {
+    }
+
+    /**
+     * Constructor from a list.
+     *
+     * @param list the initial list
+     */
+    public TypeDefinitionListImpl(List<TypeDefinition> list) {
+        fList = list;
+        fHasMoreItems = Boolean.FALSE;
+        fNumItems = BigInteger.valueOf(list.size());
+    }
+
     public List<TypeDefinition> getList() {
         return fList;
     }
@@ -47,11 +58,6 @@ public class TypeDefinitionListImpl exte
         fList = list;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.opencmis.client.provider.TypeDefintionList#hasMoreItems()
-     */
     public Boolean hasMoreItems() {
         return fHasMoreItems;
     }
@@ -60,11 +66,6 @@ public class TypeDefinitionListImpl exte
         fHasMoreItems = hasMoreItems;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.opencmis.client.provider.TypeDefintionList#getNumItems()
-     */
     public BigInteger getNumItems() {
         return fNumItems;
     }
@@ -73,11 +74,6 @@ public class TypeDefinitionListImpl exte
         fNumItems = numItems;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see java.lang.Object#toString()
-     */
     @Override
     public String toString() {
         return "Type Definition List [list=" + fList + ", has more items=" + fHasMoreItems
+ ", num items=" + fNumItems

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/TypeManager.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/TypeManager.java?rev=992351&r1=992350&r2=992351&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/TypeManager.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/TypeManager.java
Fri Sep  3 16:21:50 2010
@@ -59,9 +59,9 @@ import org.apache.commons.logging.LogFac
 
 /**
  * Type Manager.
- * 
+ *
  * @author <a href="mailto:fmueller@opentext.com">Florian M&uuml;ller</a>
- * 
+ *
  */
 public class TypeManager {
     public final static String DOCUMENT_TYPE_ID = "cmis:document";
@@ -396,10 +396,7 @@ public class TypeManager {
      */
     public TypeDefinitionList getTypesChildren(CallContext context, String typeId, boolean
includePropertyDefinitions,
             BigInteger maxItems, BigInteger skipCount) {
-        TypeDefinitionListImpl result = new TypeDefinitionListImpl();
-        result.setList(new ArrayList<TypeDefinition>());
-        result.setHasMoreItems(false);
-        result.setNumItems(BigInteger.valueOf(0));
+        TypeDefinitionListImpl result = new TypeDefinitionListImpl(new ArrayList<TypeDefinition>());
 
         int skip = (skipCount == null ? 0 : skipCount.intValue());
         if (skip < 0) {



Mime
View raw message