chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1067794 - in /incubator/chemistry/opencmis/trunk: chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/ chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/o...
Date Sun, 06 Feb 2011 22:44:47 GMT
Author: fmui
Date: Sun Feb  6 22:44:46 2011
New Revision: 1067794

URL: http://svn.apache.org/viewvc?rev=1067794&view=rev
Log:
a little code and comment clean up

Modified:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractFilableCmisObject.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/CmisBindingHelper.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/FolderImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionFactoryImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/SessionParameter.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/spi/CmisBinding.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/Converter.java

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractFilableCmisObject.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractFilableCmisObject.java?rev=1067794&r1=1067793&r2=1067794&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractFilableCmisObject.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractFilableCmisObject.java
Sun Feb  6 22:44:46 2011
@@ -46,13 +46,13 @@ public abstract class AbstractFilableCmi
         String objectId = getObjectId();
 
         // get object ids of the parent folders
-        List<ObjectParentData> providerParents = getBinding().getNavigationService().getObjectParents(
+        List<ObjectParentData> bindingParents = getBinding().getNavigationService().getObjectParents(
                 getRepositoryId(), objectId, getPropertyQueryName(PropertyIds.OBJECT_ID),
false,
                 IncludeRelationships.NONE, null, false, null);
 
         List<Folder> parents = new ArrayList<Folder>();
 
-        for (ObjectParentData p : providerParents) {
+        for (ObjectParentData p : bindingParents) {
             if ((p == null) || (p.getObject() == null) || (p.getObject().getProperties()
== null)) {
                 // should not happen...
                 throw new CmisRuntimeException("Repository sent invalid data!");
@@ -83,13 +83,13 @@ public abstract class AbstractFilableCmi
         String objectId = getObjectId();
 
         // get object paths of the parent folders
-        List<ObjectParentData> providerParents = getBinding().getNavigationService().getObjectParents(
+        List<ObjectParentData> bindingParents = getBinding().getNavigationService().getObjectParents(
                 getRepositoryId(), objectId, getPropertyQueryName(PropertyIds.PATH), false,
IncludeRelationships.NONE,
                 null, true, null);
 
         List<String> paths = new ArrayList<String>();
 
-        for (ObjectParentData p : providerParents) {
+        for (ObjectParentData p : bindingParents) {
             if ((p == null) || (p.getObject() == null) || (p.getObject().getProperties()
== null)) {
                 // should not happen...
                 throw new CmisRuntimeException("Repository sent invalid data!");

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/CmisBindingHelper.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/CmisBindingHelper.java?rev=1067794&r1=1067793&r2=1067794&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/CmisBindingHelper.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/CmisBindingHelper.java
Sun Feb  6 22:44:46 2011
@@ -31,9 +31,9 @@ import org.apache.chemistry.opencmis.com
  */
 public class CmisBindingHelper {
     /**
-     * Creates a {@link CmisProvider} object.
+     * Creates a {@link CmisBinding} object.
      */
-    public static CmisBinding createProvider(Map<String, String> parameters) {
+    public static CmisBinding createBinding(Map<String, String> parameters) {
         if (parameters == null || parameters.isEmpty()) {
             throw new CmisRuntimeException("Session parameter not set!");
         }
@@ -59,7 +59,7 @@ public class CmisBindingHelper {
     }
 
     /**
-     * Creates a provider with custom parameters.
+     * Creates a binding with custom parameters.
      */
     private static CmisBinding createCustomBinding(Map<String, String> parameters)
{
         CmisBindingFactory factory = CmisBindingFactory.newInstance();
@@ -69,7 +69,7 @@ public class CmisBindingHelper {
     }
 
     /**
-     * Creates a Web Services provider.
+     * Creates a Web Services binding.
      */
     private static CmisBinding createWebServiceBinding(Map<String, String> parameters)
{
         CmisBindingFactory factory = CmisBindingFactory.newInstance();
@@ -79,7 +79,7 @@ public class CmisBindingHelper {
     }
 
     /**
-     * Creates an AtomPub provider.
+     * Creates an AtomPub binding.
      */
     private static CmisBinding createAtomPubBinding(Map<String, String> parameters)
{
         CmisBindingFactory factory = CmisBindingFactory.newInstance();
@@ -89,7 +89,7 @@ public class CmisBindingHelper {
     }
 
     /**
-     * Creates a local provider.
+     * Creates a local binding.
      */
     private static CmisBinding createLocalBinding(Map<String, String> parameters) {
         CmisBindingFactory factory = CmisBindingFactory.newInstance();

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/FolderImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/FolderImpl.java?rev=1067794&r1=1067793&r2=1067794&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/FolderImpl.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/FolderImpl.java
Sun Feb  6 22:44:46 2011
@@ -21,10 +21,8 @@ package org.apache.chemistry.opencmis.cl
 import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 import org.apache.chemistry.opencmis.client.api.CmisObject;
 import org.apache.chemistry.opencmis.client.api.Document;
@@ -55,7 +53,6 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.data.PropertyString;
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
 import org.apache.chemistry.opencmis.commons.enums.UnfileObject;
-import org.apache.chemistry.opencmis.commons.enums.Updatability;
 import org.apache.chemistry.opencmis.commons.enums.VersioningState;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
 import org.apache.chemistry.opencmis.commons.spi.NavigationService;
@@ -64,12 +61,6 @@ public class FolderImpl extends Abstract
 
     private static final long serialVersionUID = 1L;
 
-    private static final Set<Updatability> CREATE_UPDATABILITY = new HashSet<Updatability>();
-    static {
-        CREATE_UPDATABILITY.add(Updatability.ONCREATE);
-        CREATE_UPDATABILITY.add(Updatability.READWRITE);
-    }
-
     /**
      * Constructor.
      */
@@ -290,7 +281,7 @@ public class FolderImpl extends Abstract
                 context.isIncludeAllowableActions(), context.getIncludeRelationships(),
                 context.getRenditionFilterString(), context.isIncludePathSegments(), null);
 
-        return convertProviderContainer(providerContainerList, context);
+        return convertBindingContainer(providerContainerList, context);
     }
 
     public List<Tree<FileableCmisObject>> getFolderTree(int depth) {
@@ -306,22 +297,22 @@ public class FolderImpl extends Abstract
                 context.isIncludeAllowableActions(), context.getIncludeRelationships(),
                 context.getRenditionFilterString(), context.isIncludePathSegments(), null);
 
-        return convertProviderContainer(providerContainerList, context);
+        return convertBindingContainer(providerContainerList, context);
     }
 
     /**
-     * Converts a provider container into an API container.
+     * Converts a binding container into an API container.
      */
-    private List<Tree<FileableCmisObject>> convertProviderContainer(
-            List<ObjectInFolderContainer> providerContainerList, OperationContext context)
{
-        if (providerContainerList == null) {
+    private List<Tree<FileableCmisObject>> convertBindingContainer(
+            List<ObjectInFolderContainer> bindingContainerList, OperationContext context)
{
+        if (bindingContainerList == null) {
             return null;
         }
 
         ObjectFactory of = getSession().getObjectFactory();
 
         List<Tree<FileableCmisObject>> result = new ArrayList<Tree<FileableCmisObject>>();
-        for (ObjectInFolderContainer oifc : providerContainerList) {
+        for (ObjectInFolderContainer oifc : bindingContainerList) {
             if ((oifc.getObject() == null) || (oifc.getObject().getObject() == null)) {
                 // shouldn't happen ...
                 continue;
@@ -336,7 +327,7 @@ public class FolderImpl extends Abstract
             }
 
             // convert the children
-            List<Tree<FileableCmisObject>> children = convertProviderContainer(oifc.getChildren(),
context);
+            List<Tree<FileableCmisObject>> children = convertBindingContainer(oifc.getChildren(),
context);
 
             // add both to current container
             result.add(new TreeImpl<FileableCmisObject>((FileableCmisObject) object,
children));

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionFactoryImpl.java?rev=1067794&r1=1067793&r2=1067794&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionFactoryImpl.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionFactoryImpl.java
Sun Feb  6 22:44:46 2011
@@ -64,7 +64,7 @@ public class SessionFactoryImpl implemen
     }
 
     public List<Repository> getRepositories(Map<String, String> parameters) {
-        CmisBinding binding = CmisBindingHelper.createProvider(parameters);
+        CmisBinding binding = CmisBindingHelper.createBinding(parameters);
 
         List<RepositoryInfo> repositoryInfos = binding.getRepositoryService().getRepositoryInfos(null);
 

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java?rev=1067794&r1=1067793&r2=1067794&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java
Sun Feb  6 22:44:46 2011
@@ -102,7 +102,7 @@ public class SessionImpl implements Sess
     private Map<String, String> parameters = null;
 
     /*
-     * CMIS provider (serializable)
+     * CMIS binding (serializable)
      */
     private CmisBinding binding = null;
 
@@ -484,7 +484,7 @@ public class SessionImpl implements Sess
     }
 
     /**
-     * Converts provider <code>TypeDefinitionContainer</code> to API
+     * Converts binding <code>TypeDefinitionContainer</code> to API
      * <code>Container</code>.
      */
     private List<Tree<ObjectType>> convertTypeDescendants(List<TypeDefinitionContainer>
descendantsList) {
@@ -522,7 +522,7 @@ public class SessionImpl implements Sess
                         ctxt.getRenditionFilterString(), BigInteger.valueOf(this.maxNumItems),
                         BigInteger.valueOf(skipCount), null);
 
-                // convert type definitions
+                // convert query results
                 List<QueryResult> page = new ArrayList<QueryResult>();
                 if (resultList.getObjects() != null) {
                     for (ObjectData objectData : resultList.getObjects()) {
@@ -538,7 +538,6 @@ public class SessionImpl implements Sess
                         resultList.hasMoreItems());
             }
         });
-
     }
 
     public String setExtensionContext(String context) {
@@ -559,7 +558,7 @@ public class SessionImpl implements Sess
     public void connect() {
         lock.writeLock().lock();
         try {
-            this.binding = CmisBindingHelper.createProvider(this.parameters);
+            this.binding = CmisBindingHelper.createBinding(this.parameters);
 
             /* get initial repository id from session parameter */
             String repositoryId = this.determineRepositoryId(this.parameters);
@@ -655,7 +654,7 @@ public class SessionImpl implements Sess
 
     public ObjectId createFolder(Map<String, ?> properties, ObjectId folderId, List<Policy>
policies,
             List<Ace> addAces, List<Ace> removeAces) {
-        if ((folderId != null) && (folderId.getId() == null)) {
+        if ((folderId == null) || (folderId.getId() == null)) {
             throw new IllegalArgumentException("Folder Id must be set!");
         }
         if ((properties == null) || (properties.isEmpty())) {

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java?rev=1067794&r1=1067793&r2=1067794&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java
Sun Feb  6 22:44:46 2011
@@ -122,12 +122,12 @@ public class ObjectFactoryImpl implement
 
         BindingsObjectFactory bof = getBindingsObjectFactory();
 
-        List<Ace> providerAces = new ArrayList<Ace>();
+        List<Ace> bindingAces = new ArrayList<Ace>();
         for (Ace ace : aces) {
-            providerAces.add(bof.createAccessControlEntry(ace.getPrincipalId(), ace.getPermissions()));
+            bindingAces.add(bof.createAccessControlEntry(ace.getPrincipalId(), ace.getPermissions()));
         }
 
-        return bof.createAccessControlList(providerAces);
+        return bof.createAccessControlList(bindingAces);
     }
 
     public Ace createAce(String principal, List<String> permissions) {

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/SessionParameter.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/SessionParameter.java?rev=1067794&r1=1067793&r2=1067794&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/SessionParameter.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/SessionParameter.java
Sun Feb  6 22:44:46 2011
@@ -31,7 +31,7 @@ public final class SessionParameter {
     public static final String USER = "org.apache.chemistry.opencmis.user";
     public static final String PASSWORD = "org.apache.chemistry.opencmis.password";
 
-    // ---- provider parameter ----
+    // --- binding parameter ----
     /** Predefined binding types (see {@code BindingType}) */
     public static final String BINDING_TYPE = "org.apache.chemistry.opencmis.binding.spi.type";
 

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/spi/CmisBinding.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/spi/CmisBinding.java?rev=1067794&r1=1067793&r2=1067794&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/spi/CmisBinding.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/spi/CmisBinding.java
Sun Feb  6 22:44:46 2011
@@ -79,7 +79,7 @@ public interface CmisBinding {
     PolicyService getPolicyService();
 
     /**
-     * Gets a factory for CMIS provider specific objects.
+     * Gets a factory for CMIS binding specific objects.
      */
     BindingsObjectFactory getObjectFactory();
 

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/Converter.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/Converter.java?rev=1067794&r1=1067793&r2=1067794&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/Converter.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/Converter.java
Sun Feb  6 22:44:46 2011
@@ -2398,7 +2398,7 @@ public final class Converter {
     // -------------------------------------------------------------------------
 
     /**
-     * Converts a provider extension into a Web Services extension.
+     * Converts a binding extension into a Web Services extension.
      */
     public static CmisExtensionType convert(ExtensionsData extension) {
         if (extension == null) {
@@ -2417,7 +2417,7 @@ public final class Converter {
     }
 
     /**
-     * Converts a provider extension into a Web Services extension holder.
+     * Converts a binding extension into a Web Services extension holder.
      */
     public static javax.xml.ws.Holder<CmisExtensionType> convertExtensionHolder(ExtensionsData
extension) {
         if (extension == null) {
@@ -2454,7 +2454,7 @@ public final class Converter {
     }
 
     /**
-     * Converts a Web Services extension extension into a provider holder.
+     * Converts a Web Services extension extension into a binding holder.
      */
     public static ExtensionsData convertExtensionHolder(javax.xml.ws.Holder<CmisExtensionType>
extension) {
         if (extension == null) {



Mime
View raw message