manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1619703 - in /manifoldcf/trunk: CHANGES.txt connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java
Date Fri, 22 Aug 2014 08:42:10 GMT
Author: kwright
Date: Fri Aug 22 08:42:10 2014
New Revision: 1619703

URL: http://svn.apache.org/r1619703
Log:
Fix for CONNECTORS-1013.

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1619703&r1=1619702&r2=1619703&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Fri Aug 22 08:42:10 2014
@@ -3,6 +3,10 @@ $Id$
 
 ======================= 1.8-dev =====================
 
+CONNECTORS-1013: Handle new kind of XML we see coming back from
+SharePoint on getLists metadata field list requests.
+(Lalit Jangra, Karl Wright)
+
 ======================= Release 1.7 =====================
 
 CONNECTORS-1012: Upgrade xmlbeans and POI to fix various CVE's.

Modified: manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java?rev=1619703&r1=1619702&r2=1619703&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java
(original)
+++ manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java
Fri Aug 22 08:42:10 2014
@@ -1738,28 +1738,27 @@ public class SPSProxyHelper {
       nodeList.clear();
       doc.processPath(nodeList, "*", parent);  // <ns1:Fields>
 
-      Object fields = nodeList.get(0);
-      if ( !doc.getNodeName(fields).equals("ns1:Fields") )
-        throw new ManifoldCFException( "Bad xml - child node 0 '" + doc.getNodeName(fields)
+ "' is not 'ns1:Fields'");
-
-      nodeList.clear();
-      doc.processPath(nodeList, "*", fields);
-
-      int i = 0;
-      while (i < nodeList.size())
+      for (Object metaField : nodeList)
       {
-        Object o = nodeList.get( i++ );
-        // Logging.connectors.debug( i + ": " + o );
-        String name = doc.getValue( o, "DisplayName" );
-        String fieldName = doc.getValue( o, "Name" );
-        String hidden = doc.getValue( o, "Hidden" );
-        // System.out.println( "Hidden :" + hidden );
-        if ( name.length() != 0 && fieldName.length() != 0 && ( !hidden.equalsIgnoreCase(
"true") ) )
+        if ( doc.getNodeName(metaField).equals("ns1:Fields") )
         {
-          // make sure we don't include the same field more than once.
-          // This may happen if the Library has more than one view.
-          if ( result.containsKey( fieldName ) == false)
-            result.put(fieldName, name);
+          ArrayList fieldsList = new ArrayList();
+          doc.processPath(fieldsList, "*", metaField);
+
+          for (Object o : fieldsList)
+          {
+            String name = doc.getValue( o, "DisplayName" );
+            String fieldName = doc.getValue( o, "Name" );
+            String hidden = doc.getValue( o, "Hidden" );
+            // System.out.println( "Hidden :" + hidden );
+            if ( name.length() != 0 && fieldName.length() != 0 && ( !hidden.equalsIgnoreCase(
"true") ) )
+            {
+              // make sure we don't include the same field more than once.
+              // This may happen if the Library has more than one view.
+              if ( result.containsKey( fieldName ) == false)
+                result.put(fieldName, name);
+            }
+          }
         }
       }
       // System.out.println(result.size());



Mime
View raw message