From: Aron Roberts Date: Mon, 14 Nov 2011 23:38:04 +0000 (+0000) Subject: CSPACE-4057,CSPACE-3268,CSPACE-3269: Set datatype of multiple date fields, across... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=eee53db4cd1571c8851bde16521377b82961b143;p=tmp%2Fjakarta-migration.git CSPACE-4057,CSPACE-3268,CSPACE-3269: Set datatype of multiple date fields, across various object, procedural and authority records, to a date type (xs:date) in services XSD schema. Revised tests accordingly. Added loanInAuthorizationDate and repeatable loanStatus group to Loan In Schema. Added borrowersAuthorizer and borrowersAuthorizationDate fields to Loan Out Schema, also renamed loanedObjectStatus repeatable group and its fields to name/prefix loanStatus. --- diff --git a/services/acquisition/3rdparty/nuxeo-platform-cs-acquisition/src/main/resources/schemas/acquisitions_common.xsd b/services/acquisition/3rdparty/nuxeo-platform-cs-acquisition/src/main/resources/schemas/acquisitions_common.xsd index 5046ade10..ebba7a018 100644 --- a/services/acquisition/3rdparty/nuxeo-platform-cs-acquisition/src/main/resources/schemas/acquisitions_common.xsd +++ b/services/acquisition/3rdparty/nuxeo-platform-cs-acquisition/src/main/resources/schemas/acquisitions_common.xsd @@ -21,13 +21,13 @@ - + - + - + diff --git a/services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionServiceTest.java b/services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionServiceTest.java index c43ef9ec7..3147e8a15 100644 --- a/services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionServiceTest.java +++ b/services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionServiceTest.java @@ -32,6 +32,7 @@ import org.collectionspace.services.client.PayloadOutputPart; import org.collectionspace.services.client.PoxPayloadIn; import org.collectionspace.services.client.PoxPayloadOut; import org.collectionspace.services.common.AbstractCommonListUtils; +import org.collectionspace.services.common.datetime.GregorianCalendarDateTimeUtils; import org.collectionspace.services.jaxb.AbstractCommonList; import org.collectionspace.services.acquisition.AcquisitionsCommon; @@ -62,17 +63,20 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl { // Instance variables specific to this test. /** The known resource id. */ private String knownResourceId = null; + private final static String CURRENT_DATE_UTC = + GregorianCalendarDateTimeUtils.timestampUTC(); - @Override - public String getServicePathComponent() { - return AcquisitionClient.SERVICE_PATH_COMPONENT; - } + + @Override + public String getServicePathComponent() { + return AcquisitionClient.SERVICE_PATH_COMPONENT; + } - @Override - protected String getServiceName() { - return AcquisitionClient.SERVICE_NAME; - } + @Override + protected String getServiceName() { + return AcquisitionClient.SERVICE_NAME; + } /* (non-Javadoc) * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance() @@ -797,10 +801,8 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl { AcquisitionDateList acqDatesList = new AcquisitionDateList(); List acqDates = acqDatesList.getAcquisitionDate(); - // FIXME Use properly timestamps for representative acquisition - // dates in this example test record. The following are mere placeholders. - acqDates.add("First Acquisition Date -" + identifier); - acqDates.add("Second Acquisition Date-" + identifier); + acqDates.add(CURRENT_DATE_UTC); + acqDates.add(CURRENT_DATE_UTC); acquisition.setAcquisitionDates(acqDatesList); OwnerList ownersList = new OwnerList(); diff --git a/services/blob/3rdparty/nuxeo-platform-cs-blob/src/main/resources/schemas/blobs_common.xsd b/services/blob/3rdparty/nuxeo-platform-cs-blob/src/main/resources/schemas/blobs_common.xsd index fa00fd0e4..cbc5707d2 100644 --- a/services/blob/3rdparty/nuxeo-platform-cs-blob/src/main/resources/schemas/blobs_common.xsd +++ b/services/blob/3rdparty/nuxeo-platform-cs-blob/src/main/resources/schemas/blobs_common.xsd @@ -60,7 +60,7 @@ - + diff --git a/services/collectionobject/3rdparty/nuxeo-platform-collectionobject-lifesci/src/main/resources/schemas/collectionobjects_naturalhistory.xsd b/services/collectionobject/3rdparty/nuxeo-platform-collectionobject-lifesci/src/main/resources/schemas/collectionobjects_naturalhistory.xsd index 40118113d..895a69a7d 100644 --- a/services/collectionobject/3rdparty/nuxeo-platform-collectionobject-lifesci/src/main/resources/schemas/collectionobjects_naturalhistory.xsd +++ b/services/collectionobject/3rdparty/nuxeo-platform-collectionobject-lifesci/src/main/resources/schemas/collectionobjects_naturalhistory.xsd @@ -33,111 +33,111 @@ --> - - + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - + + - - - - - - - - - - - - + + + + + + + + + + + + - - - + + - - - - - - - - - - - + + + + + + + + + + + - - - + + - - - - - - - - - - - + + + + + + + + + + + - - - + + - - - - - - - - - + + + + + + + + + diff --git a/services/collectionobject/jaxb/src/main/resources/collectionobjects_common.xsd b/services/collectionobject/jaxb/src/main/resources/collectionobjects_common.xsd index e9f8bdd34..3b209b355 100644 --- a/services/collectionobject/jaxb/src/main/resources/collectionobjects_common.xsd +++ b/services/collectionobject/jaxb/src/main/resources/collectionobjects_common.xsd @@ -407,7 +407,7 @@ - + diff --git a/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml b/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml index 01d127ad6..1dd48b19a 100644 --- a/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml +++ b/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml @@ -852,13 +852,10 @@ authRef borrowersAuthorizer - - @@ -81,7 +81,7 @@ - + @@ -94,11 +94,11 @@ - + - + diff --git a/services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeServiceTest.java b/services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeServiceTest.java index 4a5fbbfc1..055323dad 100644 --- a/services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeServiceTest.java +++ b/services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeServiceTest.java @@ -65,6 +65,8 @@ public class IntakeServiceTest extends AbstractServiceTestImpl { private final Logger logger = LoggerFactory.getLogger(IntakeServiceTest.class); /** The known resource id. */ private String knownResourceId = null; + private final static String CURRENT_DATE_UTC = + GregorianCalendarDateTimeUtils.currentDateUTC(); @Override protected CollectionSpaceClient getClientInstance() { @@ -465,7 +467,6 @@ public class IntakeServiceTest extends AbstractServiceTestImpl { // Update the content of this resource. intakeCommons.setEntryNumber("updated-" + intakeCommons.getEntryNumber()); - intakeCommons.setEntryDate("updated-" + intakeCommons.getEntryDate()); if (logger.isDebugEnabled()) { logger.debug("to be updated object"); logger.debug(objectAsXmlString(intakeCommons, IntakesCommon.class)); @@ -507,8 +508,8 @@ public class IntakeServiceTest extends AbstractServiceTestImpl { Assert.assertNotNull(updatedIntake); - Assert.assertEquals(updatedIntake.getEntryDate(), - intakeCommons.getEntryDate(), + Assert.assertEquals(updatedIntake.getEntryNumber(), + intakeCommons.getEntryNumber(), "Data in updated object did not match submitted data."); currentLocationGroupList = updatedIntake.getCurrentLocationGroupList(); @@ -908,7 +909,7 @@ public class IntakeServiceTest extends AbstractServiceTestImpl { protected PoxPayloadOut createInstance(String identifier) { return createIntakeInstance( "entryNumber-" + identifier, - "entryDate-" + identifier, + CURRENT_DATE_UTC, "depositor-" + identifier); } diff --git a/services/loanin/3rdparty/nuxeo-platform-cs-loanin/src/main/resources/schemas/loansin_common.xsd b/services/loanin/3rdparty/nuxeo-platform-cs-loanin/src/main/resources/schemas/loansin_common.xsd index b6ec0d882..6503d151b 100644 --- a/services/loanin/3rdparty/nuxeo-platform-cs-loanin/src/main/resources/schemas/loansin_common.xsd +++ b/services/loanin/3rdparty/nuxeo-platform-cs-loanin/src/main/resources/schemas/loansin_common.xsd @@ -24,13 +24,16 @@ + + - - - + + + + @@ -43,9 +46,24 @@ - + + + + + + + + + + + + + + + diff --git a/services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninServiceTest.java b/services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninServiceTest.java index a101f8823..a2820ff57 100644 --- a/services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninServiceTest.java +++ b/services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninServiceTest.java @@ -34,6 +34,7 @@ import org.collectionspace.services.client.PayloadOutputPart; import org.collectionspace.services.client.PoxPayloadIn; import org.collectionspace.services.client.PoxPayloadOut; import org.collectionspace.services.common.AbstractCommonListUtils; +import org.collectionspace.services.common.datetime.GregorianCalendarDateTimeUtils; import org.collectionspace.services.jaxb.AbstractCommonList; import org.collectionspace.services.loanin.LenderGroup; import org.collectionspace.services.loanin.LenderGroupList; @@ -65,7 +66,9 @@ public class LoaninServiceTest extends AbstractServiceTestImpl { /** The known resource id. */ private String knownResourceId = null; private String LENDER_REF_NAME = - "urn:cspace:org.collectionspace.demo:personauthority:name(TestPersonAuth):person:name(Harry Lender)'Harry Lender'"; + "urn:cspace:org.collectionspace.demo:personauthorities:name(TestPersonAuth):item:name(HarryLender)'Harry Lender'"; + private final static String CURRENT_DATE_UTC = + GregorianCalendarDateTimeUtils.currentDateUTC(); /* (non-Javadoc) * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance() @@ -477,7 +480,6 @@ public class LoaninServiceTest extends AbstractServiceTestImpl { // Update the content of this resource. loaninCommon.setLoanInNumber("updated-" + loaninCommon.getLoanInNumber()); - loaninCommon.setLoanReturnDate("updated-" + loaninCommon.getLoanReturnDate()); loaninCommon.setLoanInNote("updated-" + loaninCommon.getLoanInNote()); if (logger.isDebugEnabled()) { logger.debug("to be updated object"); @@ -513,8 +515,8 @@ public class LoaninServiceTest extends AbstractServiceTestImpl { Assert.assertNotNull(updatedLoaninCommon); // Check selected fields in the updated common part. - Assert.assertEquals(updatedLoaninCommon.getLoanReturnDate(), - loaninCommon.getLoanReturnDate(), + Assert.assertEquals(updatedLoaninCommon.getLoanInNumber(), + loaninCommon.getLoanInNumber(), "Data in updated object did not match submitted data."); if (logger.isDebugEnabled()) { @@ -831,7 +833,7 @@ public class LoaninServiceTest extends AbstractServiceTestImpl { LoansinCommon loaninCommon = new LoansinCommon(); loaninCommon.setLoanInNumber(loaninNumber); - loaninCommon.setLoanReturnDate(returnDate); + loaninCommon.setLoanReturnDate(CURRENT_DATE_UTC); LenderGroupList lenderGroupList = new LenderGroupList(); LenderGroup lenderGroup = new LenderGroup(); lenderGroup.setLender(LENDER_REF_NAME); diff --git a/services/loanin/jaxb/src/main/resources/loansin-common.xsd b/services/loanin/jaxb/src/main/resources/loansin-common.xsd index 9fe86ee67..f330feae4 100644 --- a/services/loanin/jaxb/src/main/resources/loansin-common.xsd +++ b/services/loanin/jaxb/src/main/resources/loansin-common.xsd @@ -27,39 +27,56 @@ --> - + - - + + + + - - + - + - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/services/loanout/3rdparty/nuxeo-platform-cs-loanout/src/main/resources/schemas/loansout_common.xsd b/services/loanout/3rdparty/nuxeo-platform-cs-loanout/src/main/resources/schemas/loansout_common.xsd index 428076085..d29df396f 100644 --- a/services/loanout/3rdparty/nuxeo-platform-cs-loanout/src/main/resources/schemas/loansout_common.xsd +++ b/services/loanout/3rdparty/nuxeo-platform-cs-loanout/src/main/resources/schemas/loansout_common.xsd @@ -23,16 +23,18 @@ + + - + - - - + + + @@ -43,11 +45,11 @@ - + - - - + + + diff --git a/services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutServiceTest.java b/services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutServiceTest.java index 960397b64..e33b8f3e7 100644 --- a/services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutServiceTest.java +++ b/services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutServiceTest.java @@ -33,6 +33,7 @@ import org.collectionspace.services.client.PayloadOutputPart; import org.collectionspace.services.client.PoxPayloadIn; import org.collectionspace.services.client.PoxPayloadOut; import org.collectionspace.services.common.AbstractCommonListUtils; +import org.collectionspace.services.common.datetime.GregorianCalendarDateTimeUtils; import org.collectionspace.services.jaxb.AbstractCommonList; import org.collectionspace.services.loanout.LoanedObjectStatusGroup; import org.collectionspace.services.loanout.LoanedObjectStatusGroupList; @@ -60,6 +61,8 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl { private final Logger logger = LoggerFactory.getLogger(CLASS_NAME); /** The known resource id. */ private String knownResourceId = null; + private final static String CURRENT_DATE_UTC = + GregorianCalendarDateTimeUtils.currentDateUTC(); /* (non-Javadoc) * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance() @@ -436,7 +439,6 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl { // Update the content of this resource. loanoutCommon.setLoanOutNumber("updated-" + loanoutCommon.getLoanOutNumber()); - loanoutCommon.setLoanReturnDate("updated-" + loanoutCommon.getLoanReturnDate()); LoanedObjectStatusGroupList statusGroupList = loanoutCommon.getLoanedObjectStatusGroupList(); Assert.assertNotNull(statusGroupList); List statusGroups = statusGroupList.getLoanedObjectStatusGroup(); @@ -480,8 +482,8 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl { Assert.assertNotNull(updatedLoanoutCommon); // Check selected fields in the updated resource. - Assert.assertEquals(updatedLoanoutCommon.getLoanReturnDate(), - loanoutCommon.getLoanReturnDate(), + Assert.assertEquals(updatedLoanoutCommon.getLoanOutNumber(), + loanoutCommon.getLoanOutNumber(), "Data in updated object did not match submitted data."); LoanedObjectStatusGroupList updatedStatusGroupList = @@ -773,7 +775,7 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl { private PoxPayloadOut createLoanoutInstance(String identifier) { return createLoanoutInstance( "loanoutNumber-" + identifier, - "returnDate-" + identifier); + CURRENT_DATE_UTC); } /** @@ -789,9 +791,9 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl { loanoutCommon.setLoanOutNumber(loanOutNumber); loanoutCommon.setLoanReturnDate(returnDate); loanoutCommon.setBorrower( - "urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'"); + "urn:cspace:org.collectionspace.demo:orgauthorities:name(TestOrgAuth):item:name(NorthernClimesMuseum)'Northern Climes Museum'"); loanoutCommon.setBorrowersContact( - "urn:cspace:org.collectionspace.demo:personauthority:name(TestPersonAuth):person:name(Chris Contact)'Chris Contact'"); + "urn:cspace:org.collectionspace.demo:personauthorities:name(TestPersonAuth):item:name(ChrisContact)'Chris Contact'"); loanoutCommon.setLoanPurpose("Allow people in cold climes to share the magic of Surfboards of the 1960s."); LoanedObjectStatusGroupList statusGroupList = new LoanedObjectStatusGroupList(); List statusGroups = statusGroupList.getLoanedObjectStatusGroup(); diff --git a/services/loanout/jaxb/src/main/resources/loansout-common.xsd b/services/loanout/jaxb/src/main/resources/loansout-common.xsd index 6f69e019f..ce575b2d0 100644 --- a/services/loanout/jaxb/src/main/resources/loansout-common.xsd +++ b/services/loanout/jaxb/src/main/resources/loansout-common.xsd @@ -34,6 +34,8 @@ + + diff --git a/services/location/3rdparty/nuxeo-platform-cs-location/src/main/resources/schemas/locations_common.xsd b/services/location/3rdparty/nuxeo-platform-cs-location/src/main/resources/schemas/locations_common.xsd index 738bf80ab..d0c24796d 100644 --- a/services/location/3rdparty/nuxeo-platform-cs-location/src/main/resources/schemas/locations_common.xsd +++ b/services/location/3rdparty/nuxeo-platform-cs-location/src/main/resources/schemas/locations_common.xsd @@ -49,7 +49,7 @@ - + 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 0f4e44fc3..e6df03a94 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 @@ -34,6 +34,7 @@ import org.collectionspace.services.client.PayloadOutputPart; import org.collectionspace.services.client.PoxPayloadIn; import org.collectionspace.services.client.PoxPayloadOut; import org.collectionspace.services.common.AbstractCommonListUtils; +import org.collectionspace.services.common.datetime.GregorianCalendarDateTimeUtils; import org.collectionspace.services.client.LocationAuthorityClient; import org.collectionspace.services.client.LocationAuthorityClientUtils; import org.collectionspace.services.jaxb.AbstractCommonList; @@ -65,6 +66,8 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { //FI private final Logger logger = LoggerFactory.getLogger(LocationAuthorityServiceTest.class); private final String REFNAME = "refName"; private final String DISPLAYNAME = "displayName"; + private final static String CURRENT_DATE_UTC = + GregorianCalendarDateTimeUtils.currentDateUTC(); @Override public String getServicePathComponent() { @@ -94,7 +97,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl { //FI final String TEST_NAME = "Shelf 1"; final String TEST_SHORTID = "shelf1"; final String TEST_CONDITION_NOTE = "Basically clean"; - final String TEST_CONDITION_NOTE_DATE = "June 11, 1979"; + final String TEST_CONDITION_NOTE_DATE = CURRENT_DATE_UTC; final String TEST_SECURITY_NOTE = "Kind of safe"; final String TEST_ACCESS_NOTE = "Only right-thinkers may see"; final String TEST_ADDRESS = "123 Main Street, Anytown USA"; diff --git a/services/media/3rdparty/nuxeo-platform-cs-media/src/main/resources/schemas/media_common.xsd b/services/media/3rdparty/nuxeo-platform-cs-media/src/main/resources/schemas/media_common.xsd index c8834267a..d3b9f05dc 100644 --- a/services/media/3rdparty/nuxeo-platform-cs-media/src/main/resources/schemas/media_common.xsd +++ b/services/media/3rdparty/nuxeo-platform-cs-media/src/main/resources/schemas/media_common.xsd @@ -107,7 +107,7 @@ - + diff --git a/services/movement/3rdparty/nuxeo-platform-cs-movement/src/main/resources/schemas/movements_common.xsd b/services/movement/3rdparty/nuxeo-platform-cs-movement/src/main/resources/schemas/movements_common.xsd index 5cdf43fcb..21261a2bf 100644 --- a/services/movement/3rdparty/nuxeo-platform-cs-movement/src/main/resources/schemas/movements_common.xsd +++ b/services/movement/3rdparty/nuxeo-platform-cs-movement/src/main/resources/schemas/movements_common.xsd @@ -24,7 +24,7 @@ - + @@ -38,8 +38,8 @@ - - + + diff --git a/services/movement/client/src/test/java/org/collectionspace/services/client/test/MovementServiceTest.java b/services/movement/client/src/test/java/org/collectionspace/services/client/test/MovementServiceTest.java index 2a1065698..d4c8d8b68 100644 --- a/services/movement/client/src/test/java/org/collectionspace/services/client/test/MovementServiceTest.java +++ b/services/movement/client/src/test/java/org/collectionspace/services/client/test/MovementServiceTest.java @@ -69,7 +69,8 @@ public class MovementServiceTest extends AbstractServiceTestImpl { // Instance variables specific to this test. private String knownResourceId = null; - private final static String TIMESTAMP_UTC = GregorianCalendarDateTimeUtils.timestampUTC(); + private final static String CURRENT_DATE_UTC = + GregorianCalendarDateTimeUtils.currentDateUTC(); /* (non-Javadoc) * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance() @@ -307,10 +308,10 @@ public class MovementServiceTest extends AbstractServiceTestImpl { // Check the values of one or more date/time fields. if (logger.isDebugEnabled()) { logger.debug("locationDate=" + movementCommon.getLocationDate()); - logger.debug("TIMESTAMP_UTC=" + TIMESTAMP_UTC); + logger.debug("TIMESTAMP_UTC=" + CURRENT_DATE_UTC); } - Assert.assertTrue(movementCommon.getLocationDate().equals(TIMESTAMP_UTC)); - Assert.assertTrue(movementCommon.getPlannedRemovalDate().equals(TIMESTAMP_UTC)); + Assert.assertTrue(movementCommon.getLocationDate().equals(CURRENT_DATE_UTC)); + Assert.assertTrue(movementCommon.getPlannedRemovalDate().equals(CURRENT_DATE_UTC)); Assert.assertNull(movementCommon.getRemovalDate()); // Check the values of fields containing Unicode UTF-8 (non-Latin-1) characters. @@ -794,7 +795,7 @@ public class MovementServiceTest extends AbstractServiceTestImpl { movementCommon.setCurrentLocation("currentLocation value"); movementCommon.setCurrentLocationFitness("currentLocationFitness value"); movementCommon.setCurrentLocationNote("currentLocationNote value"); - movementCommon.setLocationDate(TIMESTAMP_UTC); + movementCommon.setLocationDate(CURRENT_DATE_UTC); movementCommon.setNormalLocation("normalLocation value"); movementCommon.setMovementContact("movementContact value"); MovementMethodsList movementMethodsList = new MovementMethodsList(); @@ -807,7 +808,7 @@ public class MovementServiceTest extends AbstractServiceTestImpl { movementCommon.setMovementMethods(movementMethodsList); movementCommon.setMovementNote(getUTF8DataFragment()); movementCommon.setMovementReferenceNumber(movementReferenceNumber); - movementCommon.setPlannedRemovalDate(TIMESTAMP_UTC); + movementCommon.setPlannedRemovalDate(CURRENT_DATE_UTC); movementCommon.setRemovalDate(""); // Test empty date value movementCommon.setReasonForMove("reasonForMove value"); @@ -824,70 +825,4 @@ public class MovementServiceTest extends AbstractServiceTestImpl { return multipart; } - // FIXME Should be moved to a common class, as these are general utilities. - // FIXME Should be refactored to become a convenience variant of a - // general method to return a current datestamp or timestamp in any - // provided time zone. - - /** - * Returns an ISO 8601 formatted timestamp of the - * current time instance in the UTC time zone. - */ - public String datestampUTC() { - final String ISO_8601_DATE_FORMAT_PATTERN = "yyyy-MM-dd"; - final DateFormat ISO_8601_DATE_FORMAT = - new SimpleDateFormat(ISO_8601_DATE_FORMAT_PATTERN); - - final String UTC_TIMEZONE_IDENTIFIER = "UTC"; - final TimeZone UTC_TIMEZONE = TimeZone.getTimeZone(UTC_TIMEZONE_IDENTIFIER); - - Date timestamp = new Date(); - return formatDate(timestamp, UTC_TIMEZONE, ISO_8601_DATE_FORMAT); - } - - /** - * Returns an ISO 8601 formatted timestamp of the - * current time instance in the UTC time zone. - */ - public String timestampUTC() { - final String ISO_8601_FORMAT_PATTERN = "yyyy-MM-dd'T'HH:mm:ss'Z'"; - final DateFormat ISO_8601_FORMAT = - new SimpleDateFormat(ISO_8601_FORMAT_PATTERN); - - final String UTC_TIMEZONE_IDENTIFIER = "UTC"; - final TimeZone UTC_TIMEZONE = TimeZone.getTimeZone(UTC_TIMEZONE_IDENTIFIER); - - Date timestamp = new Date(); - return formatDate(timestamp, UTC_TIMEZONE, ISO_8601_FORMAT); - } - - /** - * Formats a provided date using a provided date formatter, - * in the default system time zone. - * - * @param date A date to format. - * @param df A date formatter to apply. - * @return A formatted date string. - */ - public String formatDate(Date date, DateFormat df) { - return formatDate(date, TimeZone.getDefault(), df); - } - - // FIXME Add error handling. - - /** - * Formats a provided date using a provided date formatter, - * in a provided time zone. - * - * @param date A date to format. - * @param tz The time zone qualifier for the date to format. - * @param df A date formatter to apply. - * - * @return A formatted date string. - */ - public String formatDate(Date date, TimeZone tz, DateFormat df) { - df.setTimeZone(tz); - return df.format(date); - } - } diff --git a/services/objectexit/3rdparty/nuxeo-platform-cs-objectexit/src/main/resources/schemas/objectexit_common.xsd b/services/objectexit/3rdparty/nuxeo-platform-cs-objectexit/src/main/resources/schemas/objectexit_common.xsd index 1aef98e8d..d2045e3c5 100644 --- a/services/objectexit/3rdparty/nuxeo-platform-cs-objectexit/src/main/resources/schemas/objectexit_common.xsd +++ b/services/objectexit/3rdparty/nuxeo-platform-cs-objectexit/src/main/resources/schemas/objectexit_common.xsd @@ -1,7 +1,7 @@ - + diff --git a/services/objectexit/jaxb/src/main/resources/objectexit_common.xsd b/services/objectexit/jaxb/src/main/resources/objectexit_common.xsd index c82c14a5c..0fb56d740 100644 --- a/services/objectexit/jaxb/src/main/resources/objectexit_common.xsd +++ b/services/objectexit/jaxb/src/main/resources/objectexit_common.xsd @@ -1,7 +1,7 @@