Package com.google.enterprise.connector.spi

Examples of com.google.enterprise.connector.spi.Property.nextValue()


      Document nextDoc = docList.nextDocument();
      if (nextDoc != null && nextDoc instanceof FileDocument) {
        Property nextDocLastModifiedProp =
            nextDoc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED);
        Value nextDocLastModifiedValue = nextDocLastModifiedProp.nextValue();
        Calendar nextCal =
            Value.iso8601ToCalendar(nextDocLastModifiedValue.toString());
        assertTrue(cal.compareTo(nextCal) <= 0);
        isTested = true;
      }
View Full Code Here


    // Test the order
    for (int index : expectedOrder) {
      Document doc = docList.nextDocument();
      Property fid = doc.findProperty(SpiConstants.PROPNAME_DOCID);
      assertEquals("[" + dbType + "] Incorrect id sorting order",
          "{" + entries[index][0] + "}", fid.nextValue().toString());
    }
  }

  private String[][] getEntries() {
    return new String[][] {
View Full Code Here

        getObjectUnderTest(os, docSet, customDeletionSet, deletionEventSet);
    Document doc = null;
    while ((doc = docList.nextDocument()) != null) {
      Property actionProp = doc.findProperty(SpiConstants.PROPNAME_ACTION);
      ActionType actionType = SpiConstants.ActionType.findActionType(
          actionProp.nextValue().toString());

      String id =
          doc.findProperty(SpiConstants.PROPNAME_DOCID).nextValue().toString();
      if (ActionType.ADD.equals(actionType)) {
        IBaseObject object = os.getObject(null, id);
View Full Code Here

  public void testFindProperty() throws RepositoryException {
    FileDocument fd =
        new FileDocument(new FnId(TestConnection.docId1), ios, connec);

    Property prop = fd.findProperty("Id");
    assertEquals(TestConnection.docId1, prop.nextValue().toString());

    // TODO(tdnguyen) Revisit these test cases after fixing Permissions
    // to avoid hard-coding users' names for allow and deny.
    Property allowUsers = fd.findProperty(SpiConstants.PROPNAME_ACLUSERS);
    assertNotNull(allowUsers);
View Full Code Here

  private Set<String> getPrincipalsNames(Document doc, String propertyName)
      throws RepositoryException {
    Set<String> names = new HashSet<String>();;
    PrincipalValue prValue;
    Property property = doc.findProperty(propertyName);
    while ((prValue = (PrincipalValue) property.nextValue()) != null) {
      names.add(prValue.getPrincipal().getName());
    }
    return names;
  }
View Full Code Here

  private Principal getAclPrincipal(Document doc, String prop, String name)
      throws RepositoryException {
    Principal aclPrincipal = null;
    PrincipalValue prValue;
    Property property = doc.findProperty(prop);
    while ((prValue = (PrincipalValue) property.nextValue()) != null) {
      if (prValue.getPrincipal().getName().equalsIgnoreCase(name)) {
        aclPrincipal = prValue.getPrincipal();
        break;
      }
    }
View Full Code Here

  private void assertNoDuplicates(LivelinkDocumentList docList,
      Set<String> nodes) throws RepositoryException {
    Document doc = null;
    while ((doc = docList.nextDocument()) != null) {
      Property prop = doc.findProperty(SpiConstants.PROPNAME_DOCID);
      String value = prop.nextValue().toString();
      assertTrue(value, nodes.add(value));
    }
  }
}
View Full Code Here

    Document doc = docList.nextDocument();
    assertNotNull(doc);
    while (doc != null) {
      Property propDocId = doc.findProperty(SpiConstants.PROPNAME_DOCID);
      assertNotNull(propDocId);
      assertTrue(propDocId.nextValue().toString().contains("social"));
      doc = docList.nextDocument();
    }
  }

}
View Full Code Here

    validateRepeatedProperty(denyGroups, denyGroupsProperty);

    Property aclInheritFrom =
        doc.findProperty(SpiConstants.PROPNAME_ACLINHERITFROM_DOCID);
    assertNotNull(aclInheritFrom);
    assertEquals(expectedInheritFrom, aclInheritFrom.nextValue().toString());
  }

  public void testAddNotPublicFileWithLegacyAcl() throws RepositoryException {
    foo.setAcl(acl);
    DocumentContext context = makeContext(true, false);
View Full Code Here

    Property aclDocumentTypeProperty =
        doc.findProperty(SpiConstants.PROPNAME_DOCUMENTTYPE);
    assertNotNull(aclDocumentTypeProperty);
    assertEquals(SpiConstants.DocumentType.ACL.toString(),
        aclDocumentTypeProperty.nextValue().toString());

    Property aclInheritanceTypeProperty =
        doc.findProperty(SpiConstants.PROPNAME_ACLINHERITANCETYPE);
    assertNotNull(aclInheritanceTypeProperty);
    assertEquals(SpiConstants.AclInheritanceType.CHILD_OVERRIDES.toString(),
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.