chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r917600 [1/3] - in /incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src: main/java/org/apache/opencmis/inmemory/ main/java/org/apache/opencmis/inmemory/clientprovider/ main/java/org/apache/opencmis/inmemory/serve...
Date Mon, 01 Mar 2010 17:20:17 GMT
Author: jens
Date: Mon Mar  1 17:20:16 2010
New Revision: 917600

URL: http://svn.apache.org/viewvc?rev=917600&view=rev
Log:
InMemory Refactoring:
move main implementation of services from client provider to server interface.
This prevents additional roundtrips for ObjectHolder in AtomBinding

Added:
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/AbstractService.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/CmisInMemoryProvider.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/DiscoveryServiceImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/DummyCallContext.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/MultiFilingServiceImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/NavigationServiceImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/ObjectServiceImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/RepositoryServiceImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/VersioningServiceImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/AbstractServiceImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryDiscoveryServiceImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryMultiFilingServiceImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryNavigationServiceImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryObjectServiceImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java
Removed:
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/AbstractServiceImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/CmisInMemoryProvider.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/MultiFilingServiceImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/NavigationServiceImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/ObjectServiceImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/RepositoryServiceImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/VersioningServiceImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryDiscoveryService.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryMultiFilingService.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryNavigationService.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryObjectService.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryRepositoryService.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryVersioningService.java
Modified:
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/TypeValidator.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/CmisInMemorySpi.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/AtomLinkInfoProvider.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/RuntimeContext.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/ServiceFactory.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/test/java/org/apache/opencmis/inmemory/AbstractServiceTst.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/test/java/org/apache/opencmis/inmemory/VersioningTest.java

Modified: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/TypeValidator.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/TypeValidator.java?rev=917600&r1=917599&r2=917600&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/TypeValidator.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/TypeValidator.java Mon Mar  1 17:20:16 2010
@@ -47,7 +47,7 @@
  */
 public class TypeValidator {
 
-  static void validateRequiredSystemProperties(PropertiesData properties) {
+  public static void validateRequiredSystemProperties(PropertiesData properties) {
     if (properties == null || properties.getProperties() == null)
       throw new RuntimeException("Cannot create object, no properties are given");
 

Added: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/AbstractService.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/AbstractService.java?rev=917600&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/AbstractService.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/AbstractService.java Mon Mar  1 17:20:16 2010
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.opencmis.inmemory.clientprovider;
+
+import org.apache.opencmis.server.spi.CallContext;
+
+public class AbstractService  {
+  protected CallContext fDummyCallContext;
+  
+  protected AbstractService() {
+    fDummyCallContext = null; // currently always set to null
+  }
+  
+  public void setCallContext(CallContext ctx) {
+    fDummyCallContext = ctx;
+  }
+
+  public CallContext getCallContext() {
+    return fDummyCallContext;
+  }
+}

Added: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/CmisInMemoryProvider.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/CmisInMemoryProvider.java?rev=917600&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/CmisInMemoryProvider.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/CmisInMemoryProvider.java Mon Mar  1 17:20:16 2010
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.opencmis.inmemory.clientprovider;
+
+import java.util.Map;
+
+import org.apache.opencmis.commons.provider.AclService;
+import org.apache.opencmis.commons.provider.DiscoveryService;
+import org.apache.opencmis.commons.provider.MultiFilingService;
+import org.apache.opencmis.commons.provider.NavigationService;
+import org.apache.opencmis.commons.provider.ObjectService;
+import org.apache.opencmis.commons.provider.PolicyService;
+import org.apache.opencmis.commons.provider.RelationshipService;
+import org.apache.opencmis.commons.provider.RepositoryInfoData;
+import org.apache.opencmis.commons.provider.RepositoryService;
+import org.apache.opencmis.commons.provider.VersioningService;
+import org.apache.opencmis.inmemory.ConfigConstants;
+import org.apache.opencmis.inmemory.server.InMemoryDiscoveryServiceImpl;
+import org.apache.opencmis.inmemory.server.InMemoryMultiFilingServiceImpl;
+import org.apache.opencmis.inmemory.server.InMemoryNavigationServiceImpl;
+import org.apache.opencmis.inmemory.server.InMemoryObjectServiceImpl;
+import org.apache.opencmis.inmemory.server.InMemoryRepositoryServiceImpl;
+import org.apache.opencmis.inmemory.server.InMemoryVersioningServiceImpl;
+import org.apache.opencmis.inmemory.storedobj.api.StoreManager;
+import org.apache.opencmis.inmemory.storedobj.impl.StoreManagerFactory;
+import org.apache.opencmis.inmemory.storedobj.impl.StoreManagerImpl;
+
+/**
+ * General class to manage all the services. Directly used for unit test of the
+ * in-memory server, indirectly used for the client provider implementation of
+ * the in-memory provider
+ * 
+ * @author Jens
+ *
+ */
+public class CmisInMemoryProvider {
+
+  protected StoreManager fStoreManager;
+  protected RepositoryService fRepositoryService;
+  protected NavigationService fNavigationService;
+  protected ObjectService fObjectService;
+  protected VersioningService fVersioningService;
+  protected MultiFilingService fMultiService;
+  protected RepositoryInfoData fRepositoryInfo;
+  protected DiscoveryService fDiscoveryService;
+
+  public CmisInMemoryProvider(Map<String, String> cfgParams) {
+    setup (cfgParams);    
+  }
+  
+  protected CmisInMemoryProvider() {  
+  }
+  
+  public RepositoryService getRepositoryService() {
+    return fRepositoryService;
+  }
+
+  public NavigationService getNavigationService() {
+    return fNavigationService;
+  }
+
+  public ObjectService getObjectService() {
+    return fObjectService;    
+  }
+
+  public VersioningService getVersioningService() {
+   return fVersioningService; 
+  }
+
+  public RelationshipService getRelationshipService() {
+    return null;
+  }
+
+  public DiscoveryService getDiscoveryService() {
+    return fDiscoveryService;
+  }
+
+  public MultiFilingService getMultiFilingService() {
+    return fMultiService;
+  }
+
+  public AclService getAclService() {
+    return null;
+  }
+
+  public PolicyService getPolicyService() {
+    return null;
+  }
+
+  protected void setup(Map<String, String> cfgParams) {
+    String repositoryClassName = (String) cfgParams.get(ConfigConstants.REPOSITORY_CLASS);
+    if (null==repositoryClassName)
+      repositoryClassName = StoreManagerImpl.class.getName();
+    
+    fStoreManager = StoreManagerFactory.createInstance(repositoryClassName);
+    String repositoryId  = (String) cfgParams.get(ConfigConstants.REPOSITORY_ID);
+    
+    // first create repository
+    if (null != repositoryId ) {
+      // then create/initialize type system
+      String typeCreatorClassName = (String) cfgParams.get(ConfigConstants.TYPE_CREATOR_CLASS);
+      fStoreManager.createAndInitRepository(repositoryId, typeCreatorClassName);
+    } else {    
+      // then init repository (note: loads root folder which requires cmis:folder type available)
+      fStoreManager.initRepository(null);
+    }
+    
+    InMemoryRepositoryServiceImpl repSvc = new InMemoryRepositoryServiceImpl(fStoreManager);
+    InMemoryNavigationServiceImpl navSvc = new InMemoryNavigationServiceImpl(fStoreManager);
+    InMemoryObjectServiceImpl objSvc = new InMemoryObjectServiceImpl(fStoreManager);
+    InMemoryVersioningServiceImpl verSvc = new InMemoryVersioningServiceImpl(fStoreManager, objSvc);
+    InMemoryDiscoveryServiceImpl disSvc = new InMemoryDiscoveryServiceImpl(fStoreManager, repSvc,
+        navSvc);
+    InMemoryMultiFilingServiceImpl multiSvc = new InMemoryMultiFilingServiceImpl(fStoreManager);
+
+    // initialize services
+    fRepositoryService = new RepositoryServiceImpl(repSvc);
+    fNavigationService = new NavigationServiceImpl(navSvc);
+    fObjectService = new ObjectServiceImpl(objSvc);
+    fVersioningService = new VersioningServiceImpl(verSvc);    
+    fMultiService = new MultiFilingServiceImpl(multiSvc);
+    fDiscoveryService = new DiscoveryServiceImpl(disSvc);
+  }
+
+  
+}

Modified: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/CmisInMemorySpi.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/CmisInMemorySpi.java?rev=917600&r1=917599&r2=917600&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/CmisInMemorySpi.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/CmisInMemorySpi.java Mon Mar  1 17:20:16 2010
@@ -33,14 +33,8 @@
 import org.apache.opencmis.commons.provider.RepositoryInfoData;
 import org.apache.opencmis.commons.provider.RepositoryService;
 import org.apache.opencmis.commons.provider.VersioningService;
-import org.apache.opencmis.inmemory.CmisInMemoryProvider;
 import org.apache.opencmis.inmemory.ConfigConstants;
-import org.apache.opencmis.inmemory.NavigationServiceImpl;
-import org.apache.opencmis.inmemory.ObjectServiceImpl;
-import org.apache.opencmis.inmemory.RepositoryServiceImpl;
-import org.apache.opencmis.inmemory.VersioningServiceImpl;
 import org.apache.opencmis.inmemory.storedobj.api.StoreManager;
-import org.apache.opencmis.inmemory.storedobj.impl.StoreManagerFactory;
 import org.apache.opencmis.inmemory.storedobj.impl.StoreManagerImpl;
 
 /**

Added: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/DiscoveryServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/DiscoveryServiceImpl.java?rev=917600&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/DiscoveryServiceImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/DiscoveryServiceImpl.java Mon Mar  1 17:20:16 2010
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.opencmis.inmemory.clientprovider;
+
+import java.math.BigInteger;
+
+import org.apache.opencmis.commons.api.ExtensionsData;
+import org.apache.opencmis.commons.enums.IncludeRelationships;
+import org.apache.opencmis.commons.provider.DiscoveryService;
+import org.apache.opencmis.commons.provider.Holder;
+import org.apache.opencmis.commons.provider.ObjectList;
+import org.apache.opencmis.inmemory.server.InMemoryDiscoveryServiceImpl;
+
+public class DiscoveryServiceImpl  extends AbstractService implements DiscoveryService {
+
+  private InMemoryDiscoveryServiceImpl fDiscoverySvc;
+
+  public DiscoveryServiceImpl(InMemoryDiscoveryServiceImpl disSvc) {
+    fDiscoverySvc = disSvc;
+  }
+
+  public ObjectList getContentChanges(String repositoryId, Holder<String> changeLogToken,
+      Boolean includeProperties, String filter, Boolean includePolicyIds, Boolean includeAcl,
+      BigInteger maxItems, ExtensionsData extension) {
+
+    return fDiscoverySvc.getContentChanges(fDummyCallContext, repositoryId, changeLogToken,
+        includeProperties, filter, includePolicyIds, includeAcl, maxItems, extension, null);
+  }
+
+  public ObjectList query(String repositoryId, String statement, Boolean searchAllVersions,
+      Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+      String renditionFilter, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+
+    return fDiscoverySvc.query(fDummyCallContext, repositoryId, statement, searchAllVersions,
+        includeAllowableActions, includeRelationships, renditionFilter, maxItems, skipCount,
+        extension);
+  }
+
+}

Added: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/DummyCallContext.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/DummyCallContext.java?rev=917600&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/DummyCallContext.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/DummyCallContext.java Mon Mar  1 17:20:16 2010
@@ -0,0 +1,40 @@
+package org.apache.opencmis.inmemory.clientprovider;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.opencmis.server.spi.CallContext;
+
+public class DummyCallContext implements CallContext {
+  private Map<String, String> fParameter = new HashMap<String, String>();
+
+  public DummyCallContext() {
+    fParameter.put( USERNAME, "TestUser");
+    fParameter.put( PASSWORD, "secret");
+    fParameter.put( LOCALE, "en");
+  }
+  
+  public String get(String key) {
+    return fParameter.get(key);
+  }
+
+  public String getBinding() {
+    return BINDING_ATOMPUB;
+  }
+
+  public String getLocale() {
+    return get(LOCALE);
+  }
+
+  public String getPassword() {
+    return get(PASSWORD);
+  }
+
+  public String getUsername() {
+    return get(USERNAME);
+  }
+
+  public void put(String key, String value) {
+    fParameter.put(key, value);
+  }
+}

Added: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/MultiFilingServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/MultiFilingServiceImpl.java?rev=917600&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/MultiFilingServiceImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/MultiFilingServiceImpl.java Mon Mar  1 17:20:16 2010
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.opencmis.inmemory.clientprovider;
+
+import org.apache.opencmis.commons.api.ExtensionsData;
+import org.apache.opencmis.commons.provider.MultiFilingService;
+import org.apache.opencmis.inmemory.server.InMemoryMultiFilingServiceImpl;
+
+public class MultiFilingServiceImpl  extends AbstractService implements MultiFilingService {
+
+  private InMemoryMultiFilingServiceImpl fMultiSvc;
+
+  public MultiFilingServiceImpl(InMemoryMultiFilingServiceImpl multiSvc) {
+    fMultiSvc = multiSvc;
+  }
+
+  public void addObjectToFolder(String repositoryId, String objectId, String folderId,
+      Boolean allVersions, ExtensionsData extension) {
+
+    fMultiSvc.addObjectToFolder(fDummyCallContext, repositoryId, objectId, folderId, allVersions, extension, null);
+  }
+
+  public void removeObjectFromFolder(String repositoryId, String objectId, String folderId,
+      ExtensionsData extension) {
+    
+    fMultiSvc.removeObjectFromFolder(fDummyCallContext, repositoryId, objectId, folderId, extension, null);    
+  }
+}

Added: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/NavigationServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/NavigationServiceImpl.java?rev=917600&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/NavigationServiceImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/NavigationServiceImpl.java Mon Mar  1 17:20:16 2010
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.opencmis.inmemory.clientprovider;
+
+import java.math.BigInteger;
+import java.util.List;
+
+import org.apache.opencmis.commons.api.ExtensionsData;
+import org.apache.opencmis.commons.enums.IncludeRelationships;
+import org.apache.opencmis.commons.provider.NavigationService;
+import org.apache.opencmis.commons.provider.ObjectData;
+import org.apache.opencmis.commons.provider.ObjectInFolderContainer;
+import org.apache.opencmis.commons.provider.ObjectInFolderList;
+import org.apache.opencmis.commons.provider.ObjectList;
+import org.apache.opencmis.commons.provider.ObjectParentData;
+import org.apache.opencmis.inmemory.server.InMemoryNavigationServiceImpl;
+
+/**
+ * Navigation Service interface. See CMIS 1.0 domain model for details.
+ * 
+ * @author Jens
+ */
+
+public class NavigationServiceImpl extends AbstractService implements NavigationService {
+  private InMemoryNavigationServiceImpl fNavSvc;
+
+  public NavigationServiceImpl(InMemoryNavigationServiceImpl navSvc) {
+    fNavSvc = navSvc;
+  }
+
+  public ObjectList getCheckedOutDocs(String repositoryId, String folderId, String filter,
+      String orderBy, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+      String renditionFilter, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+
+    return fNavSvc.getCheckedOutDocs(fDummyCallContext, repositoryId, folderId, filter, orderBy,
+        includeAllowableActions, includeRelationships, renditionFilter, maxItems, skipCount,
+        extension, null);
+  }
+
+  public ObjectInFolderList getChildren(String repositoryId, String folderId, String filter,
+      String orderBy, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+      String renditionFilter, Boolean includePathSegment, BigInteger maxItems,
+      BigInteger skipCount, ExtensionsData extension) {
+
+    return fNavSvc.getChildren(fDummyCallContext, repositoryId, folderId, filter, orderBy,
+        includeAllowableActions, includeRelationships, renditionFilter, includePathSegment,
+        maxItems, skipCount, extension, null);
+  }
+
+  public List<ObjectInFolderContainer> getDescendants(String repositoryId, String folderId,
+      BigInteger depth, String filter, Boolean includeAllowableActions,
+      IncludeRelationships includeRelationships, String renditionFilter,
+      Boolean includePathSegment, ExtensionsData extension) {
+
+    return fNavSvc.getDescendants(fDummyCallContext, repositoryId, folderId, depth, filter,
+        includeAllowableActions, includeRelationships, renditionFilter, includePathSegment,
+        extension, null);
+  }
+
+  public ObjectData getFolderParent(String repositoryId, String folderId, String filter,
+      ExtensionsData extension) {
+
+    return fNavSvc.getFolderParent(fDummyCallContext, repositoryId, folderId, filter, extension,
+        null);
+  }
+
+  public List<ObjectInFolderContainer> getFolderTree(String repositoryId, String folderId,
+      BigInteger depth, String filter, Boolean includeAllowableActions,
+      IncludeRelationships includeRelationships, String renditionFilter,
+      Boolean includePathSegment, ExtensionsData extension) {
+
+    return fNavSvc.getDescendants(fDummyCallContext, repositoryId, folderId, depth, filter,
+        includeAllowableActions, includeRelationships, renditionFilter, includePathSegment,
+        extension, null);
+  }
+
+  public List<ObjectParentData> getObjectParents(String repositoryId, String objectId,
+      String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+      String renditionFilter, Boolean includeRelativePathSegment, ExtensionsData extension) {
+
+    return fNavSvc.getObjectParents(fDummyCallContext, repositoryId, objectId, filter,
+        includeAllowableActions, includeRelationships, renditionFilter, includeRelativePathSegment,
+        extension, null);
+  }
+}

Added: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/ObjectServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/ObjectServiceImpl.java?rev=917600&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/ObjectServiceImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/ObjectServiceImpl.java Mon Mar  1 17:20:16 2010
@@ -0,0 +1,158 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.opencmis.inmemory.clientprovider;
+
+import java.math.BigInteger;
+import java.util.List;
+
+import org.apache.opencmis.commons.api.ExtensionsData;
+import org.apache.opencmis.commons.enums.IncludeRelationships;
+import org.apache.opencmis.commons.enums.UnfileObjects;
+import org.apache.opencmis.commons.enums.VersioningState;
+import org.apache.opencmis.commons.provider.AccessControlList;
+import org.apache.opencmis.commons.provider.AllowableActionsData;
+import org.apache.opencmis.commons.provider.ContentStreamData;
+import org.apache.opencmis.commons.provider.FailedToDeleteData;
+import org.apache.opencmis.commons.provider.Holder;
+import org.apache.opencmis.commons.provider.ObjectData;
+import org.apache.opencmis.commons.provider.ObjectService;
+import org.apache.opencmis.commons.provider.PropertiesData;
+import org.apache.opencmis.commons.provider.RenditionData;
+import org.apache.opencmis.inmemory.server.InMemoryObjectServiceImpl;
+
+public class ObjectServiceImpl extends AbstractService implements ObjectService {
+
+  private InMemoryObjectServiceImpl fObjSvc;
+
+  public ObjectServiceImpl(InMemoryObjectServiceImpl objSvc) {
+    fObjSvc = objSvc;
+  }
+
+  public String createDocument(String repositoryId, PropertiesData properties, String folderId,
+      ContentStreamData contentStream, VersioningState versioningState, List<String> policies,
+      AccessControlList addAces, AccessControlList removeAces, ExtensionsData extension) {
+    
+    return fObjSvc.createDocument(fDummyCallContext, repositoryId, properties, folderId, contentStream, versioningState, policies, addAces, removeAces, extension);
+  }
+
+  public String createDocumentFromSource(String repositoryId, String sourceId,
+      PropertiesData properties, String folderId, VersioningState versioningState,
+      List<String> policies, AccessControlList addAces, AccessControlList removeAces,
+      ExtensionsData extension) {
+    
+    return fObjSvc.createDocumentFromSource(fDummyCallContext, repositoryId, sourceId, properties, folderId, versioningState, policies, addAces, removeAces, extension);
+  }
+
+  public String createFolder(String repositoryId, PropertiesData properties, String folderId,
+      List<String> policies, AccessControlList addAces, AccessControlList removeAces,
+      ExtensionsData extension) {
+    
+    return fObjSvc.createFolder(fDummyCallContext, repositoryId, properties, folderId, policies, addAces, removeAces, extension);
+  }
+
+  public String createPolicy(String repositoryId, PropertiesData properties, String folderId,
+      List<String> policies, AccessControlList addAces, AccessControlList removeAces,
+      ExtensionsData extension) {
+    
+    return fObjSvc.createPolicy(fDummyCallContext, repositoryId, properties, folderId, policies, addAces, removeAces, extension);
+  }
+
+  public String createRelationship(String repositoryId, PropertiesData properties,
+      List<String> policies, AccessControlList addAces, AccessControlList removeAces,
+      ExtensionsData extension) {
+    
+    return fObjSvc.createRelationship(fDummyCallContext, repositoryId, properties, policies, addAces, removeAces, extension);
+  }
+
+  public void deleteContentStream(String repositoryId, Holder<String> objectId,
+      Holder<String> changeToken, ExtensionsData extension) {
+    
+    fObjSvc.deleteContentStream(fDummyCallContext, repositoryId, objectId, changeToken, extension);
+  }
+
+  public void deleteObject(String repositoryId, String objectId, Boolean allVersions,
+      ExtensionsData extension) {
+    
+    fObjSvc.deleteObjectOrCancelCheckOut(fDummyCallContext, repositoryId, objectId, allVersions, extension);
+  }
+
+  public FailedToDeleteData deleteTree(String repositoryId, String folderId, Boolean allVersions,
+      UnfileObjects unfileObjects, Boolean continueOnFailure, ExtensionsData extension) {
+    
+    return fObjSvc.deleteTree(fDummyCallContext, repositoryId, folderId, allVersions, unfileObjects, continueOnFailure, extension);
+  }
+
+  public AllowableActionsData getAllowableActions(String repositoryId, String objectId,
+      ExtensionsData extension) {
+    
+    return fObjSvc.getAllowableActions(fDummyCallContext, repositoryId, objectId, extension);
+  }
+
+  public ContentStreamData getContentStream(String repositoryId, String objectId, String streamId,
+      BigInteger offset, BigInteger length, ExtensionsData extension) {
+    
+    return fObjSvc.getContentStream(fDummyCallContext, repositoryId, objectId, streamId, offset, length, extension);
+  }
+
+  public ObjectData getObject(String repositoryId, String objectId, String filter,
+      Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+      String renditionFilter, Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension) {
+    
+    return fObjSvc.getObject(fDummyCallContext, repositoryId, objectId, filter, includeAllowableActions, includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension, null);
+  }
+
+  public ObjectData getObjectByPath(String repositoryId, String path, String filter,
+      Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+      String renditionFilter, Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension) {
+    
+    return fObjSvc.getObjectByPath(fDummyCallContext, repositoryId, path, filter, includeAllowableActions, includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension, null);
+  }
+
+  public PropertiesData getProperties(String repositoryId, String objectId, String filter,
+      ExtensionsData extension) {
+    
+    return fObjSvc.getProperties(fDummyCallContext, repositoryId, objectId, filter, extension);
+  }
+
+  public List<RenditionData> getRenditions(String repositoryId, String objectId,
+      String renditionFilter, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+    
+    return fObjSvc.getRenditions(fDummyCallContext, repositoryId, objectId, renditionFilter, maxItems, skipCount, extension);
+  }
+
+  public void moveObject(String repositoryId, Holder<String> objectId, String targetFolderId,
+      String sourceFolderId, ExtensionsData extension) {
+
+    fObjSvc.moveObject(fDummyCallContext, repositoryId, objectId, targetFolderId, sourceFolderId, extension, null);    
+  }
+
+  public void setContentStream(String repositoryId, Holder<String> objectId, Boolean overwriteFlag,
+      Holder<String> changeToken, ContentStreamData contentStream, ExtensionsData extension) {
+    
+    fObjSvc.setContentStream(fDummyCallContext, repositoryId, objectId, overwriteFlag, changeToken, contentStream, extension);
+  }
+
+  public void updateProperties(String repositoryId, Holder<String> objectId,
+      Holder<String> changeToken, PropertiesData properties, ExtensionsData extension) {
+    
+    fObjSvc.updateProperties(fDummyCallContext, repositoryId, objectId, changeToken, properties, null, extension, null);    
+  }
+  
+}

Added: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/RepositoryServiceImpl.java?rev=917600&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/RepositoryServiceImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/RepositoryServiceImpl.java Mon Mar  1 17:20:16 2010
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.opencmis.inmemory.clientprovider;
+
+import java.math.BigInteger;
+import java.util.List;
+
+import org.apache.opencmis.commons.api.ExtensionsData;
+import org.apache.opencmis.commons.api.TypeDefinition;
+import org.apache.opencmis.commons.api.TypeDefinitionContainer;
+import org.apache.opencmis.commons.api.TypeDefinitionList;
+import org.apache.opencmis.commons.provider.RepositoryInfoData;
+import org.apache.opencmis.commons.provider.RepositoryService;
+import org.apache.opencmis.inmemory.server.InMemoryRepositoryServiceImpl;
+
+/**
+ * InMemory Repository Service.
+ * 
+ * @author <a href="mailto:fmueller@opentext.com">Florian M&uuml;ller</a>
+ * 
+ */
+public class RepositoryServiceImpl  extends AbstractService implements RepositoryService {
+
+  private InMemoryRepositoryServiceImpl fRepSvc;
+  /**
+   * Constructor.
+   */
+  public RepositoryServiceImpl(InMemoryRepositoryServiceImpl repSvc) {
+    fRepSvc = repSvc;
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.RepositoryService#getRepositoryInfo(java.lang.String,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public RepositoryInfoData getRepositoryInfo(String repositoryId, ExtensionsData extension) {
+
+    return fRepSvc.getRepositoryInfo(fDummyCallContext, repositoryId, extension);
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.RepositoryService#getRepositoryInfos(boolean,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public List<RepositoryInfoData> getRepositoryInfos(ExtensionsData extension) {
+    return fRepSvc.getRepositoryInfos(fDummyCallContext, extension);
+  }
+  
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.RepositoryService#getTypeChildren(java.lang.String,
+   * java.lang.String, java.lang.Boolean, java.math.BigInteger, java.math.BigInteger,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public TypeDefinitionList getTypeChildren(String repositoryId, String typeId,
+      Boolean includePropertyDefinitions, BigInteger maxItems, BigInteger skipCount,
+      ExtensionsData extension) {
+
+    return fRepSvc.getTypeChildren(fDummyCallContext, repositoryId, typeId, includePropertyDefinitions, maxItems, skipCount, extension);
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.RepositoryService#getTypeDefinition(java.lang.String,
+   * java.lang.String, org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public TypeDefinition getTypeDefinition(String repositoryId, String typeId,
+      ExtensionsData extension) {
+    
+    return fRepSvc.getTypeDefinition(fDummyCallContext, repositoryId, typeId, extension);
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.RepositoryService#getTypeDescendants(java.lang.String,
+   * java.lang.String, java.math.BigInteger, java.lang.Boolean,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public List<TypeDefinitionContainer> getTypeDescendants(String repositoryId, String typeId,
+      BigInteger depth, Boolean includePropertyDefinitions, ExtensionsData extension) {
+    
+    return fRepSvc.getTypeDescendants(fDummyCallContext, repositoryId, typeId, depth, includePropertyDefinitions, extension);
+  }
+
+ 
+}

Added: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/VersioningServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/VersioningServiceImpl.java?rev=917600&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/VersioningServiceImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/clientprovider/VersioningServiceImpl.java Mon Mar  1 17:20:16 2010
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.opencmis.inmemory.clientprovider;
+
+import java.util.List;
+
+import org.apache.opencmis.commons.api.ExtensionsData;
+import org.apache.opencmis.commons.enums.IncludeRelationships;
+import org.apache.opencmis.commons.provider.AccessControlList;
+import org.apache.opencmis.commons.provider.ContentStreamData;
+import org.apache.opencmis.commons.provider.Holder;
+import org.apache.opencmis.commons.provider.ObjectData;
+import org.apache.opencmis.commons.provider.PropertiesData;
+import org.apache.opencmis.commons.provider.VersioningService;
+import org.apache.opencmis.inmemory.server.InMemoryVersioningServiceImpl;
+
+public class VersioningServiceImpl extends AbstractService implements VersioningService {
+
+  private InMemoryVersioningServiceImpl fVersioningSvc;
+
+  public VersioningServiceImpl(InMemoryVersioningServiceImpl verSvc) {
+    fVersioningSvc = verSvc;
+  }
+
+  public void cancelCheckOut(String repositoryId, String objectId, ExtensionsData extension) {
+
+    fVersioningSvc.cancelCheckOut(fDummyCallContext, repositoryId, objectId, extension);
+  }
+
+  public void checkIn(String repositoryId, Holder<String> objectId, Boolean major,
+      PropertiesData properties, ContentStreamData contentStream, String checkinComment,
+      List<String> policies, AccessControlList addAces, AccessControlList removeAces,
+      ExtensionsData extension) {
+
+    fVersioningSvc.checkIn(fDummyCallContext, repositoryId, objectId, major, properties,
+        contentStream, checkinComment, policies, addAces, removeAces, extension, null);
+  }
+
+  public void checkOut(String repositoryId, Holder<String> objectId, ExtensionsData extension,
+      Holder<Boolean> contentCopied) {
+
+    fVersioningSvc.checkOut(fDummyCallContext, repositoryId, objectId, extension, contentCopied,
+        null);
+  }
+
+  public List<ObjectData> getAllVersions(String repositoryId, String versionSeriesId,
+      String filter, Boolean includeAllowableActions, ExtensionsData extension) {
+
+    return fVersioningSvc.getAllVersions(fDummyCallContext, repositoryId, versionSeriesId, filter,
+        includeAllowableActions, extension, null);
+  }
+
+  public ObjectData getObjectOfLatestVersion(String repositoryId, String versionSeriesId,
+      Boolean major, String filter, Boolean includeAllowableActions,
+      IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
+      Boolean includeAcl, ExtensionsData extension) {
+
+    return fVersioningSvc.getObjectOfLatestVersion(fDummyCallContext, repositoryId,
+        versionSeriesId, major, filter, includeAllowableActions, includeRelationships,
+        renditionFilter, includePolicyIds, includeAcl, extension, null);
+  }
+
+  public PropertiesData getPropertiesOfLatestVersion(String repositoryId, String versionSeriesId,
+      Boolean major, String filter, ExtensionsData extension) {
+
+    return fVersioningSvc.getPropertiesOfLatestVersion(fDummyCallContext, repositoryId,
+        versionSeriesId, major, filter, extension);
+  }
+
+}

Added: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/AbstractServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/AbstractServiceImpl.java?rev=917600&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/AbstractServiceImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/AbstractServiceImpl.java Mon Mar  1 17:20:16 2010
@@ -0,0 +1,171 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.opencmis.inmemory.server;
+
+import org.apache.opencmis.commons.PropertyIds;
+import org.apache.opencmis.commons.api.TypeDefinition;
+import org.apache.opencmis.commons.api.TypeDefinitionContainer;
+import org.apache.opencmis.commons.exceptions.CmisObjectNotFoundException;
+import org.apache.opencmis.commons.exceptions.CmisUpdateConflictException;
+import org.apache.opencmis.commons.provider.PropertiesData;
+import org.apache.opencmis.inmemory.storedobj.api.DocumentVersion;
+import org.apache.opencmis.inmemory.storedobj.api.ObjectStore;
+import org.apache.opencmis.inmemory.storedobj.api.StoreManager;
+import org.apache.opencmis.inmemory.storedobj.api.StoredObject;
+import org.apache.opencmis.inmemory.storedobj.api.VersionedDocument;
+
+/**
+ * Common functionality for all service implementations
+ * 
+ * @author Jens
+ *
+ */
+public class AbstractServiceImpl {
+  
+  protected StoreManager fStoreManager;
+  
+  protected AbstractServiceImpl(StoreManager storeManager) {
+    fStoreManager = storeManager;
+  }
+  
+  /**
+   * check if repository is known and that object exists. To avoid later calls
+   * to again retrieve the object from the id return the retrieved object for 
+   * later use.
+   * 
+   * @param repositoryId
+   *    repository id
+   * @param objectId
+   *    object id
+   * @return
+   *    object for objectId
+   */
+  protected StoredObject checkStandardParameters(String repositoryId, String objectId) {
+
+    ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
+
+    if (objStore==null)
+      throw new CmisObjectNotFoundException("Unknown repository id: " + repositoryId);
+    
+    StoredObject so = objStore.getObjectById(objectId);
+    
+    if (so==null)
+      throw new CmisObjectNotFoundException("Unknown object id: " + objectId); 
+    
+    return so;
+  }
+  
+  protected StoredObject checkExistingObjectId(ObjectStore objStore, String objectId) {
+    
+    StoredObject so = objStore.getObjectById(objectId);
+    
+    if (so==null)
+      throw new CmisObjectNotFoundException("Unknown object id: " + objectId);   
+    
+    return so;
+  }
+
+  protected void checkRepositoryId(String repositoryId) {
+    ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
+
+    if (objStore==null)
+      throw new CmisObjectNotFoundException("Unknown repository id: " + repositoryId);    
+  }
+  
+  protected TypeDefinition getTypeDefinition(String repositoryId, PropertiesData properties) {
+    String typeId = (String) properties.getProperties().get(PropertyIds.CMIS_OBJECT_TYPE_ID)
+        .getFirstValue();
+    TypeDefinitionContainer typeDefC = fStoreManager.getTypeById(repositoryId, typeId);
+    if (typeDefC == null)
+      throw new RuntimeException("Cannot create object, a type with id " + typeId + " is unknown");
+    
+    return typeDefC.getTypeDefinition();
+  }
+  
+  protected TypeDefinition getTypeDefinition(String repositoryId, StoredObject obj) {
+    
+    TypeDefinitionContainer typeDefC = fStoreManager.getTypeById(repositoryId, obj.getTypeId());
+    return typeDefC.getTypeDefinition();
+  }
+  
+  /**
+   * We allow checkin, cancel, checkout operations on a single version as well as on a version series
+   * This method returns the versioned document (version series) in each case
+   * @param value
+   *    version or version series id of a document
+   * @return
+   *    version series id
+   */
+  protected VersionedDocument getVersionedDocumentOfObjectId(StoredObject so) {
+    
+    VersionedDocument verDoc;
+    if (so instanceof DocumentVersion) {
+      // get document the version is contained in to c
+      verDoc = ((DocumentVersion) so).getParentDocument();
+    } else {
+      verDoc = (VersionedDocument) so;
+    }
+
+    return verDoc;
+  }
+  
+  protected VersionedDocument testIsNotCheckedOutBySomeoneElse(StoredObject so, String user) {
+    checkIsVersionableObject(so);
+    VersionedDocument verDoc = getVersionedDocumentOfObjectId(so);
+    if (verDoc.isCheckedOut())
+      testCheckedOutByCurrentUser(user, verDoc);
+      
+    return verDoc;
+  }
+  
+  protected VersionedDocument testHasProperCheckedOutStatus(StoredObject so, String user) {
+    
+    checkIsVersionableObject(so);
+    VersionedDocument verDoc = getVersionedDocumentOfObjectId(so);
+
+    checkHasUser(user);
+    
+    testIsCheckedOut(verDoc);
+    testCheckedOutByCurrentUser(user, verDoc);
+    
+    return verDoc;
+  }
+  
+  protected void checkIsVersionableObject(StoredObject so) {
+    if (! (so instanceof VersionedDocument || so instanceof DocumentVersion))
+      throw new RuntimeException("Object is of a versionable type but not instance of VersionedDocument or DocumentVersion.");    
+  }
+  
+  protected void checkHasUser(String user) {
+    if (null == user || user.length() == 0)
+      throw new CmisUpdateConflictException("Object can't be checked-in, no user is given.");
+  }
+  
+  protected void testCheckedOutByCurrentUser(String user, VersionedDocument verDoc) {
+    if (! user.equals(verDoc.getCheckedOutBy()))
+      throw new CmisUpdateConflictException("Object can't be checked-in, user "
+          + verDoc.getCheckedOutBy() + " has checked out the document.");    
+  }
+  
+  protected void testIsCheckedOut(VersionedDocument verDoc) {
+    if (!verDoc.isCheckedOut())
+      throw new CmisUpdateConflictException("Canot check-in: Document " + verDoc.getId() + " is not checked out.");
+  }
+
+}

Modified: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/AtomLinkInfoProvider.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/AtomLinkInfoProvider.java?rev=917600&r1=917599&r2=917600&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/AtomLinkInfoProvider.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/AtomLinkInfoProvider.java Mon Mar  1 17:20:16 2010
@@ -64,18 +64,14 @@
    * @param objectInfos
    *          Holder to fill with information
    */
-  public void fillInformationForAtomLinks(String repositoryId, String objectId, ObjectInfoHolder objectInfos) {
-    if (null == objectInfos || null == objectId)
+  public void fillInformationForAtomLinks(String repositoryId, StoredObject so, ObjectInfoHolder objectInfos) {
+    if (null == objectInfos || null == so)
       return;
-    
-    ObjectInfoImpl objInfo = new ObjectInfoImpl();
-    ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
-    StoredObject so = objectStore.getObjectById(objectId);   
-
     TypeDefinition typeDef = fStoreManager.getTypeById(repositoryId, so.getTypeId()).getTypeDefinition();
     
-    // Fill all setters:
-    objInfo.setId(objectId);
+    ObjectInfoImpl objInfo = new ObjectInfoImpl();
+   // Fill all setters:
+    objInfo.setId(so.getId());
     objInfo.setName(so.getName());
     objInfo.setCreatedBy(so.getCreatedBy()); //!
     objInfo.setCreationDate(so.getCreatedAt()); //!
@@ -143,6 +139,25 @@
     
     objectInfos.addObjectInfo(objInfo);
   }
+  
+ /**
+   * FillObjectInfoHolder object with required information needed for Atom binding for a single object
+   * 
+   * @param repositoryId
+   *          id of repository 
+   * @param objectId
+   *          object to retrieve information for
+   * @param objectInfos
+   *          Holder to fill with information
+   */
+  public void fillInformationForAtomLinks(String repositoryId, String objectId, ObjectInfoHolder objectInfos) {
+    if (null == objectInfos || null == objectId)
+      return;
+    
+    ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
+    StoredObject so = objectStore.getObjectById(objectId);   
+    fillInformationForAtomLinks(repositoryId, so, objectInfos);    
+  }
 
   /**
    * FillObjectInfoHolder object with required information needed for Atom binding

Added: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryDiscoveryServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryDiscoveryServiceImpl.java?rev=917600&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryDiscoveryServiceImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryDiscoveryServiceImpl.java Mon Mar  1 17:20:16 2010
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.opencmis.inmemory.server;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.GregorianCalendar;
+import java.util.List;
+
+import org.apache.opencmis.commons.api.ExtensionsData;
+import org.apache.opencmis.commons.enums.IncludeRelationships;
+import org.apache.opencmis.commons.enums.TypeOfChanges;
+import org.apache.opencmis.commons.impl.dataobjects.ChangeEventInfoDataImpl;
+import org.apache.opencmis.commons.impl.dataobjects.ObjectDataImpl;
+import org.apache.opencmis.commons.impl.dataobjects.ObjectListImpl;
+import org.apache.opencmis.commons.provider.Holder;
+import org.apache.opencmis.commons.provider.ObjectData;
+import org.apache.opencmis.commons.provider.ObjectInFolderContainer;
+import org.apache.opencmis.commons.provider.ObjectList;
+import org.apache.opencmis.commons.provider.RepositoryInfoData;
+import org.apache.opencmis.inmemory.storedobj.api.StoreManager;
+import org.apache.opencmis.server.spi.CallContext;
+import org.apache.opencmis.server.spi.CmisDiscoveryService;
+import org.apache.opencmis.server.spi.ObjectInfoHolder;
+
+public class InMemoryDiscoveryServiceImpl implements CmisDiscoveryService {
+
+  private StoreManager fStoreManager;
+  AtomLinkInfoProvider fAtomLinkProvider;
+  InMemoryNavigationServiceImpl fNavigationService; // real implementation of the service
+  InMemoryRepositoryServiceImpl fRepositoryService;
+
+  public InMemoryDiscoveryServiceImpl(StoreManager storeManager, InMemoryRepositoryServiceImpl repSvc,
+      InMemoryNavigationServiceImpl navSvc) {
+    fStoreManager = storeManager;
+    fAtomLinkProvider = new AtomLinkInfoProvider(fStoreManager);
+    fNavigationService = navSvc;
+    fRepositoryService = repSvc;
+  }
+
+  public ObjectList getContentChanges(CallContext context, String repositoryId,
+      Holder<String> changeLogToken, Boolean includeProperties, String filter,
+      Boolean includePolicyIds, Boolean includeAcl, BigInteger maxItems, ExtensionsData extension,
+      ObjectInfoHolder objectInfos) {
+    // dummy implementation using hard coded values
+
+    // Attach the CallContext to a thread local context that can be accessed from everywhere
+    RuntimeContext.getRuntimeConfig().attachCfg(context);
+
+    RepositoryInfoData rep = fRepositoryService.getRepositoryInfo(context, repositoryId, null);
+    String rootFolderId = rep.getRootFolderId();
+
+    ObjectListImpl objList = new ObjectListImpl();
+    List<ObjectInFolderContainer> tempRes = fNavigationService.getDescendants(context,
+        repositoryId, rootFolderId, BigInteger.valueOf(3), filter, false,
+        IncludeRelationships.NONE, null, false, extension, null);
+
+    // convert ObjectInFolderContainerList to objectList
+    List<ObjectData> lod = new ArrayList<ObjectData>();
+    for (ObjectInFolderContainer obj : tempRes) {
+      convertList(lod, obj);
+    }
+    objList.setObjects(lod);
+    objList.setNumItems(BigInteger.valueOf(lod.size()));
+
+    // To be able to provide all Atom links in the response we need additional information:
+    fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, null, objectInfos, objList);
+    return objList;
+  }
+
+  private void convertList(List<ObjectData> lod, ObjectInFolderContainer obj) {
+    lod.add(obj.getObject().getObject());
+    // add dummy event info
+    ObjectData oif = obj.getObject().getObject();
+    ObjectDataImpl oifImpl = (ObjectDataImpl) oif;
+    ChangeEventInfoDataImpl changeEventInfo = new ChangeEventInfoDataImpl();
+    changeEventInfo.setTypeOfChanges(TypeOfChanges.UPDATED);
+    changeEventInfo.setChangeTime(new GregorianCalendar());
+    oifImpl.setChangeEventInfo(changeEventInfo);
+    if (null != obj.getChildren()) {
+      for (ObjectInFolderContainer oifc : obj.getChildren()) {
+        convertList(lod, oifc);
+      }
+    }
+  }
+
+  public ObjectList query(CallContext context, String repositoryId, String statement,
+      Boolean searchAllVersions, Boolean includeAllowableActions,
+      IncludeRelationships includeRelationships, String renditionFilter, BigInteger maxItems,
+      BigInteger skipCount, ExtensionsData extension) {
+    // dummy implementation using hard coded values
+
+    // Attach the CallContext to a thread local context that can be accessed from everywhere
+    RuntimeContext.getRuntimeConfig().attachCfg(context);
+
+    // use descendants of root folder as result
+    RepositoryInfoData rep = fRepositoryService.getRepositoryInfo(context, repositoryId, null);
+    String rootFolderId = rep.getRootFolderId();
+    ObjectListImpl objList = new ObjectListImpl();
+    List<ObjectInFolderContainer> tempRes = fNavigationService.getDescendants(context,
+        repositoryId, rootFolderId, BigInteger.valueOf(3), "*", includeAllowableActions,
+        includeRelationships, renditionFilter, false, extension, null);
+
+    // convert ObjectInFolderContainerList to objectList
+    List<ObjectData> lod = new ArrayList<ObjectData>();
+    for (ObjectInFolderContainer obj : tempRes) {
+      convertList(lod, obj);
+    }
+    objList.setObjects(lod);
+    objList.setNumItems(BigInteger.valueOf(lod.size()));
+
+    return objList;
+  }
+
+}

Added: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryMultiFilingServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryMultiFilingServiceImpl.java?rev=917600&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryMultiFilingServiceImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryMultiFilingServiceImpl.java Mon Mar  1 17:20:16 2010
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.opencmis.inmemory.server;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.opencmis.commons.api.ExtensionsData;
+import org.apache.opencmis.commons.enums.IncludeRelationships;
+import org.apache.opencmis.commons.exceptions.CmisConstraintException;
+import org.apache.opencmis.commons.exceptions.CmisNotSupportedException;
+import org.apache.opencmis.commons.provider.ObjectData;
+import org.apache.opencmis.inmemory.storedobj.api.Folder;
+import org.apache.opencmis.inmemory.storedobj.api.MultiFiling;
+import org.apache.opencmis.inmemory.storedobj.api.ObjectStore;
+import org.apache.opencmis.inmemory.storedobj.api.StoreManager;
+import org.apache.opencmis.inmemory.storedobj.api.StoredObject;
+import org.apache.opencmis.inmemory.types.PropertyCreationHelper;
+import org.apache.opencmis.server.spi.CallContext;
+import org.apache.opencmis.server.spi.CmisMultiFilingService;
+import org.apache.opencmis.server.spi.ObjectInfoHolder;
+
+public class InMemoryMultiFilingServiceImpl extends AbstractServiceImpl implements
+    CmisMultiFilingService {
+
+  private static final Log LOG = LogFactory.getLog(InMemoryMultiFilingServiceImpl.class.getName());
+
+  AtomLinkInfoProvider fAtomLinkProvider;
+
+  public InMemoryMultiFilingServiceImpl(StoreManager storeMgr) {
+    super(storeMgr);
+    fAtomLinkProvider = new AtomLinkInfoProvider(storeMgr);
+  }
+
+  public ObjectData addObjectToFolder(CallContext context, String repositoryId, String objectId,
+      String folderId, Boolean allVersions, ExtensionsData extension, ObjectInfoHolder objectInfos) {
+
+    LOG.debug("Begin addObjectToFolder()");
+
+    // Attach the CallContext to a thread local context that can be accessed from everywhere
+    RuntimeContext.getRuntimeConfig().attachCfg(context);
+
+    StoredObject[] so2 = checkParams(repositoryId, objectId, folderId);
+    if (allVersions != null && allVersions.booleanValue() == false)
+      throw new CmisNotSupportedException(
+          "Cannot add object to folder, version specific filing is not supported.");
+    StoredObject so = so2[0];
+    StoredObject folder = so2[1];
+    checkObjects(so, folder);
+
+    Folder newParent = (Folder) folder;
+    MultiFiling obj = (MultiFiling) so;
+    obj.addParent(newParent);
+
+    fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
+    fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, folder, objectInfos);
+
+    ObjectData od = PropertyCreationHelper.getObjectData(fStoreManager, so, null, false,
+        IncludeRelationships.NONE, null, false, false, extension);
+
+    LOG.debug("End addObjectToFolder()");
+    return od;
+  }
+
+  public ObjectData removeObjectFromFolder(CallContext context, String repositoryId,
+      String objectId, String folderId, ExtensionsData extension, ObjectInfoHolder objectInfos) {
+
+    LOG.debug("Begin removeObjectFromFolder()");
+    // Attach the CallContext to a thread local context that can be accessed from everywhere
+    RuntimeContext.getRuntimeConfig().attachCfg(context);
+
+    StoredObject so = checkStandardParameters(repositoryId, objectId);
+    ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
+    StoredObject folder = checkExistingObjectId(objectStore, folderId);
+
+    checkObjects(so, folder);
+    Folder parent = (Folder) folder;
+    MultiFiling obj = (MultiFiling) so;
+    obj.removeParent(parent);
+
+    // To be able to provide all Atom links in the response we need additional information:
+    fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
+    fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, folder, objectInfos);
+
+    ObjectData od = PropertyCreationHelper.getObjectData(fStoreManager, so, null, false,
+        IncludeRelationships.NONE, null, false, false, extension);
+
+    LOG.debug("End removeObjectFromFolder()");
+
+    return od;
+  }
+
+  private StoredObject[] checkParams(String repositoryId, String objectId, String folderId) {
+    StoredObject[] so = new StoredObject[2];
+    so[0] = checkStandardParameters(repositoryId, objectId);
+    ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
+    so[1] = checkExistingObjectId(objectStore, folderId);
+    return so;
+  }
+
+  private void checkObjects(StoredObject so, StoredObject folder) {
+    if (!(so instanceof MultiFiling))
+      throw new CmisConstraintException("Cannot add object to folder, object id " + so.getId()
+          + " is not a multi-filed object.");
+
+    if ((so instanceof Folder))
+      throw new CmisConstraintException("Cannot add object to folder, object id " + folder.getId()
+          + " is a folder and folders are not multi-filed.");
+
+    if (!(folder instanceof Folder))
+      throw new CmisConstraintException("Cannot add object to folder, folder id " + folder.getId()
+          + " does not refer to a folder.");
+  }
+
+}



Mime
View raw message