Package com.google.enterprise.connector.sharepoint.client

Examples of com.google.enterprise.connector.sharepoint.client.SharepointClient


    // Set the traversal context on client context so that it can be used by
    // any other classes that will make use of the same.
    sharepointClientContext.setTraversalContext(traversalContext);

    final SharepointClient sharepointClient = new SharepointClient(
        clientFactory, sharepointClientContext);

    sharepointClientContext.setBatchHint(hint);
    SPDocumentList rsAll = null;

    // First, get the documents discovered in the previous crawl cycle.
    // The true flag indicates that we want to check if there are any
    // pending docs from previous crawl cycle
    rsAll = traverse(sharepointClient, true);
    if ((rsAll != null) && (rsAll.size() > 0)) {
      LOGGER.info("Traversal returned " + rsAll.size()
          + " documents discovered in the previous batch traversal(s).");
    } else {
      LOGGER.info("No documents to be sent from previous batch traversal(s). Recrawling...");
      try {
        sharepointClient.updateGlobalState(globalState);
      } catch (final Exception e) {
        LOGGER.log(Level.SEVERE, "Exception while updating global state.... ", e);
      } catch (final Throwable t) {
        LOGGER.log(Level.SEVERE, "Error while updating global state.... ", t);
      }
      // The 'false' flag indicates that we want to scan for all lists for
      // any updates and just not the subset. This is required as the
      // above call to updateGlobalState(globalState) might have
      // discovered docs in one or more (worst case all) list states
      final SPDocumentList rs = traverse(sharepointClient, false);
      if (rs != null) {
        LOGGER.info("Traversal returned " + rs.size()
            + " documents discovered in the current batch traversal.");
        if (rsAll == null) {
          rsAll = rs;
        } else {
          rsAll.addAll(rs);
        }
      } else {
        LOGGER.info("No documents to be sent from the current crawl cycle.");
      }
      if (sharepointClient.isDoCrawl() && (null == rsAll || rsAll.size() == 0)
          && null != globalState.getLastCrawledWeb()) {
        LOGGER.log(Level.INFO, "Setting LastCrawledWebStateID and LastCrawledListStateID as null and updating the state file to reflect that a full crawl has completed...");
        globalState.setLastCrawledWeb(null);
        globalState.setLastCrawledList(null);
        globalState.saveState();
View Full Code Here


    assertNotNull(items);
    assertEquals(0, items.size());

    // The SAX client factory is registered by the SharepointClient constructor
    // so we need to create a new instance of SharepointClient.
    SharepointClient sharepointClient = new SharepointClient(clientFactory,
        sharepointClientContext);
    items = getSite1TestListChangesSinceToken();
    assertNotNull(items);
    assertTrue(items.size() > 0);
  }
View Full Code Here

    Call.setTransportForProtocol("http", FileTransport.class);
    FileTransport.setResponseFileName("source/javatests/data/unicode-chars.xml");

    // The SAX client factory is registered by the SharepointClient constructor
    // so we need to create a new instance of SharepointClient.
    SharepointClient sharepointClient = new SharepointClient(clientFactory,
        sharepointClientContext);

    List<SPDocument> items = getSite1TestListChangesSinceToken();
    assertNotNull(items);
    assertTrue(items.size() > 0);
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.sharepoint.client.SharepointClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.