Package com.google.enterprise.connector.sharepoint.spiimpl

Examples of com.google.enterprise.connector.sharepoint.spiimpl.SPDocument


  public void testDefensiveCopyForCrawlQueue() throws SharepointException {
    ListState list = new ListState("{GUID_LIST_1}", "List1", "GenericList",
        Calendar.getInstance(), "List",
        "http://sharepoint.example.com/List1/AllItems.aspx", null);
    List<SPDocument> mutableDocumentList = new ArrayList<SPDocument>();
    SPDocument document1 = new SPDocument(
        "LIST_ITEM_1", "http://sharepoint.example.com/List1/DispForm.aspx?ID=1",
        Calendar.getInstance(), SpiConstants.ActionType.ADD);
    mutableDocumentList.add(document1);
   
    list.setCrawlQueue(mutableDocumentList);
    // Verify List crawl queue
    assertEquals(ImmutableList.of(document1), list.getCrawlQueue());

     // Add new document to mutable list
    SPDocument document2 = new SPDocument(
        "LIST_ITEM_2", "http://sharepoint.example.com/List1/DispForm.aspx?ID=2",
        Calendar.getInstance(), SpiConstants.ActionType.ADD);
    mutableDocumentList.add(document2);

    // Verify List crawl queue is not modified
View Full Code Here


  }

  public void testGetAttachments() throws MalformedURLException,
      RepositoryException {
    System.out.println("Testing getAttachments()...");
    final SPDocument doc = new SPDocument("1", "url1", new GregorianCalendar(
        2007, 1, 1), SPConstants.NO_AUTHOR, SPConstants.NO_OBJTYPE,
        SPConstants.PARENT_WEB_TITLE, FeedType.CONTENT_FEED, SPType.SP2007);
    List<SPDocument> items = listsHelper.getAttachments(this.testList, doc);
    assertNotNull(items);
    System.out.println("[ getAttachments() ] Test Passed.");
View Full Code Here

    List<SPDocument> items = getSite1TestListChangesSinceToken();
    assertNotNull(items);
    assertTrue(items.size() > 0);
   
    SPDocument doc = getGetDocumentFromListById(items, 1);
    assertNotNull(doc);
    String docTitle = getDocStringAttribute(doc, "Title");
    assertNotNull(docTitle);
    assertEquals(92, docTitle.length());
    assertEquals(0, docTitle.indexOf('!'));
View Full Code Here

    List<SPDocument> testDocs = listState.getCrawlQueue();
    assertNotNull(testDocs);

    // SharePoint document representing list
    SPDocument spdocument = listState.getDocumentInstance(FeedType.CONTENT_FEED);
    testDocs.add(spdocument);

    // SharePoint document representing site landing page(site)
    final SPDocument spdocument2 = siteData.getSiteData(webState);
    testDocs.add(spdocument2);

    SPDocumentList docList = new SPDocumentList(testDocs, globalState);
    assertNotNull(docList);
View Full Code Here

    context.setSupportsInheritedAcls(true);
    context.setSupportsDenyAcls(true);
    spContext.setTraversalContext(context);

    AclHelper aclHelper = new AclHelper(spContext, webState.getWebUrl());
    SPDocument webApppolicy = null;
    webApppolicy = aclHelper.getWebApplicationPolicy(webState,
        spContext.getFeedType().toString());
    assertNotNull(webApppolicy);
    assertEquals("Web app policy URL should be same as root site URL",
        TestConfiguration.Site4_URL, webApppolicy.getUrl());
    assertNotNull(webApppolicy.getAclGroups());
    assertFalse(webApppolicy.getAclGroups().isEmpty());
    assertNotNull(webApppolicy.getAclDenyUsers());
    assertFalse(webApppolicy.getAclDenyUsers().isEmpty());
    assertNotNull(webApppolicy.getAclUsers());
    assertFalse(webApppolicy.getAclUsers().isEmpty());
  }
View Full Code Here

    List<SPDocument> docsToPass = new ArrayList<SPDocument>();
    //Get Web application policy document.
    AclHelper aclHelper = new AclHelper(spContext, webState.getWebUrl());

    // Load Document for Root Web Home Page.
    SPDocument webDoc = siteData.getSiteData(webState);
    assertNotNull(webDoc);
    docsToPass.add(webDoc);

    // Load Documents scenarios for ACLs
View Full Code Here

      }
    }
  }

  private SPDocument getDocumentForUrl(String url,String docID) {
    SPDocument doc = new SPDocument(docID, url,
        Calendar.getInstance(), ActionType.ADD);
    return doc;
  }
View Full Code Here

    List<SPDocument> items =
        listsHelper.getListItems(testList, null, null, null);
    assertNotNull(items);
    assertTrue(1 == items.size());

    SPDocument doc = items.get(0);
    assertTrue((testListUrl + "/Doc1").equals(doc.getUrl()));
  }
View Full Code Here

    listsHelper.setUsername(username);
    List<SPDocument> items = listsHelper.getListItems(list, null, null, null);
    assertNotNull(items);
    assertEquals(1, items.size());

    SPDocument doc = items.get(0);
    assertEquals(expectedUrl, doc.getUrl());
  }
View Full Code Here

  public void testGetSiteData() throws Exception {
    final GlobalState state = new GlobalState(clientFactory,
        TestConfiguration.googleConnectorWorkDir, FeedType.CONTENT_FEED);
    WebState ws = state.makeWebState(sharepointClientContext,
        TestConfiguration.sharepointUrl + SPConstants.DEFAULT_SITE_LANDING_PAGE);
    final SPDocument document = this.siteData.getSiteData(ws);
    assertNotNull(document);
    String author = document.getAuthor().toLowerCase();
    String objectType = document.getObjType();
    assertEquals(TestConfiguration.userNameFormat2, author);
    assertEquals("Site", objectType);
  }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.sharepoint.spiimpl.SPDocument

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.