Package com.google.enterprise.connector.sharepoint.state

Examples of com.google.enterprise.connector.sharepoint.state.WebState


        TestConfiguration.sharepointUrl);
    globalState = TestConfiguration.initState(sharepointClientContext);
  }

  public void testGetAclForUrls() throws Exception {
    WebState webState = globalState.lookupWeb(TestConfiguration.Site1_URL, sharepointClientContext);
    ListState listState = globalState.lookupList(TestConfiguration.Site1_URL, TestConfiguration.Site1_List1_GUID);
    assertNotNull(listState);

    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);

    aclHelper = new AclHelper(sharepointClientContext, webState.getWebUrl());
    aclHelper.fetchAclForDocuments(docList, webState);
    for (SPDocument document : docList.getDocuments()) {
      assertNotNull(document);
      assertNotNull(document.getAclUsers());
      assertNotNull(document.getAclGroups());
View Full Code Here


      assertNotNull(document.getAclGroups());
    }
  }

  public void testWebApplicationPolicyDocument() throws Exception {
    WebState webState = globalState.lookupWeb(TestConfiguration.Site4_URL,
        sharepointClientContext);
    SharepointClientContext spContext = (SharepointClientContext)sharepointClientContext.clone();
    SimpleTraversalContext context = new SimpleTraversalContext();
    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",
View Full Code Here

    assertFalse(webApppolicy.getAclUsers().isEmpty());
  }

  public void testGetAclForUrlsUsingInheritance() throws Exception {
    // Get WebState for ACL Test Site
    WebState webState = globalState.lookupWeb(TestConfiguration.Site4_URL,
        sharepointClientContext);
    SharepointClientContext spContext = (SharepointClientContext)sharepointClientContext.clone();
    SimpleTraversalContext context = new SimpleTraversalContext();
    context.setSupportsInheritedAcls(true);
    spContext.setTraversalContext(context);
    assertNotNull(webState);
    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);
View Full Code Here

    assertNotNull(document.getAclGroups());
    assertTrue("Parent Url Mismatch",
        document.getParentUrl().equalsIgnoreCase(parentUrl));
  }
  public void testGetAclChangesSinceToken() throws Exception {
    WebState webstate = globalState.lookupWeb(TestConfiguration.Site1_URL, sharepointClientContext);
    String changeToken = "1;1;1648c1de-0093-4fb8-a888-f032f5a2da4c;634103077352630000;2263";
    webstate.setNextAclChangeToken(changeToken);
    webstate.commitAclChangeToken();
    aclHelper = new AclHelper(this.sharepointClientContext,
        webstate.getWebUrl());
    aclHelper.fetchAclChangesSinceTokenAndUpdateState(webstate);
    assertNotSame("Change Token is not updated", changeToken, webstate.getNextAclChangeToken());
  }
View Full Code Here

    final SiteDataHelper siteData =
        new SiteDataHelper(sharepointClientContext);

    final GlobalState state = new GlobalState(clientFactory,
        TestConfiguration.googleConnectorWorkDir, FeedType.CONTENT_FEED);
    final WebState ws =
        state.makeWebState(sharepointClientContext, "http://example.com");

    List<ListState> listCollection = siteData.getNamedLists(ws);
    assertNotNull(listCollection);
View Full Code Here

  }

  public void testGetNamedList() throws Exception {
    final GlobalState state = new GlobalState(clientFactory,
        TestConfiguration.googleConnectorWorkDir, FeedType.CONTENT_FEED);
    final WebState ws = state.makeWebState(sharepointClientContext,
        TestConfiguration.sharepointUrl);
    assertNotNull(ws);
    List<ListState> items = this.siteData.getNamedLists(ws);
    assertNotNull(items);
  }
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();
View Full Code Here

  }
 
  public void testGetSiteDataWithUtf() throws Exception {
    final GlobalState state = new GlobalState(clientFactory,
        TestConfiguration.googleConnectorWorkDir, FeedType.CONTENT_FEED);
    WebState ws = state.makeWebState(sharepointClientContext,
        TestConfiguration.UTF8SiteUrl);
    final SPDocument document = this.siteData.getSiteData(ws);
    assertNotNull(document);
    // document Type should be null. For Publishing sites it will be ACL.
    assertNull(document.getDocumentType());
View Full Code Here

  }
 
  public void testGetSiteDataPublishingSite() throws Exception {
    final GlobalState state = new GlobalState(clientFactory,
        TestConfiguration.googleConnectorWorkDir, FeedType.CONTENT_FEED);
    WebState ws = state.makeWebState(sharepointClientContext,
        TestConfiguration.publishingSiteUrl + SPConstants.DEFAULT_SITE_LANDING_PAGE);
    final SPDocument document = this.siteData.getSiteData(ws);
    assertNotNull(document);
    // document Type should be null. For Publishing sites it will be ACL.
    assertEquals(DocumentType.ACL,document.getDocumentType());
View Full Code Here

    final Calendar cLastMod = Calendar.getInstance();
    cLastMod.setTime(new Date());
    GlobalState gs = new GlobalState(clientFactory,
        TestConfiguration.googleConnectorWorkDir,
        TestConfiguration.feedType);
    WebState ws = gs.makeWebState(sharepointClientContext, TestConfiguration.Site1_URL);
    final ListState currentDummyAlertList = new ListState(internalName,
        SPConstants.ALERTS_TYPE, SPConstants.ALERTS_TYPE, cLastMod,
        SPConstants.ALERTS_TYPE, internalName, ws);

    List<SPDocument> lstAlerts = alerts.getAlerts(ws, currentDummyAlertList);
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.sharepoint.state.WebState

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.