Merged BRANCHES/DEV/BELARUS/HEAD-2010_03_17 to HEAD:

19347: .NET TCK tests were updated to current CMIS version. Several bugs were fixed.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19359 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2010-03-18 12:32:37 +00:00
parent b9833537e4
commit ad616fc014

View File

@@ -46,6 +46,7 @@ public class DMMultiFilingServicePort extends DMAbstractServicePort implements M
public void addObjectToFolder(String repositoryId, String objectId, String folderId, Boolean allVersions, Holder<CmisExtensionType> extension) throws CmisException public void addObjectToFolder(String repositoryId, String objectId, String folderId, Boolean allVersions, Holder<CmisExtensionType> extension) throws CmisException
{ {
checkRepositoryId(repositoryId); checkRepositoryId(repositoryId);
checkConstraints(objectId, folderId, false);
try try
{ {
cmisService.addObjectToFolder(objectId, folderId); cmisService.addObjectToFolder(objectId, folderId);
@@ -67,7 +68,7 @@ public class DMMultiFilingServicePort extends DMAbstractServicePort implements M
public void removeObjectFromFolder(String repositoryId, String objectId, String folderId, Holder<CmisExtensionType> extension) throws CmisException public void removeObjectFromFolder(String repositoryId, String objectId, String folderId, Holder<CmisExtensionType> extension) throws CmisException
{ {
checkRepositoryId(repositoryId); checkRepositoryId(repositoryId);
checkConstraints(objectId, folderId); checkConstraints(objectId, folderId, true);
try try
{ {
@@ -80,7 +81,7 @@ public class DMMultiFilingServicePort extends DMAbstractServicePort implements M
} }
private void checkConstraints(String objectId, String folderId) throws CmisException private void checkConstraints(String objectId, String folderId, boolean checkIsObjectInFolder) throws CmisException
{ {
NodeRef objectNodeRef = null; NodeRef objectNodeRef = null;
NodeRef folderNodeRef = null; NodeRef folderNodeRef = null;
@@ -102,7 +103,7 @@ public class DMMultiFilingServicePort extends DMAbstractServicePort implements M
throw ExceptionUtil.createCmisException("Object " + objectId + " is not a document", EnumServiceException.INVALID_ARGUMENT); throw ExceptionUtil.createCmisException("Object " + objectId + " is not a document", EnumServiceException.INVALID_ARGUMENT);
} }
if (!isObjectInFolder(objectNodeRef, folderNodeRef)) if (checkIsObjectInFolder && !isObjectInFolder(objectNodeRef, folderNodeRef))
{ {
throw ExceptionUtil.createCmisException("Folder doesn't contain specified object", EnumServiceException.OBJECT_NOT_FOUND); throw ExceptionUtil.createCmisException("Folder doesn't contain specified object", EnumServiceException.OBJECT_NOT_FOUND);
} }