From 526ee4ba355a9137c26a882a9284abbd216f21b6 Mon Sep 17 00:00:00 2001 From: Aron Roberts Date: Fri, 19 Feb 2010 20:00:32 +0000 Subject: [PATCH] CSPACE-826,CSPACE-1030: Further integration of Contact as a sub-resource of PersonAuthority/Person. Retrieving contacts for a person has been added. Initial UpdateContact and deleteContact code is also present but is currently commented out due to as-yet unresolved errors. PersonAuthorityResource no longer directly invokes ContactResource, and ContactResource has been reverted to r1327 accordingly. --- .../services/contact/ContactJAXBSchema.java | 1 + .../services/contact/ContactResource.java | 88 ----------- .../client/PersonAuthorityClient.java | 12 ++ .../services/client/PersonAuthorityProxy.java | 10 +- .../test/PersonAuthorityServiceTest.java | 102 ++++++++++++- .../person/PersonAuthorityResource.java | 144 +++++++++++++----- 6 files changed, 223 insertions(+), 134 deletions(-) diff --git a/services/contact/jaxb/src/main/java/org/collectionspace/services/contact/ContactJAXBSchema.java b/services/contact/jaxb/src/main/java/org/collectionspace/services/contact/ContactJAXBSchema.java index 3c1aafdbb..6af5c448d 100644 --- a/services/contact/jaxb/src/main/java/org/collectionspace/services/contact/ContactJAXBSchema.java +++ b/services/contact/jaxb/src/main/java/org/collectionspace/services/contact/ContactJAXBSchema.java @@ -7,6 +7,7 @@ package org.collectionspace.services.contact; * */ public interface ContactJAXBSchema { + final static String CONTACTS_COMMON = "contacts_common"; final static String CSID = "csid"; final static String IN_AUTHORITY = "inAuthority"; final static String IN_ITEM ="inItem"; diff --git a/services/contact/service/src/main/java/org/collectionspace/services/contact/ContactResource.java b/services/contact/service/src/main/java/org/collectionspace/services/contact/ContactResource.java index eacd99ae6..9d1eb50d2 100644 --- a/services/contact/service/src/main/java/org/collectionspace/services/contact/ContactResource.java +++ b/services/contact/service/src/main/java/org/collectionspace/services/contact/ContactResource.java @@ -79,34 +79,6 @@ public class ContactResource extends AbstractCollectionSpaceResourceImpl { return serviceName; } - private void validateIdsNotEmpty(String authorityCsid, String itemCsid, String csid) - throws WebApplicationException{ - if (authorityCsid == null || authorityCsid.trim().isEmpty()) { - logger.error("missing authorityCsid!"); - Response response = Response.status(Response.Status.BAD_REQUEST).entity( - "ID of Authority in request " + - "must not be null or empty").type( - "text/plain").build(); - throw new WebApplicationException(response); - } - if (itemCsid == null || itemCsid.trim().isEmpty()) { - logger.error("missing itemCsid!"); - Response response = Response.status(Response.Status.BAD_REQUEST).entity( - "ID of Item in request " + - "must not be null or empty").type( - "text/plain").build(); - throw new WebApplicationException(response); - } - if (csid == null || csid.trim().isEmpty()) { - logger.error("missing csid!"); - Response response = Response.status(Response.Status.BAD_REQUEST).entity( - "ID of Contact in request " + - "must not be null or empty").type( - "text/plain").build(); - throw new WebApplicationException(response); - } - } - @Override public DocumentHandler createDocumentHandler(ServiceContext ctx) throws Exception { DocumentHandler docHandler = ctx.getDocumentHandler(); @@ -119,9 +91,6 @@ public class ContactResource extends AbstractCollectionSpaceResourceImpl { return docHandler; } - // FIXME This method might be removed or disabled once its - // counterpart, sub-resource-based createContact method, below, - // is fully working. @POST public Response createContact(MultipartInput input) { try { @@ -143,26 +112,6 @@ public class ContactResource extends AbstractCollectionSpaceResourceImpl { } } - @POST - public String createContact(String authorityCsid, String itemCsid, MultipartInput input) { - try { - ServiceContext ctx = MultipartServiceContextFactory.get().createServiceContext(input, getServiceName()); - DocumentHandler handler = createDocumentHandler(ctx); - String csid = getRepositoryClient(ctx).create(ctx, handler); - return csid; - } catch (Exception e) { - if (logger.isDebugEnabled()) { - logger.debug("Caught exception in createContact", e); - } - Response response = Response.status( - Response.Status.INTERNAL_SERVER_ERROR).entity("Create failed").type("text/plain").build(); - throw new WebApplicationException(response); - } - } - - // FIXME This method might be removed or disabled once its - // counterpart, sub-resource-based getContact method, below, - // is fully working. @GET @Path("{csid}") public MultipartOutput getContact( @@ -208,43 +157,6 @@ public class ContactResource extends AbstractCollectionSpaceResourceImpl { return result; } - public MultipartOutput getContact(@PathParam("authorityCsid") String authorityCsid, - @PathParam("itemCsid") String itemCsid, @PathParam("csid") String csid) - throws DocumentNotFoundException, WebApplicationException { - if (logger.isDebugEnabled()) { - logger.debug("getContact with authorityCsid=" + authorityCsid + - " itemcsid=" + itemCsid + " csid=" + csid); - } - try { - validateIdsNotEmpty(authorityCsid, itemCsid, csid); - } catch (WebApplicationException e) { - throw e; - } - MultipartOutput result = null; - try { - ServiceContext ctx = MultipartServiceContextFactory.get().createServiceContext(null, getServiceName()); - DocumentHandler handler = createDocumentHandler(ctx); - getRepositoryClient(ctx).get(ctx, csid, handler); - result = (MultipartOutput) ctx.getOutput(); - } catch (DocumentNotFoundException dnfe) { - throw dnfe; - } catch (Exception e) { - if (logger.isDebugEnabled()) { - logger.debug("getContact", e); - } - Response response = Response.status( - Response.Status.INTERNAL_SERVER_ERROR).entity("Get failed").type("text/plain").build(); - throw new WebApplicationException(response); - } - if (result == null) { - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Get failed, the requested Contact CSID:" + csid + " was not found.").type( - "text/plain").build(); - throw new WebApplicationException(response); - } - return result; - } - @GET @Produces("application/xml") public ContactsCommonList getContactList(@Context UriInfo ui) { diff --git a/services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClient.java b/services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClient.java index f5cd9c21d..65c7d28a9 100644 --- a/services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClient.java +++ b/services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClient.java @@ -2,6 +2,7 @@ package org.collectionspace.services.client; import javax.ws.rs.core.Response; +import org.collectionspace.services.contact.ContactsCommonList; import org.collectionspace.services.person.PersonauthoritiesCommonList; import org.collectionspace.services.person.PersonsCommonList; import org.collectionspace.services.client.PersonAuthorityProxy; @@ -31,6 +32,7 @@ public class PersonAuthorityClient extends AbstractServiceClientImpl { public String getItemCommonPartName() { return getCommonPartName("persons"); } + /** * */ @@ -175,6 +177,16 @@ public class PersonAuthorityClient extends AbstractServiceClientImpl { return personAuthorityProxy.readContact(parentcsid, itemcsid, csid); } + public ClientResponse readContactList(String parentcsid, + String itemcsid) { + return personAuthorityProxy.readContactList(parentcsid, itemcsid); + } + + public ClientResponse updateContact(String parentcsid, + String itemcsid, String csid, MultipartOutput multipart) { + return personAuthorityProxy.updateContact(parentcsid, itemcsid, csid, multipart); + } + public ClientResponse deleteContact(String parentcsid, String itemcsid, String csid) { return personAuthorityProxy.deleteContact(parentcsid, diff --git a/services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityProxy.java b/services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityProxy.java index e2cfc9466..3f5f82759 100644 --- a/services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityProxy.java +++ b/services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityProxy.java @@ -78,14 +78,14 @@ public interface PersonAuthorityProxy { // List Contacts @GET @Produces({"application/xml"}) - @Path("{parentcsid}/items/{itemcsid}/contacts/") + @Path("/{parentcsid}/items/{itemcsid}/contacts/") ClientResponse readContactList( @PathParam("parentcsid") String parentcsid, @PathParam("itemcsid") String itemcsid); //(C)reate Contact @POST - @Path("{parentcsid}/items/{itemcsid}/contacts/") + @Path("/{parentcsid}/items/{itemcsid}/contacts/") ClientResponse createContact( @PathParam("parentcsid") String parentcsid, @PathParam("itemcsid") String itemcsid, @@ -93,7 +93,7 @@ public interface PersonAuthorityProxy { //(R)ead Contact @GET - @Path("{parentcsid}/items/{itemcsid}/contacts/{csid}") + @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}") ClientResponse readContact( @PathParam("parentcsid") String parentcsid, @PathParam("itemcsid") String itemcsid, @@ -101,7 +101,7 @@ public interface PersonAuthorityProxy { //(U)pdate Contact @PUT - @Path("{parentcsid}/items/{itemcsid}/contacts/{csid}") + @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}") ClientResponse updateContact( @PathParam("parentcsid") String parentcsid, @PathParam("itemcsid") String itemcsid, @@ -110,7 +110,7 @@ public interface PersonAuthorityProxy { //(D)elete Contact @DELETE - @Path("{parentcsid}/items/{itemcsid}/contacts/{csid}") + @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}") ClientResponse deleteContact( @PathParam("parentcsid") String parentcsid, @PathParam("itemcsid") String itemcsid, diff --git a/services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthorityServiceTest.java b/services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthorityServiceTest.java index 759a7d406..564e62481 100644 --- a/services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthorityServiceTest.java +++ b/services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthorityServiceTest.java @@ -225,7 +225,8 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl { // Submit the request to the service and store the response. String identifier = createIdentifier(); MultipartOutput multipart = - ContactClientUtils.createContactInstance(parentcsid, itemcsid, identifier); + ContactClientUtils.createContactInstance(parentcsid, + itemcsid, identifier, contactClient.getCommonPartName()); ClientResponse res = client.createContact(parentcsid, itemcsid, multipart); int statusCode = res.getStatus(); @@ -853,8 +854,44 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl { readContactList(knownResourceId, knownItemResourceId); } - private void readContactList(String authorityId, String itemId) { - // Currently a no-op method. + private void readContactList(String parentcsid, String itemcsid) { + final String testName = "readContactList"; + + // Perform setup. + setupReadList(testName); + + // Submit the request to the service and store the response. + ClientResponse res = + client.readContactList(parentcsid, itemcsid); + ContactsCommonList list = res.getEntity(); + int statusCode = res.getStatus(); + + // Check the status code of the response: does it match + // the expected response(s)? + if(logger.isDebugEnabled()){ + logger.debug(testName + ": status = " + statusCode); + } + Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + + List items = + list.getContactListItem(); + int nItemsReturned = items.size(); + // There will be one item created, associated with a + // known parent resource, by the createItem test. + // + // In addition, there will be 'nItemsToCreateInList' + // additional items created by the createItemList test, + // all associated with the same parent resource. + int nExpectedItems = nItemsToCreateInList + 1; + if(logger.isDebugEnabled()){ + logger.debug(testName + ": Expected " + + nExpectedItems +" items; got: "+nItemsReturned); + } + Assert.assertEquals(nItemsReturned, nExpectedItems); + + //FIXME: Add debugging output here. } // Failure outcomes @@ -986,7 +1023,64 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl { @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class, groups = {"update"}, dependsOnMethods = {"updateItem"}) public void updateContact(String testName) throws Exception { - // Currently a no-op test. + + /* + // Perform setup. + setupUpdate(testName); + + ClientResponse res = + client.readContact(knownResourceId, knownItemResourceId, knownContactResourceId); + if(logger.isDebugEnabled()){ + logger.debug(testName + ": read status = " + res.getStatus()); + } + Assert.assertEquals(res.getStatus(), EXPECTED_STATUS_CODE); + + if(logger.isDebugEnabled()){ + logger.debug("got Contact to update with ID: " + + knownContactResourceId + + " in item: " + knownItemResourceId + + " in parent: " + knownResourceId ); + } + MultipartInput input = (MultipartInput) res.getEntity(); + ContactsCommon contact = (ContactsCommon) extractPart(input, + contactClient.getCommonPartName(), ContactsCommon.class); + Assert.assertNotNull(contact); + + // Update the contents of this resource. + contact.setAddressText1("updated-" + contact.getAddressText1()); + if(logger.isDebugEnabled()){ + logger.debug("to be updated Contact"); + logger.debug(objectAsXmlString(contact, + ContactsCommon.class)); + } + + // Submit the updated resource to the service and store the response. + MultipartOutput output = new MultipartOutput(); + OutputPart commonPart = output.addPart(contact, MediaType.APPLICATION_XML_TYPE); + commonPart.getHeaders().add("label", contactClient.getCommonPartName()); + res = client.updateContact(knownResourceId, knownItemResourceId, knownContactResourceId, output); + int statusCode = res.getStatus(); + + // Check the status code of the response: does it match the expected response(s)? + if(logger.isDebugEnabled()){ + logger.debug(testName + ": status = " + statusCode); + } + Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + + // Retrieve the updated resource and verify that its contents exist. + input = (MultipartInput) res.getEntity(); + ContactsCommon updatedContact = + (ContactsCommon) extractPart(input, + contactClient.getCommonPartName(), ContactsCommon.class); + Assert.assertNotNull(updatedContact); + + // Verify that the updated resource received the correct data. + Assert.assertEquals(updatedContact.getAddressText1(), + contact.getAddressText1(), + "Data in updated Contact did not match submitted data."); + */ } // Failure outcomes diff --git a/services/person/service/src/main/java/org/collectionspace/services/person/PersonAuthorityResource.java b/services/person/service/src/main/java/org/collectionspace/services/person/PersonAuthorityResource.java index 451286f4a..e711140ee 100644 --- a/services/person/service/src/main/java/org/collectionspace/services/person/PersonAuthorityResource.java +++ b/services/person/service/src/main/java/org/collectionspace/services/person/PersonAuthorityResource.java @@ -56,6 +56,8 @@ import org.collectionspace.services.common.security.UnauthorizedException; import org.collectionspace.services.common.query.IQueryManager; import org.collectionspace.services.contact.ContactResource; import org.collectionspace.services.contact.ContactsCommon; +import org.collectionspace.services.contact.ContactsCommonList; +import org.collectionspace.services.contact.ContactJAXBSchema; import org.collectionspace.services.contact.nuxeo.ContactDocumentModelHandler; import org.collectionspace.services.person.nuxeo.PersonDocumentModelHandler; import org.jboss.resteasy.plugins.providers.multipart.MultipartInput; @@ -591,15 +593,11 @@ public class PersonAuthorityResource extends AbstractCollectionSpaceResourceImpl @PathParam("itemcsid") String itemcsid, MultipartInput input) { try { - + // Note that we have to create the service context and document + // handler for the Contact service, not the main service. ServiceContext ctx = MultipartServiceContextFactory.get().createServiceContext(input, getContactServiceName()); DocumentHandler handler = createContactDocumentHandler(ctx, parentcsid, itemcsid); String csid = getRepositoryClient(ctx).create(ctx, handler); -/* - ContactResource contactResource = new ContactResource(); - String csid = - contactResource.createContact(parentcsid, itemcsid, input); - */ UriBuilder path = UriBuilder.fromResource(PersonAuthorityResource.class); path.path("" + parentcsid + "/items/" + itemcsid + "/contacts/" + csid); Response response = Response.created(path.build()).build(); @@ -628,17 +626,41 @@ public class PersonAuthorityResource extends AbstractCollectionSpaceResourceImpl @GET @Produces({"application/xml"}) @Path("{parentcsid}/items/{itemcsid}/contacts/") - public Response getContactList( + public ContactsCommonList getContactList( @PathParam("parentcsid") String parentcsid, - @PathParam("itemcsid") String itemcsid) { - - // FIXME Placeholder while call is being implemented. - String msg = "Reading lists of contacts is not yet implemented."; - logger.info(msg); - Response response = Response.status( - Response.Status.INTERNAL_SERVER_ERROR).entity(msg).type("text/plain").build(); - return response; - + @PathParam("itemcsid") String itemcsid, + @Context UriInfo ui) { + ContactsCommonList contactObjectList = new ContactsCommonList(); + try { + ServiceContext ctx = MultipartServiceContextFactory.get().createServiceContext(null, getContactServiceName()); + DocumentHandler handler = createContactDocumentHandler(ctx, parentcsid, itemcsid); + MultivaluedMap queryParams = ui.getQueryParameters(); + DocumentFilter myFilter = new DocumentFilter(); + myFilter.setPagination(queryParams); + myFilter.setWhereClause(ContactJAXBSchema.CONTACTS_COMMON + ":" + + ContactJAXBSchema.IN_AUTHORITY + + "='" + parentcsid + "'" + + " AND " + + ContactJAXBSchema.CONTACTS_COMMON + ":" + + ContactJAXBSchema.IN_ITEM + + "='" + itemcsid + "'" + + " AND ecm:isProxy = 0"); + handler.setDocumentFilter(myFilter); + getRepositoryClient(ctx).getFiltered(ctx, handler); + contactObjectList = (ContactsCommonList) handler.getCommonPartList(); + } catch (UnauthorizedException ue) { + Response response = Response.status( + Response.Status.UNAUTHORIZED).entity("Index failed reason " + ue.getErrorReason()).type("text/plain").build(); + throw new WebApplicationException(response); + } catch (Exception e) { + if (logger.isDebugEnabled()) { + logger.debug("Caught exception in getContactsList", e); + } + Response response = Response.status( + Response.Status.INTERNAL_SERVER_ERROR).entity("Index failed").type("text/plain").build(); + throw new WebApplicationException(response); + } + return contactObjectList; } @GET @@ -648,17 +670,21 @@ public class PersonAuthorityResource extends AbstractCollectionSpaceResourceImpl @PathParam("itemcsid") String itemcsid, @PathParam("csid") String csid) { MultipartOutput result = null; + if (logger.isDebugEnabled()) { + logger.debug("getContact with parentCsid=" + parentcsid + + " itemcsid=" + itemcsid + " csid=" + csid); + } try { - + // Note that we have to create the service context and document + // handler for the Contact service, not the main service. ServiceContext ctx = MultipartServiceContextFactory.get().createServiceContext(null, getContactServiceName()); DocumentHandler handler = createContactDocumentHandler(ctx, parentcsid, itemcsid); getRepositoryClient(ctx).get(ctx, csid, handler); result = (MultipartOutput) ctx.getOutput(); -/* - ContactResource resource = new ContactResource(); - result = resource.getContact(parentcsid, itemcsid, csid); - * - */ + } catch (UnauthorizedException ue) { + Response response = Response.status( + Response.Status.UNAUTHORIZED).entity("Get failed reason " + ue.getErrorReason()).type("text/plain").build(); + throw new WebApplicationException(response); } catch (DocumentNotFoundException dnfe) { if (logger.isDebugEnabled()) { logger.debug("getContact", dnfe); @@ -672,7 +698,7 @@ public class PersonAuthorityResource extends AbstractCollectionSpaceResourceImpl logger.debug("getContact", e); } Response response = Response.status(Response.Status.INTERNAL_SERVER_ERROR) - .entity("Get of contact failed") + .entity("Get contact failed") .type("text/plain").build(); throw new WebApplicationException(response); } @@ -692,10 +718,62 @@ public class PersonAuthorityResource extends AbstractCollectionSpaceResourceImpl @PathParam("parentcsid") String parentcsid, @PathParam("itemcsid") String itemcsid, @PathParam("csid") String csid, - MultipartInput input) { - - // FIXME Placeholder while call is being implemented. + MultipartInput theUpdate) { + if (logger.isDebugEnabled()) { + logger.debug("updateContact with parentcsid=" + parentcsid + + " itemcsid=" + itemcsid + " csid=" + csid); + } + if (parentcsid == null || parentcsid.trim().isEmpty()) { + logger.error("updateContact: missing csid!"); + Response response = Response.status(Response.Status.BAD_REQUEST).entity( + "update failed on Contact parentcsid=" + parentcsid).type( + "text/plain").build(); + throw new WebApplicationException(response); + } + if (itemcsid == null || itemcsid.trim().isEmpty()) { + logger.error("updateContact: missing itemcsid!"); + Response response = Response.status(Response.Status.BAD_REQUEST).entity( + "update failed on Contact=" + itemcsid).type( + "text/plain").build(); + throw new WebApplicationException(response); + } + if (csid == null || csid.trim().isEmpty()) { + logger.error("updateContact: missing csid!"); + Response response = Response.status(Response.Status.BAD_REQUEST).entity( + "update failed on Contact=" + csid).type( + "text/plain").build(); + throw new WebApplicationException(response); + } MultipartOutput result = null; + try { + // Note that we have to create the service context and document + // handler for the Contact service, not the main service. + ServiceContext ctx = MultipartServiceContextFactory.get() + .createServiceContext(theUpdate, getContactServiceName()); + DocumentHandler handler = createContactDocumentHandler(ctx, parentcsid, itemcsid); + getRepositoryClient(ctx).update(ctx, csid, handler); + result = (MultipartOutput) ctx.getOutput(); + } catch (BadRequestException bre) { + Response response = Response.status( + Response.Status.BAD_REQUEST).entity("Create failed reason " + bre.getErrorReason()).type("text/plain").build(); + throw new WebApplicationException(response); + } catch (UnauthorizedException ue) { + Response response = Response.status( + Response.Status.UNAUTHORIZED).entity("Update failed reason " + ue.getErrorReason()).type("text/plain").build(); + throw new WebApplicationException(response); + } catch (DocumentNotFoundException dnfe) { + if (logger.isDebugEnabled()) { + logger.debug("caught exception in updateContact", dnfe); + } + Response response = Response.status(Response.Status.NOT_FOUND).entity( + "Update failed on Contact csid=" + itemcsid).type( + "text/plain").build(); + throw new WebApplicationException(response); + } catch (Exception e) { + Response response = Response.status( + Response.Status.INTERNAL_SERVER_ERROR).entity("Update failed").type("text/plain").build(); + throw new WebApplicationException(response); + } return result; } @@ -705,7 +783,6 @@ public class PersonAuthorityResource extends AbstractCollectionSpaceResourceImpl @PathParam("parentcsid") String parentcsid, @PathParam("itemcsid") String itemcsid, @PathParam("csid") String csid) { - if (logger.isDebugEnabled()) { logger.debug("deleteContact with parentCsid=" + parentcsid + " itemcsid=" + itemcsid + " csid=" + csid); @@ -732,18 +809,12 @@ public class PersonAuthorityResource extends AbstractCollectionSpaceResourceImpl throw new WebApplicationException(response); } try { - + // Note that we have to create the service context for the + // Contact service, not the main service. ServiceContext ctx = MultipartServiceContextFactory.get().createServiceContext(null, getContactServiceName()); getRepositoryClient(ctx).delete(ctx, csid); - return Response.status(HttpResponseCodes.SC_OK).build(); - -/* - ContactResource resource = new ContactResource(); - Response response = resource.deleteContact(parentcsid, itemcsid, csid); - return response; -*/ - + return Response.status(HttpResponseCodes.SC_OK).build(); } catch (UnauthorizedException ue) { Response response = Response.status( Response.Status.UNAUTHORIZED).entity("Delete failed reason " + ue.getErrorReason()).type("text/plain").build(); @@ -756,7 +827,6 @@ public class PersonAuthorityResource extends AbstractCollectionSpaceResourceImpl .entity("Delete failed, the requested Contact CSID:" + csid + ": was not found.") .type("text/plain").build(); throw new WebApplicationException(response); - } catch (Exception e) { Response response = Response.status( Response.Status.INTERNAL_SERVER_ERROR).entity("Delete failed").type("text/plain").build(); -- 2.47.3