]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5119,CSPACE-5135,CSPACE-5138: More list tests now pass in Person service.
authorAron Roberts <aron@socrates.berkeley.edu>
Wed, 2 May 2012 21:10:56 +0000 (14:10 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Wed, 2 May 2012 21:10:56 +0000 (14:10 -0700)
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java
services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml

index 946bf848b397208bea0a3db79696782f4f177601..ed3bfba73069e6e3377f3798ef4cb668d49b2f7a 100644 (file)
@@ -432,9 +432,8 @@ public abstract class AuthorityResource<AuthCommon, AuthItemHandler>
             // be on the displayName field
             String sortBy = queryParams.getFirst(IClientQueryParams.SORT_BY_PARAM);
             if (sortBy == null || sortBy.isEmpty()) {
-                // String qualifiedDisplayNameField = authorityCommonSchemaName + ":"
-                //         + AuthorityItemJAXBSchema.DISPLAY_NAME;
-                String qualifiedDisplayNameField = getQualifiedDisplayNameField();
+                String qualifiedDisplayNameField = authorityCommonSchemaName + ":"
+                        + AuthorityItemJAXBSchema.DISPLAY_NAME;
                 myFilter.setOrderByClause(qualifiedDisplayNameField);
             }
             String nameQ = queryParams.getFirst("refName");
@@ -448,10 +447,6 @@ public abstract class AuthorityResource<AuthCommon, AuthItemHandler>
         }
     }
     
-    protected String getQualifiedDisplayNameField() {
-        return NuxeoUtils.getPrimaryXPathPropertyName(authorityCommonSchemaName, 
-                getItemTermInfoGroupXPathBase(), AuthorityItemJAXBSchema.TERM_DISPLAY_NAME);
-    }
 
     /**
      * Update authority.
@@ -677,7 +672,12 @@ public abstract class AuthorityResource<AuthCommon, AuthItemHandler>
             String keywords = queryParams.getFirst(IQueryManager.SEARCH_TYPE_KEYWORDS_KW);
             String advancedSearch = queryParams.getFirst(IQueryManager.SEARCH_TYPE_KEYWORDS_AS);
 
-            String qualifiedDisplayNameField = getQualifiedDisplayNameField();
+            String qualifiedDisplayNameField = 
+                    authorityItemCommonSchemaName + ":" + getItemTermInfoGroupXPathBase()
+                        + "/0/" + AuthorityItemJAXBSchema.TERM_DISPLAY_NAME;
+
+                    // NuxeoUtils.getPrimaryXPathPropertyName(authorityItemCommonSchemaName, 
+                    //     getItemTermInfoGroupXPathBase(), AuthorityItemJAXBSchema.TERM_DISPLAY_NAME);
 
             // Note that docType defaults to the ServiceName, so we're fine with that.
             ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = null;
@@ -730,7 +730,8 @@ public abstract class AuthorityResource<AuthCommon, AuthItemHandler>
             }
             if (logger.isDebugEnabled()) {
                 logger.debug("getAuthorityItemList filtered WHERE clause: "
-                        + myFilter.getWhereClause());
+                        + myFilter.getWhereClause() 
+                        + " and ORDER BY clause: " + myFilter.getOrderByClause());
             }
             getRepositoryClient(ctx).getFiltered(ctx, handler);
             return (AbstractCommonList) handler.getCommonPartList();
index 506d4a31d0bd2eac0463fe9ef48065946c676671..ad85f2a2e5edf9768b19e0d867eb5b63308cd721 100644 (file)
@@ -169,7 +169,7 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
             field = new ListResultField();
             field.setElement(AuthorityItemJAXBSchema.TERM_DISPLAY_NAME);
             field.setXpath(NuxeoUtils.getPrimaryXPathPropertyName(
-                    null, getItemTermInfoGroupXPathBase(), AuthorityItemJAXBSchema.TERM_DISPLAY_NAME));
+                    authorityItemCommonSchemaName, getItemTermInfoGroupXPathBase(), AuthorityItemJAXBSchema.TERM_DISPLAY_NAME));
             // field.setXpath(AuthorityItemJAXBSchema.DISPLAY_NAME);
             list.add(field);
         }
@@ -189,7 +189,7 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
             field = new ListResultField();
             field.setElement(AuthorityItemJAXBSchema.TERM_STATUS);
             field.setXpath(NuxeoUtils.getPrimaryXPathPropertyName(
-                    null, getItemTermInfoGroupXPathBase(), AuthorityItemJAXBSchema.TERM_STATUS));
+                    authorityItemCommonSchemaName, getItemTermInfoGroupXPathBase(), AuthorityItemJAXBSchema.TERM_STATUS));
             // field.setXpath(AuthorityItemJAXBSchema.TERM_STATUS);
             list.add(field);
         }
index a18cd2bdfb921decd4ef51a5e5ddb9ece8dec21c..7abf3e7ffe0e3c43b23b535a0f36301650cfcefd 100644 (file)
                                        <!-- Omit the standard AuthorityItem items (they are handled by the code) -->
             <service:ListResultField>
               <service:element>foreName</service:element>
-              <service:xpath>foreName</service:xpath>
+              <service:xpath>personTermGroupList/[0]/foreName</service:xpath>
             </service:ListResultField>
             <service:ListResultField>
               <service:element>surName</service:element>
-              <service:xpath>surName</service:xpath>
+              <service:xpath>personTermGroupList/[0]/surName</service:xpath>
             </service:ListResultField>
           </service:ListResultsFields>
         </service:params>