]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5381 Added refinements to only consider relations that are not soft deleted.
authorPatrick Schmitz <pschmitz@berkeley.edu>
Tue, 24 Jul 2012 23:03:48 +0000 (16:03 -0700)
committerPatrick Schmitz <pschmitz@berkeley.edu>
Tue, 24 Jul 2012 23:03:48 +0000 (16:03 -0700)
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/DocHandlerBase.java
services/common/src/main/java/org/collectionspace/services/nuxeo/util/NuxeoUtils.java

index c8f4efbc7566775d6bc13fa3b4cf0587a0ae40e9..a709869179fa32b8518929359ac85841cc1ead63 100644 (file)
@@ -79,7 +79,7 @@ public abstract class DocHandlerBase<T> extends RemoteDocumentModelHandlerImpl<T
     protected static final String STANDARD_LIST_URI_FIELD = CollectionSpaceClient.COLLECTIONSPACE_CORE_URI;\r
     protected static final String STANDARD_LIST_UPDATED_AT_FIELD = CollectionSpaceClient.COLLECTIONSPACE_CORE_UPDATED_AT;\r
     protected static final String STANDARD_LIST_WORKFLOW_FIELD = CollectionSpaceClient.COLLECTIONSPACE_CORE_WORKFLOWSTATE;\r
-    protected static final String STANDARD_LIST_MARK_RT_FIELD = "relTo";\r
+    protected static final String STANDARD_LIST_MARK_RT_FIELD = "related";\r
 \r
     @Override\r
     public AbstractCommonList getCommonPartList() {\r
@@ -242,7 +242,9 @@ public abstract class DocHandlerBase<T> extends RemoteDocumentModelHandlerImpl<T
                                item.put(STANDARD_LIST_CSID_FIELD, id);\r
                        if(markRtSbj!=null) {\r
                            String relationClause = RelationsUtils.buildWhereClause(markRtSbj, null, null, id, null);\r
-                           QueryContext queryContext = new QueryContext(sc, relationClause);\r
+                           String whereClause = relationClause + IQueryManager.SEARCH_QUALIFIER_AND + \r
+                                                                       NuxeoUtils.buildWorkflowNotDeletedWhereClause();\r
+                           QueryContext queryContext = new QueryContext(sc, whereClause);\r
                            queryContext.setDocType(IRelationsManager.DOC_TYPE);\r
                            String query = NuxeoUtils.buildNXQLQuery(sc, queryContext);\r
                            // Search for 1 relation that matches. 1 is enough to fail the filter\r
index b18bdf78a21af7389d13effca3243f119864db22..a3ed9fb36b76fe24bbe5c085fb26db79424295cf 100644 (file)
@@ -400,6 +400,10 @@ public class NuxeoUtils {
         return query.toString();
     }
     
+    static public final String buildWorkflowNotDeletedWhereClause() {
+       return "ecm:currentLifeCycleState <> 'deleted'";
+    }
+    
     
     /**
      * Builds an NXQL SELECT query across multiple document types.