Author: kwright
Date: Thu Jul 17 00:58:37 2014
New Revision: 1611231

URL: http://svn.apache.org/r1611231
Log:
Revert most of the last change; the SharePoint connector is a chained connector 
which therefore must rescan its parent nodes

Modified:
    
manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java

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=1611231&r1=1611230&r2=1611231&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
 Thu Jul 17 00:58:37 2014
@@ -1266,90 +1266,86 @@ public class SharePointRepository extend
           // === List style identifier ===
           if (dListSeparatorIndex == documentIdentifier.length() - 3)
           {
-            if (!scanOnly[i])
-            {
-              activities.noDocument(documentIdentifier,version);
-
-              String siteListPath = 
documentIdentifier.substring(0,documentIdentifier.length()-3);
-              int listCutoff = siteListPath.lastIndexOf( "/" );
-              String site = siteListPath.substring(0,listCutoff);
-              String listName = siteListPath.substring( listCutoff + 1 );
+            // Chained connectors always scan parent nodes, so they don't 
bother setting a version
+            String siteListPath = 
documentIdentifier.substring(0,documentIdentifier.length()-3);
+            int listCutoff = siteListPath.lastIndexOf( "/" );
+            String site = siteListPath.substring(0,listCutoff);
+            String listName = siteListPath.substring( listCutoff + 1 );
 
-              if (Logging.connectors.isDebugEnabled())
-                Logging.connectors.debug( "SharePoint: Document identifier is 
a list: '" + siteListPath + "'" );
+            if (Logging.connectors.isDebugEnabled())
+              Logging.connectors.debug( "SharePoint: Document identifier is a 
list: '" + siteListPath + "'" );
 
-              String listID = proxy.getListID( encodePath(site), site, 
listName );
-              if (listID != null)
-              {
-                String encodedSitePath = encodePath(site);
+            String listID = proxy.getListID( encodePath(site), site, listName 
);
+            if (listID != null)
+            {
+              String encodedSitePath = encodePath(site);
                 
-                // Get the list's fields
-                Map<String,String> fieldNames = proxy.getFieldList( 
encodedSitePath, listID );
-                if (fieldNames != null)
-                {
-                  String[] fields = new String[fieldNames.size()];
-                  int j = 0;
-                  for (String field : fieldNames.keySet())
-                  {
-                    fields[j++] = field;
-                  }
+              // Get the list's fields
+              Map<String,String> fieldNames = proxy.getFieldList( 
encodedSitePath, listID );
+              if (fieldNames != null)
+              {
+                String[] fields = new String[fieldNames.size()];
+                int j = 0;
+                for (String field : fieldNames.keySet())
+                {
+                  fields[j++] = field;
+                }
                   
-                  String[] accessTokens;
-                  String[] denyTokens;
+                String[] accessTokens;
+                String[] denyTokens;
                   
-                  if (forcedAcls == null)
-                  {
-                    // Security is off
-                    accessTokens = new String[0];
-                    denyTokens = new String[0];
-                  }
-                  else if (forcedAcls.length != 0)
-                  {
-                    // Forced security
-                    accessTokens = forcedAcls;
-                    denyTokens = new String[0];
-                  }
-                  else
-                  {
-                    // Security enabled, native security
-                    accessTokens = proxy.getACLs( encodedSitePath, listID, 
activeDirectoryAuthority );
-                    denyTokens = new String[]{defaultAuthorityDenyToken};
-                  }
+                if (forcedAcls == null)
+                {
+                  // Security is off
+                  accessTokens = new String[0];
+                  denyTokens = new String[0];
+                }
+                else if (forcedAcls.length != 0)
+                {
+                  // Forced security
+                  accessTokens = forcedAcls;
+                  denyTokens = new String[0];
+                }
+                else
+                {
+                  // Security enabled, native security
+                  accessTokens = proxy.getACLs( encodedSitePath, listID, 
activeDirectoryAuthority );
+                  denyTokens = new String[]{defaultAuthorityDenyToken};
+                }
 
-                  if (accessTokens != null)
-                  {
-                    ListItemStream fs = new ListItemStream( activities, 
encodedServerLocation, site, siteListPath, spec,
-                      documentIdentifier, accessTokens, denyTokens, listID, 
fields );
-                    boolean success = proxy.getChildren( fs, encodedSitePath , 
listID, dspStsWorks );
-                    if (!success)
-                    {
-                      // Site/list no longer exists, so delete entry
-                      if (Logging.connectors.isDebugEnabled())
-                        Logging.connectors.debug("SharePoint: No list found 
for list '"+siteListPath+"' - deleting");
-                      activities.deleteDocument(documentIdentifier);
-                    }
-                  }
-                  else
+                if (accessTokens != null)
+                {
+                  ListItemStream fs = new ListItemStream( activities, 
encodedServerLocation, site, siteListPath, spec,
+                    documentIdentifier, accessTokens, denyTokens, listID, 
fields );
+                  boolean success = proxy.getChildren( fs, encodedSitePath , 
listID, dspStsWorks );
+                  if (!success)
                   {
+                    // Site/list no longer exists, so delete entry
                     if (Logging.connectors.isDebugEnabled())
-                      Logging.connectors.debug("SharePoint: Access token 
lookup failed for list '"+siteListPath+"' - deleting");
-                    activities.noDocument(documentIdentifier,version);
+                      Logging.connectors.debug("SharePoint: No list found for 
list '"+siteListPath+"' - deleting");
+                    activities.deleteDocument(documentIdentifier);
                   }
                 }
                 else
                 {
                   if (Logging.connectors.isDebugEnabled())
-                    Logging.connectors.debug("SharePoint: Field list lookup 
failed for list '"+siteListPath+"' - deleting");
-                  activities.noDocument(documentIdentifier,version);
+                    Logging.connectors.debug("SharePoint: Access token lookup 
failed for list '"+siteListPath+"' - deleting");
+                  activities.deleteDocument(documentIdentifier);
                 }
               }
               else
               {
                 if (Logging.connectors.isDebugEnabled())
-                  Logging.connectors.debug("SharePoint: GUID lookup failed for 
list '"+siteListPath+"' - deleting");
-                activities.noDocument(documentIdentifier,version);
+                  Logging.connectors.debug("SharePoint: Field list lookup 
failed for list '"+siteListPath+"' - deleting");
+                activities.deleteDocument(documentIdentifier);
               }
             }
+            else
+            {
+              if (Logging.connectors.isDebugEnabled())
+                Logging.connectors.debug("SharePoint: GUID lookup failed for 
list '"+siteListPath+"' - deleting");
+              activities.deleteDocument(documentIdentifier);
+            }
           }
           else
           {
@@ -1612,91 +1608,86 @@ public class SharePointRepository extend
           // === Library style identifier ===
           if (dLibSeparatorIndex == documentIdentifier.length() - 2)
           {
-            if (!scanOnly[i])
-            {
-              // It's a library.
-              activities.noDocument(documentIdentifier,version);
+            // Chained document parents are always rescanned
+            String siteLibPath = 
documentIdentifier.substring(0,documentIdentifier.length()-2);
+            int libCutoff = siteLibPath.lastIndexOf( "/" );
+            String site = siteLibPath.substring(0,libCutoff);
+            String libName = siteLibPath.substring( libCutoff + 1 );
 
-              String siteLibPath = 
documentIdentifier.substring(0,documentIdentifier.length()-2);
-              int libCutoff = siteLibPath.lastIndexOf( "/" );
-              String site = siteLibPath.substring(0,libCutoff);
-              String libName = siteLibPath.substring( libCutoff + 1 );
-
-              if (Logging.connectors.isDebugEnabled())
-                Logging.connectors.debug( "SharePoint: Document identifier is 
a library: '" + siteLibPath + "'" );
+            if (Logging.connectors.isDebugEnabled())
+              Logging.connectors.debug( "SharePoint: Document identifier is a 
library: '" + siteLibPath + "'" );
 
-              String libID = proxy.getDocLibID( encodePath(site), site, 
libName );
-              if (libID != null)
-              {
-                String encodedSitePath = encodePath(site);
-                
-                // Get the lib's fields
-                Map<String,String> fieldNames = proxy.getFieldList( 
encodedSitePath, libID );
-                if (fieldNames != null)
-                {
-                  String[] fields = new String[fieldNames.size()];
-                  int j = 0;
-                  for (String field : fieldNames.keySet())
-                  {
-                    fields[j++] = field;
-                  }
+            String libID = proxy.getDocLibID( encodePath(site), site, libName 
);
+            if (libID != null)
+            {
+              String encodedSitePath = encodePath(site);
+              
+              // Get the lib's fields
+              Map<String,String> fieldNames = proxy.getFieldList( 
encodedSitePath, libID );
+              if (fieldNames != null)
+              {
+                String[] fields = new String[fieldNames.size()];
+                int j = 0;
+                for (String field : fieldNames.keySet())
+                {
+                  fields[j++] = field;
+                }
                   
-                  String[] accessTokens;
-                  String[] denyTokens;
+                String[] accessTokens;
+                String[] denyTokens;
                   
-                  if (forcedAcls == null)
-                  {
-                    // Security is off
-                    accessTokens = new String[0];
-                    denyTokens = new String[0];
-                  }
-                  else if (forcedAcls.length != 0)
-                  {
-                    // Forced security
-                    accessTokens = forcedAcls;
-                    denyTokens = new String[0];
-                  }
-                  else
-                  {
-                    // Security enabled, native security
-                    accessTokens = proxy.getACLs( encodedSitePath, libID, 
activeDirectoryAuthority );
-                    denyTokens = new String[]{defaultAuthorityDenyToken};
-                  }
+                if (forcedAcls == null)
+                {
+                  // Security is off
+                  accessTokens = new String[0];
+                  denyTokens = new String[0];
+                }
+                else if (forcedAcls.length != 0)
+                {
+                  // Forced security
+                  accessTokens = forcedAcls;
+                  denyTokens = new String[0];
+                }
+                else
+                {
+                  // Security enabled, native security
+                  accessTokens = proxy.getACLs( encodedSitePath, libID, 
activeDirectoryAuthority );
+                  denyTokens = new String[]{defaultAuthorityDenyToken};
+                }
 
-                  if (accessTokens != null)
-                  {
-                    FileStream fs = new FileStream( activities, 
encodedServerLocation, site, siteLibPath, spec,
-                      documentIdentifier, accessTokens, denyTokens, libID, 
fields );
-                    boolean success = proxy.getChildren( fs, encodedSitePath , 
libID, dspStsWorks );
-                    if (!success)
-                    {
-                      // Site/library no longer exists, so delete entry
-                      if (Logging.connectors.isDebugEnabled())
-                        Logging.connectors.debug("SharePoint: No list found 
for library '"+siteLibPath+"' - deleting");
-                      activities.deleteDocument(documentIdentifier);
-                    }
-                  }
-                  else
+                if (accessTokens != null)
+                {
+                  FileStream fs = new FileStream( activities, 
encodedServerLocation, site, siteLibPath, spec,
+                    documentIdentifier, accessTokens, denyTokens, libID, 
fields );
+                  boolean success = proxy.getChildren( fs, encodedSitePath , 
libID, dspStsWorks );
+                  if (!success)
                   {
+                    // Site/library no longer exists, so delete entry
                     if (Logging.connectors.isDebugEnabled())
-                      Logging.connectors.debug("SharePoint: Access token 
lookup failed for library '"+siteLibPath+"' - deleting");
-                    activities.noDocument(documentIdentifier,version);
+                      Logging.connectors.debug("SharePoint: No list found for 
library '"+siteLibPath+"' - deleting");
+                    activities.deleteDocument(documentIdentifier);
                   }
                 }
                 else
                 {
                   if (Logging.connectors.isDebugEnabled())
-                    Logging.connectors.debug("SharePoint: Field list lookup 
failed for library '"+siteLibPath+"' - deleting");
-                  activities.noDocument(documentIdentifier,version);
+                    Logging.connectors.debug("SharePoint: Access token lookup 
failed for library '"+siteLibPath+"' - deleting");
+                  activities.deleteDocument(documentIdentifier);
                 }
               }
               else
               {
                 if (Logging.connectors.isDebugEnabled())
-                  Logging.connectors.debug("SharePoint: GUID lookup failed for 
library '"+siteLibPath+"' - deleting");
-                activities.noDocument(documentIdentifier,version);
+                  Logging.connectors.debug("SharePoint: Field list lookup 
failed for library '"+siteLibPath+"' - deleting");
+                activities.deleteDocument(documentIdentifier);
               }
             }
+            else
+            {
+              if (Logging.connectors.isDebugEnabled())
+                Logging.connectors.debug("SharePoint: GUID lookup failed for 
library '"+siteLibPath+"' - deleting");
+              activities.deleteDocument(documentIdentifier);
+            }
           }
           else
           {


Reply via email to