From 93b08d65bbf0270874e11376099489b448ed9fc6 Mon Sep 17 00:00:00 2001 From: Aron Roberts Date: Fri, 5 Apr 2013 15:08:08 -0700 Subject: [PATCH] CSPACE-5956: Emit correct values in list results when doing wildcarded searches (using the _ALL_ convention) across multiple authorities. --- .../nuxeo/AuthorityItemDocumentModelHandler.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); -- 2.47.3