chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dcaru...@apache.org
Subject svn commit: r936938 [10/29] - in /incubator/chemistry/opencmis/trunk/chemistry-opencmis-server: chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/ chemistry-opencmis-server-bindings/src/main/java/org/apache/chem...
Date Thu, 22 Apr 2010 16:28:00 GMT
Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/ObjectService.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/ObjectService.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/ObjectService.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/ObjectService.java Thu Apr 22 16:27:57 2010
@@ -47,317 +47,318 @@ import org.apache.chemistry.opencmis.ser
  */
 public class ObjectService implements CmisObjectService {
 
-	private RepositoryMap fRepositoryMap;
+    private RepositoryMap fRepositoryMap;
 
-	/**
-	 * Constructor.
-	 */
-	public ObjectService(RepositoryMap repositoryMap) {
-		fRepositoryMap = repositoryMap;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.server.spi.CmisObjectService#create(org.apache.opencmis
-	 * .server.spi.CallContext , java.lang.String,
-	 * org.apache.opencmis.commons.provider.PropertiesData, java.lang.String,
-	 * org.apache.opencmis.commons.provider.ContentStreamData,
-	 * org.apache.opencmis.commons.enums.VersioningState, java.util.List,
-	 * org.apache.opencmis.commons.api.ExtensionsData,
-	 * org.apache.opencmis.server.spi.ObjectInfoHolder)
-	 */
-	public ObjectData create(CallContext context, String repositoryId, Properties properties, String folderId,
-			ContentStream contentStream, VersioningState versioningState, List<String> policies,
-			ExtensionsData extension, ObjectInfoHolder objectInfos) {
-		return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).create(context, properties, folderId,
-				contentStream, versioningState, objectInfos);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.server.spi.CmisObjectService#createDocument(org.apache
-	 * .opencmis.server. spi.CallContext, java.lang.String,
-	 * org.apache.opencmis.commons.provider.PropertiesData, java.lang.String,
-	 * org.apache.opencmis.commons.provider.ContentStreamData,
-	 * org.apache.opencmis.commons.enums.VersioningState, java.util.List,
-	 * org.apache.opencmis.commons.provider.AccessControlList,
-	 * org.apache.opencmis.commons.provider.AccessControlList,
-	 * org.apache.opencmis.commons.api.ExtensionsData)
-	 */
-	public String createDocument(CallContext context, String repositoryId, Properties properties, String folderId,
-			ContentStream contentStream, VersioningState versioningState, List<String> policies, Acl addAces,
-			Acl removeAces, ExtensionsData extension) {
-		return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).createDocument(context, properties,
-				folderId, contentStream, versioningState);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.server.spi.CmisObjectService#createDocumentFromSource
-	 * (org.apache.opencmis .server.spi. CallContext, java.lang.String,
-	 * java.lang.String, org.apache.opencmis.commons.provider.PropertiesData,
-	 * java.lang.String, org.apache.opencmis.commons.enums.VersioningState,
-	 * java.util.List, org.apache.opencmis.commons.provider.AccessControlList,
-	 * org.apache.opencmis.commons.provider.AccessControlList,
-	 * org.apache.opencmis.commons.api.ExtensionsData)
-	 */
-	public String createDocumentFromSource(CallContext context, String repositoryId, String sourceId,
-			Properties properties, String folderId, VersioningState versioningState, List<String> policies,
-			Acl addAces, Acl removeAces, ExtensionsData extension) {
-		return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).createDocumentFromSource(context,
-				sourceId, properties, folderId, versioningState);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.server.spi.CmisObjectService#createFolder(org.apache
-	 * .opencmis.server.spi .CallContext, java.lang.String,
-	 * org.apache.opencmis.commons.provider.PropertiesData, java.lang.String,
-	 * java.util.List, org.apache.opencmis.commons.provider.AccessControlList,
-	 * org.apache.opencmis.commons.provider.AccessControlList,
-	 * org.apache.opencmis.commons.api.ExtensionsData)
-	 */
-	public String createFolder(CallContext context, String repositoryId, Properties properties, String folderId,
-			List<String> policies, Acl addAces, Acl removeAces, ExtensionsData extension) {
-		return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).createFolder(context, properties,
-				folderId);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.server.spi.CmisObjectService#createPolicy(org.apache
-	 * .opencmis.server.spi .CallContext, java.lang.String,
-	 * org.apache.opencmis.commons.provider.PropertiesData, java.lang.String,
-	 * java.util.List, org.apache.opencmis.commons.provider.AccessControlList,
-	 * org.apache.opencmis.commons.provider.AccessControlList,
-	 * org.apache.opencmis.commons.api.ExtensionsData)
-	 */
-	public String createPolicy(CallContext context, String repositoryId, Properties properties, String folderId,
-			List<String> policies, Acl addAces, Acl removeAces, ExtensionsData extension) {
-		fRepositoryMap.getAuthenticatedRepository(context, repositoryId);
-		throw new CmisNotSupportedException("createPolicy not supported!");
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.server.spi.CmisObjectService#createRelationship(org
-	 * .apache.opencmis.server .spi.CallContext , java.lang.String,
-	 * org.apache.opencmis.commons.provider.PropertiesData, java.util.List,
-	 * org.apache.opencmis.commons.provider.AccessControlList,
-	 * org.apache.opencmis.commons.provider.AccessControlList,
-	 * org.apache.opencmis.commons.api.ExtensionsData)
-	 */
-	public String createRelationship(CallContext context, String repositoryId, Properties properties,
-			List<String> policies, Acl addAces, Acl removeAces, ExtensionsData extension) {
-		fRepositoryMap.getAuthenticatedRepository(context, repositoryId);
-		throw new CmisNotSupportedException("createRelationship not supported!");
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.server.spi.CmisObjectService#deleteContentStream(
-	 * org.apache.opencmis.server .spi.CallContext , java.lang.String,
-	 * org.apache.opencmis.commons.provider.Holder,
-	 * org.apache.opencmis.commons.provider.Holder,
-	 * org.apache.opencmis.commons.api.ExtensionsData)
-	 */
-	public void deleteContentStream(CallContext context, String repositoryId, Holder<String> objectId,
-			Holder<String> changeToken, ExtensionsData extension) {
-		fRepositoryMap.getAuthenticatedRepository(context, repositoryId)
-				.setContentStream(context, objectId, true, null);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.server.spi.CmisObjectService#deleteObjectOrCancelCheckOut
-	 * (org.apache.opencmis .server. spi.CallContext, java.lang.String,
-	 * java.lang.String, java.lang.Boolean,
-	 * org.apache.opencmis.commons.api.ExtensionsData)
-	 */
-	public void deleteObjectOrCancelCheckOut(CallContext context, String repositoryId, String objectId,
-			Boolean allVersions, ExtensionsData extension) {
-		fRepositoryMap.getAuthenticatedRepository(context, repositoryId).deleteObject(context, objectId);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.server.spi.CmisObjectService#deleteTree(org.apache
-	 * .opencmis.server.spi. CallContext, java.lang.String, java.lang.String,
-	 * java.lang.Boolean, org.apache.opencmis.commons.enums.UnfileObjects,
-	 * java.lang.Boolean, org.apache.opencmis.commons.api.ExtensionsData)
-	 */
-	public FailedToDeleteData deleteTree(CallContext context, String repositoryId, String folderId,
-			Boolean allVersions, UnfileObject unfileObjects, Boolean continueOnFailure, ExtensionsData extension) {
-		return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).deleteTree(context, folderId,
-				continueOnFailure);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.server.spi.CmisObjectService#getAllowableActions(
-	 * org.apache.opencmis.server .spi.CallContext , java.lang.String,
-	 * java.lang.String, org.apache.opencmis.commons.api.ExtensionsData)
-	 */
-	public AllowableActions getAllowableActions(CallContext context, String repositoryId, String objectId,
-			ExtensionsData extension) {
-		return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getAllowableActions(context, objectId);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.server.spi.CmisObjectService#getContentStream(org
-	 * .apache.opencmis.server .spi.CallContext, java.lang.String,
-	 * java.lang.String, java.lang.String, java.math.BigInteger,
-	 * java.math.BigInteger, org.apache.opencmis.commons.api.ExtensionsData)
-	 */
-	public ContentStream getContentStream(CallContext context, String repositoryId, String objectId, String streamId,
-			BigInteger offset, BigInteger length, ExtensionsData extension) {
-		return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getContentStream(context, objectId,
-				offset, length);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * 
-	 * @seeorg.apache.opencmis.server.spi.CmisObjectService#getObject(org.apache.
-	 * opencmis.server.spi. CallContext, java.lang.String, java.lang.String,
-	 * java.lang.String, java.lang.Boolean,
-	 * org.apache.opencmis.commons.enums.IncludeRelationships, java.lang.String,
-	 * java.lang.Boolean, java.lang.Boolean,
-	 * org.apache.opencmis.commons.api.ExtensionsData,
-	 * org.apache.opencmis.server.spi.ObjectInfoHolder)
-	 */
-	public ObjectData getObject(CallContext context, String repositoryId, String objectId, String filter,
-			Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
-			Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension, ObjectInfoHolder objectInfos) {
-		return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getObject(context, objectId, filter,
-				includeAllowableActions, includeAcl, objectInfos);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.server.spi.CmisObjectService#getObjectByPath(org.
-	 * apache.opencmis.server .spi.CallContext, java.lang.String,
-	 * java.lang.String, java.lang.String, java.lang.Boolean,
-	 * org.apache.opencmis.commons.enums.IncludeRelationships, java.lang.String,
-	 * java.lang.Boolean, java.lang.Boolean,
-	 * org.apache.opencmis.commons.api.ExtensionsData,
-	 * org.apache.opencmis.server.spi.ObjectInfoHolder)
-	 */
-	public ObjectData getObjectByPath(CallContext context, String repositoryId, String path, String filter,
-			Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
-			Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension, ObjectInfoHolder objectInfos) {
-		return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getObjectByPath(context, path, filter,
-				includeAllowableActions, includeAcl, objectInfos);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.server.spi.CmisObjectService#getProperties(org.apache
-	 * .opencmis.server.spi .CallContext, java.lang.String, java.lang.String,
-	 * java.lang.String, org.apache.opencmis.commons.api.ExtensionsData,
-	 * org.apache.opencmis.server.spi.ObjectInfoHolder)
-	 */
-	public Properties getProperties(CallContext context, String repositoryId, String objectId, String filter,
-			ExtensionsData extension) {
-		ObjectData object = fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getObject(context,
-				objectId, filter, false, false, null);
-		return object.getProperties();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.server.spi.CmisObjectService#getRenditions(org.apache
-	 * .opencmis.server.spi .CallContext, java.lang.String, java.lang.String,
-	 * java.lang.String, java.math.BigInteger, java.math.BigInteger,
-	 * org.apache.opencmis.commons.api.ExtensionsData)
-	 */
-	public List<RenditionData> getRenditions(CallContext context, String repositoryId, String objectId,
-			String renditionFilter, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
-		fRepositoryMap.getAuthenticatedRepository(context, repositoryId);
-		return Collections.emptyList();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.server.spi.CmisObjectService#moveObject(org.apache
-	 * .opencmis.server.spi. CallContext, java.lang.String,
-	 * org.apache.opencmis.commons.provider.Holder, java.lang.String,
-	 * java.lang.String, org.apache.opencmis.commons.api.ExtensionsData,
-	 * org.apache.opencmis.server.spi.ObjectInfoHolder)
-	 */
-	public ObjectData moveObject(CallContext context, String repositoryId, Holder<String> objectId,
-			String targetFolderId, String sourceFolderId, ExtensionsData extension, ObjectInfoHolder objectInfos) {
-		return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).moveObject(context, objectId,
-				targetFolderId, objectInfos);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.server.spi.CmisObjectService#setContentStream(org
-	 * .apache.opencmis.server .spi.CallContext, java.lang.String,
-	 * org.apache.opencmis.commons.provider.Holder, java.lang.Boolean,
-	 * org.apache.opencmis.commons.provider.Holder,
-	 * org.apache.opencmis.commons.provider.ContentStreamData,
-	 * org.apache.opencmis.commons.api.ExtensionsData)
-	 */
-	public void setContentStream(CallContext context, String repositoryId, Holder<String> objectId,
-			Boolean overwriteFlag, Holder<String> changeToken, ContentStream contentStream, ExtensionsData extension) {
-		fRepositoryMap.getAuthenticatedRepository(context, repositoryId).setContentStream(context, objectId,
-				overwriteFlag, contentStream);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.server.spi.CmisObjectService#updateProperties(org
-	 * .apache.opencmis.server .spi.CallContext, java.lang.String,
-	 * org.apache.opencmis.commons.provider.Holder,
-	 * org.apache.opencmis.commons.provider.Holder,
-	 * org.apache.opencmis.commons.provider.PropertiesData,
-	 * org.apache.opencmis.commons.provider.AccessControlList,
-	 * org.apache.opencmis.commons.api.ExtensionsData,
-	 * org.apache.opencmis.server.spi.ObjectInfoHolder)
-	 */
-	public ObjectData updateProperties(CallContext context, String repositoryId, Holder<String> objectId,
-			Holder<String> changeToken, Properties properties, Acl acl, ExtensionsData extension,
-			ObjectInfoHolder objectInfos) {
-		return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).updateProperties(context, objectId,
-				properties, objectInfos);
-	}
+    /**
+     * Constructor.
+     */
+    public ObjectService(RepositoryMap repositoryMap) {
+        fRepositoryMap = repositoryMap;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.server.spi.CmisObjectService#create(org.apache.opencmis
+     * .server.spi.CallContext , java.lang.String,
+     * org.apache.opencmis.commons.provider.PropertiesData, java.lang.String,
+     * org.apache.opencmis.commons.provider.ContentStreamData,
+     * org.apache.opencmis.commons.enums.VersioningState, java.util.List,
+     * org.apache.opencmis.commons.api.ExtensionsData,
+     * org.apache.opencmis.server.spi.ObjectInfoHolder)
+     */
+    public ObjectData create(CallContext context, String repositoryId, Properties properties, String folderId,
+            ContentStream contentStream, VersioningState versioningState, List<String> policies,
+            ExtensionsData extension, ObjectInfoHolder objectInfos) {
+        return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).create(context, properties, folderId,
+                contentStream, versioningState, objectInfos);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.server.spi.CmisObjectService#createDocument(org.apache
+     * .opencmis.server. spi.CallContext, java.lang.String,
+     * org.apache.opencmis.commons.provider.PropertiesData, java.lang.String,
+     * org.apache.opencmis.commons.provider.ContentStreamData,
+     * org.apache.opencmis.commons.enums.VersioningState, java.util.List,
+     * org.apache.opencmis.commons.provider.AccessControlList,
+     * org.apache.opencmis.commons.provider.AccessControlList,
+     * org.apache.opencmis.commons.api.ExtensionsData)
+     */
+    public String createDocument(CallContext context, String repositoryId, Properties properties, String folderId,
+            ContentStream contentStream, VersioningState versioningState, List<String> policies, Acl addAces,
+            Acl removeAces, ExtensionsData extension) {
+        return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).createDocument(context, properties,
+                folderId, contentStream, versioningState);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.server.spi.CmisObjectService#createDocumentFromSource
+     * (org.apache.opencmis .server.spi. CallContext, java.lang.String,
+     * java.lang.String, org.apache.opencmis.commons.provider.PropertiesData,
+     * java.lang.String, org.apache.opencmis.commons.enums.VersioningState,
+     * java.util.List, org.apache.opencmis.commons.provider.AccessControlList,
+     * org.apache.opencmis.commons.provider.AccessControlList,
+     * org.apache.opencmis.commons.api.ExtensionsData)
+     */
+    public String createDocumentFromSource(CallContext context, String repositoryId, String sourceId,
+            Properties properties, String folderId, VersioningState versioningState, List<String> policies,
+            Acl addAces, Acl removeAces, ExtensionsData extension) {
+        return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).createDocumentFromSource(context,
+                sourceId, properties, folderId, versioningState);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.server.spi.CmisObjectService#createFolder(org.apache
+     * .opencmis.server.spi .CallContext, java.lang.String,
+     * org.apache.opencmis.commons.provider.PropertiesData, java.lang.String,
+     * java.util.List, org.apache.opencmis.commons.provider.AccessControlList,
+     * org.apache.opencmis.commons.provider.AccessControlList,
+     * org.apache.opencmis.commons.api.ExtensionsData)
+     */
+    public String createFolder(CallContext context, String repositoryId, Properties properties, String folderId,
+            List<String> policies, Acl addAces, Acl removeAces, ExtensionsData extension) {
+        return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).createFolder(context, properties,
+                folderId);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.server.spi.CmisObjectService#createPolicy(org.apache
+     * .opencmis.server.spi .CallContext, java.lang.String,
+     * org.apache.opencmis.commons.provider.PropertiesData, java.lang.String,
+     * java.util.List, org.apache.opencmis.commons.provider.AccessControlList,
+     * org.apache.opencmis.commons.provider.AccessControlList,
+     * org.apache.opencmis.commons.api.ExtensionsData)
+     */
+    public String createPolicy(CallContext context, String repositoryId, Properties properties, String folderId,
+            List<String> policies, Acl addAces, Acl removeAces, ExtensionsData extension) {
+        fRepositoryMap.getAuthenticatedRepository(context, repositoryId);
+        throw new CmisNotSupportedException("createPolicy not supported!");
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.server.spi.CmisObjectService#createRelationship(org
+     * .apache.opencmis.server .spi.CallContext , java.lang.String,
+     * org.apache.opencmis.commons.provider.PropertiesData, java.util.List,
+     * org.apache.opencmis.commons.provider.AccessControlList,
+     * org.apache.opencmis.commons.provider.AccessControlList,
+     * org.apache.opencmis.commons.api.ExtensionsData)
+     */
+    public String createRelationship(CallContext context, String repositoryId, Properties properties,
+            List<String> policies, Acl addAces, Acl removeAces, ExtensionsData extension) {
+        fRepositoryMap.getAuthenticatedRepository(context, repositoryId);
+        throw new CmisNotSupportedException("createRelationship not supported!");
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.server.spi.CmisObjectService#deleteContentStream(
+     * org.apache.opencmis.server .spi.CallContext , java.lang.String,
+     * org.apache.opencmis.commons.provider.Holder,
+     * org.apache.opencmis.commons.provider.Holder,
+     * org.apache.opencmis.commons.api.ExtensionsData)
+     */
+    public void deleteContentStream(CallContext context, String repositoryId, Holder<String> objectId,
+            Holder<String> changeToken, ExtensionsData extension) {
+        fRepositoryMap.getAuthenticatedRepository(context, repositoryId)
+                .setContentStream(context, objectId, true, null);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.server.spi.CmisObjectService#deleteObjectOrCancelCheckOut
+     * (org.apache.opencmis .server. spi.CallContext, java.lang.String,
+     * java.lang.String, java.lang.Boolean,
+     * org.apache.opencmis.commons.api.ExtensionsData)
+     */
+    public void deleteObjectOrCancelCheckOut(CallContext context, String repositoryId, String objectId,
+            Boolean allVersions, ExtensionsData extension) {
+        fRepositoryMap.getAuthenticatedRepository(context, repositoryId).deleteObject(context, objectId);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.server.spi.CmisObjectService#deleteTree(org.apache
+     * .opencmis.server.spi. CallContext, java.lang.String, java.lang.String,
+     * java.lang.Boolean, org.apache.opencmis.commons.enums.UnfileObjects,
+     * java.lang.Boolean, org.apache.opencmis.commons.api.ExtensionsData)
+     */
+    public FailedToDeleteData deleteTree(CallContext context, String repositoryId, String folderId,
+            Boolean allVersions, UnfileObject unfileObjects, Boolean continueOnFailure, ExtensionsData extension) {
+        return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).deleteTree(context, folderId,
+                continueOnFailure);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.server.spi.CmisObjectService#getAllowableActions(
+     * org.apache.opencmis.server .spi.CallContext , java.lang.String,
+     * java.lang.String, org.apache.opencmis.commons.api.ExtensionsData)
+     */
+    public AllowableActions getAllowableActions(CallContext context, String repositoryId, String objectId,
+            ExtensionsData extension) {
+        return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getAllowableActions(context, objectId);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.server.spi.CmisObjectService#getContentStream(org
+     * .apache.opencmis.server .spi.CallContext, java.lang.String,
+     * java.lang.String, java.lang.String, java.math.BigInteger,
+     * java.math.BigInteger, org.apache.opencmis.commons.api.ExtensionsData)
+     */
+    public ContentStream getContentStream(CallContext context, String repositoryId, String objectId, String streamId,
+            BigInteger offset, BigInteger length, ExtensionsData extension) {
+        return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getContentStream(context, objectId,
+                offset, length);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * 
+     * 
+     * @seeorg.apache.opencmis.server.spi.CmisObjectService#getObject(org.apache.
+     * opencmis.server.spi. CallContext, java.lang.String, java.lang.String,
+     * java.lang.String, java.lang.Boolean,
+     * org.apache.opencmis.commons.enums.IncludeRelationships, java.lang.String,
+     * java.lang.Boolean, java.lang.Boolean,
+     * org.apache.opencmis.commons.api.ExtensionsData,
+     * org.apache.opencmis.server.spi.ObjectInfoHolder)
+     */
+    public ObjectData getObject(CallContext context, String repositoryId, String objectId, String filter,
+            Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
+            Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension, ObjectInfoHolder objectInfos) {
+        return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getObject(context, objectId, filter,
+                includeAllowableActions, includeAcl, objectInfos);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.server.spi.CmisObjectService#getObjectByPath(org.
+     * apache.opencmis.server .spi.CallContext, java.lang.String,
+     * java.lang.String, java.lang.String, java.lang.Boolean,
+     * org.apache.opencmis.commons.enums.IncludeRelationships, java.lang.String,
+     * java.lang.Boolean, java.lang.Boolean,
+     * org.apache.opencmis.commons.api.ExtensionsData,
+     * org.apache.opencmis.server.spi.ObjectInfoHolder)
+     */
+    public ObjectData getObjectByPath(CallContext context, String repositoryId, String path, String filter,
+            Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
+            Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension, ObjectInfoHolder objectInfos) {
+        return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getObjectByPath(context, path, filter,
+                includeAllowableActions, includeAcl, objectInfos);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.server.spi.CmisObjectService#getProperties(org.apache
+     * .opencmis.server.spi .CallContext, java.lang.String, java.lang.String,
+     * java.lang.String, org.apache.opencmis.commons.api.ExtensionsData,
+     * org.apache.opencmis.server.spi.ObjectInfoHolder)
+     */
+    public Properties getProperties(CallContext context, String repositoryId, String objectId, String filter,
+            ExtensionsData extension) {
+        ObjectData object = fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getObject(context,
+                objectId, filter, false, false, null);
+        return object.getProperties();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.server.spi.CmisObjectService#getRenditions(org.apache
+     * .opencmis.server.spi .CallContext, java.lang.String, java.lang.String,
+     * java.lang.String, java.math.BigInteger, java.math.BigInteger,
+     * org.apache.opencmis.commons.api.ExtensionsData)
+     */
+    public List<RenditionData> getRenditions(CallContext context, String repositoryId, String objectId,
+            String renditionFilter, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+        fRepositoryMap.getAuthenticatedRepository(context, repositoryId);
+        return Collections.emptyList();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.server.spi.CmisObjectService#moveObject(org.apache
+     * .opencmis.server.spi. CallContext, java.lang.String,
+     * org.apache.opencmis.commons.provider.Holder, java.lang.String,
+     * java.lang.String, org.apache.opencmis.commons.api.ExtensionsData,
+     * org.apache.opencmis.server.spi.ObjectInfoHolder)
+     */
+    public ObjectData moveObject(CallContext context, String repositoryId, Holder<String> objectId,
+            String targetFolderId, String sourceFolderId, ExtensionsData extension, ObjectInfoHolder objectInfos) {
+        return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).moveObject(context, objectId,
+                targetFolderId, objectInfos);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.server.spi.CmisObjectService#setContentStream(org
+     * .apache.opencmis.server .spi.CallContext, java.lang.String,
+     * org.apache.opencmis.commons.provider.Holder, java.lang.Boolean,
+     * org.apache.opencmis.commons.provider.Holder,
+     * org.apache.opencmis.commons.provider.ContentStreamData,
+     * org.apache.opencmis.commons.api.ExtensionsData)
+     */
+    public void setContentStream(CallContext context, String repositoryId, Holder<String> objectId,
+            Boolean overwriteFlag, Holder<String> changeToken, ContentStream contentStream, ExtensionsData extension) {
+        fRepositoryMap.getAuthenticatedRepository(context, repositoryId).setContentStream(context, objectId,
+                overwriteFlag, contentStream);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.server.spi.CmisObjectService#updateProperties(org
+     * .apache.opencmis.server .spi.CallContext, java.lang.String,
+     * org.apache.opencmis.commons.provider.Holder,
+     * org.apache.opencmis.commons.provider.Holder,
+     * org.apache.opencmis.commons.provider.PropertiesData,
+     * org.apache.opencmis.commons.provider.AccessControlList,
+     * org.apache.opencmis.commons.api.ExtensionsData,
+     * org.apache.opencmis.server.spi.ObjectInfoHolder)
+     */
+    public ObjectData updateProperties(CallContext context, String repositoryId, Holder<String> objectId,
+            Holder<String> changeToken, Properties properties, Acl acl, ExtensionsData extension,
+            ObjectInfoHolder objectInfos) {
+        return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).updateProperties(context, objectId,
+                properties, objectInfos);
+    }
 
 }

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=936938&r1=936937&r2=936938&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 Thu Apr 22 16:27:57 2010
@@ -34,78 +34,78 @@ import org.apache.chemistry.opencmis.com
  */
 public class RepositoryMap {
 
-	private Map<String, FileShareRepository> fMap;
-	private Map<String, String> fLogins;
+    private Map<String, FileShareRepository> fMap;
+    private Map<String, String> fLogins;
 
-	public RepositoryMap() {
-		fMap = new HashMap<String, FileShareRepository>();
-		fLogins = new HashMap<String, String>();
-	}
-
-	/**
-	 * Adds a repository object.
-	 */
-	public void addRepository(FileShareRepository fsr) {
-		if ((fsr == null) || (fsr.getRepositoryId() == null)) {
-			return;
-		}
-
-		fMap.put(fsr.getRepositoryId(), fsr);
-	}
-
-	/**
-	 * Gets a repository object by id.
-	 */
-	public FileShareRepository getRepository(String repositoryId) {
-		// get repository object
-		FileShareRepository result = fMap.get(repositoryId);
-		if (result == null) {
-			throw new CmisObjectNotFoundException("Unknown repository '" + repositoryId + "'!");
-		}
-
-		return result;
-	}
-
-	/**
-	 * Gets a repository object by id.
-	 */
-	public FileShareRepository getAuthenticatedRepository(CallContext context, String repositoryId) {
-		// check user and password first
-		if (!authenticate(context.getUsername(), context.getPassword())) {
-			throw new CmisPermissionDeniedException();
-		}
-
-		// get repository object
-		return repositoryId == null ? null : getRepository(repositoryId);
-	}
-
-	/**
-	 * Returns all repository objects.
-	 */
-	public Collection<FileShareRepository> getRepositories() {
-		return fMap.values();
-	}
-
-	/**
-	 * Adds a login.
-	 */
-	public void addLogin(String username, String password) {
-		if ((username == null) || (password == null)) {
-			return;
-		}
-
-		fLogins.put(username.trim(), password);
-	}
-
-	/**
-	 * Authenticates a user against the configured logins.
-	 */
-	private boolean authenticate(String username, String password) {
-		String pwd = fLogins.get(username);
-		if (pwd == null) {
-			return false;
-		}
+    public RepositoryMap() {
+        fMap = new HashMap<String, FileShareRepository>();
+        fLogins = new HashMap<String, String>();
+    }
+
+    /**
+     * Adds a repository object.
+     */
+    public void addRepository(FileShareRepository fsr) {
+        if ((fsr == null) || (fsr.getRepositoryId() == null)) {
+            return;
+        }
+
+        fMap.put(fsr.getRepositoryId(), fsr);
+    }
+
+    /**
+     * Gets a repository object by id.
+     */
+    public FileShareRepository getRepository(String repositoryId) {
+        // get repository object
+        FileShareRepository result = fMap.get(repositoryId);
+        if (result == null) {
+            throw new CmisObjectNotFoundException("Unknown repository '" + repositoryId + "'!");
+        }
+
+        return result;
+    }
+
+    /**
+     * Gets a repository object by id.
+     */
+    public FileShareRepository getAuthenticatedRepository(CallContext context, String repositoryId) {
+        // check user and password first
+        if (!authenticate(context.getUsername(), context.getPassword())) {
+            throw new CmisPermissionDeniedException();
+        }
+
+        // get repository object
+        return repositoryId == null ? null : getRepository(repositoryId);
+    }
+
+    /**
+     * Returns all repository objects.
+     */
+    public Collection<FileShareRepository> getRepositories() {
+        return fMap.values();
+    }
+
+    /**
+     * Adds a login.
+     */
+    public void addLogin(String username, String password) {
+        if ((username == null) || (password == null)) {
+            return;
+        }
+
+        fLogins.put(username.trim(), password);
+    }
+
+    /**
+     * Authenticates a user against the configured logins.
+     */
+    private boolean authenticate(String username, String password) {
+        String pwd = fLogins.get(username);
+        if (pwd == null) {
+            return false;
+        }
 
-		return pwd.equals(password);
-	}
+        return pwd.equals(password);
+    }
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/RepositoryService.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/RepositoryService.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/RepositoryService.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/RepositoryService.java Thu Apr 22 16:27:57 2010
@@ -38,87 +38,89 @@ import org.apache.chemistry.opencmis.ser
  */
 public class RepositoryService implements CmisRepositoryService {
 
-	private RepositoryMap fRepositoryMap;
+    private RepositoryMap fRepositoryMap;
 
-	/**
-	 * Constructor.
-	 */
-	public RepositoryService(RepositoryMap repositoryMap) {
-		fRepositoryMap = repositoryMap;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.server.spi.CmisRepositoryService#getRepositoryInfo
-	 * (org.apache.opencmis. server.spi.CallContext , java.lang.String,
-	 * org.apache.opencmis.commons.api.ExtensionsData)
-	 */
-	public RepositoryInfo getRepositoryInfo(CallContext context, String repositoryId, ExtensionsData extension) {
-		return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getRepositoryInfo(context);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * 
-	 * 
-	 * @seeorg.apache.opencmis.server.spi.CmisRepositoryService#getRepositoryInfos
-	 * (org.apache.opencmis. server.spi. CallContext,
-	 * org.apache.opencmis.commons.api.ExtensionsData)
-	 */
-	public List<RepositoryInfo> getRepositoryInfos(CallContext context, ExtensionsData extension) {
-		List<RepositoryInfo> result = new ArrayList<RepositoryInfo>();
-
-		for (FileShareRepository fsr : fRepositoryMap.getRepositories()) {
-			result.add(fsr.getRepositoryInfo(context));
-		}
-
-		return result;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.server.spi.CmisRepositoryService#getTypeChildren(
-	 * org.apache.opencmis.server .spi.CallContext , java.lang.String,
-	 * java.lang.String, java.lang.Boolean, java.math.BigInteger,
-	 * java.math.BigInteger, org.apache.opencmis.commons.api.ExtensionsData)
-	 */
-	public TypeDefinitionList getTypeChildren(CallContext context, String repositoryId, String typeId,
-			Boolean includePropertyDefinitions, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
-		return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getTypesChildren(context, typeId,
-				includePropertyDefinitions, maxItems, skipCount);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.server.spi.CmisRepositoryService#getTypeDefinition
-	 * (org.apache.opencmis. server.spi.CallContext , java.lang.String,
-	 * java.lang.String, org.apache.opencmis.commons.api.ExtensionsData)
-	 */
-	public TypeDefinition getTypeDefinition(CallContext context, String repositoryId, String typeId,
-			ExtensionsData extension) {
-		return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getTypeDefinition(context, typeId);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * 
-	 * 
-	 * @seeorg.apache.opencmis.server.spi.CmisRepositoryService#getTypeDescendants
-	 * (org.apache.opencmis. server.spi. CallContext, java.lang.String,
-	 * java.lang.String, java.math.BigInteger, java.lang.Boolean,
-	 * org.apache.opencmis.commons.api.ExtensionsData)
-	 */
-	public List<TypeDefinitionContainer> getTypeDescendants(CallContext context, String repositoryId, String typeId,
-			BigInteger depth, Boolean includePropertyDefinitions, ExtensionsData extension) {
-		return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getTypesDescendants(context, typeId,
-				depth, includePropertyDefinitions);
-	}
+    /**
+     * Constructor.
+     */
+    public RepositoryService(RepositoryMap repositoryMap) {
+        fRepositoryMap = repositoryMap;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.server.spi.CmisRepositoryService#getRepositoryInfo
+     * (org.apache.opencmis. server.spi.CallContext , java.lang.String,
+     * org.apache.opencmis.commons.api.ExtensionsData)
+     */
+    public RepositoryInfo getRepositoryInfo(CallContext context, String repositoryId, ExtensionsData extension) {
+        return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getRepositoryInfo(context);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * 
+     * 
+     * 
+     * @seeorg.apache.opencmis.server.spi.CmisRepositoryService#getRepositoryInfos
+     * (org.apache.opencmis. server.spi. CallContext,
+     * org.apache.opencmis.commons.api.ExtensionsData)
+     */
+    public List<RepositoryInfo> getRepositoryInfos(CallContext context, ExtensionsData extension) {
+        List<RepositoryInfo> result = new ArrayList<RepositoryInfo>();
+
+        for (FileShareRepository fsr : fRepositoryMap.getRepositories()) {
+            result.add(fsr.getRepositoryInfo(context));
+        }
+
+        return result;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.server.spi.CmisRepositoryService#getTypeChildren(
+     * org.apache.opencmis.server .spi.CallContext , java.lang.String,
+     * java.lang.String, java.lang.Boolean, java.math.BigInteger,
+     * java.math.BigInteger, org.apache.opencmis.commons.api.ExtensionsData)
+     */
+    public TypeDefinitionList getTypeChildren(CallContext context, String repositoryId, String typeId,
+            Boolean includePropertyDefinitions, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+        return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getTypesChildren(context, typeId,
+                includePropertyDefinitions, maxItems, skipCount);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.server.spi.CmisRepositoryService#getTypeDefinition
+     * (org.apache.opencmis. server.spi.CallContext , java.lang.String,
+     * java.lang.String, org.apache.opencmis.commons.api.ExtensionsData)
+     */
+    public TypeDefinition getTypeDefinition(CallContext context, String repositoryId, String typeId,
+            ExtensionsData extension) {
+        return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getTypeDefinition(context, typeId);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * 
+     * 
+     * 
+     * @seeorg.apache.opencmis.server.spi.CmisRepositoryService#getTypeDescendants
+     * (org.apache.opencmis. server.spi. CallContext, java.lang.String,
+     * java.lang.String, java.math.BigInteger, java.lang.Boolean,
+     * org.apache.opencmis.commons.api.ExtensionsData)
+     */
+    public List<TypeDefinitionContainer> getTypeDescendants(CallContext context, String repositoryId, String typeId,
+            BigInteger depth, Boolean includePropertyDefinitions, ExtensionsData extension) {
+        return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getTypesDescendants(context, typeId,
+                depth, includePropertyDefinitions);
+    }
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/ServicesFactory.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/ServicesFactory.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/ServicesFactory.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/ServicesFactory.java Thu Apr 22 16:27:57 2010
@@ -54,203 +54,203 @@ import org.apache.commons.logging.LogFac
  */
 public class ServicesFactory extends AbstractServicesFactory {
 
-	private static final String PREFIX_LOGIN = "login.";
-	private static final String PREFIX_REPOSITORY = "repository.";
-	private static final String PREFIX_TYPE = "type.";
-	private static final String SUFFIX_READWRITE = ".readwrite";
-	private static final String SUFFIX_READONLY = ".readonly";
-
-	private static final BigInteger DEFAULT_MAX_ITEMS_OBJECTS = BigInteger.valueOf(200);
-	private static final BigInteger DEFAULT_MAX_ITEMS_TYPES = BigInteger.valueOf(50);
-	private static final BigInteger DEFAULT_DEPTH_OBJECTS = BigInteger.valueOf(10);
-	private static final BigInteger DEFAULT_DEPTH_TYPES = BigInteger.valueOf(-1);
-
-	private static final Log log = LogFactory.getLog(AbstractServicesFactory.class);
-
-	private RepositoryMap fRepositoryMap;
-	private TypeManager fTypeManager;
-
-	private CmisRepositoryService fRepositoryService;
-	private CmisNavigationService fNavigationService;
-	private CmisObjectService fObjectService;
-	private CmisVersioningService fVersioningService;
-	private CmisAclService fAclService;
-
-	public ServicesFactory() {
-	}
-
-	@Override
-	public void init(Map<String, String> parameters) {
-		fRepositoryMap = new RepositoryMap();
-		fTypeManager = new TypeManager();
-
-		readConfiguration(parameters);
-
-		// create service object with wrappers
-		fRepositoryService = new RepositoryServiceWrapper(new RepositoryService(fRepositoryMap),
-				DEFAULT_MAX_ITEMS_TYPES, DEFAULT_DEPTH_TYPES);
-		fNavigationService = new NavigationServiceWrapper(new NavigationService(fRepositoryMap),
-				DEFAULT_MAX_ITEMS_OBJECTS, DEFAULT_DEPTH_OBJECTS);
-		fObjectService = new ObjectServiceWrapper(new ObjectService(fRepositoryMap), DEFAULT_MAX_ITEMS_OBJECTS);
-		fVersioningService = new VersioningServiceWrapper(new VersioningService(fRepositoryMap));
-		fAclService = new AclServiceWrapper(new AclService(fRepositoryMap));
-	}
-
-	@Override
-	public CmisRepositoryService getRepositoryService() {
-		return fRepositoryService;
-	}
-
-	@Override
-	public CmisNavigationService getNavigationService() {
-		return fNavigationService;
-	}
-
-	@Override
-	public CmisObjectService getObjectService() {
-		return fObjectService;
-	}
-
-	@Override
-	public CmisVersioningService getVersioningService() {
-		return fVersioningService;
-	}
-
-	@Override
-	public CmisAclService getAclService() {
-		return fAclService;
-	}
-
-	// ---- helpers ----
-
-	private void readConfiguration(Map<String, String> parameters) {
-		List<String> keys = new ArrayList<String>(parameters.keySet());
-		Collections.sort(keys);
-
-		for (String key : keys) {
-			if (key.startsWith(PREFIX_LOGIN)) {
-				// get logins
-				String usernameAndPassword = replaceSystemProperties(parameters.get(key));
-				if (usernameAndPassword == null) {
-					continue;
-				}
-
-				String username = usernameAndPassword;
-				String password = "";
-
-				int x = usernameAndPassword.indexOf(':');
-				if (x > -1) {
-					username = usernameAndPassword.substring(0, x);
-					password = usernameAndPassword.substring(x + 1);
-				}
-
-				fRepositoryMap.addLogin(username, password);
-
-				log.info("Added login '" + username + "'.");
-			} else if (key.startsWith(PREFIX_TYPE)) {
-				// load type definition
-				TypeDefinition type = loadType(replaceSystemProperties(parameters.get(key)));
-				if (type != null) {
-					fTypeManager.addType(type);
-				}
-			} else if (key.startsWith(PREFIX_REPOSITORY)) {
-				// configure repositories
-				String repositoryId = key.substring(PREFIX_REPOSITORY.length()).trim();
-				int x = repositoryId.lastIndexOf('.');
-				if (x > 0) {
-					repositoryId = repositoryId.substring(0, x);
-				}
-
-				if (repositoryId.length() == 0) {
-					throw new IllegalArgumentException("No repository id!");
-				}
-
-				if (key.endsWith(SUFFIX_READWRITE)) {
-					// read-write users
-					FileShareRepository fsr = fRepositoryMap.getRepository(repositoryId);
-					for (String user : split(parameters.get(key))) {
-						fsr.addUser(replaceSystemProperties(user), false);
-					}
-				} else if (key.endsWith(SUFFIX_READONLY)) {
-					// read-only users
-					FileShareRepository fsr = fRepositoryMap.getRepository(repositoryId);
-					for (String user : split(parameters.get(key))) {
-						fsr.addUser(replaceSystemProperties(user), true);
-					}
-				} else {
-					// new repository
-					String root = replaceSystemProperties(parameters.get(key));
-					FileShareRepository fsr = new FileShareRepository(repositoryId, root, fTypeManager);
-
-					fRepositoryMap.addRepository(fsr);
-
-					log.info("Added repository '" + fsr.getRepositoryId() + "': " + root);
-				}
-			}
-		}
-	}
-
-	private List<String> split(String csl) {
-		if (csl == null) {
-			return Collections.emptyList();
-		}
-
-		List<String> result = new ArrayList<String>();
-		for (String s : csl.split(",")) {
-			result.add(s.trim());
-		}
-
-		return result;
-	}
-
-	private String replaceSystemProperties(String s) {
-		if (s == null) {
-			return null;
-		}
-
-		StringBuilder result = new StringBuilder();
-		StringBuilder property = null;
-		boolean inProperty = false;
-
-		for (int i = 0; i < s.length(); i++) {
-			char c = s.charAt(i);
-
-			if (inProperty) {
-				if (c == '}') {
-					String value = System.getProperty(property.toString());
-					if (value != null) {
-						result.append(value);
-					}
-					inProperty = false;
-				} else {
-					property.append(c);
-				}
-			} else {
-				if (c == '{') {
-					property = new StringBuilder();
-					inProperty = true;
-				} else {
-					result.append(c);
-				}
-			}
-		}
-
-		return result.toString();
-	}
-
-	@SuppressWarnings("unchecked")
-	private TypeDefinition loadType(String filename) {
-		TypeDefinition result = null;
-
-		try {
-			Unmarshaller u = JaxBHelper.createUnmarshaller();
-			JAXBElement<CmisTypeDefinitionType> type = (JAXBElement<CmisTypeDefinitionType>) u.unmarshal(new File(
-					filename));
-			result = Converter.convert(type.getValue());
-		} catch (Exception e) {
-			log.info("Could not load type: '" + filename + "'", e);
-		}
+    private static final String PREFIX_LOGIN = "login.";
+    private static final String PREFIX_REPOSITORY = "repository.";
+    private static final String PREFIX_TYPE = "type.";
+    private static final String SUFFIX_READWRITE = ".readwrite";
+    private static final String SUFFIX_READONLY = ".readonly";
+
+    private static final BigInteger DEFAULT_MAX_ITEMS_OBJECTS = BigInteger.valueOf(200);
+    private static final BigInteger DEFAULT_MAX_ITEMS_TYPES = BigInteger.valueOf(50);
+    private static final BigInteger DEFAULT_DEPTH_OBJECTS = BigInteger.valueOf(10);
+    private static final BigInteger DEFAULT_DEPTH_TYPES = BigInteger.valueOf(-1);
+
+    private static final Log log = LogFactory.getLog(AbstractServicesFactory.class);
+
+    private RepositoryMap fRepositoryMap;
+    private TypeManager fTypeManager;
+
+    private CmisRepositoryService fRepositoryService;
+    private CmisNavigationService fNavigationService;
+    private CmisObjectService fObjectService;
+    private CmisVersioningService fVersioningService;
+    private CmisAclService fAclService;
+
+    public ServicesFactory() {
+    }
+
+    @Override
+    public void init(Map<String, String> parameters) {
+        fRepositoryMap = new RepositoryMap();
+        fTypeManager = new TypeManager();
+
+        readConfiguration(parameters);
+
+        // create service object with wrappers
+        fRepositoryService = new RepositoryServiceWrapper(new RepositoryService(fRepositoryMap),
+                DEFAULT_MAX_ITEMS_TYPES, DEFAULT_DEPTH_TYPES);
+        fNavigationService = new NavigationServiceWrapper(new NavigationService(fRepositoryMap),
+                DEFAULT_MAX_ITEMS_OBJECTS, DEFAULT_DEPTH_OBJECTS);
+        fObjectService = new ObjectServiceWrapper(new ObjectService(fRepositoryMap), DEFAULT_MAX_ITEMS_OBJECTS);
+        fVersioningService = new VersioningServiceWrapper(new VersioningService(fRepositoryMap));
+        fAclService = new AclServiceWrapper(new AclService(fRepositoryMap));
+    }
+
+    @Override
+    public CmisRepositoryService getRepositoryService() {
+        return fRepositoryService;
+    }
+
+    @Override
+    public CmisNavigationService getNavigationService() {
+        return fNavigationService;
+    }
+
+    @Override
+    public CmisObjectService getObjectService() {
+        return fObjectService;
+    }
+
+    @Override
+    public CmisVersioningService getVersioningService() {
+        return fVersioningService;
+    }
+
+    @Override
+    public CmisAclService getAclService() {
+        return fAclService;
+    }
+
+    // ---- helpers ----
+
+    private void readConfiguration(Map<String, String> parameters) {
+        List<String> keys = new ArrayList<String>(parameters.keySet());
+        Collections.sort(keys);
+
+        for (String key : keys) {
+            if (key.startsWith(PREFIX_LOGIN)) {
+                // get logins
+                String usernameAndPassword = replaceSystemProperties(parameters.get(key));
+                if (usernameAndPassword == null) {
+                    continue;
+                }
+
+                String username = usernameAndPassword;
+                String password = "";
+
+                int x = usernameAndPassword.indexOf(':');
+                if (x > -1) {
+                    username = usernameAndPassword.substring(0, x);
+                    password = usernameAndPassword.substring(x + 1);
+                }
+
+                fRepositoryMap.addLogin(username, password);
+
+                log.info("Added login '" + username + "'.");
+            } else if (key.startsWith(PREFIX_TYPE)) {
+                // load type definition
+                TypeDefinition type = loadType(replaceSystemProperties(parameters.get(key)));
+                if (type != null) {
+                    fTypeManager.addType(type);
+                }
+            } else if (key.startsWith(PREFIX_REPOSITORY)) {
+                // configure repositories
+                String repositoryId = key.substring(PREFIX_REPOSITORY.length()).trim();
+                int x = repositoryId.lastIndexOf('.');
+                if (x > 0) {
+                    repositoryId = repositoryId.substring(0, x);
+                }
+
+                if (repositoryId.length() == 0) {
+                    throw new IllegalArgumentException("No repository id!");
+                }
+
+                if (key.endsWith(SUFFIX_READWRITE)) {
+                    // read-write users
+                    FileShareRepository fsr = fRepositoryMap.getRepository(repositoryId);
+                    for (String user : split(parameters.get(key))) {
+                        fsr.addUser(replaceSystemProperties(user), false);
+                    }
+                } else if (key.endsWith(SUFFIX_READONLY)) {
+                    // read-only users
+                    FileShareRepository fsr = fRepositoryMap.getRepository(repositoryId);
+                    for (String user : split(parameters.get(key))) {
+                        fsr.addUser(replaceSystemProperties(user), true);
+                    }
+                } else {
+                    // new repository
+                    String root = replaceSystemProperties(parameters.get(key));
+                    FileShareRepository fsr = new FileShareRepository(repositoryId, root, fTypeManager);
+
+                    fRepositoryMap.addRepository(fsr);
+
+                    log.info("Added repository '" + fsr.getRepositoryId() + "': " + root);
+                }
+            }
+        }
+    }
+
+    private List<String> split(String csl) {
+        if (csl == null) {
+            return Collections.emptyList();
+        }
+
+        List<String> result = new ArrayList<String>();
+        for (String s : csl.split(",")) {
+            result.add(s.trim());
+        }
+
+        return result;
+    }
+
+    private String replaceSystemProperties(String s) {
+        if (s == null) {
+            return null;
+        }
+
+        StringBuilder result = new StringBuilder();
+        StringBuilder property = null;
+        boolean inProperty = false;
+
+        for (int i = 0; i < s.length(); i++) {
+            char c = s.charAt(i);
+
+            if (inProperty) {
+                if (c == '}') {
+                    String value = System.getProperty(property.toString());
+                    if (value != null) {
+                        result.append(value);
+                    }
+                    inProperty = false;
+                } else {
+                    property.append(c);
+                }
+            } else {
+                if (c == '{') {
+                    property = new StringBuilder();
+                    inProperty = true;
+                } else {
+                    result.append(c);
+                }
+            }
+        }
+
+        return result.toString();
+    }
+
+    @SuppressWarnings("unchecked")
+    private TypeDefinition loadType(String filename) {
+        TypeDefinition result = null;
+
+        try {
+            Unmarshaller u = JaxBHelper.createUnmarshaller();
+            JAXBElement<CmisTypeDefinitionType> type = (JAXBElement<CmisTypeDefinitionType>) u.unmarshal(new File(
+                    filename));
+            result = Converter.convert(type.getValue());
+        } catch (Exception e) {
+            log.info("Could not load type: '" + filename + "'", e);
+        }
 
-		return result;
-	}
+        return result;
+    }
 }



Mime
View raw message