You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2015/06/07 12:08:17 UTC

svn commit: r1684018 - in /manifoldcf/branches/dev_1x: ./ connectors/sharepoint/ connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java

Author: kwright
Date: Sun Jun  7 10:08:17 2015
New Revision: 1684018

URL: http://svn.apache.org/r1684018
Log:
Add better debugging to sharepoint connector

Modified:
    manifoldcf/branches/dev_1x/   (props changed)
    manifoldcf/branches/dev_1x/connectors/sharepoint/   (props changed)
    manifoldcf/branches/dev_1x/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java

Propchange: manifoldcf/branches/dev_1x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jun  7 10:08:17 2015
@@ -124,4 +124,4 @@
 /manifoldcf/branches/CONNECTORS-981:1605049-1605773
 /manifoldcf/branches/CONNECTORS-989:1611600-1612101
 /manifoldcf/branches/CONNECTORS-990:1610284-1610707
-/manifoldcf/trunk:1620703,1620748,1620812,1620862,1621449,1621613,1621855,1622213,1622740,1622850,1622853-1622854,1623249,1623251,1623314,1623599,1623951,1623953-1623954,1623956,1623972,1624058,1624085,1624174,1624236,1624377,1624384,1624399,1624449,1624464,1624504,1624729-1624731,1624906,1624909-1624910,1624982,1625023,1625095,1625103,1625108,1625264,1625270,1625394,1625400,1625910,1626090,1626097,1626102,1626638-1626639,1626973,1627687,1627690,1627959,1628046,1628066,1628106,1628168,1628188,1628699,1628798,1628808,1628845,1628905,1629122,1629374-1629375,1629379,1629541,1629994,1630188,1630535,1630623,1630671,1630812,1630885,1631039,1631162,1631164,1631252,1631750,1631953,1632013,1632225,1632289,1632562,1632844,1632847,1632854,1633062-1633063,1633108,1633193,1633202,1633282,1633284,1633295,1633336,1633339,1633345,1633348,1633364,1633378,1633383,1633432,1633546,1633590,1633634,1633668,1633727,1633760,1633764,1633786,1633910,1633923,1634021,1634028,1634067,1634132,1634145,1634148,163
 4155,1634188,1634202,1634264,1634373,1634530,1634688,1634850,1634857,1635103,1635116,1635421,1635438,1635478,1635481,1635484,1635490,1635809,1635939,1636146,1636167,1636180,1636207,1636215,1636232,1636334,1636519,1636570,1636684,1636940,1637011,1637310,1637350,1637364,1637373,1637378,1639259,1639593,1639600,1640018,1640101,1640199,1640204,1640208,1640314,1640319,1640749,1640772,1640805,1640888,1640925,1640941-1640942,1641222,1641328,1641557,1641559,1641629,1641633,1641724,1641754,1641911,1642163,1642255,1642318,1642531,1642650,1642658,1642673,1642716,1644197,1644399,1644538,1644920,1644931,1646317,1646397,1646403,1646408,1646640,1646947,1647574,1647585,1647608,1648686,1648976,1649201,1649203,1649529,1649605,1649628,1649794,1650351,1650722,1650741-1650742,1650745,1650747,1650911,1650954,1651332,1651539,1651907,1651921,1652071,1652974,1653175,1653899,1654651,1655205,1655261,1655264,1655377,1655411,1655618,1655914,1657346,1657443,1658004,1658036,1658121,1658155,1658188,1658463,1658476,
 1660258,1660276,1661454,1665848,1666160,1666781,1666820,1668312,1669100,1669238,1669487,1669523,1669586,1669660,1670614,1670625,1670715,1671496,1672169,1672301,1672616,1672737,1673559,1673573,1673579,1673722,1675781,1675898,1676094,1676882,1676910,1678300,1678329,1678471,1678551,1679730,1679826,1681390,1681735,1682232,1682252,1682410,1682602,1682622,1682719,1683208,1683506,1683529,1683768,1684015
+/manifoldcf/trunk:1620703,1620748,1620812,1620862,1621449,1621613,1621855,1622213,1622740,1622850,1622853-1622854,1623249,1623251,1623314,1623599,1623951,1623953-1623954,1623956,1623972,1624058,1624085,1624174,1624236,1624377,1624384,1624399,1624449,1624464,1624504,1624729-1624731,1624906,1624909-1624910,1624982,1625023,1625095,1625103,1625108,1625264,1625270,1625394,1625400,1625910,1626090,1626097,1626102,1626638-1626639,1626973,1627687,1627690,1627959,1628046,1628066,1628106,1628168,1628188,1628699,1628798,1628808,1628845,1628905,1629122,1629374-1629375,1629379,1629541,1629994,1630188,1630535,1630623,1630671,1630812,1630885,1631039,1631162,1631164,1631252,1631750,1631953,1632013,1632225,1632289,1632562,1632844,1632847,1632854,1633062-1633063,1633108,1633193,1633202,1633282,1633284,1633295,1633336,1633339,1633345,1633348,1633364,1633378,1633383,1633432,1633546,1633590,1633634,1633668,1633727,1633760,1633764,1633786,1633910,1633923,1634021,1634028,1634067,1634132,1634145,1634148,163
 4155,1634188,1634202,1634264,1634373,1634530,1634688,1634850,1634857,1635103,1635116,1635421,1635438,1635478,1635481,1635484,1635490,1635809,1635939,1636146,1636167,1636180,1636207,1636215,1636232,1636334,1636519,1636570,1636684,1636940,1637011,1637310,1637350,1637364,1637373,1637378,1639259,1639593,1639600,1640018,1640101,1640199,1640204,1640208,1640314,1640319,1640749,1640772,1640805,1640888,1640925,1640941-1640942,1641222,1641328,1641557,1641559,1641629,1641633,1641724,1641754,1641911,1642163,1642255,1642318,1642531,1642650,1642658,1642673,1642716,1644197,1644399,1644538,1644920,1644931,1646317,1646397,1646403,1646408,1646640,1646947,1647574,1647585,1647608,1648686,1648976,1649201,1649203,1649529,1649605,1649628,1649794,1650351,1650722,1650741-1650742,1650745,1650747,1650911,1650954,1651332,1651539,1651907,1651921,1652071,1652974,1653175,1653899,1654651,1655205,1655261,1655264,1655377,1655411,1655618,1655914,1657346,1657443,1658004,1658036,1658121,1658155,1658188,1658463,1658476,
 1660258,1660276,1661454,1665848,1666160,1666781,1666820,1668312,1669100,1669238,1669487,1669523,1669586,1669660,1670614,1670625,1670715,1671496,1672169,1672301,1672616,1672737,1673559,1673573,1673579,1673722,1675781,1675898,1676094,1676882,1676910,1678300,1678329,1678471,1678551,1679730,1679826,1681390,1681735,1682232,1682252,1682410,1682602,1682622,1682719,1683208,1683506,1683529,1683768,1684015,1684017

Propchange: manifoldcf/branches/dev_1x/connectors/sharepoint/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jun  7 10:08:17 2015
@@ -59,4 +59,4 @@
 /manifoldcf/branches/CONNECTORS-891/connectors/sharepoint:1568778-1568807
 /manifoldcf/branches/CONNECTORS-912/connectors/sharepoint:1579605-1582723
 /manifoldcf/branches/CONNECTORS-990/connectors/sharepoint:1610284-1610707
-/manifoldcf/trunk/connectors/sharepoint:1621613,1621855,1622740,1623599,1625023,1625108,1626973,1630188,1633668,1640199,1642531,1665848,1672616,1672737,1682232,1682252
+/manifoldcf/trunk/connectors/sharepoint:1621613,1621855,1622740,1623599,1625023,1625108,1626973,1630188,1633668,1640199,1642531,1665848,1672616,1672737,1682232,1682252,1684017

Modified: manifoldcf/branches/dev_1x/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java?rev=1684018&r1=1684017&r2=1684018&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java (original)
+++ manifoldcf/branches/dev_1x/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java Sun Jun  7 10:08:17 2015
@@ -112,6 +112,9 @@ public class SPSProxyHelper {
   public String[] getACLs(String site, String guid, boolean activeDirectoryAuthority )
     throws ManifoldCFException, ServiceInterruption
   {
+    if (Logging.connectors.isDebugEnabled())
+      Logging.connectors.debug("SharePoint: In getACLs; site='"+site+"', guid='"+guid+"', activeDirectoryAuthority="+activeDirectoryAuthority);
+
     long currentTime;
     try
     {
@@ -125,7 +128,11 @@ public class SPSProxyHelper {
       com.microsoft.schemas.sharepoint.soap.directory.GetPermissionCollectionResponseGetPermissionCollectionResult aclResult = aclCall.getPermissionCollection( guid, "List" );
       org.apache.axis.message.MessageElement[] aclList = aclResult.get_any();
 
-      XMLDoc doc = new XMLDoc( aclList[0].toString() );
+      final String xmlResponse = aclList[0].toString();
+      if (Logging.connectors.isDebugEnabled())
+        Logging.connectors.debug("SharePoint: getACLs xml response: "+xmlResponse);
+      
+      XMLDoc doc = new XMLDoc( xmlResponse );
       ArrayList nodeList = new ArrayList();
 
       doc.processPath(nodeList, "*", null);
@@ -322,7 +329,7 @@ public class SPSProxyHelper {
         encodedRelativePath = encodedRelativePath.substring(1);
 
       if (Logging.connectors.isDebugEnabled())
-        Logging.connectors.debug("SharePoint: Getting document acls for site '"+site+"' file '"+file+"': Encoded relative path is '"+encodedRelativePath+"'");
+        Logging.connectors.debug("SharePoint: In getDocumentACLs for site '"+site+"', file '"+file+"': Encoded relative path is '"+encodedRelativePath+"'");
       UserGroupWS userService = new UserGroupWS( baseUrl + site, userName, password, configuration, httpClient  );
       com.microsoft.schemas.sharepoint.soap.directory.UserGroupSoap userCall = userService.getUserGroupSoapHandler( );
 
@@ -332,18 +339,19 @@ public class SPSProxyHelper {
       com.microsoft.sharepoint.webpartpages.GetPermissionCollectionResponseGetPermissionCollectionResult aclResult = aclCall.getPermissionCollection( encodedRelativePath, "Item" );
       if (aclResult == null)
       {
-        Logging.connectors.debug("SharePoint: document acls were null");
+        Logging.connectors.debug("SharePoint: getDocumentACLs: document acls were null");
         return null;
       }
       
       org.apache.axis.message.MessageElement[] aclList = aclResult.get_any();
 
+      final String xmlResponse = aclList[0].toString();
       if (Logging.connectors.isDebugEnabled())
       {
-        Logging.connectors.debug("SharePoint: document acls xml: '" + aclList[0].toString() + "'");
+        Logging.connectors.debug("SharePoint: getDocumentACLs xml response: " + xmlResponse);
       }
 
-      XMLDoc doc = new XMLDoc( aclList[0].toString() );
+      XMLDoc doc = new XMLDoc( xmlResponse );
       ArrayList nodeList = new ArrayList();
 
       doc.processPath(nodeList, "*", null);
@@ -520,6 +528,9 @@ public class SPSProxyHelper {
   public boolean getChildren(IFileStream fileStream, String site, String guid, boolean dspStsWorks )
     throws ManifoldCFException, ServiceInterruption
   {
+    if (Logging.connectors.isDebugEnabled())
+      Logging.connectors.debug("SharePoint: In getChildren; site='"+site+"', guid='"+guid+"', dspStsWorks="+dspStsWorks);
+
     long currentTime;
     try
     {
@@ -553,12 +564,12 @@ public class SPSProxyHelper {
 
         QueryResponse resp = call.query( myRequest );
         org.apache.axis.message.MessageElement[] list = resp.get_any();
+
+        final String xmlResponse = list[0].toString();
         if (Logging.connectors.isDebugEnabled())
-        {
-          Logging.connectors.debug("SharePoint: list xml: '" + list[0].toString() + "'");
-        }
+          Logging.connectors.debug("SharePoint: getChildren xml response: "+xmlResponse);
 
-        XMLDoc doc = new XMLDoc( list[0].toString() );
+        XMLDoc doc = new XMLDoc( xmlResponse );
 
         doc.processPath(nodeList, "*", null);
         if (nodeList.size() != 1)
@@ -617,7 +628,7 @@ public class SPSProxyHelper {
           MessageElement[] itemsList = itemsResult.get_any();
 
           if (Logging.connectors.isDebugEnabled()){
-            Logging.connectors.debug("SharePoint: getListItems xml response: '" + itemsList[0].toString() + "'");
+            Logging.connectors.debug("SharePoint: getChildren xml response: " + itemsList[0].toString());
           }
 
           if (itemsList.length != 1)
@@ -771,6 +782,9 @@ public class SPSProxyHelper {
   public String getDocLibID(String parentSite, String parentSiteDecoded, String docLibrary)
     throws ServiceInterruption, ManifoldCFException
   {
+    if (Logging.connectors.isDebugEnabled())
+      Logging.connectors.debug("SharePoint: In getDocLibID; parentSite='"+parentSite+"', parentSiteDecoded='"+parentSiteDecoded+"', docLibrary='"+docLibrary+"'");
+
     long currentTime;
     try
     {
@@ -792,7 +806,10 @@ public class SPSProxyHelper {
       GetListCollectionResponseGetListCollectionResult listResp = listsCall.getListCollection();
       org.apache.axis.message.MessageElement[] lists = listResp.get_any();
 
-      XMLDoc doc = new XMLDoc( lists[0].toString() );
+      final String xmlResponse = lists[0].toString();
+      if (Logging.connectors.isDebugEnabled())
+        Logging.connectors.debug("SharePoint: getDocLibID xml response: "+xmlResponse);
+      XMLDoc doc = new XMLDoc( xmlResponse );
       ArrayList nodeList = new ArrayList();
 
       doc.processPath(nodeList, "*", null);
@@ -967,6 +984,9 @@ public class SPSProxyHelper {
   public String getListID(String parentSite, String parentSiteDecoded, String listName)
     throws ServiceInterruption, ManifoldCFException
   {
+    if (Logging.connectors.isDebugEnabled())
+      Logging.connectors.debug("SharePoint: In getListID; parentsite='"+parentSite+"', parentSiteDecoded='"+parentSiteDecoded+"', listName='"+listName+"'");
+
     long currentTime;
     try
     {
@@ -988,7 +1008,10 @@ public class SPSProxyHelper {
       GetListCollectionResponseGetListCollectionResult listResp = listsCall.getListCollection();
       org.apache.axis.message.MessageElement[] lists = listResp.get_any();
 
-      XMLDoc doc = new XMLDoc( lists[0].toString() );
+      final String xmlResponse = lists[0].toString();
+      if (Logging.connectors.isDebugEnabled())
+        Logging.connectors.debug("SharePoint: getListID xml response: "+xmlResponse);
+      XMLDoc doc = new XMLDoc( xmlResponse );
       ArrayList nodeList = new ArrayList();
 
       doc.processPath(nodeList, "*", null);
@@ -1170,6 +1193,9 @@ public class SPSProxyHelper {
   public XMLDoc getVersions( String site, String docPath)
     throws ServiceInterruption, ManifoldCFException
   {
+    if (Logging.connectors.isDebugEnabled())
+      Logging.connectors.debug("SharePoint: In getVersions; site='"+site+"', docPath='"+docPath+"'");
+
     long currentTime;
     try
     {
@@ -1180,8 +1206,11 @@ public class SPSProxyHelper {
       GetVersionsResponseGetVersionsResult versionsResp = versionsCall.getVersions( docPath );
       org.apache.axis.message.MessageElement[] lists = versionsResp.get_any();
 
-      //System.out.println( lists[0].toString() );
-      XMLDoc doc = new XMLDoc( lists[0].toString() );
+      final String xmlResponse = lists[0].toString();
+      if (Logging.connectors.isDebugEnabled())
+        Logging.connectors.debug("SharePoint: getVersions response: "+xmlResponse);
+      
+      XMLDoc doc = new XMLDoc( xmlResponse );
       ArrayList nodeList = new ArrayList();
 
       doc.processPath(nodeList, "*", null);
@@ -1601,7 +1630,11 @@ public class SPSProxyHelper {
         listCall.getAttachmentCollection( listName, itemID );
       org.apache.axis.message.MessageElement[] List = listResponse.get_any();
 
-      XMLDoc doc = new XMLDoc( List[0].toString() );
+      final String xmlResponse = List[0].toString();
+      if (Logging.connectors.isDebugEnabled())
+        Logging.connectors.debug("SharePoint: getAttachmentNames response: "+xmlResponse);
+
+      XMLDoc doc = new XMLDoc( xmlResponse );
       ArrayList nodeList = new ArrayList();
 
       doc.processPath(nodeList, "*", null);
@@ -1722,7 +1755,11 @@ public class SPSProxyHelper {
       GetListResponseGetListResult listResponse = listCall.getList( listName );
       org.apache.axis.message.MessageElement[] List = listResponse.get_any();
 
-      XMLDoc doc = new XMLDoc( List[0].toString() );
+      final String xmlResponse = List[0].toString();
+      if (Logging.connectors.isDebugEnabled())
+        Logging.connectors.debug("SharePoint: getFieldList xml response: "+xmlResponse);
+      
+      XMLDoc doc = new XMLDoc( xmlResponse );
       ArrayList nodeList = new ArrayList();
 
       doc.processPath(nodeList, "*", null);
@@ -1833,6 +1870,9 @@ public class SPSProxyHelper {
   public Map<String,String> getFieldValues( String[] fieldNames, String site, String docLibrary, String docId, boolean dspStsWorks )
     throws ManifoldCFException, ServiceInterruption
   {
+    if (Logging.connectors.isDebugEnabled())
+      Logging.connectors.debug("SharePoint: In getFieldValues; fieldNames="+fieldNames+", site='"+site+"', docLibrary='"+docLibrary+"', docId='"+docId+"', dspStsWorks="+dspStsWorks);
+
     long currentTime;
     try
     {
@@ -1912,12 +1952,13 @@ public class SPSProxyHelper {
         QueryResponse resp = call.query( myRequest );
         org.apache.axis.message.MessageElement[] list = resp.get_any();
 
+        final String xmlResponse = list[0].toString();
         if (Logging.connectors.isDebugEnabled())
         {
-          Logging.connectors.debug("SharePoint: list xml: '" + list[0].toString() + "'");
+          Logging.connectors.debug("SharePoint: getFieldValues xml response: '" +xmlResponse+ "'");
         }
 
-        XMLDoc doc = new XMLDoc( list[0].toString() );
+        XMLDoc doc = new XMLDoc( xmlResponse );
         ArrayList nodeList = new ArrayList();
 
         doc.processPath(nodeList, "*", null);
@@ -1979,12 +2020,13 @@ public class SPSProxyHelper {
 
         MessageElement[] list = items.get_any();
 
+        final String xmlResponse = list[0].toString();
         if (Logging.connectors.isDebugEnabled()){
-          Logging.connectors.debug("SharePoint: getListItems for '"+docId+"' using FileRef value '"+sitePlusDocId+"' xml response: '" + list[0].toString() + "'");
+          Logging.connectors.debug("SharePoint: getListItems FileRef value '"+sitePlusDocId+"', xml response: '" + xmlResponse + "'");
         }
 
         ArrayList nodeList = new ArrayList();
-        XMLDoc doc = new XMLDoc(list[0].toString());
+        XMLDoc doc = new XMLDoc(xmlResponse);
 
         doc.processPath(nodeList, "*", null);
         if (nodeList.size() != 1)
@@ -2103,6 +2145,9 @@ public class SPSProxyHelper {
   public List<NameValue> getSites( String parentSite )
     throws ManifoldCFException, ServiceInterruption
   {
+    if (Logging.connectors.isDebugEnabled())
+      Logging.connectors.debug("SharePoint: In getSites; parentSite='"+parentSite+"'");
+
     long currentTime;
     try
     {
@@ -2116,7 +2161,10 @@ public class SPSProxyHelper {
       GetWebCollectionResponseGetWebCollectionResult webResp = webCall.getWebCollection();
       org.apache.axis.message.MessageElement[] webList = webResp.get_any();
 
-      XMLDoc doc = new XMLDoc( webList[0].toString() );
+      final String xmlResponse = webList[0].toString();
+      if (Logging.connectors.isDebugEnabled())
+        Logging.connectors.debug("SharePoint: getSites xml response: "+xmlResponse);
+      XMLDoc doc = new XMLDoc( xmlResponse );
       ArrayList nodeList = new ArrayList();
 
       doc.processPath(nodeList, "*", null);
@@ -2228,6 +2276,9 @@ public class SPSProxyHelper {
   public List<NameValue> getDocumentLibraries( String parentSite, String parentSiteDecoded )
     throws ManifoldCFException, ServiceInterruption
   {
+    if (Logging.connectors.isDebugEnabled())
+      Logging.connectors.debug("SharePoint: In getDocumentLibraries; parentSite='"+parentSite+"', parentSiteDecoded='"+parentSiteDecoded+"'");
+
     long currentTime;
     try
     {
@@ -2249,7 +2300,11 @@ public class SPSProxyHelper {
 
       //if ( parentSite.compareTo("/Sample2") == 0) System.out.println( lists[0].toString() );
 
-      XMLDoc doc = new XMLDoc( lists[0].toString() );
+      final String xmlResponse = lists[0].toString();
+      if (Logging.connectors.isDebugEnabled())
+        Logging.connectors.debug("SharePoint: getDocumentLibraries xml response: "+xmlResponse);
+      
+      XMLDoc doc = new XMLDoc( xmlResponse );
       ArrayList nodeList = new ArrayList();
 
       doc.processPath(nodeList, "*", null);
@@ -2379,6 +2434,9 @@ public class SPSProxyHelper {
   public List<NameValue> getLists( String parentSite, String parentSiteDecoded )
     throws ManifoldCFException, ServiceInterruption
   {
+    if (Logging.connectors.isDebugEnabled())
+      Logging.connectors.debug("SharePoint: In getLists; parentSite='"+parentSite+"', parentSiteDecoded='"+parentSiteDecoded+"'");
+
     long currentTime;
     try
     {
@@ -2398,9 +2456,11 @@ public class SPSProxyHelper {
       GetListCollectionResponseGetListCollectionResult listResp = listsCall.getListCollection();
       org.apache.axis.message.MessageElement[] lists = listResp.get_any();
 
-      //if ( parentSite.compareTo("/Sample2") == 0) System.out.println( lists[0].toString() );
+      final String xmlResponse = lists[0].toString();
+      if (Logging.connectors.isDebugEnabled())
+        Logging.connectors.debug("SharePoint: getLists xml response: "+xmlResponse);
 
-      XMLDoc doc = new XMLDoc( lists[0].toString() );
+      XMLDoc doc = new XMLDoc( xmlResponse );
       ArrayList nodeList = new ArrayList();
 
       doc.processPath(nodeList, "*", null);