You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2013/09/22 21:52:28 UTC

svn commit: r1525420 [3/3] - in /manifoldcf/trunk: ./ connectors/sharepoint/ connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/ framework/core/src/main/java/org/apache/manifoldcf/core/common/ framework/pu...

Modified: manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/common/DateParser.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/common/DateParser.java?rev=1525420&r1=1525419&r2=1525420&view=diff
==============================================================================
--- manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/common/DateParser.java (original)
+++ manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/common/DateParser.java Sun Sep 22 19:52:28 2013
@@ -32,29 +32,41 @@ public class DateParser
   {
     if (isoDateValue == null)
       return null;
-    // There are a number of variations on the basic format.
-    // We'll look for key characters to help is determine which is which.
-    StringBuilder isoFormatString = new StringBuilder("yy");
-    if (isoDateValue.length() > 2 && isoDateValue.charAt(2) != '-')
-      isoFormatString.append("yy");
-    isoFormatString.append("-MM-dd'T'HH:mm:ss");
-    if (isoDateValue.indexOf(".") != -1)
-      isoFormatString.append(".SSS");
-    if (isoDateValue.endsWith("Z"))
-      isoFormatString.append("'Z'");
+    
+    boolean isMicrosoft = (isoDateValue.indexOf("T") == -1);
+    
+    String formatString;
+    if (isMicrosoft)
+    {
+      formatString = "yyyy-MM-dd' 'HH:mm:ss";
+    }
     else
     {
-      // We need to be able to parse either "-08:00" or "-0800".  The 'Z' specifier only handles
-      // -0800, unfortunately - see CONNECTORS-700.  So we have to do some hackery to remove the colon.
-      int colonIndex = isoDateValue.lastIndexOf(":");
-      int dashIndex = isoDateValue.lastIndexOf("-");
-      int plusIndex = isoDateValue.lastIndexOf("+");
-      if (colonIndex != -1 &&
-        ((dashIndex != -1 && colonIndex == dashIndex+3 && isNumeral(isoDateValue,dashIndex-1)) || (plusIndex != -1 && colonIndex == plusIndex+3 && isNumeral(isoDateValue,plusIndex-1))))
-        isoDateValue = isoDateValue.substring(0,colonIndex) + isoDateValue.substring(colonIndex+1);
-      isoFormatString.append("Z");      // RFC 822 time, including general time zones
+      // There are a number of variations on the basic format.
+      // We'll look for key characters to help is determine which is which.
+      StringBuilder isoFormatString = new StringBuilder("yy");
+      if (isoDateValue.length() > 2 && isoDateValue.charAt(2) != '-')
+        isoFormatString.append("yy");
+      isoFormatString.append("-MM-dd'T'HH:mm:ss");
+      if (isoDateValue.indexOf(".") != -1)
+        isoFormatString.append(".SSS");
+      if (isoDateValue.endsWith("Z"))
+        isoFormatString.append("'Z'");
+      else
+      {
+        // We need to be able to parse either "-08:00" or "-0800".  The 'Z' specifier only handles
+        // -0800, unfortunately - see CONNECTORS-700.  So we have to do some hackery to remove the colon.
+        int colonIndex = isoDateValue.lastIndexOf(":");
+        int dashIndex = isoDateValue.lastIndexOf("-");
+        int plusIndex = isoDateValue.lastIndexOf("+");
+        if (colonIndex != -1 &&
+          ((dashIndex != -1 && colonIndex == dashIndex+3 && isNumeral(isoDateValue,dashIndex-1)) || (plusIndex != -1 && colonIndex == plusIndex+3 && isNumeral(isoDateValue,plusIndex-1))))
+          isoDateValue = isoDateValue.substring(0,colonIndex) + isoDateValue.substring(colonIndex+1);
+        isoFormatString.append("Z");      // RFC 822 time, including general time zones
+      }
+      formatString = isoFormatString.toString();
     }
-    java.text.DateFormat iso8601Format = new java.text.SimpleDateFormat(isoFormatString.toString());
+    java.text.DateFormat iso8601Format = new java.text.SimpleDateFormat(formatString);
     try
     {
       return iso8601Format.parse(isoDateValue);

Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobManager.java?rev=1525420&r1=1525419&r2=1525420&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobManager.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobManager.java Sun Sep 22 19:52:28 2013
@@ -582,6 +582,7 @@ public interface IJobManager
   *@param legalLinkTypes is the set of legal link types that this connector generates.
   *@param docIDHash is the local document identifier hash value.
   *@param parentIdentifierHash is the optional parent identifier hash value for this document.  Pass null if none.
+  *       MUST be present in the case of carrydown information.
   *@param relationshipType is the optional link type between this document and its parent.  Pass null if there
   *       is no relationship with a parent.
   *@param hopcountMethod is either accurate, nodelete, or neverdelete.
@@ -610,6 +611,7 @@ public interface IJobManager
   *@param docIDHashes are the hashes of the local document identifiers.
   *@param docIDs are the local document identifiers.
   *@param parentIdentifierHash is the optional parent identifier hash of these documents.  Pass null if none.
+  *       MUST be present in the case of carrydown information.
   *@param relationshipType is the optional link type between this document and its parent.  Pass null if there
   *       is no relationship with a parent.
   *@param hopcountMethod is either accurate, nodelete, or neverdelete.

Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IProcessActivity.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IProcessActivity.java?rev=1525420&r1=1525419&r2=1525420&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IProcessActivity.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IProcessActivity.java Sun Sep 22 19:52:28 2013
@@ -33,6 +33,7 @@ public interface IProcessActivity extend
   * fetched the document).
   *@param parentIdentifier is the document identifier that is considered to be the "parent"
   * of this identifier.  May be null, if no hopcount filtering desired for this kind of relationship.
+  * MUST be present in the case of carrydown information.
   *@param relationshipType is the string describing the kind of relationship described by this
   * reference.  This must be one of the strings returned by the IRepositoryConnector method
   * "getRelationshipTypes()".  May be null.
@@ -51,6 +52,7 @@ public interface IProcessActivity extend
   * fetched the document).
   *@param parentIdentifier is the document identifier that is considered to be the "parent"
   * of this identifier.  May be null, if no hopcount filtering desired for this kind of relationship.
+  * MUST be present in the case of carrydown information.
   *@param relationshipType is the string describing the kind of relationship described by this
   * reference.  This must be one of the strings returned by the IRepositoryConnector method
   * "getRelationshipTypes()".  May be null.
@@ -69,6 +71,7 @@ public interface IProcessActivity extend
   * fetched the document).
   *@param parentIdentifier is the document identifier that is considered to be the "parent"
   * of this identifier.  May be null, if no hopcount filtering desired for this kind of relationship.
+  * MUST be present in the case of carrydown information.
   *@param relationshipType is the string describing the kind of relationship described by this
   * reference.  This must be one of the strings returned by the IRepositoryConnector method
   * "getRelationshipTypes()".  May be null.

Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java?rev=1525420&r1=1525419&r2=1525420&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java Sun Sep 22 19:52:28 2013
@@ -3971,7 +3971,8 @@ public class JobManager implements IJobM
   *@param jobID is the job identifier.
   *@param legalLinkTypes is the set of legal link types that this connector generates.
   *@param docIDHashes are the local document identifier hashes.
-  *@param parentIdentifierHash is the optional parent identifier hash of this document.  Pass null if none.
+  *@param parentIdentifierHash is the optional parent identifier hash of this document.  Pass null if none. 
+  *       MUST be present in the case of carrydown information.
   *@param relationshipType is the optional link type between this document and its parent.  Pass null if there
   *       is no relationship with a parent.
   *@param hopcountMethod is the desired method for managing hopcounts.
@@ -4263,6 +4264,7 @@ public class JobManager implements IJobM
   *@param legalLinkTypes is the set of legal link types that this connector generates.
   *@param docIDHash is the local document identifier hash value.
   *@param parentIdentifierHash is the optional parent identifier hash of this document.  Pass null if none.
+  *       MUST be present in the case of carrydown information.
   *@param relationshipType is the optional link type between this document and its parent.  Pass null if there
   *       is no relationship with a parent.
   *@param hopcountMethod is the desired method for managing hopcounts.