]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5300 - Fix problem with CMIS calls. Document type must have schemas declared.
authorPatrick Schmitz <pschmitz@berkeley.edu>
Fri, 22 Jun 2012 16:49:49 +0000 (09:49 -0700)
committerPatrick Schmitz <pschmitz@berkeley.edu>
Fri, 22 Jun 2012 16:49:49 +0000 (09:49 -0700)
3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/core-types-contrib.xml
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RepositoryJavaClientImpl.java
services/servicegroup/service/src/main/java/org/collectionspace/services/servicegroup/nuxeo/ServiceGroupDocumentModelHandler.java

index a6f879e491ec640a898bd72ec94a52cf8b33beb9..8be0f16199d9c5be60ea6eafdf643c147b1aee6d 100644 (file)
@@ -6,6 +6,9 @@
   </extension>
   <extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
     <doctype name="CollectionSpaceDocument" extends="Document">
+      <schema name="common"/>
+      <schema name="dublincore"/>
+      <schema name="collectionspace_core"/>
     </doctype>
   </extension>  
   <extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
index bf058c070de0c2199d1e44f6f1a33e78ee398f5b..99d590ee7f5ed3624854fc87af9356072fa14bd0 100644 (file)
@@ -532,6 +532,9 @@ public class RepositoryJavaClientImpl implements RepositoryClient<PoxPayloadIn,
 
         DocumentFilter filter = handler.getDocumentFilter();
         String oldOrderBy = filter.getOrderByClause();
+        if (isClauseEmpty(oldOrderBy) == true){
+            filter.setOrderByClause(DocumentFilter.ORDER_BY_LAST_UPDATED);
+        }
         QueryContext queryContext = new QueryContext(ctx, handler);
 
         try {
@@ -541,15 +544,10 @@ public class RepositoryJavaClientImpl implements RepositoryClient<PoxPayloadIn,
             }
             DocumentModelList docList = null;
                if (handler.isCMISQuery() == true) {
-                       // We have to omit the ORDER BY until we can get the "Document" table bug addressed.
-                       // CF Nuxeo JIRA NXP-9562
                        String inList = buildInListForDocTypes(docTypes);
                        ctx.getQueryParams().add(IQueryManager.SEARCH_RELATED_MATCH_OBJ_DOCTYPES, inList);
                        docList = getFilteredCMIS(repoSession, ctx, handler, queryContext);
             } else {
-                if (isClauseEmpty(oldOrderBy) == true){
-                    filter.setOrderByClause(DocumentFilter.ORDER_BY_LAST_UPDATED);
-                }
                 String query = NuxeoUtils.buildNXQLQuery(docTypes, queryContext);
                 if (logger.isDebugEnabled()) {
                     logger.debug("findDocs() NXQL: "+query);
index 3000a18737358196dbf049c5e5dff25f489234ea..b32601512d0fa6eb89084093d1fb6a2774471704 100644 (file)
@@ -124,7 +124,7 @@ public class ServiceGroupDocumentModelHandler
                }
                
                // This should be "Document" but CMIS is gagging on that right now.
-               ctx.getQueryParams().add(IQueryManager.SELECT_DOC_TYPE_FIELD, "cmis:document");
+               ctx.getQueryParams().add(IQueryManager.SELECT_DOC_TYPE_FIELD, "CollectionSpaceDocument");
                
                // Now we have to issue the search
                // findDocs qill build a QueryContext, which wants to see a docType for our context