]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5943: Restrict results returned by inAuthority value. Minor updates to comments.
authorAron Roberts <aron@socrates.berkeley.edu>
Tue, 2 Apr 2013 01:00:05 +0000 (18:00 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Tue, 2 Apr 2013 01:00:05 +0000 (18:00 -0700)
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RepositoryJavaClientImpl.java

index 5f1eeef91c06156897c4f19e350b1a8f010dfe20..ddd4a7708bde17ee5cfbb78190fd4c3f9e8b0a11 100644 (file)
@@ -690,16 +690,20 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
     
     // By convention, the name of the database table that contains
     // repeatable term information group records is derivable from
-    // an XPath base value by removing a suffix and converting to lowercase
+    // an existing XPath base value, by removing a suffix and converting
+    // to lowercase
     protected String getTermGroupTableName() {
         String termInfoGroupListName = getItemTermInfoGroupXPathBase();
         return termInfoGroupListName.substring(0, termInfoGroupListName.lastIndexOf(LIST_SUFFIX)).toLowerCase();
     }
     
     protected String getInAuthorityValue() {
-        // FIXME: Replace this placeholder / stub with actual code
-        // to obtain the relevant inAuthority value
-        return AuthorityResource.PARENT_WILDCARD;
+        String inAuthorityValue = getInAuthority();
+        if (Tools.notBlank(inAuthorityValue)) {
+            return inAuthorityValue;
+        } else {
+            return AuthorityResource.PARENT_WILDCARD;
+        }
     }
     
     @Override
index ccbed7a5a62cbc53cdaa19f11f013b00c1ab05ba..ea900db807e77f07c25bab6977a022964d6fb1c8 100644 (file)
@@ -923,8 +923,8 @@ public class RepositoryJavaClientImpl implements RepositoryClient<PoxPayloadIn,
         
         // FIXME: Resolve how to handle the case where the partial term
         // query parameter is included in the request, but has been given an
-        // empty (blank) value. Then implement that here, if current behavior
-        // does not match the required behavior.
+        // empty (blank) value ("...?pt=") Then implement the required
+        // behavior here, if current behavior does not match what is required.
         //
         // (We're currently returning all records in that case.)
        
@@ -967,6 +967,7 @@ public class RepositoryJavaClientImpl implements RepositoryClient<PoxPayloadIn,
         // FIXME: Get this value from an existing constant, if available
         final String USER_SUPPLIED_WILDCARD = "*";
         partialTerm = handleProvidedLeadingWildcard(partialTerm, USER_SUPPLIED_WILDCARD);
+        // Automatically insert a trailing wildcard
         params.add(partialTerm + JDBCTools.SQL_WILDCARD); // Value for replaceable parameter 1 in the query
         
         // Restrict the query to filter out deleted records, if requested