From: Patrick Schmitz Date: Tue, 15 Nov 2011 08:22:15 +0000 (+0000) Subject: CSPACE-4395 authority item list results now return termStatus. Also fixed some tests... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=500fb67c4ee1b21529ef0d2e8d375ff6bbab0b3a;p=tmp%2Fjakarta-migration.git CSPACE-4395 authority item list results now return termStatus. Also fixed some tests related to recent date changes. --- diff --git a/services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/CollectionSpaceIntegrationTest.java b/services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/CollectionSpaceIntegrationTest.java index 7b3cf3715..b3fc2ca00 100755 --- a/services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/CollectionSpaceIntegrationTest.java +++ b/services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/CollectionSpaceIntegrationTest.java @@ -39,6 +39,7 @@ import org.collectionspace.services.client.PoxPayloadIn; import org.collectionspace.services.collectionobject.CollectionobjectsCommon; import org.collectionspace.services.collectionobject.TitleGroup; import org.collectionspace.services.collectionobject.TitleGroupList; +import org.collectionspace.services.common.datetime.GregorianCalendarDateTimeUtils; import org.collectionspace.services.intake.IntakesCommon; import org.collectionspace.services.relation.RelationsCommon; import org.collectionspace.services.relation.RelationshipType; @@ -91,8 +92,8 @@ public abstract class CollectionSpaceIntegrationTest { * @param identifier the identifier */ void fillIntake(IntakesCommon theIntake, String identifier) { - fillIntake(theIntake, "entryNumber-" + identifier, "entryDate-" - + identifier); + String CURRENT_DATE_UTC = GregorianCalendarDateTimeUtils.currentDateUTC(); + fillIntake(theIntake, "entryNumber-" + identifier, CURRENT_DATE_UTC); } /** diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/ac1.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/ac1.xml index 31de83477..ae8665103 100755 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/ac1.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/ac1.xml @@ -4,8 +4,8 @@ xmlns:ns2="http://collectionspace.org/services/jaxb" xmlns:ns3="http://collectionspace.org/services/acquisition"> - NEW First Acquisition Date-334 - Second Acquisition Date-1292275630222 + 2010-11-15T07:30:24Z + 2009-10-15T07:30:24Z acquisitionReferenceNumber-1 diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/ac2.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/ac2.xml index 81287aba8..dfa99178c 100755 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/ac2.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/ac2.xml @@ -4,8 +4,8 @@ xmlns:ns2="http://collectionspace.org/services/jaxb" xmlns:ns3="http://collectionspace.org/services/acquisition"> - Second Acquisition Date-1292275631503 - First Acquisition Date -1292275631503 + 2010-11-15T07:30:24Z + 2009-10-15T07:30:24Z acquisitionReferenceNumber-1292275631503 diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/res/ac1.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/res/ac1.res.xml index 7187217b2..da16a0e14 100755 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/res/ac1.res.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/res/ac1.res.xml @@ -4,8 +4,8 @@ acquisitionReferenceNumber-1 -NEW First Acquisition Date-334 -Second Acquisition Date-1292275630222 +2010-11-15T07:30:24Z +2009-10-15T07:30:24Z Donor Acquisition Source-1292275630222 diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/res/ac2.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/res/ac2.res.xml index 21d1a9364..9fa704a36 100755 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/res/ac2.res.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/res/ac2.res.xml @@ -4,8 +4,8 @@ acquisitionReferenceNumber-1292275631503 -Second Acquisition Date-1292275631503 -First Acquisition Date -1292275631503 +2010-11-15T07:30:24Z +2009-10-15T07:30:24Z Museum Acquisition Source-1292275631503 diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/res/ac3.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/res/ac3.res.xml index dd7b7a580..ebe0bbfe8 100755 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/res/ac3.res.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/res/ac3.res.xml @@ -4,8 +4,8 @@ acquisitionReferenceNumber-1292275630222 -First Acquisition Date -1292275630222 -Second Acquisition Date-1292275630222 +2010-11-15T07:30:24Z +2009-10-15T07:30:24Z Donor Acquisition Source-1292275630222 diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/res/GetVocabularyItems.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/res/GetVocabularyItems.res.xml index fe7ab95e3..4a130df47 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/res/GetVocabularyItems.res.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/res/GetVocabularyItems.res.xml @@ -6,26 +6,29 @@ 0 3 3 - csid|uri|updatedAt|displayName|shortIdentifier|refName|order + csid|uri|updatedAt|order|displayName|shortIdentifier|refName|termStatus ${Item3DupeOrder.displayName} ${Item3DupeOrder.itemID} ${Item3DupeOrder.order} /vocabularies/${Vocabulary1.CSID}/items/${Item3DupeOrder.CSID} - ${Item3DupeOrder.CSID} + ${Item3DupeOrder.CSID} + ${Item2.displayName} ${Item2.itemID} ${Item2.order} /vocabularies/${Vocabulary1.CSID}/items/${Item2.CSID} - ${Item2.CSID} + ${Item2.CSID} + ${Item1.displayName} ${Item1.itemID} ${Item1.order} /vocabularies/${Vocabulary1.CSID}/items/${Item1.CSID} - ${Item1.CSID} + ${Item1.CSID} + diff --git a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java index 090e77aa4..799a9e494 100644 --- a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java +++ b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java @@ -35,6 +35,7 @@ import org.collectionspace.services.common.api.Tools; import org.collectionspace.services.common.context.MultipartServiceContext; import org.collectionspace.services.common.context.ServiceBindingUtils; import org.collectionspace.services.common.context.ServiceContext; +import org.collectionspace.services.common.document.DocumentException; import org.collectionspace.services.common.document.DocumentWrapper; import org.collectionspace.services.common.document.DocumentWrapperImpl; import org.collectionspace.services.common.relation.IRelationsManager; @@ -45,6 +46,7 @@ import org.collectionspace.services.common.vocabulary.AuthorityJAXBSchema; import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema; import org.collectionspace.services.common.vocabulary.RefNameServiceUtils; import org.collectionspace.services.nuxeo.client.java.DocHandlerBase; +import org.collectionspace.services.common.service.ListResultField; import org.collectionspace.services.nuxeo.util.NuxeoUtils; import org.collectionspace.services.relation.RelationResource; import org.collectionspace.services.relation.RelationsCommon; @@ -119,6 +121,57 @@ public abstract class AuthorityItemDocumentModelHandler this.authorityRefNameBase = value; } + @Override + public List getListItemsArray() throws DocumentException { + List list = super.getListItemsArray(); + int nFields = list.size(); + // Ensure some common fields so do not depend upon config for general logic + boolean hasDisplayName = false; + boolean hasShortId = false; + boolean hasRefName = false; + boolean hasTermStatus = false; + for(int i=0;i - - displayName - displayName - - - shortIdentifier - shortIdentifier - - - refName - refName - + order order @@ -1650,18 +1639,7 @@ - - displayName - displayName - - - shortIdentifier - shortIdentifier - - - refName - refName - + @@ -1833,18 +1811,7 @@ - - displayName - displayName - - - shortIdentifier - shortIdentifier - - - refName - refName - + @@ -2044,18 +2011,7 @@ - - displayName - displayName - - - shortIdentifier - shortIdentifier - - - refName - refName - + @@ -2192,18 +2148,7 @@ - - displayName - displayName - - - shortIdentifier - shortIdentifier - - - refName - refName - +