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