]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5956: Emit correct <uri> values in list results when doing wildcarded searches...
authorAron Roberts <aron@socrates.berkeley.edu>
Fri, 5 Apr 2013 22:08:08 +0000 (15:08 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Fri, 5 Apr 2013 22:08:08 +0000 (15:08 -0700)
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java

index 55e47c916465c993ea327a5245a1cbc14b90a860..2ab24a84208d82bb7e43cd2449c7251833c43380 100644 (file)
@@ -88,6 +88,7 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
      * 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<AICommon>
     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);