manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1617312 - in /manifoldcf/trunk: ./ connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/ framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/connectors/
Date Mon, 11 Aug 2014 16:03:32 GMT
Author: kwright
Date: Mon Aug 11 16:03:31 2014
New Revision: 1617312

URL: http://svn.apache.org/r1617312
Log:
Fix for CONNECTORS-1007.

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
    manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/connectors/BaseRepositoryConnector.java

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1617312&r1=1617311&r2=1617312&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Mon Aug 11 16:03:31 2014
@@ -5,6 +5,9 @@ $Id$
 
 ======================= Release 1.7 =====================
 
+CONNECTORS-1007: Fix CMIS connector so that tests pass.
+(Karl Wright)
+
 CONNECTORS-1006: Update googledrive API to latest released version.
 (Karl Wright)
 

Modified: manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java?rev=1617312&r1=1617311&r2=1617312&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
(original)
+++ manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
Mon Aug 11 16:03:31 2014
@@ -1064,7 +1064,7 @@ public class CmisRepositoryConnector ext
 
     getSession();
     Logging.connectors.debug("CMIS: Inside processDocuments");
-        
+    
     String cmisQuery = StringUtils.EMPTY;
     for (int i = 0; i < spec.getChildCount(); i++)
     {
@@ -1112,7 +1112,13 @@ public class CmisRepositoryConnector ext
           // content ingestion
 
           Document document = (Document) cmisObject;
-          document = document.getObjectOfLatestVersion(false);
+          try {
+            document = document.getObjectOfLatestVersion(false);
+          } catch (CmisObjectNotFoundException e) {
+            // Document gone
+            activities.deleteDocument(nodeId);
+            continue;
+          }
           long fileLength = document.getContentStreamLength();
           InputStream is = null;
           
@@ -1323,7 +1329,12 @@ public class CmisRepositoryConnector ext
 
         //we have to check if this CMIS repository support versioning
         // or if the versioning is disabled for this content
-        document = document.getObjectOfLatestVersion(false);
+        try {
+          document = document.getObjectOfLatestVersion(false);
+        } catch (CmisObjectNotFoundException e) {
+          rval[i] = null;
+          continue;
+        }
         if(StringUtils.isNotEmpty(document.getVersionLabel())){
           rval[i] = document.getVersionLabel() + ":" + cmisQuery;
         } else {

Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/connectors/BaseRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/connectors/BaseRepositoryConnector.java?rev=1617312&r1=1617311&r2=1617312&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/connectors/BaseRepositoryConnector.java
(original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/connectors/BaseRepositoryConnector.java
Mon Aug 11 16:03:31 2014
@@ -645,7 +645,8 @@ public abstract class BaseRepositoryConn
       else
         versionStrings[i] = vc.getVersionString();
     }
-    processDocuments(documentIdentifiers,versionStrings,activities,spec,scanOnly,jobMode);
+    if (spec != null)
+      processDocuments(documentIdentifiers,versionStrings,activities,spec,scanOnly,jobMode);
   }
 
   /** Process a set of documents.



Mime
View raw message