Fix issue in CMIS Web Services handling of repository id. CMIS Spaces Flex Client now operates against Alfresco via CMIS Web Services.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13608 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2009-03-12 19:15:58 +00:00
parent 894727b0cd
commit 7629f2f65f
2 changed files with 6 additions and 15 deletions

View File

@@ -251,7 +251,7 @@ public class DMAbstractServicePort
*/
protected void checkRepositoryId(String repositoryId) throws InvalidArgumentException
{
if (!this.descriptorService.getServerDescriptor().getId().equals(repositoryId))
if (!this.descriptorService.getCurrentRepositoryDescriptor().getId().equals(repositoryId))
{
throw new InvalidArgumentException("Invalid repository id");
}

View File

@@ -117,7 +117,7 @@ public class DMRepositoryServicePort extends DMAbstractServicePort implements Re
throws RuntimeException, InvalidArgumentException, OperationNotSupportedException, UpdateConflictException, PermissionDeniedException
{
CmisRepositoryEntryType repositoryEntryType = new CmisRepositoryEntryType();
Descriptor serverDescriptor = descriptorService.getServerDescriptor();
Descriptor serverDescriptor = descriptorService.getCurrentRepositoryDescriptor();
repositoryEntryType.setRepositoryID(serverDescriptor.getId());
repositoryEntryType.setRepositoryName(serverDescriptor.getName());
return Collections.singletonList(repositoryEntryType);
@@ -139,12 +139,9 @@ public class DMRepositoryServicePort extends DMAbstractServicePort implements Re
public CmisRepositoryInfoType getRepositoryInfo(GetRepositoryInfo parameters)
throws PermissionDeniedException, UpdateConflictException, ObjectNotFoundException, OperationNotSupportedException, InvalidArgumentException, RuntimeException, ConstraintViolationException
{
Descriptor serverDescriptor = descriptorService.getServerDescriptor();
if (serverDescriptor.getId().equals(parameters.getRepositoryId()) == false)
{
throw new InvalidArgumentException("Invalid repository id");
}
checkRepositoryId(parameters.getRepositoryId());
Descriptor serverDescriptor = descriptorService.getCurrentRepositoryDescriptor();
CmisRepositoryInfoType repositoryInfoType = new CmisRepositoryInfoType();
repositoryInfoType.setRepositoryId(serverDescriptor.getId());
repositoryInfoType.setRepositoryName(serverDescriptor.getName());
@@ -408,10 +405,7 @@ public class DMRepositoryServicePort extends DMAbstractServicePort implements Re
public GetTypesResponse getTypes(GetTypes parameters)
throws RuntimeException, InvalidArgumentException, ObjectNotFoundException, ConstraintViolationException, OperationNotSupportedException, UpdateConflictException, PermissionDeniedException
{
if (descriptorService.getServerDescriptor().getId().equals(parameters.getRepositoryId()) == false)
{
throw new InvalidArgumentException("Invalid repository id");
}
checkRepositoryId(parameters.getRepositoryId());
Collection<CMISTypeId> typeIds;
if (parameters.getTypeId() == null)
@@ -469,10 +463,7 @@ public class DMRepositoryServicePort extends DMAbstractServicePort implements Re
public GetTypeDefinitionResponse getTypeDefinition(GetTypeDefinition parameters)
throws PermissionDeniedException, UpdateConflictException, ObjectNotFoundException, OperationNotSupportedException, TypeNotFoundException, InvalidArgumentException, RuntimeException, ConstraintViolationException
{
if (descriptorService.getServerDescriptor().getId().equals(parameters.getRepositoryId()) == false)
{
throw new InvalidArgumentException("Invalid repository id");
}
checkRepositoryId(parameters.getRepositoryId());
GetTypeDefinitionResponse response = new GetTypeDefinitionResponse();
response.setType(getCmisTypeDefinition(parameters.getTypeId(), true));