Package com.google.enterprise.connector.dctm.dfcwrap

Examples of com.google.enterprise.connector.dctm.dfcwrap.IFormat


    document = createNewDocument(session);
  }

  public void testGetFormat() throws RepositoryException {
    try {
      IFormat format = object.getFormat();
      Assert.assertNotNull(format);
    } finally {
      if (session != null) {
        sessionManager.release(session);
      }
View Full Code Here


    object.setSessionManager(sessionManager);
  }

  public void testGetFormat() throws RepositoryException {
    try {
      IFormat format = object.getFormat();
      Assert.assertNotNull(format);
    } finally {
      if (session != null) {
        sessionManager.release(session);
      }
View Full Code Here

      return findFolderProperty(name, values);
    } else if (SpiConstants.PROPNAME_ISPUBLIC.equals(name)) {
      values.add(Value.getBooleanValue(traversalManager.isPublic()));
    } else if (SpiConstants.PROPNAME_MIMETYPE.equals(name)) {
      try {
        IFormat dctmForm = object.getFormat();
        String mimetype = dctmForm.getMIMEType();
        logger.fine("mimetype of the document " + versionId + ": " + mimetype);
        // The GSA will not index empty documents with binary content types,
        // so omit the content type if the document cannot be indexed.
        if (canIndex(false)) {
          values.add(Value.getStringValue(mimetype));
View Full Code Here

  public void testCanIndexExcel() throws DfException, RepositoryException {
    String idString = getAnExistingExcelObjectId(session);
    IId id = dctmClientX.getId(idString);
    ISysObject object = (ISysObject) session.getObject(id);
    IFormat dctmForm = (DmFormat) object.getFormat();

    Assert.assertNotNull(dctmForm);
    Assert.assertTrue(dctmForm.canIndex());

  }
View Full Code Here

  public void testCanIndexAccess() throws DfException, RepositoryException {
    String idString = getAnExistingAccessObjectId(session);

    IId id = dctmClientX.getId(idString);
    ISysObject object = (ISysObject) session.getObject(id);
    IFormat dctmForm = (DmFormat) object.getFormat();

    Assert.assertNotNull(dctmForm);
    Assert.assertFalse(dctmForm.canIndex());
  }
View Full Code Here

  public void testCanIndexPDF() throws DfException, RepositoryException {
    String idString = getAnExistingPDFObjectId(session);
    IId id = dctmClientX.getId(idString);
    ISysObject object = (ISysObject) session.getObject(id);
    IFormat dctmForm = (DmFormat) object.getFormat();

    Assert.assertNotNull(dctmForm);
    Assert.assertTrue(dctmForm.canIndex());
  }
View Full Code Here

  public void testGetPDFMIMEType() throws DfException, RepositoryException {
    String idString = getAnExistingPDFObjectId(session);
    IId id = dctmClientX.getId(idString);
    ISysObject object = (ISysObject) session.getObject(id);
    IFormat dctmForm = (DmFormat) object.getFormat();

    Assert.assertEquals(dctmForm.getMIMEType(), "application/pdf");
  }
View Full Code Here

  public void testGetExcelMIMEType() throws DfException, RepositoryException {
    String idString = getAnExistingExcelObjectId(session);
    IId id = dctmClientX.getId(idString);
    ISysObject object = (ISysObject) session.getObject(id);
    IFormat dctmForm = (DmFormat) object.getFormat();

    Assert.assertEquals(dctmForm.getMIMEType(), "application/vnd.ms-excel");
  }
View Full Code Here

  public void testGetWordMIMEType() throws DfException, RepositoryException {
    String idString = getAnExistingWordObjectId(session);
    IId id = dctmClientX.getId(idString);
    ISysObject object = (ISysObject) session.getObject(id);
    IFormat dctmForm = (DmFormat) object.getFormat();

    Assert.assertEquals(dctmForm.getMIMEType(), "application/msword");
  }
View Full Code Here

    // Don't send content that is too big or too small.
    long contentSize = object.getContentSize();
    TraversalContext traversalContext = traversalManager.getTraversalContext();

    // Don't send content whose mimetype is not supported.
    IFormat format = object.getFormat();
    String mimetype = format.getMIMEType();
    if (traversalContext != null) {
      int supportLevel = traversalContext.mimeTypeSupportLevel(mimetype);
      if (supportLevel < 0) {
        if (logging) {
          logger.fine("excluded content format: " + format.getName());
        }
        throw new SkippedDocumentException("Excluded by content type: "
                                           + mimetype);
      }
      if (supportLevel == 0) {
        if (logging) {
          logger.fine("unindexable content format: " + format.getName());
        }
        return false;
      }
      if (contentSize > traversalContext.maxDocumentSize()) {
        if (logging) {
          logger.fine("content is too large: " + contentSize);
        }
        return false;
      }
    } else {
      if (!format.canIndex()) {
        if (logging) {
          logger.fine("unindexable content format: " + format.getName());
        }
        return false;
      }
      if (contentSize > MAX_CONTENT_SIZE) {
        if (logging) {
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.dctm.dfcwrap.IFormat

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.