Package com.google.enterprise.connector.spi

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


  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


      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

    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();
              byte[] buffer = new byte[32];
View Full Code Here

    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

        + ".invalid.txt");
    assertNull(testDoc.getContent());

    final Property prop = testDoc.findProperty(SPConstants.HTTP_STATUS_CODE);
    assertNotNull(prop);
    assertEquals("404", prop.nextValue().toString());
    assertNull(prop.nextValue());
  }

  public final void testDownloadContentsForInvalidUrl() throws Exception {
    this.doc.setContentDwnldURL(TestConfiguration.Site1_List_Item_MSG_File_URL
View Full Code Here

    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;
    long end = 0;
View Full Code Here

    assertNull(testDoc.getContent());

    final Property prop = testDoc.findProperty(SPConstants.HTTP_STATUS_CODE);
    assertNotNull(prop);
    assertEquals("404", prop.nextValue().toString());
    assertNull(prop.nextValue());
  }

  public final void testDownloadContentsForInvalidUrl() throws Exception {
    this.doc.setContentDwnldURL(TestConfiguration.Site1_List_Item_MSG_File_URL
        + ".invalid.txt");
View Full Code Here

    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

  }
 
  private static String getFirstStringValue(Document doc, String key) {
    try {
      Property prop = doc.findProperty(key);
      return prop.nextValue().toString();
    } catch (RepositoryException re) {
      return null;
    }
  }
}
View Full Code Here

    assertNotNull("Document list is null", docList);
    Document doc = docList.nextDocument();
    while (doc != null && doc instanceof FileDocument) {
      Property lastModifiedProp =
          doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED);
      Value lastModifiedValue = lastModifiedProp.nextValue();
      Calendar cal = Value.iso8601ToCalendar(lastModifiedValue.toString());

      Document nextDoc = docList.nextDocument();
      if (nextDoc != null && nextDoc instanceof FileDocument) {
        Property nextDocLastModifiedProp =
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.