From: Aron Roberts Date: Fri, 5 Apr 2013 22:08:08 +0000 (-0700) Subject: CSPACE-5956: Emit correct values in list results when doing wildcarded searches... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=93b08d65bbf0270874e11376099489b448ed9fc6;p=tmp%2Fjakarta-migration.git CSPACE-5956: Emit correct values in list results when doing wildcarded searches (using the _ALL_ convention) across multiple authorities. --- 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 55e47c916..2ab24a842 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 @@ -88,6 +88,7 @@ public abstract class AuthorityItemDocumentModelHandler * inVocabulary is the parent Authority for this context */ protected String inAuthority = null; + protected boolean wildcardedAuthorityRequest = false; protected String authorityRefNameBase = null; // Used to determine when the displayName changes as part of the update. protected String oldDisplayNameOnUpdate = null; @@ -163,7 +164,12 @@ public abstract class AuthorityItemDocumentModelHandler public String getUri(DocumentModel docModel) { // Laramie20110510 CSPACE-3932 String authorityServicePath = getAuthorityServicePath(); - if(inAuthority==null) { // Only happens on queries to wildcarded authorities + if(inAuthority==null) { // Only true with the first document model received, on queries to wildcarded authorities + wildcardedAuthorityRequest = true; + } + // If this search crosses multiple authorities, get the inAuthority value + // from each record, rather than using the cached value from the first record + if(wildcardedAuthorityRequest) { try { inAuthority = (String) docModel.getProperty(authorityItemCommonSchemaName, AuthorityItemJAXBSchema.IN_AUTHORITY);