manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1630148 - /manifoldcf/branches/CONNECTORS-1067/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java
Date Wed, 08 Oct 2014 15:45:25 GMT
Author: kwright
Date: Wed Oct  8 15:45:24 2014
New Revision: 1630148

URL: http://svn.apache.org/r1630148
Log:
update wiki connector

Modified:
    manifoldcf/branches/CONNECTORS-1067/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java

Modified: manifoldcf/branches/CONNECTORS-1067/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1067/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java?rev=1630148&r1=1630147&r2=1630148&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1067/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java
(original)
+++ manifoldcf/branches/CONNECTORS-1067/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java
Wed Oct  8 15:45:24 2014
@@ -3866,13 +3866,39 @@ public class WikiConnector extends org.a
               String comment = t.getComment();
               String title = t.getTitle();
               String lastModified = t.getLastModified();
+              Date modifiedDate = (lastModified==null)?null:DateParser.parseISO8601Date(lastModified);
+              String contentType = "text/plain";
+              dataSize = contentFile.length();
+
+              if (!activities.checkURLIndexable(fullURL))
+              {
+                activities.noDocument(documentIdentifier,documentVersion);
+                return;
+              }
+              
+              if (!activities.checkLengthIndexable(dataSize))
+              {
+                activities.noDocument(documentIdentifier,documentVersion);
+                return;
+              }
+              
+              if (!activities.checkMimeTypeIndexable(contentType))
+              {
+                activities.noDocument(documentIdentifier,documentVersion);
+                return;
+              }
+              
+              if (!activities.checkDateIndexable(modifiedDate))
+              {
+                activities.noDocument(documentIdentifier,documentVersion);
+                return;
+              }
               
               RepositoryDocument rd = new RepositoryDocument();
               
               // For wiki, type is always text/plain
-              rd.setMimeType("text/plain");
+              rd.setMimeType(contentType);
               
-              dataSize = contentFile.length();
               InputStream is = new FileInputStream(contentFile);
               try
               {
@@ -3886,7 +3912,7 @@ public class WikiConnector extends org.a
                 if (lastModified != null)
                 {
                   rd.addField("last-modified",lastModified);
-                  rd.setModifiedDate(DateParser.parseISO8601Date(lastModified));
+                  rd.setModifiedDate(modifiedDate);
                 }
 
                 if (allowACL != null && allowACL.length > 0) {



Mime
View raw message