]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-3771, CSPACE-4791 refObjs call did not support wf_deleted filter, so was not...
authorPatrick Schmitz <pschmitz@berkeley.edu>
Sat, 9 Jun 2012 03:58:02 +0000 (20:58 -0700)
committerPatrick Schmitz <pschmitz@berkeley.edu>
Sat, 9 Jun 2012 03:58:02 +0000 (20:58 -0700)
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java
services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java

index c1b3cdad8230083b3c81d214d5ae2c730b4e3308..0cb449c1372250ab155118a5a202a5b717879364 100644 (file)
@@ -459,7 +459,7 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
                         serviceTypes,
                         refName,
                         propertyName,
-                        myFilter.getPageSize(), myFilter.getStartPage(), true /*computeTotal*/);
+                        myFilter, true /*computeTotal*/);
                } catch (PropertyException pe) {
                        throw pe;
                } catch (DocumentException de) {
index 5e01c243026f03bf0a72ce8dda352d979c2a0c16..c793447490b7b6ab489741c9f640646fe4bdfac1 100644 (file)
@@ -54,6 +54,7 @@ import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.common.config.TenantBindingConfigReaderImpl;\r
 import org.collectionspace.services.common.context.ServiceBindingUtils;\r
 import org.collectionspace.services.common.document.DocumentException;\r
+import org.collectionspace.services.common.document.DocumentFilter;\r
 import org.collectionspace.services.common.document.DocumentNotFoundException;\r
 import org.collectionspace.services.common.document.DocumentUtils;\r
 import org.collectionspace.services.common.document.DocumentWrapper;\r
@@ -214,10 +215,12 @@ public class RefNameServiceUtils {
             List<String> serviceTypes,\r
             String refName,\r
             String refPropName,\r
-            int pageSize, int pageNum, boolean computeTotal)\r
+            DocumentFilter filter, boolean computeTotal)\r
                        throws DocumentException, DocumentNotFoundException {\r
        AuthorityRefDocList wrapperList = new AuthorityRefDocList();\r
         AbstractCommonList commonList = (AbstractCommonList) wrapperList;\r
+        int pageNum = filter.getStartPage();\r
+        int pageSize = filter.getPageSize(); \r
         commonList.setPageNum(pageNum);\r
         commonList.setPageSize(pageSize);\r
         List<AuthorityRefDocList.AuthorityRefDocItem> list =\r
@@ -229,7 +232,8 @@ public class RefNameServiceUtils {
         RepositoryJavaClientImpl nuxeoRepoClient = (RepositoryJavaClientImpl)repoClient;\r
        try {\r
                DocumentModelList docList = findAuthorityRefDocs(ctx, repoClient, repoSession,\r
-                               serviceTypes, refName, refPropName, queriedServiceBindings, authRefFieldsByService, pageSize, pageNum, computeTotal);\r
+                               serviceTypes, refName, refPropName, queriedServiceBindings, authRefFieldsByService,\r
+                               filter.getWhereClause(), pageSize, pageNum, computeTotal);\r
        \r
                if (docList == null) { // found no authRef fields - nothing to process\r
                    return wrapperList;\r
@@ -302,7 +306,7 @@ public class RefNameServiceUtils {
                        // reliable (stateless).\r
                        DocumentModelList docList = findAuthorityRefDocs(ctx, repoClient, repoSession,\r
                                        getRefNameServiceTypes(), oldRefName, refPropName,\r
-                                       queriedServiceBindings, authRefFieldsByService, pageSize, 0, false);\r
+                                       queriedServiceBindings, authRefFieldsByService, null, pageSize, 0, false);\r
                \r
                        if((docList == null)                    // found no authRef fields - nothing to do\r
                                || (docList.size() == 0)) {     // No more to handle\r
@@ -340,6 +344,7 @@ public class RefNameServiceUtils {
             String refPropName,\r
             Map<String, ServiceBindingType> queriedServiceBindings,\r
             Map<String, List<AuthRefConfigInfo>> authRefFieldsByService,\r
+            String whereClauseAdditions,\r
             int pageSize, int pageNum, boolean computeTotal) throws DocumentException, DocumentNotFoundException {\r
 \r
         // Get the service bindings for this tenant\r
@@ -361,6 +366,10 @@ public class RefNameServiceUtils {
         if (query == null) { // found no authRef fields - nothing to query\r
             return null;\r
         }\r
+        // Additional qualifications, like workflow state\r
+        if(whereClauseAdditions!=null) {\r
+               query += " AND " + whereClauseAdditions;\r
+        }\r
         // Now we have to issue the search\r
         RepositoryJavaClientImpl nuxeoRepoClient = (RepositoryJavaClientImpl)repoClient;\r
         DocumentWrapper<DocumentModelList> docListWrapper = nuxeoRepoClient.findDocs(ctx, repoSession,\r