manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1525382 - in /manifoldcf/branches/CONNECTORS-778/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint: SPSProxyHelper.java SharePointRepository.java
Date Sun, 22 Sep 2013 15:46:52 GMT
Author: kwright
Date: Sun Sep 22 15:46:52 2013
New Revision: 1525382

URL: http://svn.apache.org/r1525382
Log:
Various fixes

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

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=1525382&r1=1525381&r2=1525382&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 15:46:52 2013
@@ -1567,16 +1567,9 @@ public class SPSProxyHelper {
         throw new ManifoldCFException("Bad xml - missing outer node - there are "+Integer.toString(nodeList.size())+"
nodes");
       }
 
-      Object parent = nodeList.get(0);
-      if (!doc.getNodeName(parent).equals("ns1:List"))
-        throw new ManifoldCFException("Bad xml - outer node is '" + doc.getNodeName(parent)
+ "' not 'ns1:List'");
-
-      nodeList.clear();
-      doc.processPath(nodeList, "*", parent);  // <ns1:Attachments>
-
       Object attachments = nodeList.get(0);
       if ( !doc.getNodeName(attachments).equals("ns1:Attachments") )
-        throw new ManifoldCFException( "Bad xml - child node 0 '" + doc.getNodeName(attachments)
+ "' is not 'ns1:Attachments'");
+        throw new ManifoldCFException( "Bad xml - outer node '" + doc.getNodeName(attachments)
+ "' is not 'ns1:Attachments'");
 
       nodeList.clear();
       doc.processPath(nodeList, "*", attachments);
@@ -1585,7 +1578,9 @@ public class SPSProxyHelper {
       while (i < nodeList.size())
       {
         Object o = nodeList.get( i++ );
-        String attachmentURL = doc.getValue( o, "ns1:Attachment" );
+        if ( !doc.getNodeName(o).equals("ns1:Attachment") )
+          throw new ManifoldCFException( "Bad xml - inner node '" + doc.getNodeName(o) +
"' is not 'ns1:Attachment'");
+        String attachmentURL = doc.getData( o );
         if (attachmentURL != null)
         {
           int index = attachmentURL.lastIndexOf("/");

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=1525382&r1=1525381&r2=1525382&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 15:46:52 2013
@@ -752,7 +752,7 @@ public class SharePointRepository extend
 
             String encodedSitePath = encodePath(sitePath);
 
-            int attachmentSeparatorIndex = itemAndAttachment.indexOf("/");
+            int attachmentSeparatorIndex = itemAndAttachment.indexOf("/",1);
             if (attachmentSeparatorIndex == -1)
             {
               // == List item path! ==
@@ -910,7 +910,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 list no longer apparently exists");
+                    Logging.connectors.debug("SharePoint: Can't get version of '"+documentIdentifier+"'
because created date, modified data, or attachment url not found");
                   rval[i] = null;
                 }
               }
@@ -1298,7 +1298,7 @@ public class SharePointRepository extend
             String decodedItemPath = decodedListPath + itemAndAttachment;
             
             // If the item part has a slash, we're looking at an attachment
-            int attachmentSeparatorIndex = itemAndAttachment.indexOf("/");
+            int attachmentSeparatorIndex = itemAndAttachment.indexOf("/",1);
             if (attachmentSeparatorIndex == -1)
             {
               // == List item identifier ==
@@ -1333,7 +1333,7 @@ public class SharePointRepository extend
               // Now, do any queuing that is needed.
               if (attachmentsSupported)
               {
-                String itemID = itemAndAttachment.substring(attachmentSeparatorIndex+1);
+                String itemID = itemAndAttachment.substring(1);
                 String listID = listIDMap.get(decodedListPath);
                 if (listID == null)
                 {
@@ -1354,7 +1354,13 @@ public class SharePointRepository extend
 
                 // Get the attachment names
                 // MHL: need to get the item number from somewhere
-                String itemNumber = itemID;
+                // This is a hack to see if everything else works.
+                int undIndex = itemID.indexOf("_");
+                String itemNumber;
+                if (undIndex != -1)
+                  itemNumber = itemID.substring(0,undIndex);
+                else
+                  itemNumber = itemID;
                 
                 List<NameValue> attachmentNames = proxy.getAttachmentNames( site, listID,
itemNumber );
                 // Now, queue up each attachment as a separate entry
@@ -1365,7 +1371,7 @@ public class SharePointRepository extend
                   
                   // No check for inclusion; if the list item is included, so is this
                   String[] dataNames = new String[]{"createdDate","modifiedDate","accessTokens","denyTokens","url"};
-                  String[][] dataValues = new String[3][];
+                  String[][] dataValues = new String[5][];
                   if (createdDate == null)
                     dataValues[0] = new String[0];
                   else



Mime
View raw message