Package com.google.enterprise.connector.spi

Examples of com.google.enterprise.connector.spi.DocumentList.nextDocument()


  public void documentContainsDirectDefaultParentAcls() throws Exception {
    String[][] data = {{expectedId, timeStr}};
    @SuppressWarnings("unchecked") DocumentList doclist =
        getDocumentList(data, directAces, defaultAces, parentAces);

    Document doc = doclist.nextDocument();
    assertTrue(doc instanceof FileDocument);
    assertDocInheritFrom(doc, expectedId + AclDocument.SEC_FOLDER_POSTFIX);
    assertDocContainsDirectDefaultAces(doc, 0);

    Document acl = doclist.nextDocument();
View Full Code Here


    Document doc = doclist.nextDocument();
    assertTrue(doc instanceof FileDocument);
    assertDocInheritFrom(doc, expectedId + AclDocument.SEC_FOLDER_POSTFIX);
    assertDocContainsDirectDefaultAces(doc, 0);

    Document acl = doclist.nextDocument();
    assertTrue(acl instanceof AclDocument);
    assertEquals(expectedId + AclDocument.SEC_FOLDER_POSTFIX,
        Value.getSingleValueString(acl, SpiConstants.PROPNAME_DOCID));
    assertAclContainsAces(acl, PermissionSource.SOURCE_PARENT, 0);
View Full Code Here

    assertTrue(acl instanceof AclDocument);
    assertEquals(expectedId + AclDocument.SEC_FOLDER_POSTFIX,
        Value.getSingleValueString(acl, SpiConstants.PROPNAME_DOCID));
    assertAclContainsAces(acl, PermissionSource.SOURCE_PARENT, 0);

    assertNull(doclist.nextDocument());
  }

  /**
   * Tests document inheriting from TMPL docid, TMPL-Parent-ACL document
   * inheriting from FLDR-Parent-ACL document and FLDR-Parent-Document existed.
View Full Code Here

    String[][] data = {{expectedId, timeStr}};
    @SuppressWarnings("unchecked") DocumentList doclist =
        getDocumentList(data, directAces, defaultAces, templateAces,
            parentAces);

    Document doc = doclist.nextDocument();
    assertTrue(doc instanceof FileDocument);
    assertDocInheritFrom(doc, expectedId + AclDocument.SEC_POLICY_POSTFIX);
    assertDocContainsDirectDefaultAces(doc, 0);

    Document fldrAcl = doclist.nextDocument();
View Full Code Here

    Document doc = doclist.nextDocument();
    assertTrue(doc instanceof FileDocument);
    assertDocInheritFrom(doc, expectedId + AclDocument.SEC_POLICY_POSTFIX);
    assertDocContainsDirectDefaultAces(doc, 0);

    Document fldrAcl = doclist.nextDocument();
    assertTrue(fldrAcl instanceof AclDocument);
    assertAclContainsAces(fldrAcl, PermissionSource.SOURCE_PARENT, 0);

    Document tmplAcl = doclist.nextDocument();
    assertTrue(tmplAcl instanceof AclDocument);
View Full Code Here

    Document fldrAcl = doclist.nextDocument();
    assertTrue(fldrAcl instanceof AclDocument);
    assertAclContainsAces(fldrAcl, PermissionSource.SOURCE_PARENT, 0);

    Document tmplAcl = doclist.nextDocument();
    assertTrue(tmplAcl instanceof AclDocument);
    assertDocInheritFrom(tmplAcl, expectedId + AclDocument.SEC_FOLDER_POSTFIX);
    assertAclContainsAces(tmplAcl, PermissionSource.SOURCE_TEMPLATE, 0);

    assertNull(doclist.nextDocument());
View Full Code Here

    Document tmplAcl = doclist.nextDocument();
    assertTrue(tmplAcl instanceof AclDocument);
    assertDocInheritFrom(tmplAcl, expectedId + AclDocument.SEC_FOLDER_POSTFIX);
    assertAclContainsAces(tmplAcl, PermissionSource.SOURCE_TEMPLATE, 0);

    assertNull(doclist.nextDocument());
  }

  private void assertDocInheritFrom(Document doc, String expectedDocId)
      throws Exception {
    assertEquals(expectedDocId, Value.getSingleValueString(doc,
View Full Code Here

    TraversalManager tm = session.getTraversalManager();
    tm.setBatchHint(batchHint);
    DocumentList docList = tm.startTraversal();
    ArrayList<String> docids = new ArrayList<String>();
    Document doc;
    while ((doc = docList.nextDocument()) != null) {
      Property p = doc.findProperty(SpiConstants.PROPNAME_DOCID);
      docids.add(p.nextValue().toString());
    }

    long start = 0;
View Full Code Here

   
    try {
      GdConnector gdc = new GdConnector();
      gdc.setService(alwaysNotModifiedService);
      DocumentList resultSet = gdc.startTraversal();
      assertNull(resultSet.nextDocument());
    } catch (RepositoryException re) {
      fail(re.toString());
    }
  }
 
View Full Code Here

   
    try {
      GdConnector gdc = new GdConnector();
      gdc.setService(alwaysOneEntryService);
      DocumentList resultSet = gdc.startTraversal();
      Document docA = resultSet.nextDocument();
      Document docB = resultSet.nextDocument();
      assertNotNull(docA);
      assertEquals("\u9762",
          getFirstStringValue(docA, SpiConstants.PROPNAME_DOCID));
      assertNull(docB);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.