From 18d0b58a19f658c77fc072ee4a035ec078b695c1 Mon Sep 17 00:00:00 2001 From: Aron Roberts Date: Wed, 16 Feb 2011 00:26:04 +0000 Subject: [PATCH] CSPACE-3574: Merging Plain Old XML payload work into trunk. --- services/common-test/.classpath | 223 +++++++++++- services/common-test/.project | 41 +-- .../nuxeo-platform-cs-dimension/.classpath | 17 +- .../nuxeo-platform-cs-dimension/.project | 38 +- services/dimension/client/.classpath | 328 +++++++++++++++++- services/dimension/client/.project | 60 ++-- services/dimension/client/pom.xml | 5 + .../services/client/DimensionClient.java | 33 +- .../services/client/DimensionFactory.java | 26 +- .../services/client/DimensionProxy.java | 12 +- .../client/test/DimensionServiceTest.java | 87 +++-- .../test-data/xmlreplay/dimension-master.xml | 2 +- services/dimension/jaxb/.classpath | 42 ++- services/dimension/jaxb/.project | 40 +-- .../.settings/org.maven.ide.eclipse.prefs | 8 +- services/dimension/service/.classpath | 317 ++++++++++++++++- services/dimension/service/.project | 48 ++- services/dimension/service/pom.xml | 5 + .../services/dimension/DimensionResource.java | 47 +-- services/hyperjaxb/.classpath | 73 +++- services/hyperjaxb/.project | 38 +- .../.settings/org.maven.ide.eclipse.prefs | 8 +- services/id/client/.classpath | 225 +++++++++++- services/id/client/.project | 41 +-- .../services/client/IdClient.java | 6 + .../services/client/test/IdServiceTest.java | 4 + services/id/service/.classpath | 322 ++++++++++++++++- services/id/service/.project | 46 ++- 28 files changed, 1788 insertions(+), 354 deletions(-) diff --git a/services/common-test/.classpath b/services/common-test/.classpath index 5488bdc01..2732e6b29 100644 --- a/services/common-test/.classpath +++ b/services/common-test/.classpath @@ -1,9 +1,216 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/services/common-test/.project b/services/common-test/.project index 6096b27c6..d8933d1a7 100644 --- a/services/common-test/.project +++ b/services/common-test/.project @@ -1,23 +1,20 @@ - - org.collectionspace.services.common-test - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.maven.ide.eclipse.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.maven.ide.eclipse.maven2Nature - - + org.collectionspace.services.common-test + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + + org.collectionspace.services.client + org.collectionspace.services.jaxb + + + + org.eclipse.jdt.core.javabuilder + + + org.maven.ide.eclipse.maven2Builder + + + + org.eclipse.jdt.core.javanature + org.maven.ide.eclipse.maven2Nature + + \ No newline at end of file diff --git a/services/dimension/3rdparty/nuxeo-platform-cs-dimension/.classpath b/services/dimension/3rdparty/nuxeo-platform-cs-dimension/.classpath index 199bbbbdb..f81b42c4a 100644 --- a/services/dimension/3rdparty/nuxeo-platform-cs-dimension/.classpath +++ b/services/dimension/3rdparty/nuxeo-platform-cs-dimension/.classpath @@ -1,8 +1,11 @@ - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/services/dimension/3rdparty/nuxeo-platform-cs-dimension/.project b/services/dimension/3rdparty/nuxeo-platform-cs-dimension/.project index 754d88320..f12cf04b7 100644 --- a/services/dimension/3rdparty/nuxeo-platform-cs-dimension/.project +++ b/services/dimension/3rdparty/nuxeo-platform-cs-dimension/.project @@ -1,23 +1,17 @@ - - org.collectionspace.services.dimension.3rdparty.nuxeo - Dimension Nuxeo Document Type - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.maven.ide.eclipse.maven2Builder - - - - - - org.maven.ide.eclipse.maven2Nature - org.eclipse.jdt.core.javanature - - + org.collectionspace.services.dimension.3rdparty.nuxeo + Dimension 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/dimension/client/.classpath b/services/dimension/client/.classpath index 425cd1620..1e06d7234 100644 --- a/services/dimension/client/.classpath +++ b/services/dimension/client/.classpath @@ -1,10 +1,320 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/services/dimension/client/.project b/services/dimension/client/.project index 909c45737..e3233a62d 100644 --- a/services/dimension/client/.project +++ b/services/dimension/client/.project @@ -1,26 +1,36 @@ - - org.collectionspace.services.dimension.client - - - org.collectionspace.services.client - org.collectionspace.services.common - org.collectionspace.services.dimension.jaxb - - - - org.eclipse.jdt.core.javabuilder - - - - - org.maven.ide.eclipse.maven2Builder - - - - - - org.maven.ide.eclipse.maven2Nature - org.eclipse.jdt.core.javanature - - + org.collectionspace.services.dimension.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.collectionobject.client + org.collectionspace.services.collectionobject.jaxb + org.collectionspace.services.common + org.collectionspace.services.contact.client + org.collectionspace.services.contact.jaxb + org.collectionspace.services.dimension.jaxb + org.collectionspace.services.hyperjaxb + org.collectionspace.services.intake.client + org.collectionspace.services.intake.jaxb + org.collectionspace.services.IntegrationTests + org.collectionspace.services.jaxb + org.collectionspace.services.organization.client + org.collectionspace.services.organization.jaxb + org.collectionspace.services.person.client + org.collectionspace.services.person.jaxb + org.collectionspace.services.relation.client + + + + 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/dimension/client/pom.xml b/services/dimension/client/pom.xml index 410bdd452..d0a12dc97 100644 --- a/services/dimension/client/pom.xml +++ b/services/dimension/client/pom.xml @@ -35,6 +35,11 @@ org.collectionspace.services.client ${project.version} + + org.collectionspace.services + org.collectionspace.services.common + ${project.version} + org.collectionspace.services diff --git a/services/dimension/client/src/main/java/org/collectionspace/services/client/DimensionClient.java b/services/dimension/client/src/main/java/org/collectionspace/services/client/DimensionClient.java index 6c7a1bc09..2cbe68085 100644 --- a/services/dimension/client/src/main/java/org/collectionspace/services/client/DimensionClient.java +++ b/services/dimension/client/src/main/java/org/collectionspace/services/client/DimensionClient.java @@ -35,8 +35,8 @@ import org.jboss.resteasy.client.ProxyFactory; import org.jboss.resteasy.plugins.providers.RegisterBuiltin; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor; -import org.jboss.resteasy.plugins.providers.multipart.MultipartInput; -import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput; +//import org.jboss.resteasy.plugins.providers.multipart.MultipartInput; +//import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput; import org.jboss.resteasy.spi.ResteasyProviderFactory; /** @@ -45,14 +45,22 @@ import org.jboss.resteasy.spi.ResteasyProviderFactory; * @version $Revision:$ */ public class DimensionClient extends AbstractServiceClientImpl { + public static final String SERVICE_NAME = "dimensions"; + public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME; + public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT; + public static final String SERVICE_PATH_PROXY = SERVICE_PATH + "/"; + public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME; - /* (non-Javadoc) - * @see org.collectionspace.services.client.BaseServiceClient#getServicePathComponent() - */ + @Override public String getServicePathComponent() { - return "dimensions"; + return SERVICE_PATH_COMPONENT; } - + + @Override + public String getServiceName() { + return SERVICE_NAME; + } + /** * */ @@ -118,7 +126,7 @@ public class DimensionClient extends AbstractServiceClientImpl { * @see org.collectionspace.services.client.DimensionProxy#getDimension(java.lang.String) */ - public ClientResponse read(String csid) { + public ClientResponse read(String csid) { return dimensionProxy.read(csid); } @@ -127,8 +135,8 @@ public class DimensionClient extends AbstractServiceClientImpl { * @return * @see org.collectionspace.services.client.DimensionProxy#createDimension(org.collectionspace.services.Dimension) */ - public ClientResponse create(MultipartOutput multipart) { - return dimensionProxy.create(multipart); + public ClientResponse create(PoxPayloadOut xmlPayload) { + return dimensionProxy.create(xmlPayload.getBytes()); } /** @@ -137,9 +145,8 @@ public class DimensionClient extends AbstractServiceClientImpl { * @return * @see org.collectionspace.services.client.DimensionProxy#updateDimension(java.lang.Long, org.collectionspace.services.Dimension) */ - public ClientResponse update(String csid, MultipartOutput multipart) { - return dimensionProxy.update(csid, multipart); - + public ClientResponse update(String csid, PoxPayloadOut xmlPayload) { + return dimensionProxy.update(csid, xmlPayload.getBytes()); } /** diff --git a/services/dimension/client/src/main/java/org/collectionspace/services/client/DimensionFactory.java b/services/dimension/client/src/main/java/org/collectionspace/services/client/DimensionFactory.java index 9afb62917..4d3c7878c 100644 --- a/services/dimension/client/src/main/java/org/collectionspace/services/client/DimensionFactory.java +++ b/services/dimension/client/src/main/java/org/collectionspace/services/client/DimensionFactory.java @@ -27,13 +27,10 @@ */ package org.collectionspace.services.client; - - - import javax.ws.rs.core.MediaType; +import org.collectionspace.services.client.PayloadOutputPart; +import org.collectionspace.services.client.PoxPayloadOut; import org.collectionspace.services.dimension.DimensionsCommon; -import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput; -import org.jboss.resteasy.plugins.providers.multipart.OutputPart; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -46,21 +43,28 @@ public class DimensionFactory { static private final Logger logger = LoggerFactory.getLogger(DimensionFactory.class); + final static String SERVICE_PATH_COMPONENT = "dimensions"; + /** * Creates the dimension instance. * - * @param commpnPartName + * @param commonPartName * @param dimension - * @return the multipart output + * @return an output payload */ - public static MultipartOutput createDimensionInstance(String commonPartName, + public static PoxPayloadOut createDimensionInstance(String commonPartName, DimensionsCommon dimension) { - MultipartOutput multipart = new MultipartOutput(); - OutputPart commonPart = + PoxPayloadOut multipart = new PoxPayloadOut(getServicePathComponent()); + PayloadOutputPart commonPart = multipart.addPart(dimension, MediaType.APPLICATION_XML_TYPE); - commonPart.getHeaders().add("label", commonPartName); + commonPart.setLabel(commonPartName); return multipart; } + + public static String getServicePathComponent() { + return SERVICE_PATH_COMPONENT; + } + } diff --git a/services/dimension/client/src/main/java/org/collectionspace/services/client/DimensionProxy.java b/services/dimension/client/src/main/java/org/collectionspace/services/client/DimensionProxy.java index ea71d5aa1..711e57b17 100644 --- a/services/dimension/client/src/main/java/org/collectionspace/services/client/DimensionProxy.java +++ b/services/dimension/client/src/main/java/org/collectionspace/services/client/DimensionProxy.java @@ -12,15 +12,13 @@ import javax.ws.rs.core.Response; import org.collectionspace.services.dimension.DimensionsCommonList; 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("/dimensions/") -@Produces({"multipart/mixed"}) -@Consumes({"multipart/mixed"}) +@Produces({"application/xml"}) +@Consumes({"application/xml"}) public interface DimensionProxy extends CollectionSpaceProxy { @GET @@ -29,17 +27,17 @@ public interface DimensionProxy extends CollectionSpaceProxy { //(C)reate @POST - ClientResponse create(MultipartOutput multipart); + ClientResponse create(byte[] payload); //(R)ead @GET @Path("/{csid}") - ClientResponse read(@PathParam("csid") String csid); + ClientResponse read(@PathParam("csid") String csid); //(U)pdate @PUT @Path("/{csid}") - ClientResponse update(@PathParam("csid") String csid, MultipartOutput multipart); + ClientResponse update(@PathParam("csid") String csid, byte[] payload); //(D)elete @DELETE diff --git a/services/dimension/client/src/test/java/org/collectionspace/services/client/test/DimensionServiceTest.java b/services/dimension/client/src/test/java/org/collectionspace/services/client/test/DimensionServiceTest.java index 9ed5bdbfd..106320b3d 100644 --- a/services/dimension/client/src/test/java/org/collectionspace/services/client/test/DimensionServiceTest.java +++ b/services/dimension/client/src/test/java/org/collectionspace/services/client/test/DimensionServiceTest.java @@ -30,15 +30,16 @@ import javax.ws.rs.core.Response; import org.collectionspace.services.client.CollectionSpaceClient; import org.collectionspace.services.client.DimensionClient; import org.collectionspace.services.client.DimensionFactory; +import org.collectionspace.services.client.PayloadInputPart; +import org.collectionspace.services.client.PayloadOutputPart; +import org.collectionspace.services.client.PoxPayloadIn; +import org.collectionspace.services.client.PoxPayloadOut; import org.collectionspace.services.dimension.DimensionsCommon; import org.collectionspace.services.dimension.DimensionsCommonList; import org.collectionspace.services.jaxb.AbstractCommonList; 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.testng.Assert; //import org.testng.annotations.AfterClass; import org.testng.annotations.Test; @@ -65,6 +66,11 @@ public class DimensionServiceTest extends AbstractServiceTestImpl { /** The known resource id. */ private String knownResourceId = null; + @Override + protected String getServiceName() { + return DimensionClient.SERVICE_NAME; + } + /* (non-Javadoc) * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance() */ @@ -104,7 +110,7 @@ public class DimensionServiceTest extends AbstractServiceTestImpl { // Submit the request to the service and store the response. DimensionClient client = new DimensionClient(); String identifier = createIdentifier(); - MultipartOutput multipart = createDimensionInstance(client.getCommonPartName(), + PoxPayloadOut multipart = createDimensionInstance(client.getCommonPartName(), identifier); ClientResponse res = client.create(multipart); @@ -284,7 +290,7 @@ public class DimensionServiceTest extends AbstractServiceTestImpl { // Submit the request to the service and store the response. DimensionClient client = new DimensionClient(); - ClientResponse res = client.read(knownResourceId); + ClientResponse res = client.read(knownResourceId); int statusCode = res.getStatus(); // Check the status code of the response: does it match @@ -296,10 +302,13 @@ public class DimensionServiceTest extends AbstractServiceTestImpl { invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); - MultipartInput input = (MultipartInput) res.getEntity(); - DimensionsCommon dimension = (DimensionsCommon) extractPart(input, - client.getCommonPartName(), DimensionsCommon.class); - Assert.assertNotNull(dimension); + PoxPayloadIn input = new PoxPayloadIn(res.getEntity()); + PayloadInputPart payloadInputPart = input.getPart(client.getCommonPartName()); + DimensionsCommon dimensionsCommon = null; + if (payloadInputPart != null) { + dimensionsCommon = (DimensionsCommon) payloadInputPart.getBody(); + } + Assert.assertNotNull(dimensionsCommon); } // Failure outcomes @@ -319,7 +328,7 @@ public class DimensionServiceTest extends AbstractServiceTestImpl { // Submit the request to the service and store the response. DimensionClient client = new DimensionClient(); - ClientResponse res = client.read(NON_EXISTENT_ID); + ClientResponse res = client.read(NON_EXISTENT_ID); int statusCode = res.getStatus(); // Check the status code of the response: does it match @@ -406,7 +415,7 @@ public class DimensionServiceTest extends AbstractServiceTestImpl { // Retrieve the contents of a resource to update. DimensionClient client = new DimensionClient(); - ClientResponse res = + ClientResponse res = client.read(knownResourceId); if (logger.isDebugEnabled()) { logger.debug(testName + ": read status = " + res.getStatus()); @@ -416,22 +425,25 @@ public class DimensionServiceTest extends AbstractServiceTestImpl { if (logger.isDebugEnabled()) { logger.debug("got object to update with ID: " + knownResourceId); } - MultipartInput input = (MultipartInput) res.getEntity(); - DimensionsCommon dimension = (DimensionsCommon) extractPart(input, - client.getCommonPartName(), DimensionsCommon.class); - Assert.assertNotNull(dimension); + PoxPayloadIn input = new PoxPayloadIn(res.getEntity()); + PayloadInputPart payloadInputPart = input.getPart(client.getCommonPartName()); + DimensionsCommon dimensionsCommon = null; + if (payloadInputPart != null) { + dimensionsCommon = (DimensionsCommon) payloadInputPart.getBody(); + } + Assert.assertNotNull(dimensionsCommon); // Update the content of this resource. - dimension.setValue("updated-" + dimension.getValue()); - dimension.setValueDate("updated-" + dimension.getValueDate()); + dimensionsCommon.setValue("updated-" + dimensionsCommon.getValue()); + dimensionsCommon.setValueDate("updated-" + dimensionsCommon.getValueDate()); if (logger.isDebugEnabled()) { logger.debug("to be updated object"); - logger.debug(objectAsXmlString(dimension, DimensionsCommon.class)); + logger.debug(objectAsXmlString(dimensionsCommon, DimensionsCommon.class)); } // Submit the request to the service and store the response. - MultipartOutput output = new MultipartOutput(); - OutputPart commonPart = output.addPart(dimension, MediaType.APPLICATION_XML_TYPE); - commonPart.getHeaders().add("label", client.getCommonPartName()); + PoxPayloadOut output = new PoxPayloadOut(this.getServicePathComponent()); + PayloadOutputPart commonPart = output.addPart(dimensionsCommon, MediaType.APPLICATION_XML_TYPE); + commonPart.setLabel(client.getCommonPartName()); res = client.update(knownResourceId, output); int statusCode = res.getStatus(); @@ -443,15 +455,14 @@ public class DimensionServiceTest extends AbstractServiceTestImpl { invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); - - input = (MultipartInput) res.getEntity(); - DimensionsCommon updatedDimension = + input = new PoxPayloadIn(res.getEntity()); + DimensionsCommon updatedDimensionsCommon = (DimensionsCommon) extractPart(input, client.getCommonPartName(), DimensionsCommon.class); - Assert.assertNotNull(updatedDimension); + Assert.assertNotNull(updatedDimensionsCommon); - Assert.assertEquals(updatedDimension.getValueDate(), - dimension.getValueDate(), + Assert.assertEquals(updatedDimensionsCommon.getValueDate(), + dimensionsCommon.getValueDate(), "Data in updated object did not match submitted data."); } @@ -590,9 +601,9 @@ public class DimensionServiceTest extends AbstractServiceTestImpl { // Note: The ID used in this 'create' call may be arbitrary. // The only relevant ID may be the one used in update(), below. DimensionClient client = new DimensionClient(); - MultipartOutput multipart = createDimensionInstance(client.getCommonPartName(), + PoxPayloadOut multipart = createDimensionInstance(client.getCommonPartName(), NON_EXISTENT_ID); - ClientResponse res = + ClientResponse res = client.update(NON_EXISTENT_ID, multipart); int statusCode = res.getStatus(); @@ -714,7 +725,7 @@ public class DimensionServiceTest extends AbstractServiceTestImpl { * @param identifier the identifier * @return the multipart output */ - private MultipartOutput createDimensionInstance(String commonPartName, String identifier) { + private PoxPayloadOut createDimensionInstance(String commonPartName, String identifier) { return createDimensionInstance(commonPartName, "dimensionType-" + identifier, "entryNumber-" + identifier, @@ -729,17 +740,17 @@ public class DimensionServiceTest extends AbstractServiceTestImpl { * @param entryDate the entry date * @return the multipart output */ - private MultipartOutput createDimensionInstance(String commonPartName, String dimensionType, String entryNumber, String entryDate) { - DimensionsCommon dimension = new DimensionsCommon(); - dimension.setDimension(dimensionType); - dimension.setValue(entryNumber); - dimension.setValueDate(entryDate); - MultipartOutput multipart = DimensionFactory.createDimensionInstance( - commonPartName, dimension); + private PoxPayloadOut createDimensionInstance(String commonPartName, String dimensionType, String entryNumber, String entryDate) { + DimensionsCommon dimensionsCommon = new DimensionsCommon(); + dimensionsCommon.setDimension(dimensionType); + dimensionsCommon.setValue(entryNumber); + dimensionsCommon.setValueDate(entryDate); + PoxPayloadOut multipart = DimensionFactory.createDimensionInstance( + commonPartName, dimensionsCommon); if (logger.isDebugEnabled()) { logger.debug("to be created, dimension common"); - logger.debug(objectAsXmlString(dimension, + logger.debug(objectAsXmlString(dimensionsCommon, DimensionsCommon.class)); } diff --git a/services/dimension/client/src/test/resources/test-data/xmlreplay/dimension-master.xml b/services/dimension/client/src/test/resources/test-data/xmlreplay/dimension-master.xml index c78d5a80e..fcca1b534 100755 --- a/services/dimension/client/src/test/resources/test-data/xmlreplay/dimension-master.xml +++ b/services/dimension/client/src/test/resources/test-data/xmlreplay/dimension-master.xml @@ -10,7 +10,7 @@ - + diff --git a/services/dimension/jaxb/.classpath b/services/dimension/jaxb/.classpath index 557f8a4e0..f4b0d7851 100644 --- a/services/dimension/jaxb/.classpath +++ b/services/dimension/jaxb/.classpath @@ -1,10 +1,34 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/services/dimension/jaxb/.project b/services/dimension/jaxb/.project index 218f53a21..27f0b36f8 100644 --- a/services/dimension/jaxb/.project +++ b/services/dimension/jaxb/.project @@ -1,23 +1,19 @@ - - org.collectionspace.services.dimension.jaxb - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.maven.ide.eclipse.maven2Builder - - - - - - org.maven.ide.eclipse.maven2Nature - org.eclipse.jdt.core.javanature - - + org.collectionspace.services.dimension.jaxb + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + + 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/dimension/jaxb/.settings/org.maven.ide.eclipse.prefs b/services/dimension/jaxb/.settings/org.maven.ide.eclipse.prefs index 044caaaa0..86abf8e53 100644 --- a/services/dimension/jaxb/.settings/org.maven.ide.eclipse.prefs +++ b/services/dimension/jaxb/.settings/org.maven.ide.eclipse.prefs @@ -1,9 +1,9 @@ -#Tue Dec 21 09:59:01 PST 2010 +#Wed Jan 19 22:49:47 PST 2011 activeProfiles= eclipse.preferences.version=1 -fullBuildGoals=process-classes +fullBuildGoals=process-test-resources includeModules=false resolveWorkspaceProjects=true -resourceFilterGoals=process-classes -skipCompilerPlugin=false +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true version=1 diff --git a/services/dimension/service/.classpath b/services/dimension/service/.classpath index 425cd1620..cd209d480 100644 --- a/services/dimension/service/.classpath +++ b/services/dimension/service/.classpath @@ -1,10 +1,309 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/services/dimension/service/.project b/services/dimension/service/.project index 871d3c122..91a4f3b26 100644 --- a/services/dimension/service/.project +++ b/services/dimension/service/.project @@ -1,26 +1,24 @@ - - org.collectionspace.services.dimension.service - - - org.collectionspace.services.common - org.collectionspace.services.dimension.jaxb - org.collectionspace.services.jaxb - - - - org.eclipse.jdt.core.javabuilder - - - - - org.maven.ide.eclipse.maven2Builder - - - - - - org.maven.ide.eclipse.maven2Nature - org.eclipse.jdt.core.javanature - - + org.collectionspace.services.dimension.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.dimension.jaxb + 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/dimension/service/pom.xml b/services/dimension/service/pom.xml index c6d094007..7d5a3d986 100644 --- a/services/dimension/service/pom.xml +++ b/services/dimension/service/pom.xml @@ -20,6 +20,11 @@ org.collectionspace.services.common ${project.version} + + org.collectionspace.services + org.collectionspace.services.client + ${project.version} + org.collectionspace.services org.collectionspace.services.dimension.jaxb diff --git a/services/dimension/service/src/main/java/org/collectionspace/services/dimension/DimensionResource.java b/services/dimension/service/src/main/java/org/collectionspace/services/dimension/DimensionResource.java index 65c6ece81..5b54df800 100644 --- a/services/dimension/service/src/main/java/org/collectionspace/services/dimension/DimensionResource.java +++ b/services/dimension/service/src/main/java/org/collectionspace/services/dimension/DimensionResource.java @@ -38,6 +38,8 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.UriBuilder; import javax.ws.rs.core.UriInfo; +import org.collectionspace.services.client.PoxPayloadIn; +import org.collectionspace.services.client.PoxPayloadOut; import org.collectionspace.services.common.AbstractMultiPartCollectionSpaceResourceImpl; //import org.collectionspace.services.dimension.DimensionsCommonList.*; @@ -48,8 +50,6 @@ import org.collectionspace.services.common.ServiceMain; import org.collectionspace.services.common.context.ServiceContext; import org.collectionspace.services.common.document.DocumentNotFoundException; import org.collectionspace.services.common.document.DocumentHandler; -import org.jboss.resteasy.plugins.providers.multipart.MultipartInput; -import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput; import org.jboss.resteasy.util.HttpResponseCodes; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -58,8 +58,8 @@ import org.slf4j.LoggerFactory; * The Class DimensionResource. */ @Path("/dimensions") -@Consumes("multipart/mixed") -@Produces("multipart/mixed") +@Consumes("application/xml") +@Produces("application/xml") public class DimensionResource extends AbstractMultiPartCollectionSpaceResourceImpl { @@ -120,14 +120,15 @@ public class DimensionResource extends /** * Creates the dimension. * - * @param input the input + * @param xmlText an XML payload * * @return the response */ @POST - public Response createDimension(MultipartInput input) { + public Response createDimension(String xmlText) { try { - ServiceContext ctx = createServiceContext(input); + PoxPayloadIn input = new PoxPayloadIn(xmlText); + ServiceContext ctx = createServiceContext(input); DocumentHandler handler = createDocumentHandler(ctx); String csid = getRepositoryClient(ctx).create(ctx, handler); //dimensionObject.setCsid(csid); @@ -154,7 +155,7 @@ public class DimensionResource extends */ @GET @Path("{csid}") - public MultipartOutput getDimension( + public byte[] getDimension( @PathParam("csid") String csid) { if (logger.isDebugEnabled()) { logger.debug("getDimension with csid=" + csid); @@ -166,12 +167,12 @@ public class DimensionResource extends "text/plain").build(); throw new WebApplicationException(response); } - MultipartOutput result = null; + PoxPayloadOut result = null; try { - ServiceContext ctx = createServiceContext(); + ServiceContext ctx = createServiceContext(); DocumentHandler handler = createDocumentHandler(ctx); getRepositoryClient(ctx).get(ctx, csid, handler); - result = (MultipartOutput) ctx.getOutput(); + result = ctx.getOutput(); } catch (DocumentNotFoundException dnfe) { if (logger.isDebugEnabled()) { logger.debug("getDimension", dnfe); @@ -194,7 +195,7 @@ public class DimensionResource extends "text/plain").build(); throw new WebApplicationException(response); } - return result; + return result.getBytes(); } /** @@ -210,7 +211,7 @@ public class DimensionResource extends DimensionsCommonList dimensionObjectList = new DimensionsCommonList(); MultivaluedMap queryParams = ui.getQueryParameters(); try { - ServiceContext ctx = createServiceContext(queryParams); + ServiceContext ctx = createServiceContext(queryParams); DocumentHandler handler = createDocumentHandler(ctx); getRepositoryClient(ctx).getFiltered(ctx, handler); dimensionObjectList = (DimensionsCommonList) handler.getCommonPartList(); @@ -229,15 +230,14 @@ public class DimensionResource extends * Update dimension. * * @param csid the csid - * @param theUpdate the the update + * @param xmlText an XML payload * * @return the multipart output */ @PUT @Path("{csid}") - public MultipartOutput updateDimension( - @PathParam("csid") String csid, - MultipartInput theUpdate) { + public byte[] updateDimension( + @PathParam("csid") String csid, String xmlText) { if (logger.isDebugEnabled()) { logger.debug("updateDimension with csid=" + csid); } @@ -248,15 +248,16 @@ public class DimensionResource extends "text/plain").build(); throw new WebApplicationException(response); } - MultipartOutput result = null; + PoxPayloadOut result = null; try { - ServiceContext ctx = createServiceContext(theUpdate); + PoxPayloadIn update = new PoxPayloadIn(xmlText); + ServiceContext ctx = createServiceContext(update); DocumentHandler handler = createDocumentHandler(ctx); getRepositoryClient(ctx).update(ctx, csid, handler); - result = (MultipartOutput) ctx.getOutput(); + result = ctx.getOutput(); } catch (DocumentNotFoundException dnfe) { if (logger.isDebugEnabled()) { - logger.debug("caugth exception in updateDimension", dnfe); + logger.debug("Caught exception in updateDimension", dnfe); } Response response = Response.status(Response.Status.NOT_FOUND).entity( "Update failed on Dimension csid=" + csid).type( @@ -267,7 +268,7 @@ public class DimensionResource extends Response.Status.INTERNAL_SERVER_ERROR).entity("Update failed").type("text/plain").build(); throw new WebApplicationException(response); } - return result; + return result.getBytes(); } /** @@ -292,7 +293,7 @@ public class DimensionResource extends throw new WebApplicationException(response); } try { - ServiceContext ctx = createServiceContext(); + ServiceContext ctx = createServiceContext(); getRepositoryClient(ctx).delete(ctx, csid); return Response.status(HttpResponseCodes.SC_OK).build(); } catch (DocumentNotFoundException dnfe) { diff --git a/services/hyperjaxb/.classpath b/services/hyperjaxb/.classpath index 557f8a4e0..809e60637 100644 --- a/services/hyperjaxb/.classpath +++ b/services/hyperjaxb/.classpath @@ -1,10 +1,65 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/services/hyperjaxb/.project b/services/hyperjaxb/.project index d41666e52..bcff54ed8 100644 --- a/services/hyperjaxb/.project +++ b/services/hyperjaxb/.project @@ -1,23 +1,17 @@ - - org.collectionspace.services.hyperjaxb - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.maven.ide.eclipse.maven2Builder - - - - - - org.maven.ide.eclipse.maven2Nature - org.eclipse.jdt.core.javanature - - + org.collectionspace.services.hyperjaxb + 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/hyperjaxb/.settings/org.maven.ide.eclipse.prefs b/services/hyperjaxb/.settings/org.maven.ide.eclipse.prefs index 2354529b5..97c7be065 100644 --- a/services/hyperjaxb/.settings/org.maven.ide.eclipse.prefs +++ b/services/hyperjaxb/.settings/org.maven.ide.eclipse.prefs @@ -1,9 +1,9 @@ -#Tue Dec 21 10:28:35 PST 2010 +#Wed Jan 19 22:49:22 PST 2011 activeProfiles= eclipse.preferences.version=1 -fullBuildGoals=process-classes +fullBuildGoals=process-test-resources includeModules=false resolveWorkspaceProjects=true -resourceFilterGoals=process-classes -skipCompilerPlugin=false +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true version=1 diff --git a/services/id/client/.classpath b/services/id/client/.classpath index 425cd1620..92ac6bc95 100644 --- a/services/id/client/.classpath +++ b/services/id/client/.classpath @@ -1,10 +1,217 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/services/id/client/.project b/services/id/client/.project index cd71cd806..e3c7c6082 100644 --- a/services/id/client/.project +++ b/services/id/client/.project @@ -1,23 +1,20 @@ - - org.collectionspace.services.id.client - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.maven.ide.eclipse.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.maven.ide.eclipse.maven2Nature - - + org.collectionspace.services.id.client + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + + org.collectionspace.services.client + org.collectionspace.services.jaxb + + + + org.eclipse.jdt.core.javabuilder + + + org.maven.ide.eclipse.maven2Builder + + + + org.eclipse.jdt.core.javanature + org.maven.ide.eclipse.maven2Nature + + \ No newline at end of file diff --git a/services/id/client/src/main/java/org/collectionspace/services/client/IdClient.java b/services/id/client/src/main/java/org/collectionspace/services/client/IdClient.java index 580be7f8b..53e998afd 100644 --- a/services/id/client/src/main/java/org/collectionspace/services/client/IdClient.java +++ b/services/id/client/src/main/java/org/collectionspace/services/client/IdClient.java @@ -72,4 +72,10 @@ public class IdClient extends AbstractServiceClientImpl { return idProxy.createId(csid); } + @Override + public String getServiceName() { + // TODO Auto-generated method stub + return null; //FIXME: REM - See http://issues.collectionspace.org/browse/CSPACE-3497 + } + } diff --git a/services/id/client/src/test/java/org/collectionspace/services/client/test/IdServiceTest.java b/services/id/client/src/test/java/org/collectionspace/services/client/test/IdServiceTest.java index dba70a845..c3767df17 100644 --- a/services/id/client/src/test/java/org/collectionspace/services/client/test/IdServiceTest.java +++ b/services/id/client/src/test/java/org/collectionspace/services/client/test/IdServiceTest.java @@ -236,5 +236,9 @@ public class IdServiceTest extends BaseServiceTest { return "4b984865-f93d-4481-b874-3dba863ec589"; } + @Override + protected String getServiceName() { + throw new UnsupportedOperationException(); //FIXME: REM - See http://issues.collectionspace.org/browse/CSPACE-3498 } + } } diff --git a/services/id/service/.classpath b/services/id/service/.classpath index 425cd1620..4ba0cc031 100644 --- a/services/id/service/.classpath +++ b/services/id/service/.classpath @@ -1,10 +1,314 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/services/id/service/.project b/services/id/service/.project index e15d2c4ea..a54c4e0e9 100644 --- a/services/id/service/.project +++ b/services/id/service/.project @@ -1,25 +1,23 @@ - - org.collectionspace.services.id.service - - - org.collectionspace.services.common - org.collectionspace.services.id.jaxb - - - - org.eclipse.jdt.core.javabuilder - - - - - org.maven.ide.eclipse.maven2Builder - - - - - - org.maven.ide.eclipse.maven2Nature - org.eclipse.jdt.core.javanature - - + org.collectionspace.services.id.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.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 -- 2.47.3