Package com.google.enterprise.connector.spi

Examples of com.google.enterprise.connector.spi.Document.findProperty()


    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 {
View Full Code Here


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

    boolean tested = false;
    DocumentList docList = traverser.getDocumentList(new Checkpoint());
    Document doc;
    while ((doc = docList.nextDocument()) != null) {
      assertTrue(checkpointContains(docList.checkpoint(),
          doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED),
          JsonField.LAST_MODIFIED_TIME));
      tested = true;
    }
    assertTrue(tested);
  }
View Full Code Here

    DocumentList docList = traverser.getDocumentList(new Checkpoint());
    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) {
View Full Code Here

      Calendar cal = Value.iso8601ToCalendar(lastModifiedValue.toString());

      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

            getDeletionEvents(os.getObjects()));

    // 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());
    }
  }
View Full Code Here

    DocumentList docList =
        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();
View Full Code Here

      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);
        assertFalse(object instanceof FileDeletionObject);
        assertTrue(checkpointContains(docList.checkpoint(),
            doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED),
View Full Code Here

          doc.findProperty(SpiConstants.PROPNAME_DOCID).nextValue().toString();
      if (ActionType.ADD.equals(actionType)) {
        IBaseObject object = os.getObject(null, id);
        assertFalse(object instanceof FileDeletionObject);
        assertTrue(checkpointContains(docList.checkpoint(),
            doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED),
            JsonField.LAST_MODIFIED_TIME));
        isAddTested = true;
      } else if (ActionType.DELETE.equals(actionType)) {
        IBaseObject object = os.getObject(null, id);
        if (object.isDeletionEvent()) {
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.