From: Richard Millet Date: Wed, 16 Feb 2011 00:13:40 +0000 (+0000) Subject: CSPACE-3574: Merging Plain Old XML payload work into trunk. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=e9a3c46c32eaa6b18d7afb77bf1458085e08bd49;p=tmp%2Fjakarta-migration.git CSPACE-3574: Merging Plain Old XML payload work into trunk. --- diff --git a/services/location/3rdparty/nuxeo-platform-cs-location/.classpath b/services/location/3rdparty/nuxeo-platform-cs-location/.classpath index b61c5d843..04c4e000e 100644 --- a/services/location/3rdparty/nuxeo-platform-cs-location/.classpath +++ b/services/location/3rdparty/nuxeo-platform-cs-location/.classpath @@ -1,7 +1,7 @@ - - - - + - + + + + \ No newline at end of file diff --git a/services/location/3rdparty/nuxeo-platform-cs-location/.project b/services/location/3rdparty/nuxeo-platform-cs-location/.project index 748ad4ef9..43ec8994b 100644 --- a/services/location/3rdparty/nuxeo-platform-cs-location/.project +++ b/services/location/3rdparty/nuxeo-platform-cs-location/.project @@ -1,23 +1,17 @@ - - org.collectionspace.services.person.3rdparty.nuxeo - Person Nuxeo Document Type - - + org.collectionspace.services.location.3rdparty.nuxeo + Location Nuxeo Document Type. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + org.eclipse.jdt.core.javabuilder - - org.maven.ide.eclipse.maven2Builder - - org.maven.ide.eclipse.maven2Nature org.eclipse.jdt.core.javanature - + \ No newline at end of file diff --git a/services/location/client/.classpath b/services/location/client/.classpath index 425cd1620..0b590d8af 100644 --- a/services/location/client/.classpath +++ b/services/location/client/.classpath @@ -1,10 +1,310 @@ - - - - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/services/location/client/.project b/services/location/client/.project index ba2d51a96..baf3e78d4 100644 --- a/services/location/client/.project +++ b/services/location/client/.project @@ -1,26 +1,26 @@ - - org.collectionspace.services.person.client - + org.collectionspace.services.location.client + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + org.collectionspace.services.3rdparty.nuxeo.quote-api org.collectionspace.services.client org.collectionspace.services.common - org.collectionspace.services.person.jaxb + org.collectionspace.services.contact.client + org.collectionspace.services.contact.jaxb + org.collectionspace.services.hyperjaxb + org.collectionspace.services.jaxb + org.collectionspace.services.location.jaxb org.eclipse.jdt.core.javabuilder - - org.maven.ide.eclipse.maven2Builder - - org.maven.ide.eclipse.maven2Nature org.eclipse.jdt.core.javanature - + \ No newline at end of file diff --git a/services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityClient.java b/services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityClient.java index da40a4b85..af2955e87 100644 --- a/services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityClient.java +++ b/services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityClient.java @@ -40,34 +40,43 @@ import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.client.ProxyFactory; import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor; import org.jboss.resteasy.plugins.providers.RegisterBuiltin; -import org.jboss.resteasy.plugins.providers.multipart.MultipartInput; -import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput; import org.jboss.resteasy.spi.ResteasyProviderFactory; /** * The Class LocationAuthorityClient. */ -public class LocationAuthorityClient extends AbstractServiceClientImpl { +public class LocationAuthorityClient extends AbstractServiceClientImpl { //FIXME: REM - Client classes for Person, Org, Vocab, and Location should have a common base class + public static final String SERVICE_NAME = "locationauthorities"; + public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME; + public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT; + public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME; + // + // Subitem constants + // + public static final String SERVICE_ITEM_NAME = "locations"; + public static final String SERVICE_PATH_ITEMS_COMPONENT = "items"; //FIXME: REM - This should be defined in an AuthorityClient base class + public static final String SERVICE_ITEM_PAYLOAD_NAME = SERVICE_ITEM_NAME; + // + // Payload Part/Schema part names + // + public static final String SERVICE_COMMON_PART_NAME = SERVICE_NAME + + PART_LABEL_SEPARATOR + PART_COMMON_LABEL; + public static final String SERVICE_ITEM_COMMON_PART_NAME = SERVICE_ITEM_NAME + + PART_LABEL_SEPARATOR + PART_COMMON_LABEL; + + @Override + public String getServiceName() { + return SERVICE_NAME; + } - /* (non-Javadoc) - * @see org.collectionspace.services.client.BaseServiceClient#getServicePathComponent() - */ @Override public String getServicePathComponent() { - return "locationauthorities"; + return SERVICE_PATH_COMPONENT; } - /** - * Gets the item common part name. - * - * @return the item common part name - */ public String getItemCommonPartName() { - return getCommonPartName("locations"); + return getCommonPartName(SERVICE_ITEM_NAME); } - - /** The location authority proxy. */ -// private static final LocationAuthorityClient instance = new LocationAuthorityClient(); /** * @@ -109,9 +118,6 @@ public class LocationAuthorityClient extends AbstractServiceClientImpl { * * @return the client response */ -// public static LocationAuthorityClient getInstance() { -// return instance; -// } /** * @return list @@ -127,7 +133,7 @@ public class LocationAuthorityClient extends AbstractServiceClientImpl { * @param csid the csid * @return the client response */ - public ClientResponse read(String csid) { + public ClientResponse read(String csid) { return locationAuthorityProxy.read(csid); } @@ -137,7 +143,7 @@ public class LocationAuthorityClient extends AbstractServiceClientImpl { * @param name the name * @return the client response */ - public ClientResponse readByName(String name) { + public ClientResponse readByName(String name) { return locationAuthorityProxy.readByName(name); } @@ -147,8 +153,8 @@ public class LocationAuthorityClient extends AbstractServiceClientImpl { * @param multipart the multipart * @return the client response */ - public ClientResponse create(MultipartOutput multipart) { - return locationAuthorityProxy.create(multipart); + public ClientResponse create(PoxPayloadOut xmlPayload) { + return locationAuthorityProxy.create(xmlPayload.getBytes()); } /** @@ -158,8 +164,8 @@ public class LocationAuthorityClient extends AbstractServiceClientImpl { * @param multipart the multipart * @return the client response */ - public ClientResponse update(String csid, MultipartOutput multipart) { - return locationAuthorityProxy.update(csid, multipart); + public ClientResponse update(String csid, PoxPayloadOut xmlPayload) { + return locationAuthorityProxy.update(csid, xmlPayload.getBytes()); } @@ -225,7 +231,7 @@ public class LocationAuthorityClient extends AbstractServiceClientImpl { * @param csid the csid * @return the client response */ - public ClientResponse readItem(String vcsid, String csid) { + public ClientResponse readItem(String vcsid, String csid) { return locationAuthorityProxy.readItem(vcsid, csid); } @@ -236,8 +242,8 @@ public class LocationAuthorityClient extends AbstractServiceClientImpl { * @param multipart the multipart * @return the client response */ - public ClientResponse createItem(String vcsid, MultipartOutput multipart) { - return locationAuthorityProxy.createItem(vcsid, multipart); + public ClientResponse createItem(String vcsid, PoxPayloadOut xmlPayload) { + return locationAuthorityProxy.createItem(vcsid, xmlPayload.getBytes()); } /** @@ -248,8 +254,8 @@ public class LocationAuthorityClient extends AbstractServiceClientImpl { * @param multipart the multipart * @return the client response */ - public ClientResponse updateItem(String vcsid, String csid, MultipartOutput multipart) { - return locationAuthorityProxy.updateItem(vcsid, csid, multipart); + public ClientResponse updateItem(String vcsid, String csid, PoxPayloadOut xmlPayload) { + return locationAuthorityProxy.updateItem(vcsid, csid, xmlPayload.getBytes()); } @@ -273,8 +279,8 @@ public class LocationAuthorityClient extends AbstractServiceClientImpl { * @return the client response */ public ClientResponse createContact(String parentcsid, - String itemcsid, MultipartOutput multipart) { - return locationAuthorityProxy.createContact(parentcsid, itemcsid, multipart); + String itemcsid, PoxPayloadOut xmlPayload) { + return locationAuthorityProxy.createContact(parentcsid, itemcsid, xmlPayload.getBytes()); } /** @@ -285,7 +291,7 @@ public class LocationAuthorityClient extends AbstractServiceClientImpl { * @param csid the csid * @return the client response */ - public ClientResponse readContact(String parentcsid, + public ClientResponse readContact(String parentcsid, String itemcsid, String csid) { return locationAuthorityProxy.readContact(parentcsid, itemcsid, csid); } @@ -311,9 +317,9 @@ public class LocationAuthorityClient extends AbstractServiceClientImpl { * @param multipart the multipart * @return the client response */ - public ClientResponse updateContact(String parentcsid, - String itemcsid, String csid, MultipartOutput multipart) { - return locationAuthorityProxy.updateContact(parentcsid, itemcsid, csid, multipart); + public ClientResponse updateContact(String parentcsid, + String itemcsid, String csid, PoxPayloadOut xmlPayload) { + return locationAuthorityProxy.updateContact(parentcsid, itemcsid, csid, xmlPayload.getBytes()); } /** @@ -329,5 +335,4 @@ public class LocationAuthorityClient extends AbstractServiceClientImpl { return locationAuthorityProxy.deleteContact(parentcsid, itemcsid, csid); } - } diff --git a/services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityClientUtils.java b/services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityClientUtils.java index 0c00e49f2..eb2f5fadd 100644 --- a/services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityClientUtils.java +++ b/services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityClientUtils.java @@ -15,9 +15,8 @@ import org.collectionspace.services.LocationJAXBSchema; import org.collectionspace.services.client.test.ServiceRequestType; import org.collectionspace.services.location.LocationsCommon; import org.collectionspace.services.location.LocationauthoritiesCommon; +import org.dom4j.DocumentException; import org.jboss.resteasy.client.ClientResponse; -import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput; -import org.jboss.resteasy.plugins.providers.multipart.OutputPart; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.Assert; @@ -31,19 +30,19 @@ public class LocationAuthorityClientUtils { * @param displayName The displayName used in UI, etc. * @param refName The proper refName for this authority * @param headerLabel The common part label - * @return The MultipartOutput payload for the create call + * @return The PoxPayloadOut payload for the create call */ - public static MultipartOutput createLocationAuthorityInstance( + public static PoxPayloadOut createLocationAuthorityInstance( String displayName, String shortIdentifier, String headerLabel ) { LocationauthoritiesCommon locationAuthority = new LocationauthoritiesCommon(); locationAuthority.setDisplayName(displayName); locationAuthority.setShortIdentifier(shortIdentifier); String refName = createLocationAuthRefName(shortIdentifier, displayName); locationAuthority.setRefName(refName); - locationAuthority.setVocabType("LocationAuthority"); - MultipartOutput multipart = new MultipartOutput(); - OutputPart commonPart = multipart.addPart(locationAuthority, MediaType.APPLICATION_XML_TYPE); - commonPart.getHeaders().add("label", headerLabel); + locationAuthority.setVocabType("LocationAuthority"); //FIXME: REM - Should this really be hard-coded? + PoxPayloadOut multipart = new PoxPayloadOut(LocationAuthorityClient.SERVICE_PAYLOAD_NAME); + PayloadOutputPart commonPart = multipart.addPart(locationAuthority, MediaType.APPLICATION_XML_TYPE); + commonPart.setLabel(headerLabel); if(logger.isDebugEnabled()){ logger.debug("to be created, locationAuthority common ", @@ -57,9 +56,9 @@ public class LocationAuthorityClientUtils { * @param locationRefName The proper refName for this authority * @param locationInfo the properties for the new Location * @param headerLabel The common part label - * @return The MultipartOutput payload for the create call + * @return The PoxPayloadOut payload for the create call */ - public static MultipartOutput createLocationInstance( + public static PoxPayloadOut createLocationInstance( String locationAuthRefName, Map locationInfo, String headerLabel){ LocationsCommon location = new LocationsCommon(); String shortId = locationInfo.get(LocationJAXBSchema.SHORT_IDENTIFIER); @@ -87,10 +86,10 @@ public class LocationAuthorityClientUtils { location.setAddress(value); if((value = (String)locationInfo.get(LocationJAXBSchema.TERM_STATUS))!=null) location.setTermStatus(value); - MultipartOutput multipart = new MultipartOutput(); - OutputPart commonPart = multipart.addPart(location, + PoxPayloadOut multipart = new PoxPayloadOut(LocationAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME); + PayloadOutputPart commonPart = multipart.addPart(location, MediaType.APPLICATION_XML_TYPE); - commonPart.getHeaders().add("label", headerLabel); + commonPart.setLabel(headerLabel); if(logger.isDebugEnabled()){ logger.debug("to be created, location common ", location, LocationsCommon.class); @@ -131,7 +130,7 @@ public class LocationAuthorityClientUtils { logger.debug("Import: Create Item: \""+displayName +"\" in locationAuthority: \"" + locationAuthorityRefName +"\""); } - MultipartOutput multipart = + PoxPayloadOut multipart = createLocationInstance( locationAuthorityRefName, locationMap, client.getItemCommonPartName() ); String newID = null; @@ -158,12 +157,12 @@ public class LocationAuthorityClientUtils { return newID; } - public static MultipartOutput createLocationInstance( - String commonPartXML, String headerLabel){ - MultipartOutput multipart = new MultipartOutput(); - OutputPart commonPart = multipart.addPart(commonPartXML, + public static PoxPayloadOut createLocationInstance( + String commonPartXML, String headerLabel) throws DocumentException { + PoxPayloadOut multipart = new PoxPayloadOut(LocationAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME); + PayloadOutputPart commonPart = multipart.addPart(commonPartXML, MediaType.APPLICATION_XML_TYPE); - commonPart.getHeaders().add("label", headerLabel); + commonPart.setLabel(headerLabel); if(logger.isDebugEnabled()){ logger.debug("to be created, location common ", commonPartXML); @@ -174,14 +173,14 @@ public class LocationAuthorityClientUtils { public static String createItemInAuthority(String vcsid, String commonPartXML, - LocationAuthorityClient client ) { + LocationAuthorityClient client ) throws DocumentException { // Expected status code: 201 Created int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode(); // Type of service request being tested ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE; - MultipartOutput multipart = - createLocationInstance( commonPartXML, client.getItemCommonPartName() ); + PoxPayloadOut multipart = + createLocationInstance(commonPartXML, client.getItemCommonPartName()); String newID = null; ClientResponse res = client.createItem(vcsid, multipart); try { diff --git a/services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityProxy.java b/services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityProxy.java index d577d69f3..0c20500f5 100644 --- a/services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityProxy.java +++ b/services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityProxy.java @@ -17,40 +17,37 @@ import org.collectionspace.services.contact.ContactsCommonList; import org.collectionspace.services.location.LocationauthoritiesCommonList; import org.collectionspace.services.location.LocationsCommonList; import org.jboss.resteasy.client.ClientResponse; -import org.jboss.resteasy.plugins.providers.multipart.MultipartInput; -import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput; /** * @version $Revision:$ */ -@Path("/locationauthorities/") -@Produces({"multipart/mixed"}) -@Consumes({"multipart/mixed"}) +@Path(LocationAuthorityClient.SERVICE_PATH + "/") +@Produces("application/xml") +@Consumes("application/xml") public interface LocationAuthorityProxy extends CollectionSpaceProxy { // List Locationauthorities @GET - @Produces({"application/xml"}) ClientResponse readList(); //(C)reate @POST - ClientResponse create(MultipartOutput multipart); + ClientResponse create(byte[] xmlPayload); //(R)ead @GET @Path("/{csid}") - ClientResponse read(@PathParam("csid") String csid); + ClientResponse read(@PathParam("csid") String csid); //(R)ead by name @GET @Path("/urn:cspace:name({name})") - ClientResponse readByName(@PathParam("name") String name); + ClientResponse readByName(@PathParam("name") String name); //(U)pdate @PUT @Path("/{csid}") - ClientResponse update(@PathParam("csid") String csid, MultipartOutput multipart); + ClientResponse update(@PathParam("csid") String csid, byte[] xmlPayload); //(D)elete @DELETE @@ -67,6 +64,8 @@ public interface LocationAuthorityProxy extends CollectionSpaceProxy { @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords); /** + * @param parentcsid + * @param itemcsid * @param csid * @return * @see org.collectionspace.services.client.IntakeProxy#getAuthorityRefs(java.lang.String) @@ -90,17 +89,17 @@ public interface LocationAuthorityProxy extends CollectionSpaceProxy { //(C)reate Item @POST @Path("/{vcsid}/items/") - ClientResponse createItem(@PathParam("vcsid") String vcsid, MultipartOutput multipart); + ClientResponse createItem(@PathParam("vcsid") String vcsid, byte[] xmlPayload); //(R)ead Item @GET @Path("/{vcsid}/items/{csid}") - ClientResponse readItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid); + ClientResponse readItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid); //(U)pdate Item @PUT @Path("/{vcsid}/items/{csid}") - ClientResponse updateItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid, MultipartOutput multipart); + ClientResponse updateItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid, byte[] xmlPayload); //(D)elete Item @DELETE @@ -109,7 +108,6 @@ public interface LocationAuthorityProxy extends CollectionSpaceProxy { // List Contacts @GET - @Produces({"application/xml"}) @Path("/{parentcsid}/items/{itemcsid}/contacts/") ClientResponse readContactList( @PathParam("parentcsid") String parentcsid, @@ -121,12 +119,12 @@ public interface LocationAuthorityProxy extends CollectionSpaceProxy { ClientResponse createContact( @PathParam("parentcsid") String parentcsid, @PathParam("itemcsid") String itemcsid, - MultipartOutput multipart); + byte[] xmlPayload); //(R)ead Contact @GET @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}") - ClientResponse readContact( + ClientResponse readContact( @PathParam("parentcsid") String parentcsid, @PathParam("itemcsid") String itemcsid, @PathParam("csid") String csid); @@ -134,11 +132,11 @@ public interface LocationAuthorityProxy extends CollectionSpaceProxy { //(U)pdate Contact @PUT @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}") - ClientResponse updateContact( + ClientResponse updateContact( @PathParam("parentcsid") String parentcsid, @PathParam("itemcsid") String itemcsid, @PathParam("csid") String csid, - MultipartOutput multipart); + byte[] xmlPayload); //(D)elete Contact @DELETE diff --git a/services/location/client/src/test/java/org/collectionspace/services/client/test/LocationAuthorityServiceTest.java b/services/location/client/src/test/java/org/collectionspace/services/client/test/LocationAuthorityServiceTest.java index 246930bb1..0507a4276 100644 --- a/services/location/client/src/test/java/org/collectionspace/services/client/test/LocationAuthorityServiceTest.java +++ b/services/location/client/src/test/java/org/collectionspace/services/client/test/LocationAuthorityServiceTest.java @@ -26,13 +26,14 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.collectionspace.services.LocationJAXBSchema; import org.collectionspace.services.client.CollectionSpaceClient; import org.collectionspace.services.client.ContactClient; import org.collectionspace.services.client.ContactClientUtils; +import org.collectionspace.services.client.PayloadOutputPart; +import org.collectionspace.services.client.PoxPayloadIn; +import org.collectionspace.services.client.PoxPayloadOut; import org.collectionspace.services.contact.ContactsCommon; import org.collectionspace.services.contact.ContactsCommonList; import org.collectionspace.services.client.LocationAuthorityClient; @@ -42,12 +43,14 @@ import org.collectionspace.services.location.LocationauthoritiesCommon; import org.collectionspace.services.location.LocationauthoritiesCommonList; import org.collectionspace.services.location.LocationsCommon; import org.collectionspace.services.location.LocationsCommonList; + +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; import org.jboss.resteasy.client.ClientResponse; -import org.jboss.resteasy.plugins.providers.multipart.MultipartInput; -import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput; -import org.jboss.resteasy.plugins.providers.multipart.OutputPart; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import org.testng.Assert; import org.testng.annotations.AfterClass; import org.testng.annotations.Test; @@ -59,22 +62,36 @@ import org.testng.annotations.Test; * $LastChangedRevision: 753 $ * $LastChangedDate: 2009-09-23 11:03:36 -0700 (Wed, 23 Sep 2009) $ */ -public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { +public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { //FIXME: Test classes for Vocab, Person, Org, and Location should have a base class! /** The logger. */ private final String CLASS_NAME = LocationAuthorityServiceTest.class.getName(); - private final Logger logger = LoggerFactory.getLogger(CLASS_NAME); + private final Logger logger = LoggerFactory.getLogger(LocationAuthorityServiceTest.class); - // Instance variables specific to this test. + @Override + public String getServicePathComponent() { + return LocationAuthorityClient.SERVICE_PATH_COMPONENT; + } + + @Override + protected String getServiceName() { + return LocationAuthorityClient.SERVICE_NAME; + } - /** The SERVICE path component. */ - final String SERVICE_PATH_COMPONENT = "locationauthorities"; + public String getItemServicePathComponent() { + return LocationAuthorityClient.SERVICE_PATH_ITEMS_COMPONENT; + } - /** The ITEM service path component. */ - final String ITEM_SERVICE_PATH_COMPONENT = "items"; + // Instance variables specific to this test. - /** The CONTACT service path component. */ - final String CONTACT_SERVICE_PATH_COMPONENT = "contacts"; +// /** The SERVICE path component. */ +// final String SERVICE_PATH_COMPONENT = "locationauthorities"; +// +// /** The ITEM service path component. */ +// final String ITEM_SERVICE_PATH_COMPONENT = "items"; +// +// /** The CONTACT service path component. */ +// final String CONTACT_SERVICE_PATH_COMPONENT = "contacts"; final String TEST_NAME = "Shelf 1"; final String TEST_SHORTID = "shelf1"; @@ -161,7 +178,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { String shortId = createIdentifier(); String displayName = "displayName-" + shortId; String baseRefName = LocationAuthorityClientUtils.createLocationAuthRefName(shortId, null); - MultipartOutput multipart = + PoxPayloadOut multipart = LocationAuthorityClientUtils.createLocationAuthorityInstance( displayName, shortId, client.getCommonPartName()); String newID = null; @@ -342,7 +359,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { // Submit the request to the service and store the response. LocationAuthorityClient client = new LocationAuthorityClient(); String newID = null; - ClientResponse res = client.read(knownResourceId); + ClientResponse res = client.read(knownResourceId); try { int statusCode = res.getStatus(); @@ -356,7 +373,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); //FIXME: remove the following try catch once Aron fixes signatures try { - MultipartInput input = (MultipartInput) res.getEntity(); + PoxPayloadIn input = new PoxPayloadIn(res.getEntity()); LocationauthoritiesCommon locationAuthority = (LocationauthoritiesCommon) extractPart(input, client.getCommonPartName(), LocationauthoritiesCommon.class); @@ -387,7 +404,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { // Submit the request to the service and store the response. LocationAuthorityClient client = new LocationAuthorityClient(); - ClientResponse res = client.readByName(knownResourceShortIdentifer); + ClientResponse res = client.readByName(knownResourceShortIdentifer); try { int statusCode = res.getStatus(); @@ -401,7 +418,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); //FIXME: remove the following try catch once Aron fixes signatures try { - MultipartInput input = (MultipartInput) res.getEntity(); + PoxPayloadIn input = new PoxPayloadIn(res.getEntity()); LocationauthoritiesCommon locationAuthority = (LocationauthoritiesCommon) extractPart(input, client.getCommonPartName(), LocationauthoritiesCommon.class); Assert.assertNotNull(locationAuthority); @@ -432,7 +449,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { // Submit the request to the service and store the response. LocationAuthorityClient client = new LocationAuthorityClient(); - ClientResponse res = client.readItem(knownResourceId, knownItemResourceId); + ClientResponse res = client.readItem(knownResourceId, knownItemResourceId); try { int statusCode = res.getStatus(); @@ -446,7 +463,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); // Check whether we've received a location. - MultipartInput input = (MultipartInput) res.getEntity(); + PoxPayloadIn input = new PoxPayloadIn(res.getEntity()); LocationsCommon location = (LocationsCommon) extractPart(input, client.getItemCommonPartName(), LocationsCommon.class); Assert.assertNotNull(location); @@ -480,7 +497,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { // Submit the request to the service and store the response. LocationAuthorityClient client = new LocationAuthorityClient(); - ClientResponse res = client.readItem(knownResourceId, knownItemResourceId); + ClientResponse res = client.readItem(knownResourceId, knownItemResourceId); try { int statusCode = res.getStatus(); @@ -494,7 +511,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); // Check whether location has expected displayName. - MultipartInput input = (MultipartInput) res.getEntity(); + PoxPayloadIn input = new PoxPayloadIn(res.getEntity()); LocationsCommon location = (LocationsCommon) extractPart(input, client.getItemCommonPartName(), LocationsCommon.class); Assert.assertNotNull(location); @@ -512,9 +529,9 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { LocationAuthorityClientUtils.prepareDefaultDisplayName("updated-" + TEST_NAME); // Submit the updated resource to the service and store the response. - MultipartOutput output = new MultipartOutput(); - OutputPart commonPart = output.addPart(location, MediaType.APPLICATION_XML_TYPE); - commonPart.getHeaders().add("label", client.getItemCommonPartName()); + PoxPayloadOut output = new PoxPayloadOut(LocationAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME); + PayloadOutputPart commonPart = output.addPart(location, MediaType.APPLICATION_XML_TYPE); + commonPart.setLabel(client.getItemCommonPartName()); res.releaseConnection(); res = client.updateItem(knownResourceId, knownItemResourceId, output); statusCode = res.getStatus(); @@ -528,7 +545,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); // Retrieve the updated resource and verify that its contents exist. - input = (MultipartInput) res.getEntity(); + input = new PoxPayloadIn(res.getEntity()); LocationsCommon updatedLocation = (LocationsCommon) extractPart(input, client.getItemCommonPartName(), LocationsCommon.class); @@ -547,9 +564,9 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { location.setDisplayName(expectedDisplayName); // Submit the updated resource to the service and store the response. - output = new MultipartOutput(); + output = new PoxPayloadOut(LocationAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME); commonPart = output.addPart(location, MediaType.APPLICATION_XML_TYPE); - commonPart.getHeaders().add("label", client.getItemCommonPartName()); + commonPart.setLabel(client.getItemCommonPartName()); res.releaseConnection(); res = client.updateItem(knownResourceId, knownItemResourceId, output); statusCode = res.getStatus(); @@ -563,7 +580,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); // Retrieve the updated resource and verify that its contents exist. - input = (MultipartInput) res.getEntity(); + input = new PoxPayloadIn(res.getEntity()); updatedLocation = (LocationsCommon) extractPart(input, client.getItemCommonPartName(), LocationsCommon.class); @@ -600,7 +617,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { // Submit the request to the service and store the response. LocationAuthorityClient client = new LocationAuthorityClient(); - ClientResponse res = client.readItem(knownResourceId, knownItemResourceId); + ClientResponse res = client.readItem(knownResourceId, knownItemResourceId); try { int statusCode = res.getStatus(); @@ -614,7 +631,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { Assert.assertEquals(statusCode, Response.Status.OK.getStatusCode()); // Check whether Location has expected displayName. - MultipartInput input = (MultipartInput) res.getEntity(); + PoxPayloadIn input = new PoxPayloadIn(res.getEntity()); LocationsCommon location = (LocationsCommon) extractPart(input, client.getItemCommonPartName(), LocationsCommon.class); Assert.assertNotNull(location); @@ -623,9 +640,9 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { location.setDisplayName(null); // Submit the updated resource to the service and store the response. - MultipartOutput output = new MultipartOutput(); - OutputPart commonPart = output.addPart(location, MediaType.APPLICATION_XML_TYPE); - commonPart.getHeaders().add("label", client.getItemCommonPartName()); + PoxPayloadOut output = new PoxPayloadOut(LocationAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME); + PayloadOutputPart commonPart = output.addPart(location, MediaType.APPLICATION_XML_TYPE); + commonPart.setLabel(client.getItemCommonPartName()); res.releaseConnection(); res = client.updateItem(knownResourceId, knownItemResourceId, output); statusCode = res.getStatus(); @@ -660,7 +677,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { // Submit the request to the service and store the response. LocationAuthorityClient client = new LocationAuthorityClient(); - ClientResponse res = client.read(NON_EXISTENT_ID); + ClientResponse res = client.read(NON_EXISTENT_ID); try { int statusCode = res.getStatus(); @@ -694,7 +711,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { // Submit the request to the service and store the response. LocationAuthorityClient client = new LocationAuthorityClient(); - ClientResponse res = client.readItem(knownResourceId, NON_EXISTENT_ID); + ClientResponse res = client.readItem(knownResourceId, NON_EXISTENT_ID); try { int statusCode = res.getStatus(); @@ -893,7 +910,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { // Retrieve the contents of a resource to update. LocationAuthorityClient client = new LocationAuthorityClient(); - ClientResponse res = client.read(knownResourceId); + ClientResponse res = client.read(knownResourceId); try { if(logger.isDebugEnabled()){ logger.debug(testName + ": read status = " + res.getStatus()); @@ -903,7 +920,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { if(logger.isDebugEnabled()){ logger.debug("got LocationAuthority to update with ID: " + knownResourceId); } - MultipartInput input = (MultipartInput) res.getEntity(); + PoxPayloadIn input = new PoxPayloadIn(res.getEntity()); LocationauthoritiesCommon locationAuthority = (LocationauthoritiesCommon) extractPart(input, client.getCommonPartName(), LocationauthoritiesCommon.class); Assert.assertNotNull(locationAuthority); @@ -917,9 +934,9 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { } // Submit the updated resource to the service and store the response. - MultipartOutput output = new MultipartOutput(); - OutputPart commonPart = output.addPart(locationAuthority, MediaType.APPLICATION_XML_TYPE); - commonPart.getHeaders().add("label", client.getCommonPartName()); + PoxPayloadOut output = new PoxPayloadOut(LocationAuthorityClient.SERVICE_PAYLOAD_NAME); + PayloadOutputPart commonPart = output.addPart(locationAuthority, MediaType.APPLICATION_XML_TYPE); + commonPart.setLabel(client.getCommonPartName()); res.releaseConnection(); res = client.update(knownResourceId, output); int statusCode = res.getStatus(); @@ -933,7 +950,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); // Retrieve the updated resource and verify that its contents exist. - input = (MultipartInput) res.getEntity(); + input = new PoxPayloadIn(res.getEntity()); LocationauthoritiesCommon updatedLocationAuthority = (LocationauthoritiesCommon) extractPart(input, client.getCommonPartName(), LocationauthoritiesCommon.class); @@ -966,7 +983,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { // Retrieve the contents of a resource to update. LocationAuthorityClient client = new LocationAuthorityClient(); - ClientResponse res = + ClientResponse res = client.readItem(knownResourceId, knownItemResourceId); try { if(logger.isDebugEnabled()){ @@ -979,7 +996,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { knownItemResourceId + " in LocationAuthority: " + knownResourceId ); } - MultipartInput input = (MultipartInput) res.getEntity(); + PoxPayloadIn input = new PoxPayloadIn(res.getEntity()); LocationsCommon location = (LocationsCommon) extractPart(input, client.getItemCommonPartName(), LocationsCommon.class); Assert.assertNotNull(location); @@ -994,9 +1011,9 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { } // Submit the updated resource to the service and store the response. - MultipartOutput output = new MultipartOutput(); - OutputPart commonPart = output.addPart(location, MediaType.APPLICATION_XML_TYPE); - commonPart.getHeaders().add("label", client.getItemCommonPartName()); + PoxPayloadOut output = new PoxPayloadOut(LocationAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME); + PayloadOutputPart commonPart = output.addPart(location, MediaType.APPLICATION_XML_TYPE); + commonPart.setLabel(client.getItemCommonPartName()); res.releaseConnection(); res = client.updateItem(knownResourceId, knownItemResourceId, output); int statusCode = res.getStatus(); @@ -1010,7 +1027,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); // Retrieve the updated resource and verify that its contents exist. - input = (MultipartInput) res.getEntity(); + input = new PoxPayloadIn(res.getEntity()); LocationsCommon updatedLocation = (LocationsCommon) extractPart(input, client.getItemCommonPartName(), LocationsCommon.class); @@ -1068,9 +1085,9 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { // The only relevant ID may be the one used in update(), below. LocationAuthorityClient client = new LocationAuthorityClient(); String displayName = "displayName-NON_EXISTENT_ID"; - MultipartOutput multipart = LocationAuthorityClientUtils.createLocationAuthorityInstance( + PoxPayloadOut multipart = LocationAuthorityClientUtils.createLocationAuthorityInstance( displayName, "nonEx", client.getCommonPartName()); - ClientResponse res = + ClientResponse res = client.update(NON_EXISTENT_ID, multipart); try { int statusCode = res.getStatus(); @@ -1113,11 +1130,11 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { nonexMap.put(LocationJAXBSchema.SHORT_IDENTIFIER, "nonEx"); nonexMap.put(LocationJAXBSchema.LOCATION_TYPE, TEST_LOCATION_TYPE); nonexMap.put(LocationJAXBSchema.TERM_STATUS, TEST_STATUS); - MultipartOutput multipart = + PoxPayloadOut multipart = LocationAuthorityClientUtils.createLocationInstance( LocationAuthorityClientUtils.createLocationRefName(knownResourceRefName, "nonEx", "Non Existent"), nonexMap, client.getItemCommonPartName() ); - ClientResponse res = + ClientResponse res = client.updateItem(knownResourceId, NON_EXISTENT_ID, multipart); try { int statusCode = res.getStatus(); @@ -1397,19 +1414,6 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { /* (non-Javadoc) * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent() */ - @Override - public String getServicePathComponent() { - return SERVICE_PATH_COMPONENT; - } - - /** - * Gets the item service path component. - * - * @return the item service path component - */ - public String getItemServicePathComponent() { - return ITEM_SERVICE_PATH_COMPONENT; - } /** * Returns the root URL for the item service. diff --git a/services/location/import/src/main/java/org/collectionspace/services/location/importer/LocationAuthorityBaseImport.java b/services/location/import/src/main/java/org/collectionspace/services/location/importer/LocationAuthorityBaseImport.java index b4b22f745..7f4bc3390 100644 --- a/services/location/import/src/main/java/org/collectionspace/services/location/importer/LocationAuthorityBaseImport.java +++ b/services/location/import/src/main/java/org/collectionspace/services/location/importer/LocationAuthorityBaseImport.java @@ -37,13 +37,13 @@ import org.apache.log4j.BasicConfigurator; import org.collectionspace.services.LocationJAXBSchema; import org.collectionspace.services.client.LocationAuthorityClient; import org.collectionspace.services.client.LocationAuthorityClientUtils; +import org.collectionspace.services.client.PoxPayloadOut; import org.collectionspace.services.client.test.ServiceRequestType; import org.collectionspace.services.location.LocationauthoritiesCommon; import org.collectionspace.services.location.LocationauthoritiesCommonList; import org.collectionspace.services.location.LocationsCommon; import org.collectionspace.services.location.LocationsCommonList; import org.jboss.resteasy.client.ClientResponse; -import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput; import org.jboss.resteasy.plugins.providers.multipart.OutputPart; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -80,7 +80,7 @@ public class LocationAuthorityBaseImport { String baseLocationRefName = LocationAuthorityClientUtils.createLocationAuthRefName(locationAuthorityName, displaySuffix);//TODO: make displaySuffix correct. Laramie20100729 temp fix, made-up displaySuffix. was (locationAuthorityName, false); String fullLocationRefName = LocationAuthorityClientUtils.createLocationAuthRefName(locationAuthorityName, displaySuffix);//TODO: make displaySuffix correct. Laramie20100729 temp fix, made-up displaySuffix. was (locationAuthorityName, true); - MultipartOutput multipart = LocationAuthorityClientUtils.createLocationAuthorityInstance(locationAuthorityName, fullLocationRefName, client.getCommonPartName()); + PoxPayloadOut multipart = LocationAuthorityClientUtils.createLocationAuthorityInstance(locationAuthorityName, fullLocationRefName, client.getCommonPartName()); ClientResponse res = client.create(multipart); int statusCode = res.getStatus(); diff --git a/services/location/jaxb/.classpath b/services/location/jaxb/.classpath index 1707f3e6f..1c214e7c9 100644 --- a/services/location/jaxb/.classpath +++ b/services/location/jaxb/.classpath @@ -1,11 +1,302 @@ - - - - - - - - + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/services/location/jaxb/.project b/services/location/jaxb/.project index 27c00a817..7b14589cd 100644 --- a/services/location/jaxb/.project +++ b/services/location/jaxb/.project @@ -1,23 +1,23 @@ - - org.collectionspace.services.person.jaxb - + org.collectionspace.services.location.jaxb + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + org.collectionspace.services.3rdparty.nuxeo.quote-api + org.collectionspace.services.client + org.collectionspace.services.common + org.collectionspace.services.hyperjaxb + org.collectionspace.services.jaxb org.eclipse.jdt.core.javabuilder - - org.maven.ide.eclipse.maven2Builder - - org.maven.ide.eclipse.maven2Nature org.eclipse.jdt.core.javanature - + \ No newline at end of file diff --git a/services/location/jaxb/.settings/org.maven.ide.eclipse.prefs b/services/location/jaxb/.settings/org.maven.ide.eclipse.prefs index b5ed0421d..c9f07df5d 100644 --- a/services/location/jaxb/.settings/org.maven.ide.eclipse.prefs +++ b/services/location/jaxb/.settings/org.maven.ide.eclipse.prefs @@ -1,9 +1,9 @@ -#Fri Aug 06 10:47:29 PDT 2010 +#Wed Jan 19 22:49:45 PST 2011 activeProfiles= eclipse.preferences.version=1 fullBuildGoals=process-test-resources includeModules=false resolveWorkspaceProjects=true resourceFilterGoals=process-resources resources\:testResources -skipCompilerPlugin=false +skipCompilerPlugin=true version=1 diff --git a/services/location/service/.classpath b/services/location/service/.classpath index 83343792e..8946e5c5c 100644 --- a/services/location/service/.classpath +++ b/services/location/service/.classpath @@ -1,7 +1,314 @@ - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/services/location/service/.project b/services/location/service/.project index 290bda033..11055043f 100644 --- a/services/location/service/.project +++ b/services/location/service/.project @@ -1,26 +1,28 @@ - - org.collectionspace.services.person.service - + org.collectionspace.services.location.service + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + org.collectionspace.services.3rdparty.nuxeo.quote-api + org.collectionspace.services.client org.collectionspace.services.common + org.collectionspace.services.contact.client + org.collectionspace.services.contact.jaxb + org.collectionspace.services.contact.service + org.collectionspace.services.hyperjaxb org.collectionspace.services.jaxb - org.collectionspace.services.person.jaxb + org.collectionspace.services.location.client + org.collectionspace.services.location.jaxb org.eclipse.jdt.core.javabuilder - - org.maven.ide.eclipse.maven2Builder - - org.maven.ide.eclipse.maven2Nature org.eclipse.jdt.core.javanature - + \ No newline at end of file diff --git a/services/location/service/pom.xml b/services/location/service/pom.xml index a87969f8d..6b607bbe1 100644 --- a/services/location/service/pom.xml +++ b/services/location/service/pom.xml @@ -32,6 +32,11 @@ org.collectionspace.services.location.jaxb ${project.version} + + org.collectionspace.services + org.collectionspace.services.location.client + ${project.version} + org.collectionspace.services org.collectionspace.services.contact.service diff --git a/services/location/service/src/main/java/org/collectionspace/services/location/LocationAuthorityResource.java b/services/location/service/src/main/java/org/collectionspace/services/location/LocationAuthorityResource.java index 4c76be778..84b1f6fb3 100644 --- a/services/location/service/src/main/java/org/collectionspace/services/location/LocationAuthorityResource.java +++ b/services/location/service/src/main/java/org/collectionspace/services/location/LocationAuthorityResource.java @@ -41,6 +41,7 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.UriBuilder; import javax.ws.rs.core.UriInfo; +import org.collectionspace.services.client.LocationAuthorityClient; import org.collectionspace.services.common.vocabulary.AuthorityJAXBSchema; import org.collectionspace.services.LocationJAXBSchema; import org.collectionspace.services.common.AbstractMultiPartCollectionSpaceResourceImpl; @@ -67,8 +68,6 @@ import org.collectionspace.services.common.vocabulary.RefNameUtils; import org.collectionspace.services.common.query.IQueryManager; import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl; import org.collectionspace.services.location.nuxeo.LocationDocumentModelHandler; -import org.jboss.resteasy.plugins.providers.multipart.MultipartInput; -import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput; import org.jboss.resteasy.util.HttpResponseCodes; import org.nuxeo.ecm.core.api.DocumentModel; import org.slf4j.Logger; @@ -77,9 +76,9 @@ import org.slf4j.LoggerFactory; /** * The Class LocationAuthorityResource. */ -@Path("/locationauthorities") -@Consumes("multipart/mixed") -@Produces("multipart/mixed") +@Path(LocationAuthorityClient.SERVICE_PATH) +@Consumes("application/xml") +@Produces("application/xml") public class LocationAuthorityResource extends AuthorityResource {