Package com.google.enterprise.connector.spi

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


        }
      }
      map.put(PROPNAME_AUTHOR, new SimpleProperty(authorList));
    }

    return new SimpleDocument(map);
  }
View Full Code Here


    List valueList = new LinkedList();
    valueList.add(Value.getStringValue(lastModifiedString));
    Map propertyMap = new HashMap();
    propertyMap.put(SpiConstants.PROPNAME_LASTMODIFIED,
        new SimpleProperty(valueList));
    return new SimpleDocument(propertyMap);
  }
View Full Code Here

          }
        }
        map.put(PROPNAME_AUTHOR, new SimpleProperty(authorList));
      }

      return new SimpleDocument(map);
    }
View Full Code Here

          + " nextDocId=" + nextDocId;
    }
  }

  public static List<SimpleDocument>  createDocumentList(String docId) {
    SimpleDocument document = ConnectorTestUtils.createSimpleDocument(docId);
    List<SimpleDocument> docList = new LinkedList<SimpleDocument>();
    docList.add(document);
    return docList;
  }
View Full Code Here

     * <code>Document</code>.  It also sets the <code>documentServed</code>
     * state so that is the only <code>Document</code> traversed for this
     * <code>Connector</code>.
     */
    private DocumentList traverse() {
      SimpleDocument document = ConnectorTestUtils.createSimpleDocument("1");
      List<SimpleDocument> docList = new LinkedList<SimpleDocument>();
      docList.add(document);
      documentServed = true;
      return new SimpleDocumentList(docList);
    }
View Full Code Here

  /** Test that the filter doesn't skip if a value is null. */
  public void testNoSkipOnNullValue() throws Exception {
    Map<String, List<Value>> props = createPropertiesSubset(PROP1);
    props.put(PROP1, valueList((String) null));
    Document filter =
        createFilter(PROP1, PATTERN, true, new SimpleDocument(props));
    checkDocument(filter, props);
  }
View Full Code Here

  /** Test that null values match an empty pattern. */
  public void testSkipOnNullValue() throws Exception {
    Map<String, List<Value>> props = createPropertiesSubset(PROP1);
    props.put(PROP1, valueList((String) null));
    Document filter =
        createFilter(PROP1, "\\A\\Z", true, new SimpleDocument(props));
    try {
      checkProperty(filter.findProperty(PROP1));
      fail("SkippedDocumentException expected");
    } catch (SkippedDocumentException expected) {
      // Expected.
View Full Code Here

   * non-public property "nonExistentProperty" that has the value "dummy".
   */
  private SimpleDocument createDocumentWithUnpublishedProperty() {
    Map<String, Object> props =
        ConnectorTestUtils.createSimpleDocumentBasicProperties("dummy");
    return new SimpleDocument(ConnectorTestUtils.createSpiProperties(props)) {
      @Override
      public Property findProperty(String name) {
        if (name.equals("nonExistentProperty")) {
          return new SimpleProperty(valueList("dummy"));
        } else {
View Full Code Here

    factory.setReplacement(CLEAN_STRING);
    factory.setOverwrite(true);
    // Nuke the property, the filter should restore it.
    Map<String, List<Value>> props = createProperties();
    props.put(PROP2, valueList((String) null));
    Document filter = factory.newDocumentFilter(new SimpleDocument(props));
    checkDocument(filter, createProperties());
  }
View Full Code Here

  protected static final String SPACE = " ";
  protected static final String MIMEVALUE = "text/plain;utf-8";

  /** Creates a source Document. */
  protected Document createDocument() {
    return new SimpleDocument(createProperties());
  }
View Full Code Here

TOP

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

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.