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
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
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
// 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
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
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