Package org.pentaho.reporting.libraries.repository

Examples of org.pentaho.reporting.libraries.repository.DefaultMimeRegistry


    {
      return null;
    }

    final boolean embedded = isEmbeddedKey(report, resourceKey);
    final DefaultMimeRegistry mimeRegistry = new DefaultMimeRegistry();

    // Determine if this key should be embedded
    final Map factoryParameters = resourceKey.getFactoryParameters();
    if (embedded == false &&
        "true".equals(factoryParameters.get(ClassicEngineFactoryParameters.EMBED)) == false &&
        RawResourceLoader.SCHEMA_NAME.equals(resourceKey.getSchema()) == false)
    {
      return null;
    }

    try
    {
      // Embed the key into the document bundle
      String mimeType = (String) factoryParameters.get(ClassicEngineFactoryParameters.MIME_TYPE);
      final String originalValue = (String) factoryParameters.get(ClassicEngineFactoryParameters.ORIGINAL_VALUE);
      if (mimeType == null)
      {
        final ResourceData resourceData = report.getResourceManager().load(resourceKey);
        final Object originalMimeType = resourceData.getAttribute(ResourceData.CONTENT_TYPE);
        if (originalMimeType instanceof String)
        {
          mimeType = (String) originalMimeType;
        }
        else
        {
          mimeType = mimeRegistry.getMimeType(originalValue);
        }
      }

      String pattern = (String) factoryParameters.get(ClassicEngineFactoryParameters.PATTERN);
      if (pattern == null)
View Full Code Here


   * Creates a new dummy repository.
   */
  public DummyRepository()
  {
    location = new DummyContentLocation(this, "");
    mimeRegistry = new DefaultMimeRegistry();
  }
View Full Code Here

  private ZipContentLocation root;
  private MimeRegistry mimeRegistry;

  public ZipRepository()
  {
    this(new DefaultMimeRegistry());
  }
View Full Code Here

    this.root = new ZipContentLocation(this, null, "");
  }

  public ZipRepository(final InputStream in) throws IOException
  {
    this(in, new DefaultMimeRegistry());
  }
View Full Code Here

   * @param file the directory, which should form the root of the repository.
   * @throws ContentIOException if an error prevents the repository creation.
   */
  public FileRepository(final File file) throws ContentIOException
  {
    this(file, new DefaultMimeRegistry());
  }
View Full Code Here

  }

  public ZipRepository(final OutputStream out,
                       final int level)
  {
    this(out, level, new DefaultMimeRegistry());
  }
View Full Code Here

    this(out, level, new DefaultMimeRegistry());
  }

  public ZipRepository(final OutputStream out)
  {
    this(out, Deflater.DEFAULT_COMPRESSION, new DefaultMimeRegistry());
  }
View Full Code Here

  private ZipReadContentLocation root;
  private MimeRegistry mimeRegistry;

  public ZipReadRepository(final InputStream in) throws IOException
  {
    this(in, new DefaultMimeRegistry());
  }
View Full Code Here

  }

  public EmailRepository(final MimeMessage htmlEmail)
      throws ContentIOException, IOException, MessagingException
  {
    this(htmlEmail, new DefaultMimeRegistry());
  }
View Full Code Here

    this(htmlEmail, new DefaultMimeRegistry());
  }

  public EmailRepository(final Session session) throws ContentIOException, MessagingException
  {
    this(new DefaultMimeRegistry(), session);
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.repository.DefaultMimeRegistry

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.