Author: kwright
Date: Sun Sep 22 18:31:34 2013
New Revision: 1525412
URL: http://svn.apache.org/r1525412
Log:
Get attachment crawling working
Modified:
manifoldcf/branches/CONNECTORS-778/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java
manifoldcf/branches/CONNECTORS-778/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
manifoldcf/branches/CONNECTORS-778/framework/core/src/main/java/org/apache/manifoldcf/core/common/DateParser.java
Modified:
manifoldcf/branches/CONNECTORS-778/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java
URL:
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-778/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java?rev=1525412&r1=1525411&r2=1525412&view=diff
==============================================================================
---
manifoldcf/branches/CONNECTORS-778/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java
(original)
+++
manifoldcf/branches/CONNECTORS-778/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java
Sun Sep 22 18:31:34 2013
@@ -1556,8 +1556,6 @@ public class SPSProxyHelper {
listCall.getAttachmentCollection( listName, itemID );
org.apache.axis.message.MessageElement[] List = listResponse.get_any();
- System.out.println(List[0].toString());
-
XMLDoc doc = new XMLDoc( List[0].toString() );
ArrayList nodeList = new ArrayList();
Modified:
manifoldcf/branches/CONNECTORS-778/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
URL:
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-778/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java?rev=1525412&r1=1525411&r2=1525412&view=diff
==============================================================================
---
manifoldcf/branches/CONNECTORS-778/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
(original)
+++
manifoldcf/branches/CONNECTORS-778/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
Sun Sep 22 18:31:34 2013
@@ -792,10 +792,10 @@ public class SharePointRepository extend
if (modifiedDate != null)
{
// Item has a modified date so we presume it exists.
-
+
Date modifiedDateValue =
DateParser.parseISO8601Date(modifiedDate);
Date createdDateValue =
DateParser.parseISO8601Date(createdDate);
-
+
// Build version string
String versionToken = modifiedDate;
@@ -873,12 +873,20 @@ public class SharePointRepository extend
url = null;
// If we have no modified or created date, it means that the
parent has gone away, so we go away too.
- if (modifiedDate != null && createdDate != null && url != null)
+ if (modifiedDate != null && url != null)
{
// Item has a modified date so we presume it exists.
- Date modifiedDateValue = new Date(new
Long(modifiedDate).longValue());
- Date createdDateValue = new Date(new
Long(createdDate).longValue());
+ Date modifiedDateValue;
+ if (modifiedDate != null)
+ modifiedDateValue = new Date(new
Long(modifiedDate).longValue());
+ else
+ modifiedDateValue = null;
+ Date createdDateValue;
+ if (createdDate != null)
+ createdDateValue = new Date(new
Long(createdDate).longValue());
+ else
+ createdDateValue = null;
// Build version string
String versionToken = modifiedDate;
@@ -910,7 +918,7 @@ public class SharePointRepository extend
{
// Can't look up list ID, which means the list is gone, so
delete
if (Logging.connectors.isDebugEnabled())
- Logging.connectors.debug("SharePoint: Can't get version of
'"+documentIdentifier+"' because created date, modified data, or attachment url
not found");
+ Logging.connectors.debug("SharePoint: Can't get version of
'"+documentIdentifier+"' because modified date or attachment url not found");
rval[i] = null;
}
}
@@ -1510,7 +1518,7 @@ public class SharePointRepository extend
startPosition =
unpackList(denyTokens,version,startPosition,'+');
startPosition = unpackDate(version,startPosition,modifiedDate);
startPosition = unpackDate(version,startPosition,createdDate);
-
+
if (modifiedDate.getTime() == 0L)
modifiedDate = null;
if (createdDate.getTime() == 0L)
Modified:
manifoldcf/branches/CONNECTORS-778/framework/core/src/main/java/org/apache/manifoldcf/core/common/DateParser.java
URL:
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-778/framework/core/src/main/java/org/apache/manifoldcf/core/common/DateParser.java?rev=1525412&r1=1525411&r2=1525412&view=diff
==============================================================================
---
manifoldcf/branches/CONNECTORS-778/framework/core/src/main/java/org/apache/manifoldcf/core/common/DateParser.java
(original)
+++
manifoldcf/branches/CONNECTORS-778/framework/core/src/main/java/org/apache/manifoldcf/core/common/DateParser.java
Sun Sep 22 18:31:34 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);