Package com.google.enterprise.connector.spi

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


    testDoc.setSharepointClientContext(doc.getSharepointClientContext());
    testDoc.setContentDwnldURL(TestConfiguration.Site1_List_Item_MSG_File_URL
        + ".invalid.txt");
    assertNull(testDoc.getContent());

    final Property prop = testDoc.findProperty(SPConstants.HTTP_STATUS_CODE);
    assertNotNull(prop);
    assertEquals("404", prop.nextValue().toString());
    assertNull(prop.nextValue());
  }
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 {
              InputStream in =
                  ((BinaryValue) value).getInputStream();
View Full Code Here

        .contains(contentNonce));
  }
 
  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

    boolean isTested = false;
    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) {
        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();
      if (ActionType.ADD.equals(actionType)) {
        IBaseObject object = os.getObject(null, id);
View Full Code Here

   */
  public void testFindProperty() throws RepositoryException {
    FileDocument fd =
        new FileDocument(new FnId(TestConnection.docId1), ios, connec);

    Property prop = fd.findProperty("Id");
    assertEquals(TestConnection.docId1, prop.nextValue().toString());

    // TODO(tdnguyen) Revisit these test cases after fixing Permissions
    // to avoid hard-coding users' names for allow and deny.
    Property allowUsers = fd.findProperty(SpiConstants.PROPNAME_ACLUSERS);
    assertNotNull(allowUsers);

    Property denyUsers = fd.findProperty(SpiConstants.PROPNAME_ACLDENYUSERS);
    assertNotNull(denyUsers);

    Property allowGroups = fd.findProperty(SpiConstants.PROPNAME_ACLGROUPS);
    assertNotNull(allowGroups);

    Property denyGroups = fd.findProperty(SpiConstants.PROPNAME_ACLDENYGROUPS);
    assertNotNull(denyGroups);
  }
View Full Code Here

  private void testTraversalContext(TraversalContext traversalContext,
      long dataSize, Content contentState) throws RepositoryException {
    DocumentList list = getObjectUnderTest(traversalContext, dataSize);

    Document doc = list.nextDocument();
    Property content = doc.findProperty(SpiConstants.PROPNAME_CONTENT);
    if (contentState == Content.NULL) {
      assertNull("Expected null content", content);
    } else if (contentState == Content.NON_NULL) {
      assertNotNull("Expected non-null content", content);
    } else {
View Full Code Here

  private Set<String> getPrincipalsNames(Document doc, String propertyName)
      throws RepositoryException {
    Set<String> names = new HashSet<String>();;
    PrincipalValue prValue;
    Property property = doc.findProperty(propertyName);
    while ((prValue = (PrincipalValue) property.nextValue()) != null) {
      names.add(prValue.getPrincipal().getName());
    }
    return names;
  }
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.