chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r935641 - in /incubator/chemistry/opencmis/trunk: chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/ chemistry-opencmis-client/chemistry-opencmis-client-bindings/sr...
Date Mon, 19 Apr 2010 16:00:03 GMT
Author: fmui
Date: Mon Apr 19 16:00:02 2010
New Revision: 935641

URL: http://svn.apache.org/viewvc?rev=935641&view=rev
Log:
added local binding implementation

Added:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/AbstractLocalService.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/AclServiceImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/DiscoveryServiceImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/MultiFilingServiceImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/NavigationServiceImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/ObjectServiceImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/PolicyServiceImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/RelationshipServiceImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/RepositoryServiceImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/VersioningServiceImpl.java
Modified:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/SessionImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/CmisSpi.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/Session.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/CmisAtomPubSpi.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/CmisLocalSpi.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/CmisWebServicesSpi.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/RepositoryMap.java

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/SessionImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/SessionImpl.java?rev=935641&r1=935640&r2=935641&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/SessionImpl.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/SessionImpl.java Mon Apr 19 16:00:02 2010
@@ -19,6 +19,7 @@
 package org.apache.chemistry.opencmis.client.bindings.impl;
 
 import java.io.Serializable;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
@@ -43,6 +44,10 @@ public class SessionImpl implements Sess
 		data = new HashMap<String, Object>();
 	}
 
+	public Collection<String> getKeys() {
+		return data.keySet();
+	}
+
 	public Object get(String key) {
 		Object value = null;
 

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/CmisSpi.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/CmisSpi.java?rev=935641&r1=935640&r2=935641&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/CmisSpi.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/CmisSpi.java Mon Apr 19 16:00:02 2010
@@ -18,6 +18,8 @@
  */
 package org.apache.chemistry.opencmis.client.bindings.spi;
 
+import java.io.Serializable;
+
 import org.apache.chemistry.opencmis.commons.api.AclService;
 import org.apache.chemistry.opencmis.commons.api.DiscoveryService;
 import org.apache.chemistry.opencmis.commons.api.MultiFilingService;
@@ -31,7 +33,7 @@ import org.apache.chemistry.opencmis.com
 /**
  * CMIS SPI interface.
  */
-public interface CmisSpi {
+public interface CmisSpi extends Serializable {
 	/**
 	 * Gets a Repository Service interface object.
 	 */

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/Session.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/Session.java?rev=935641&r1=935640&r2=935641&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/Session.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/Session.java Mon Apr 19 16:00:02 2010
@@ -19,6 +19,7 @@
 package org.apache.chemistry.opencmis.client.bindings.spi;
 
 import java.io.Serializable;
+import java.util.Collection;
 
 /**
  * CMIS provider session interface.
@@ -26,6 +27,11 @@ import java.io.Serializable;
 public interface Session extends Serializable {
 
 	/**
+	 * Returns all keys.
+	 */
+	Collection<String> getKeys();
+
+	/**
 	 * Gets a session value.
 	 */
 	Object get(String key);

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/CmisAtomPubSpi.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/CmisAtomPubSpi.java?rev=935641&r1=935640&r2=935641&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/CmisAtomPubSpi.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/CmisAtomPubSpi.java Mon Apr 19 16:00:02 2010
@@ -38,6 +38,8 @@ import org.apache.commons.logging.LogFac
  */
 public class CmisAtomPubSpi implements CmisSpiFactory, CmisSpi {
 
+	private static final long serialVersionUID = 1L;
+
 	private static Log log = LogFactory.getLog(CmisAtomPubSpi.class);
 
 	private Session session;

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/AbstractLocalService.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/AbstractLocalService.java?rev=935641&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/AbstractLocalService.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/AbstractLocalService.java Mon Apr 19 16:00:02 2010
@@ -0,0 +1,111 @@
+package org.apache.chemistry.opencmis.client.bindings.spi.local;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.client.bindings.spi.Session;
+import org.apache.chemistry.opencmis.commons.SessionParameter;
+import org.apache.chemistry.opencmis.commons.api.server.CallContext;
+import org.apache.chemistry.opencmis.commons.api.server.CmisService;
+import org.apache.chemistry.opencmis.commons.api.server.CmisServiceFactory;
+
+/**
+ * Base class for all local clients.
+ */
+public abstract class AbstractLocalService {
+
+	private Session session;
+	private CmisServiceFactory factory;
+
+	private String user;
+	private String password;
+
+	/**
+	 * Sets the current session.
+	 */
+	protected void setSession(Session session) {
+		this.session = session;
+
+		Object userObj = session.get(SessionParameter.USER);
+		user = userObj instanceof String ? userObj.toString() : null;
+
+		Object passwordObj = session.get(SessionParameter.PASSWORD);
+		password = passwordObj instanceof String ? passwordObj.toString() : null;
+	}
+
+	/**
+	 * Gets the current session.
+	 */
+	protected Session getSession() {
+		return session;
+	}
+
+	/**
+	 * Sets the service factory.
+	 */
+	protected void setServiceFactory(CmisServiceFactory factory) {
+		this.factory = factory;
+	}
+
+	/**
+	 * Gets the service factory.
+	 */
+	protected CmisServiceFactory getServiceFactory() {
+		return factory;
+	}
+
+	/**
+	 * creates a local call context.
+	 */
+	protected CallContext createCallContext(String repositoryId) {
+		return new LocalCallContext(repositoryId, user, password);
+	}
+
+	protected CmisService getService(String repositoryId) {
+		return factory.getService(createCallContext(repositoryId));
+	}
+
+	// ------------------------------------------------------------------
+
+	/**
+	 * Simple {@link CallContext} implementation.
+	 */
+	class LocalCallContext implements CallContext {
+
+		private Map<String, String> contextMap = new HashMap<String, String>();
+
+		public LocalCallContext(String repositoryId, String user, String password) {
+			contextMap.put(REPOSITORY_ID, repositoryId);
+			contextMap.put(USERNAME, user);
+			contextMap.put(PASSWORD, password);
+		}
+
+		public String getBinding() {
+			return BINDING_LOCAL;
+		}
+
+		public String get(String key) {
+			return contextMap.get(key);
+		}
+
+		public String getRepositoryId() {
+			return get(REPOSITORY_ID);
+		}
+
+		public String getUsername() {
+			return get(USERNAME);
+		}
+
+		public String getPassword() {
+			return get(PASSWORD);
+		}
+
+		public String getLocale() {
+			return null;
+		}
+
+		public boolean isObjectInfoRequired() {
+			return false;
+		}
+	}
+}

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/AclServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/AclServiceImpl.java?rev=935641&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/AclServiceImpl.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/AclServiceImpl.java Mon Apr 19 16:00:02 2010
@@ -0,0 +1,41 @@
+package org.apache.chemistry.opencmis.client.bindings.spi.local;
+
+import org.apache.chemistry.opencmis.client.bindings.spi.Session;
+import org.apache.chemistry.opencmis.commons.api.Acl;
+import org.apache.chemistry.opencmis.commons.api.AclService;
+import org.apache.chemistry.opencmis.commons.api.ExtensionsData;
+import org.apache.chemistry.opencmis.commons.api.server.CmisService;
+import org.apache.chemistry.opencmis.commons.api.server.CmisServiceFactory;
+import org.apache.chemistry.opencmis.commons.enums.AclPropagation;
+
+public class AclServiceImpl extends AbstractLocalService implements AclService {
+
+	/**
+	 * Constructor.
+	 */
+	public AclServiceImpl(Session session, CmisServiceFactory factory) {
+		setSession(session);
+		setServiceFactory(factory);
+	}
+
+	public Acl applyAcl(String repositoryId, String objectId, Acl addAces, Acl removeAces,
+			AclPropagation aclPropagation, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.applyAcl(repositoryId, objectId, addAces, removeAces, aclPropagation, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public Acl getAcl(String repositoryId, String objectId, Boolean onlyBasicPermissions, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getAcl(repositoryId, objectId, onlyBasicPermissions, extension);
+		} finally {
+			service.close();
+		}
+	}
+}

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/CmisLocalSpi.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/CmisLocalSpi.java?rev=935641&r1=935640&r2=935641&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/CmisLocalSpi.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/CmisLocalSpi.java Mon Apr 19 16:00:02 2010
@@ -1,5 +1,8 @@
 package org.apache.chemistry.opencmis.client.bindings.spi.local;
 
+import java.util.HashMap;
+import java.util.Map;
+
 import org.apache.chemistry.opencmis.client.bindings.spi.CmisSpi;
 import org.apache.chemistry.opencmis.client.bindings.spi.CmisSpiFactory;
 import org.apache.chemistry.opencmis.client.bindings.spi.Session;
@@ -23,10 +26,11 @@ import org.apache.commons.logging.LogFac
  */
 public class CmisLocalSpi implements CmisSpiFactory, CmisSpi {
 
+	private static final long serialVersionUID = 1L;
+
 	private static Log log = LogFactory.getLog(CmisLocalSpi.class);
 
-	private Session session;
-	private CmisServiceFactory serviceFactory;
+	private CmisServiceFactory factory;
 
 	private RepositoryService repositoryService;
 	private NavigationService navigationService;
@@ -49,19 +53,38 @@ public class CmisLocalSpi implements Cmi
 			log.debug("Initializing local SPI...");
 		}
 
-		this.session = session;
-
+		// get the service factory class name
 		String serviceFactoryClassname = (String) session.get(SessionParameter.LOCAL_FACTORY);
 		if (serviceFactoryClassname == null) {
 			throw new CmisConnectionException("Factory class not set!");
 		}
 
 		try {
-			serviceFactory = (CmisServiceFactory) Class.forName(serviceFactoryClassname).newInstance();
+			// gather parameters from session
+			Map<String, String> parameters = new HashMap<String, String>();
+			for (String key : session.getKeys()) {
+				Object value = session.get(key);
+				if (value instanceof String) {
+					parameters.put(key, (String) value);
+				}
+			}
+
+			// create and initialize factory
+			factory = (CmisServiceFactory) Class.forName(serviceFactoryClassname).newInstance();
+			factory.init(parameters);
 		} catch (Exception e) {
 			throw new CmisConnectionException("Factory cannot be created!", e);
 		}
 
+		repositoryService = new RepositoryServiceImpl(session, factory);
+		navigationService = new NavigationServiceImpl(session, factory);
+		objectService = new ObjectServiceImpl(session, factory);
+		versioningService = new VersioningServiceImpl(session, factory);
+		discoveryService = new DiscoveryServiceImpl(session, factory);
+		multiFilingService = new MultiFilingServiceImpl(session, factory);
+		relationshipService = new RelationshipServiceImpl(session, factory);
+		policyService = new PolicyServiceImpl(session, factory);
+
 		return this;
 	}
 
@@ -108,6 +131,6 @@ public class CmisLocalSpi implements Cmi
 	}
 
 	public void close() {
-		serviceFactory.destroy();
+		factory.destroy();
 	}
 }

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/DiscoveryServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/DiscoveryServiceImpl.java?rev=935641&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/DiscoveryServiceImpl.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/DiscoveryServiceImpl.java Mon Apr 19 16:00:02 2010
@@ -0,0 +1,48 @@
+package org.apache.chemistry.opencmis.client.bindings.spi.local;
+
+import java.math.BigInteger;
+
+import org.apache.chemistry.opencmis.client.bindings.spi.Session;
+import org.apache.chemistry.opencmis.commons.api.DiscoveryService;
+import org.apache.chemistry.opencmis.commons.api.ExtensionsData;
+import org.apache.chemistry.opencmis.commons.api.Holder;
+import org.apache.chemistry.opencmis.commons.api.ObjectList;
+import org.apache.chemistry.opencmis.commons.api.server.CmisService;
+import org.apache.chemistry.opencmis.commons.api.server.CmisServiceFactory;
+import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
+
+public class DiscoveryServiceImpl extends AbstractLocalService implements DiscoveryService {
+
+	/**
+	 * Constructor.
+	 */
+	public DiscoveryServiceImpl(Session session, CmisServiceFactory factory) {
+		setSession(session);
+		setServiceFactory(factory);
+	}
+
+	public ObjectList getContentChanges(String repositoryId, Holder<String> changeLogToken, Boolean includeProperties,
+			String filter, Boolean includePolicyIds, Boolean includeAcl, BigInteger maxItems, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getContentChanges(repositoryId, changeLogToken, includeProperties, filter, includePolicyIds,
+					includeAcl, maxItems, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public ObjectList query(String repositoryId, String statement, Boolean searchAllVersions,
+			Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
+			BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.query(repositoryId, statement, searchAllVersions, includeAllowableActions,
+					includeRelationships, renditionFilter, maxItems, skipCount, extension);
+		} finally {
+			service.close();
+		}
+	}
+}

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/MultiFilingServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/MultiFilingServiceImpl.java?rev=935641&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/MultiFilingServiceImpl.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/MultiFilingServiceImpl.java Mon Apr 19 16:00:02 2010
@@ -0,0 +1,39 @@
+package org.apache.chemistry.opencmis.client.bindings.spi.local;
+
+import org.apache.chemistry.opencmis.client.bindings.spi.Session;
+import org.apache.chemistry.opencmis.commons.api.ExtensionsData;
+import org.apache.chemistry.opencmis.commons.api.MultiFilingService;
+import org.apache.chemistry.opencmis.commons.api.server.CmisService;
+import org.apache.chemistry.opencmis.commons.api.server.CmisServiceFactory;
+
+public class MultiFilingServiceImpl extends AbstractLocalService implements MultiFilingService {
+
+	/**
+	 * Constructor.
+	 */
+	public MultiFilingServiceImpl(Session session, CmisServiceFactory factory) {
+		setSession(session);
+		setServiceFactory(factory);
+	}
+
+	public void addObjectToFolder(String repositoryId, String objectId, String folderId, Boolean allVersions,
+			ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			service.addObjectToFolder(repositoryId, objectId, folderId, allVersions, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public void removeObjectFromFolder(String repositoryId, String objectId, String folderId, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			service.removeObjectFromFolder(repositoryId, objectId, folderId, extension);
+		} finally {
+			service.close();
+		}
+	}
+}

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/NavigationServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/NavigationServiceImpl.java?rev=935641&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/NavigationServiceImpl.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/NavigationServiceImpl.java Mon Apr 19 16:00:02 2010
@@ -0,0 +1,102 @@
+package org.apache.chemistry.opencmis.client.bindings.spi.local;
+
+import java.math.BigInteger;
+import java.util.List;
+
+import org.apache.chemistry.opencmis.client.bindings.spi.Session;
+import org.apache.chemistry.opencmis.commons.api.ExtensionsData;
+import org.apache.chemistry.opencmis.commons.api.NavigationService;
+import org.apache.chemistry.opencmis.commons.api.ObjectData;
+import org.apache.chemistry.opencmis.commons.api.ObjectInFolderContainer;
+import org.apache.chemistry.opencmis.commons.api.ObjectInFolderList;
+import org.apache.chemistry.opencmis.commons.api.ObjectList;
+import org.apache.chemistry.opencmis.commons.api.ObjectParentData;
+import org.apache.chemistry.opencmis.commons.api.server.CmisService;
+import org.apache.chemistry.opencmis.commons.api.server.CmisServiceFactory;
+import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
+
+public class NavigationServiceImpl extends AbstractLocalService implements NavigationService {
+
+	/**
+	 * Constructor.
+	 */
+	public NavigationServiceImpl(Session session, CmisServiceFactory factory) {
+		setSession(session);
+		setServiceFactory(factory);
+	}
+
+	public ObjectList getCheckedOutDocs(String repositoryId, String folderId, String filter, String orderBy,
+			Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
+			BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getCheckedOutDocs(repositoryId, folderId, filter, orderBy, includeAllowableActions,
+					includeRelationships, renditionFilter, maxItems, skipCount, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	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) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getChildren(repositoryId, folderId, filter, orderBy, includeAllowableActions,
+					includeRelationships, renditionFilter, includePathSegment, maxItems, skipCount, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public List<ObjectInFolderContainer> getDescendants(String repositoryId, String folderId, BigInteger depth,
+			String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+			String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getDescendants(repositoryId, folderId, depth, filter, includeAllowableActions,
+					includeRelationships, renditionFilter, includePathSegment, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public ObjectData getFolderParent(String repositoryId, String folderId, String filter, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getFolderParent(repositoryId, folderId, filter, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public List<ObjectInFolderContainer> getFolderTree(String repositoryId, String folderId, BigInteger depth,
+			String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+			String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getFolderTree(repositoryId, folderId, depth, filter, includeAllowableActions,
+					includeRelationships, renditionFilter, includePathSegment, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public List<ObjectParentData> getObjectParents(String repositoryId, String objectId, String filter,
+			Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
+			Boolean includeRelativePathSegment, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getObjectParents(repositoryId, objectId, filter, includeAllowableActions,
+					includeRelationships, renditionFilter, includeRelativePathSegment, extension);
+		} finally {
+			service.close();
+		}
+	}
+}

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/ObjectServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/ObjectServiceImpl.java?rev=935641&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/ObjectServiceImpl.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/ObjectServiceImpl.java Mon Apr 19 16:00:02 2010
@@ -0,0 +1,224 @@
+package org.apache.chemistry.opencmis.client.bindings.spi.local;
+
+import java.math.BigInteger;
+import java.util.List;
+
+import org.apache.chemistry.opencmis.client.bindings.spi.Session;
+import org.apache.chemistry.opencmis.commons.api.Acl;
+import org.apache.chemistry.opencmis.commons.api.AllowableActions;
+import org.apache.chemistry.opencmis.commons.api.ContentStream;
+import org.apache.chemistry.opencmis.commons.api.ExtensionsData;
+import org.apache.chemistry.opencmis.commons.api.FailedToDeleteData;
+import org.apache.chemistry.opencmis.commons.api.Holder;
+import org.apache.chemistry.opencmis.commons.api.ObjectData;
+import org.apache.chemistry.opencmis.commons.api.ObjectService;
+import org.apache.chemistry.opencmis.commons.api.Properties;
+import org.apache.chemistry.opencmis.commons.api.RenditionData;
+import org.apache.chemistry.opencmis.commons.api.server.CmisService;
+import org.apache.chemistry.opencmis.commons.api.server.CmisServiceFactory;
+import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
+import org.apache.chemistry.opencmis.commons.enums.UnfileObject;
+import org.apache.chemistry.opencmis.commons.enums.VersioningState;
+
+public class ObjectServiceImpl extends AbstractLocalService implements ObjectService {
+
+	/**
+	 * Constructor.
+	 */
+	public ObjectServiceImpl(Session session, CmisServiceFactory factory) {
+		setSession(session);
+		setServiceFactory(factory);
+	}
+
+	public String createDocument(String repositoryId, Properties properties, String folderId,
+			ContentStream contentStream, VersioningState versioningState, List<String> policies, Acl addAces,
+			Acl removeAces, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.createDocument(repositoryId, properties, folderId, contentStream, versioningState, policies,
+					addAces, removeAces, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public String createDocumentFromSource(String repositoryId, String sourceId, Properties properties,
+			String folderId, VersioningState versioningState, List<String> policies, Acl addAces, Acl removeAces,
+			ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.createDocumentFromSource(repositoryId, sourceId, properties, folderId, versioningState,
+					policies, addAces, removeAces, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public String createFolder(String repositoryId, Properties properties, String folderId, List<String> policies,
+			Acl addAces, Acl removeAces, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.createFolder(repositoryId, properties, folderId, policies, addAces, removeAces, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public String createPolicy(String repositoryId, Properties properties, String folderId, List<String> policies,
+			Acl addAces, Acl removeAces, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.createPolicy(repositoryId, properties, folderId, policies, addAces, removeAces, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public String createRelationship(String repositoryId, Properties properties, List<String> policies, Acl addAces,
+			Acl removeAces, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.createRelationship(repositoryId, properties, policies, addAces, removeAces, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public void deleteContentStream(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
+			ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			service.deleteContentStream(repositoryId, objectId, changeToken, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public void deleteObject(String repositoryId, String objectId, Boolean allVersions, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			service.deleteObject(repositoryId, objectId, allVersions, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public FailedToDeleteData deleteTree(String repositoryId, String folderId, Boolean allVersions,
+			UnfileObject unfileObjects, Boolean continueOnFailure, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.deleteTree(repositoryId, folderId, allVersions, unfileObjects, continueOnFailure, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public AllowableActions getAllowableActions(String repositoryId, String objectId, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getAllowableActions(repositoryId, objectId, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public ContentStream getContentStream(String repositoryId, String objectId, String streamId, BigInteger offset,
+			BigInteger length, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getContentStream(repositoryId, objectId, streamId, offset, length, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public ObjectData getObject(String repositoryId, String objectId, String filter, Boolean includeAllowableActions,
+			IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
+			Boolean includeAcl, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getObject(repositoryId, objectId, filter, includeAllowableActions, includeRelationships,
+					renditionFilter, includePolicyIds, includeAcl, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public ObjectData getObjectByPath(String repositoryId, String path, String filter, Boolean includeAllowableActions,
+			IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
+			Boolean includeAcl, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getObjectByPath(repositoryId, path, filter, includeAllowableActions, includeRelationships,
+					renditionFilter, includePolicyIds, includeAcl, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public Properties getProperties(String repositoryId, String objectId, String filter, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getProperties(repositoryId, objectId, filter, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public List<RenditionData> getRenditions(String repositoryId, String objectId, String renditionFilter,
+			BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getRenditions(repositoryId, objectId, renditionFilter, maxItems, skipCount, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public void moveObject(String repositoryId, Holder<String> objectId, String targetFolderId, String sourceFolderId,
+			ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			service.moveObject(repositoryId, objectId, targetFolderId, sourceFolderId, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public void setContentStream(String repositoryId, Holder<String> objectId, Boolean overwriteFlag,
+			Holder<String> changeToken, ContentStream contentStream, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			service.setContentStream(repositoryId, objectId, overwriteFlag, changeToken, contentStream, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public void updateProperties(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
+			Properties properties, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			service.updateProperties(repositoryId, objectId, changeToken, properties, extension);
+		} finally {
+			service.close();
+		}
+	}
+}

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/PolicyServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/PolicyServiceImpl.java?rev=935641&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/PolicyServiceImpl.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/PolicyServiceImpl.java Mon Apr 19 16:00:02 2010
@@ -0,0 +1,52 @@
+package org.apache.chemistry.opencmis.client.bindings.spi.local;
+
+import java.util.List;
+
+import org.apache.chemistry.opencmis.client.bindings.spi.Session;
+import org.apache.chemistry.opencmis.commons.api.ExtensionsData;
+import org.apache.chemistry.opencmis.commons.api.ObjectData;
+import org.apache.chemistry.opencmis.commons.api.PolicyService;
+import org.apache.chemistry.opencmis.commons.api.server.CmisService;
+import org.apache.chemistry.opencmis.commons.api.server.CmisServiceFactory;
+
+public class PolicyServiceImpl extends AbstractLocalService implements PolicyService {
+
+	/**
+	 * Constructor.
+	 */
+	public PolicyServiceImpl(Session session, CmisServiceFactory factory) {
+		setSession(session);
+		setServiceFactory(factory);
+	}
+
+	public void applyPolicy(String repositoryId, String policyId, String objectId, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			service.applyPolicy(repositoryId, policyId, objectId, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public List<ObjectData> getAppliedPolicies(String repositoryId, String objectId, String filter,
+			ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getAppliedPolicies(repositoryId, objectId, filter, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public void removePolicy(String repositoryId, String policyId, String objectId, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			service.removePolicy(repositoryId, policyId, objectId, extension);
+		} finally {
+			service.close();
+		}
+	}
+}

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/RelationshipServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/RelationshipServiceImpl.java?rev=935641&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/RelationshipServiceImpl.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/RelationshipServiceImpl.java Mon Apr 19 16:00:02 2010
@@ -0,0 +1,35 @@
+package org.apache.chemistry.opencmis.client.bindings.spi.local;
+
+import java.math.BigInteger;
+
+import org.apache.chemistry.opencmis.client.bindings.spi.Session;
+import org.apache.chemistry.opencmis.commons.api.ExtensionsData;
+import org.apache.chemistry.opencmis.commons.api.ObjectList;
+import org.apache.chemistry.opencmis.commons.api.RelationshipService;
+import org.apache.chemistry.opencmis.commons.api.server.CmisService;
+import org.apache.chemistry.opencmis.commons.api.server.CmisServiceFactory;
+import org.apache.chemistry.opencmis.commons.enums.RelationshipDirection;
+
+public class RelationshipServiceImpl extends AbstractLocalService implements RelationshipService {
+
+	/**
+	 * Constructor.
+	 */
+	public RelationshipServiceImpl(Session session, CmisServiceFactory factory) {
+		setSession(session);
+		setServiceFactory(factory);
+	}
+
+	public ObjectList getObjectRelationships(String repositoryId, String objectId, Boolean includeSubRelationshipTypes,
+			RelationshipDirection relationshipDirection, String typeId, String filter, Boolean includeAllowableActions,
+			BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getObjectRelationships(repositoryId, objectId, includeSubRelationshipTypes,
+					relationshipDirection, typeId, filter, includeAllowableActions, maxItems, skipCount, extension);
+		} finally {
+			service.close();
+		}
+	}
+}

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/RepositoryServiceImpl.java?rev=935641&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/RepositoryServiceImpl.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/RepositoryServiceImpl.java Mon Apr 19 16:00:02 2010
@@ -0,0 +1,82 @@
+package org.apache.chemistry.opencmis.client.bindings.spi.local;
+
+import java.math.BigInteger;
+import java.util.List;
+
+import org.apache.chemistry.opencmis.client.bindings.spi.Session;
+import org.apache.chemistry.opencmis.commons.api.ExtensionsData;
+import org.apache.chemistry.opencmis.commons.api.RepositoryInfo;
+import org.apache.chemistry.opencmis.commons.api.RepositoryService;
+import org.apache.chemistry.opencmis.commons.api.TypeDefinition;
+import org.apache.chemistry.opencmis.commons.api.TypeDefinitionContainer;
+import org.apache.chemistry.opencmis.commons.api.TypeDefinitionList;
+import org.apache.chemistry.opencmis.commons.api.server.CmisService;
+import org.apache.chemistry.opencmis.commons.api.server.CmisServiceFactory;
+
+/**
+ * Repository Service local client.
+ */
+public class RepositoryServiceImpl extends AbstractLocalService implements RepositoryService {
+
+	/**
+	 * Constructor.
+	 */
+	public RepositoryServiceImpl(Session session, CmisServiceFactory factory) {
+		setSession(session);
+		setServiceFactory(factory);
+	}
+
+	public RepositoryInfo getRepositoryInfo(String repositoryId, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getRepositoryInfo(repositoryId, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public List<RepositoryInfo> getRepositoryInfos(ExtensionsData extension) {
+		CmisService service = getService(null);
+
+		try {
+			return service.getRepositoryInfos(extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public TypeDefinition getTypeDefinition(String repositoryId, String typeId, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getTypeDefinition(repositoryId, typeId, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public TypeDefinitionList getTypeChildren(String repositoryId, String typeId, Boolean includePropertyDefinitions,
+			BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getTypeChildren(repositoryId, typeId, includePropertyDefinitions, maxItems, skipCount,
+					extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public List<TypeDefinitionContainer> getTypeDescendants(String repositoryId, String typeId, BigInteger depth,
+			Boolean includePropertyDefinitions, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getTypeDescendants(repositoryId, typeId, depth, includePropertyDefinitions, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+}

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/VersioningServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/VersioningServiceImpl.java?rev=935641&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/VersioningServiceImpl.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/VersioningServiceImpl.java Mon Apr 19 16:00:02 2010
@@ -0,0 +1,98 @@
+package org.apache.chemistry.opencmis.client.bindings.spi.local;
+
+import java.util.List;
+
+import org.apache.chemistry.opencmis.client.bindings.spi.Session;
+import org.apache.chemistry.opencmis.commons.api.Acl;
+import org.apache.chemistry.opencmis.commons.api.ContentStream;
+import org.apache.chemistry.opencmis.commons.api.ExtensionsData;
+import org.apache.chemistry.opencmis.commons.api.Holder;
+import org.apache.chemistry.opencmis.commons.api.ObjectData;
+import org.apache.chemistry.opencmis.commons.api.Properties;
+import org.apache.chemistry.opencmis.commons.api.VersioningService;
+import org.apache.chemistry.opencmis.commons.api.server.CmisService;
+import org.apache.chemistry.opencmis.commons.api.server.CmisServiceFactory;
+import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
+
+public class VersioningServiceImpl extends AbstractLocalService implements VersioningService {
+
+	/**
+	 * Constructor.
+	 */
+	public VersioningServiceImpl(Session session, CmisServiceFactory factory) {
+		setSession(session);
+		setServiceFactory(factory);
+	}
+
+	public void cancelCheckOut(String repositoryId, String objectId, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			service.cancelCheckOut(repositoryId, objectId, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public void checkIn(String repositoryId, Holder<String> objectId, Boolean major, Properties properties,
+			ContentStream contentStream, String checkinComment, List<String> policies, Acl addAces, Acl removeAces,
+			ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			service.checkIn(repositoryId, objectId, major, properties, contentStream, checkinComment, policies,
+					addAces, removeAces, extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public void checkOut(String repositoryId, Holder<String> objectId, ExtensionsData extension,
+			Holder<Boolean> contentCopied) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			service.checkOut(repositoryId, objectId, extension, contentCopied);
+		} finally {
+			service.close();
+		}
+	}
+
+	public List<ObjectData> getAllVersions(String repositoryId, String objectId, String versionSeriesId, String filter,
+			Boolean includeAllowableActions, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getAllVersions(repositoryId, objectId, versionSeriesId, filter, includeAllowableActions,
+					extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public ObjectData getObjectOfLatestVersion(String repositoryId, String objectId, String versionSeriesId,
+			Boolean major, String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+			String renditionFilter, Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getObjectOfLatestVersion(repositoryId, objectId, versionSeriesId, major, filter,
+					includeAllowableActions, includeRelationships, renditionFilter, includePolicyIds, includeAcl,
+					extension);
+		} finally {
+			service.close();
+		}
+	}
+
+	public Properties getPropertiesOfLatestVersion(String repositoryId, String objectId, String versionSeriesId,
+			Boolean major, String filter, ExtensionsData extension) {
+		CmisService service = getService(repositoryId);
+
+		try {
+			return service.getPropertiesOfLatestVersion(repositoryId, objectId, versionSeriesId, major, filter,
+					extension);
+		} finally {
+			service.close();
+		}
+	}
+}

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/CmisWebServicesSpi.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/CmisWebServicesSpi.java?rev=935641&r1=935640&r2=935641&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/CmisWebServicesSpi.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/CmisWebServicesSpi.java Mon Apr 19 16:00:02 2010
@@ -38,6 +38,8 @@ import org.apache.commons.logging.LogFac
  */
 public class CmisWebServicesSpi implements CmisSpiFactory, CmisSpi {
 
+	private static final long serialVersionUID = 1L;
+
 	private static Log log = LogFactory.getLog(CmisWebServicesSpi.class);
 
 	private RepositoryService repositoryService;

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/RepositoryMap.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/RepositoryMap.java?rev=935641&r1=935640&r2=935641&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/RepositoryMap.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/RepositoryMap.java Mon Apr 19 16:00:02 2010
@@ -76,7 +76,7 @@ public class RepositoryMap {
 		}
 
 		// get repository object
-		return getRepository(repositoryId);
+		return repositoryId == null ? null : getRepository(repositoryId);
 	}
 
 	/**



Mime
View raw message