Author: kwright
Date: Tue Sep 10 14:20:11 2013
New Revision: 1521500

URL: http://svn.apache.org/r1521500
Log:
ManifoldCF fix for CONNECTORS-772.  (Still need to release plugin fixes).

Modified:
    manifoldcf/trunk/   (props changed)
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/connectors/sharepoint/   (props changed)
    
manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java
    
manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java

Propchange: manifoldcf/trunk/
------------------------------------------------------------------------------
  Merged /manifoldcf/branches/CONNECTORS-772:r1521196-1521498

Modified: manifoldcf/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1521500&r1=1521499&r2=1521500&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Tue Sep 10 14:20:11 2013
@@ -3,6 +3,11 @@ $Id$
 
 ======================= 1.4-dev =====================
 
+CONNECTORS-772: SharePoint connector wasn't working against
+AWS SharePoint instances.  Added a new AWS pulldown selection
+to deal with the funky configuration there.
+(Dmitry Goldenberg, Karl Wright)
+
 CONNECTORS-770: Java7 no longer allows an interface to be
 interchangeable with a class.  Modified FileNet stub accordingly.
 (Yann Barraud, Karl Wright)

Propchange: manifoldcf/trunk/connectors/sharepoint/
------------------------------------------------------------------------------
  Merged 
/manifoldcf/branches/CONNECTORS-772/connectors/sharepoint:r1521196-1521498

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=1521500&r1=1521499&r2=1521500&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
 Tue Sep 10 14:20:11 2013
@@ -776,7 +776,7 @@ public class SPSProxyHelper {
   * @throws ManifoldCFException
   * @throws ServiceInterruption
   */
-  public String getDocLibID(String parentSite, String parentSiteDecoded, 
String docLibrary)
+  public String getDocLibID(String parentSite, String parentSiteDecoded, 
String docLibrary, boolean fullListPaths)
     throws ServiceInterruption, ManifoldCFException
   {
     long currentTime;
@@ -815,7 +815,7 @@ public class SPSProxyHelper {
       nodeList.clear();
       doc.processPath(nodeList, "*", parent);  // <ns1:Lists>
 
-      int chuckIndex = decodedServerLocation.length() + 
parentSiteDecoded.length();
+      int chuckIndex = fullListPaths?decodedServerLocation.length() + 
parentSiteDecoded.length():0;
 
       int i = 0;
       while (i < nodeList.size())
@@ -965,7 +965,7 @@ public class SPSProxyHelper {
   * @throws ManifoldCFException
   * @throws ServiceInterruption
   */
-  public String getListID(String parentSite, String parentSiteDecoded, String 
listName)
+  public String getListID(String parentSite, String parentSiteDecoded, String 
listName, boolean fullListPaths)
     throws ServiceInterruption, ManifoldCFException
   {
     long currentTime;
@@ -1004,7 +1004,7 @@ public class SPSProxyHelper {
       nodeList.clear();
       doc.processPath(nodeList, "*", parent);  // <ns1:Lists>
 
-      int chuckIndex = decodedServerLocation.length() + 
parentSiteDecoded.length();
+      int chuckIndex = fullListPaths?decodedServerLocation.length() + 
parentSiteDecoded.length():0;
 
       int i = 0;
       while (i < nodeList.size())
@@ -2068,7 +2068,7 @@ public class SPSProxyHelper {
   * @param parentSite the site to search for document libraries, empty string 
for root
   * @return lists of NameValue objects, representing document libraries
   */
-  public ArrayList getDocumentLibraries( String parentSite, String 
parentSiteDecoded )
+  public ArrayList getDocumentLibraries( String parentSite, String 
parentSiteDecoded, boolean fullListPaths )
     throws ManifoldCFException, ServiceInterruption
   {
     long currentTime;
@@ -2107,7 +2107,7 @@ public class SPSProxyHelper {
       nodeList.clear();
       doc.processPath(nodeList, "*", parent);  // <ns1:Lists>
 
-      int chuckIndex = decodedServerLocation.length() + 
parentSiteDecoded.length();
+      int chuckIndex = fullListPaths?decodedServerLocation.length() + 
parentSiteDecoded.length():0;
 
       int i = 0;
       while (i < nodeList.size())
@@ -2212,7 +2212,7 @@ public class SPSProxyHelper {
   * @param parentSite the site to search for lists, empty string for root
   * @return lists of NameValue objects, representing lists
   */
-  public ArrayList getLists( String parentSite, String parentSiteDecoded )
+  public ArrayList getLists( String parentSite, String parentSiteDecoded, 
boolean fullListPaths )
     throws ManifoldCFException, ServiceInterruption
   {
     long currentTime;
@@ -2251,7 +2251,7 @@ public class SPSProxyHelper {
       nodeList.clear();
       doc.processPath(nodeList, "*", parent);  // <ns1:Lists>
 
-      int chuckIndex = decodedServerLocation.length() + 
parentSiteDecoded.length();
+      int chuckIndex = fullListPaths?decodedServerLocation.length() + 
parentSiteDecoded.length():0;
 
       int i = 0;
       while (i < nodeList.size())

Modified: 
manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java?rev=1521500&r1=1521499&r2=1521500&view=diff
==============================================================================
--- 
manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
 (original)
+++ 
manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
 Tue Sep 10 14:20:11 2013
@@ -85,6 +85,8 @@ public class SharePointRepository extend
   
   private boolean supportsItemSecurity = false;
   private boolean dspStsWorks = true;
+  private boolean fullListPaths = true;
+  
   private String serverProtocol = null;
   private String serverUrl = null;
   private String fileBaseUrl = null;
@@ -144,7 +146,8 @@ public class SharePointRepository extend
       if (serverVersion == null)
         serverVersion = "2.0";
       supportsItemSecurity = !serverVersion.equals("2.0");
-      dspStsWorks = !serverVersion.equals("4.0");
+      dspStsWorks = !(serverVersion.equals("4.0") || 
serverVersion.equals("4.0AWS"));
+      fullListPaths = !serverVersion.equals("4.0AWS");
 
       serverProtocol = params.getParameter( "serverProtocol" );
       if (serverProtocol == null)
@@ -756,7 +759,7 @@ public class SharePointRepository extend
               String listID = listIDMap.get(decodedListPath);
               if (listID == null)
               {
-                listID = proxy.getListID(encodedSitePath, sitePath, list);
+                listID = proxy.getListID(encodedSitePath, sitePath, list, 
fullListPaths);
                 if (listID != null)
                   listIDMap.put(decodedListPath,listID);
               }
@@ -911,7 +914,7 @@ public class SharePointRepository extend
               String libID = libIDMap.get(decodedLibPath);
               if (libID == null)
               {
-                libID = proxy.getDocLibID(encodedSitePath, sitePath, lib);
+                libID = proxy.getDocLibID(encodedSitePath, sitePath, lib, 
fullListPaths);
                 if (libID != null)
                   libIDMap.put(decodedLibPath,libID);
               }
@@ -1231,7 +1234,7 @@ public class SharePointRepository extend
             // Calculate the start of the path part that would contain the 
list item name
             int listItemPathIndex = site.length() + 1 + listName.length();
 
-            String listID = proxy.getListID( encodePath(site), site, listName 
);
+            String listID = proxy.getListID( encodePath(site), site, listName, 
fullListPaths );
             if (listID != null)
             {
               ListItemStream fs = new ListItemStream( activities, 
listItemPathIndex, spec );
@@ -1326,7 +1329,7 @@ public class SharePointRepository extend
                     String listID = listIDMap.get(decodedListPath);
                     if (listID == null)
                     {
-                      listID = proxy.getListID( encodePath(site), site, 
listName);
+                      listID = proxy.getListID( encodePath(site), site, 
listName, fullListPaths );
                       if (listID == null)
                         listID = "";
                       listIDMap.put(decodedListPath,listID);
@@ -1404,7 +1407,7 @@ public class SharePointRepository extend
             // Calculate the start of the path part that would contain the 
folders/file
             int foldersFilePathIndex = site.length() + 1 + libName.length();
 
-            String libID = proxy.getDocLibID( encodePath(site), site, libName 
);
+            String libID = proxy.getDocLibID( encodePath(site), site, libName, 
fullListPaths );
             if (libID != null)
             {
               FileStream fs = new FileStream( activities, 
foldersFilePathIndex, spec );
@@ -1618,7 +1621,7 @@ public class SharePointRepository extend
                         String documentLibID = docLibIDMap.get(decodedLibPath);
                         if (documentLibID == null)
                         {
-                          documentLibID = proxy.getDocLibID( encodePath(site), 
site, libName);
+                          documentLibID = proxy.getDocLibID( encodePath(site), 
site, libName, fullListPaths );
                           if (documentLibID == null)
                             documentLibID = "";
                           docLibIDMap.put(decodedLibPath,documentLibID);
@@ -1744,7 +1747,7 @@ public class SharePointRepository extend
           }
 
           // Look at libraries
-          ArrayList libraries = proxy.getDocumentLibraries( 
encodePath(decodedSitePath), decodedSitePath );
+          ArrayList libraries = proxy.getDocumentLibraries( 
encodePath(decodedSitePath), decodedSitePath, fullListPaths );
           if (libraries != null)
           {
             int j = 0;
@@ -1765,7 +1768,7 @@ public class SharePointRepository extend
           }
 
           // Look at lists
-          ArrayList lists = proxy.getLists( encodePath(decodedSitePath), 
decodedSitePath );
+          ArrayList lists = proxy.getLists( encodePath(decodedSitePath), 
decodedSitePath, fullListPaths );
           if (lists != null)
           {
             int j = 0;
@@ -2140,6 +2143,7 @@ public class SharePointRepository extend
 "        <option value=\"2.0\" 
"+((serverVersion.equals("2.0"))?"selected=\"true\"":"")+">SharePoint Services 
2.0 (2003)</option>\n"+
 "        <option value=\"3.0\" 
"+(serverVersion.equals("3.0")?"selected=\"true\"":"")+">SharePoint Services 
3.0 (2007)</option>\n"+
 "        <option value=\"4.0\" 
"+(serverVersion.equals("4.0")?"selected=\"true\"":"")+">SharePoint Services 
4.0 (2010)</option>\n"+
+"        <option value=\"4.0AWS\" 
"+(serverVersion.equals("4.0AWS")?"selected=\"true\"":"")+">SharePoint Services 
4.0 (2010), Amazon version</option>\n"+
 "      </select>\n"+
 "    </td>\n"+
 "  </tr>\n"+
@@ -5000,7 +5004,7 @@ public class SharePointRepository extend
     throws ServiceInterruption, ManifoldCFException
   {
     getSession();
-    return proxy.getFieldList( encodePath(parentSite), proxy.getDocLibID( 
encodePath(parentSite), parentSite, docLibrary) );
+    return proxy.getFieldList( encodePath(parentSite), proxy.getDocLibID( 
encodePath(parentSite), parentSite, docLibrary, fullListPaths ) );
   }
 
   /**
@@ -5013,7 +5017,7 @@ public class SharePointRepository extend
     throws ServiceInterruption, ManifoldCFException
   {
     getSession();
-    return proxy.getFieldList( encodePath(parentSite), proxy.getListID( 
encodePath(parentSite), parentSite, listName) );
+    return proxy.getFieldList( encodePath(parentSite), proxy.getListID( 
encodePath(parentSite), parentSite, listName, fullListPaths ) );
   }
 
   /**
@@ -5037,7 +5041,7 @@ public class SharePointRepository extend
     throws ManifoldCFException, ServiceInterruption
   {
     getSession();
-    return proxy.getDocumentLibraries( encodePath(parentSite), parentSite );
+    return proxy.getDocumentLibraries( encodePath(parentSite), parentSite, 
fullListPaths );
   }
 
   /**
@@ -5049,7 +5053,7 @@ public class SharePointRepository extend
     throws ManifoldCFException, ServiceInterruption
   {
     getSession();
-    return proxy.getLists( encodePath(parentSite), parentSite );
+    return proxy.getLists( encodePath(parentSite), parentSite, fullListPaths );
   }
 
   // Protected static methods


Reply via email to