Package com.google.enterprise.connector.spi

Examples of com.google.enterprise.connector.spi.Property


    DctmSysobjectDocument dctmSpm = new DctmSysobjectDocument(
        traversalManager, session, DmInitialize.DM_ID2, null, lastModifDate,
        SpiConstants.ActionType.ADD, null);

    Property property = dctmSpm.findProperty("keywords");
    Value val = null;

    while ((val = property.nextValue()) != null) {
      // TOOD: compare val.toString() to expected keywords.
    }

    property = dctmSpm.findProperty("r_object_id");
    assertEquals(DmInitialize.DM_ID2, property.nextValue().toString());

    property = dctmSpm.findProperty(SpiConstants.PROPNAME_DOCID);
    assertEquals(DmInitialize.DM_VSID2, property.nextValue().toString());
  }
View Full Code Here


          name.startsWith("google:") || name.equals("r_object_id"));
    }
  }

  public void testFindProperty_docid() throws RepositoryException {
    Property property = document.findProperty(SpiConstants.PROPNAME_DOCID);
    assertNotNull(property);
    Value value = property.nextValue();
    assertNotNull(value);
    assertEquals(DmInitialize.DM_ID1, value.toString());
  }
View Full Code Here

  public void testFindProperty_folder() throws RepositoryException {
    // This does not work because the mock implementation does not
    // support retrieving r_folder path from the parent folders, but
    // it does check that findProperty does not return null.
    Property property;
    try {
      property = document.findProperty(SpiConstants.PROPNAME_FOLDER);
    } catch (Exception e) {
      return;
    }
    assertNotNull(property);
    Value value = property.nextValue();
    assertNotNull(value);
  }
View Full Code Here

    Value value = property.nextValue();
    assertNotNull(value);
  }

  public void testFindProperty_objectId() throws RepositoryException {
    Property property =
        document.findProperty(DctmSysobjectDocument.OBJECT_ID_NAME);
    assertNotNull(property);
    Value value = property.nextValue();
    assertNotNull(value);
    assertEquals(DmInitialize.DM_ID1, value.toString());
  }
View Full Code Here

  /**
   * Tests that the unsupported SPI properties are ignored, and only
   * handled once per property name.
   */
  public void testIgnoredSpiProperties() throws RepositoryException {
    Property property;

    assertTrue(DctmSysobjectDocument.UNSUPPORTED_PROPNAMES.toString(),
        DctmSysobjectDocument.UNSUPPORTED_PROPNAMES.isEmpty());

    property = document.findProperty(SpiConstants.PROPNAME_DOCID);
View Full Code Here

   */
  public void testNextDocument() throws RepositoryException {
    int counter = 0;
    DocumentList propertyMapList = qtm.startTraversal();
    Document pm = null;
    Property prop = null;

    while ((pm = propertyMapList.nextDocument()) != null) {

      assertTrue(pm instanceof DctmSysobjectDocument);
      prop = pm.findProperty(SpiConstants.PROPNAME_DOCID);

      assertNotNull(prop);
      assertEquals("users", prop.nextValue().toString());
      counter++;
      if (counter == 1) {
        break;
      }
    }
View Full Code Here

  @Override
  public Property findProperty(String name) throws RepositoryException {
    // Maintain the ability to check docProps directly for testing.
    List<Value> list = docProps.get(name);
    Property prop = null;
    if (list != null) {
      prop = new SimpleProperty(list);
    }
    return prop;
  }
View Full Code Here

    @SuppressWarnings("unchecked") DocumentList doclist =
        getDocumentList(data, directAces, defaultAces);

    Document doc = doclist.nextDocument();
    assertTrue(doc instanceof FileDocument);
    Property inheritFrom =
        doc.findProperty(SpiConstants.PROPNAME_ACLINHERITFROM_DOCID);
    assertNull(inheritFrom);
    assertDocContainsDirectDefaultAces(doc, 0);

    assertNull("Document should not have TMPL or FLDR ACL document",
View Full Code Here

    Document doc;
    while ((doc = docList.nextDocument()) != null) {
      System.out.println();
      for (String name : doc.getPropertyNames()) {
        Property prop = doc.findProperty(name);
        Value value;
        while ((value = prop.nextValue()) != null) {
          String printableValue;
          if (value instanceof BinaryValue) {
            try {
              InputStream in =
                  ((BinaryValue) value).getInputStream();
View Full Code Here

    Collections.sort(testSet);
    System.out.println(testSet);
  }

  public final void testFindProperty() throws Exception {
    final Property prop = this.doc.findProperty(SpiConstants.PROPNAME_DOCID);
    assertNotNull(prop);
  }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.spi.Property

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.