Package com.google.enterprise.connector.spi

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


    Property aclInheritanceTypeProperty =
        doc.findProperty(SpiConstants.PROPNAME_ACLINHERITANCETYPE);
    assertNotNull(aclInheritanceTypeProperty);
    assertEquals(SpiConstants.AclInheritanceType.CHILD_OVERRIDES.toString(),
        aclInheritanceTypeProperty.nextValue().toString());

    Property aclInheritFrom = doc.findProperty(
        SpiConstants.PROPNAME_ACLINHERITFROM_DOCID);
    assertNotNull(aclInheritFrom);
    assertEquals(inheritFrom, aclInheritFrom.nextValue().toString());
View Full Code Here


        aclInheritanceTypeProperty.nextValue().toString());

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

  public void testToString() throws RepositoryException {
    Document doc = new FileDocument(foo, makeContext(false, true), root);
    assertTrue(doc.toString().contains(foo.getPath()));
View Full Code Here

    assertEquals(properties.keySet(), doc.getPropertyNames());

    for (Map.Entry<String, String>  entry : properties.entrySet()) {
      Property property = doc.findProperty(entry.getKey());
      assertNotNull(property);
      assertEquals(entry.getValue(), property.nextValue().toString());
    }
  }

  public void testGetDocumentId() {
    DBHandle handle = new DBHandle(jsonDocument);
View Full Code Here

    {
      MockRepositoryProperty testProp = pl.getProperty("xyzzy");
      MockJcrProperty testJCRProp = new MockJcrProperty(testProp);
      Property p = new JcrProperty(testJCRProp);
      Value v = p.nextValue();
      Assert.assertEquals("skeedle", v.toString());
    }

    {
      MockRepositoryProperty testProp = pl.getProperty("baz");
View Full Code Here

    {
      MockRepositoryProperty testProp = pl.getProperty("baz");
      MockJcrProperty testJCRProp = new MockJcrProperty(testProp);
      Property p = new JcrProperty(testJCRProp);
      Value v = p.nextValue();
      Assert.assertEquals("42", v.toString());
    }

    {
      MockRepositoryProperty testProp = pl.getProperty("abc");
View Full Code Here

      MockRepositoryProperty testProp = pl.getProperty("abc");
      MockJcrProperty testJCRProp = new MockJcrProperty(testProp);
      Property p = new JcrProperty(testJCRProp);
      int counter = 0;
      Value v = null;
      while ((v = p.nextValue()) != null) {
        String res = v.toString();
        switch (counter) {
        case 0:
          Assert.assertEquals("2", res);
          break;
View Full Code Here

    {
      MockRepositoryProperty testProp = pl.getProperty("ghi");
      MockJcrProperty testJCRProp = new MockJcrProperty(testProp);
      Property p = new JcrProperty(testJCRProp);
      Value v = p.nextValue();
      Assert.assertNull(v);
    }

  }
}
View Full Code Here

    int counter = 0;
    System.out.println();
    for (String name : document.getPropertyNames()) {
      Property property = document.findProperty(name);
      assertNotNull(property);
      Value value = property.nextValue();
      assertNotNull(value);
      System.out.print(name);
      System.out.print("(");
      String type = value.getClass().getName();
      System.out.print(type);
View Full Code Here

  private static Property processAclProperty(Document document,
      String aclPropName, String aclRolePrefix) throws RepositoryException {
    LinkedList<Value> acl = new LinkedList<Value>();
    Property scopeProp = document.findProperty(aclPropName);
    Value scopeVal;
    while ((scopeVal = scopeProp.nextValue()) != null) {
      Principal principal = (scopeVal instanceof PrincipalValue)
          ? ((PrincipalValue) scopeVal).getPrincipal()
          : new Principal(scopeVal.toString().trim());
      String aclScope = principal.getName();
      if (Strings.isNullOrEmpty(aclScope)) {
View Full Code Here

      }
      Property scopeRoleProp = document.findProperty(aclRolePrefix + aclScope);
      if (scopeRoleProp != null) {
        // Add ACL Entry (scope=role pair) to the list.
        Value roleVal;
        while ((roleVal = scopeRoleProp.nextValue()) != null) {
          String role = roleVal.toString().trim();
          if (role.length() > 0) {
            acl.add(Value.getPrincipalValue(new Principal(
                principal.getPrincipalType(),
                principal.getNamespace(), aclScope + '=' + role,
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.