Package org.pentaho.reporting.libraries.repository

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


    {
      final String[] splitName = RepositoryUtilities.split(name, "/");
      final ContentEntity contentEntity = RepositoryUtilities.getEntity(zipRepository, splitName);
      if (contentEntity instanceof ContentItem)
      {
        final ContentItem contentItem = (ContentItem) contentEntity;
        return contentItem.getInputStream();
      }
    }
    catch (ContentIOException cioe)
    {
      if (logger.isDebugEnabled())
View Full Code Here


    {
      final String[] splitName = RepositoryUtilities.split(name, "/");
      final ContentEntity contentEntity = RepositoryUtilities.getEntity(zipRepository, splitName);
      if (contentEntity instanceof ContentItem)
      {
        final ContentItem contentItem = (ContentItem) contentEntity;
        return contentItem.getMimeType();
      }
      return ""; // for directories ..
    }
    catch (ContentIOException cioe)
    {
View Full Code Here

    {
      final String[] splitName = RepositoryUtilities.split(name, "/");
      final ContentEntity contentEntity = RepositoryUtilities.getEntity(repository, splitName);
      if (contentEntity instanceof ContentItem)
      {
        final ContentItem contentItem = (ContentItem) contentEntity;
        return contentItem.getInputStream();
      }
    }
    catch (ContentIOException cioe)
    {
      if (logger.isDebugEnabled())
View Full Code Here

    {
      final String[] splitName = RepositoryUtilities.split(name, "/");
      final ContentEntity contentEntity = RepositoryUtilities.getEntity(repository, splitName);
      if (contentEntity instanceof ContentItem)
      {
        final ContentItem contentItem = (ContentItem) contentEntity;
        return contentItem.getMimeType();
      }
    }
    catch (ContentIOException cioe)
    {
      // ignored.
View Full Code Here

    {
      xmlWriter.close();
      return;
    }

    ContentItem styleFile = getStyleFile();
    if (styleFile != null)
    {
      final String encoding = getConfiguration().getConfigProperty
          (HtmlTableModule.ENCODING, EncodingRegistry.getPlatformDefaultEncoding());
      final Writer styleOut = new OutputStreamWriter
          (new BufferedOutputStream(styleFile.getOutputStream()), encoding);
      getStyleManager().write(styleOut);
      styleOut.flush();
      styleOut.close();

      if (isForceBufferedWriting() == false)
View Full Code Here

      final MasterReport masterReport = getReport();
      final Configuration configuration = masterReport.getConfiguration();

      final ContentLocation contentLocation = getBodyContentLocation();
      final NameGenerator nameGenerator = getBodyNameGenerator();
      final ContentItem contentItem =
          contentLocation.createItem(nameGenerator.generateName(null, "text/xml"));
      final OutputStream outputStream = contentItem.getOutputStream();

      try
      {
        final XmlTableOutputProcessor outputProcessor =
            new XmlTableOutputProcessor(outputStream);
View Full Code Here

      final MasterReport masterReport = getReport();
      final Configuration configuration = masterReport.getConfiguration();

      final ContentLocation contentLocation = getBodyContentLocation();
      final NameGenerator nameGenerator = getBodyNameGenerator();
      final ContentItem contentItem =
          contentLocation.createItem(nameGenerator.generateName(null, "application/rtf"));
      final OutputStream outputStream = contentItem.getOutputStream();

      try
      {
        final FlowRTFOutputProcessor outputProcessor =
            new FlowRTFOutputProcessor(configuration, outputStream, masterReport.getResourceManager());
View Full Code Here

      final ResourceData resourceData = resourceManager.load(source);
      final String mimeType = queryMimeType(resourceData);
      if (isValidImage(mimeType))
      {
        // lets do some voodo ..
        final ContentItem item = dataLocation.createItem
            (dataNameGenerator.generateName(extractFilename(resourceData), mimeType));
        if (item.isWriteable())
        {
          item.setAttribute(LibRepositoryBoot.REPOSITORY_DOMAIN, LibRepositoryBoot.CONTENT_TYPE, mimeType);

          // write it out ..
          final InputStream stream = new BufferedInputStream(resourceData.getResourceAsStream(resourceManager));
          try
          {
            final OutputStream outputStream = new BufferedOutputStream(item.getOutputStream());
            try
            {
              IOUtils.getInstance().copyStreams(stream, outputStream);
            }
            finally
View Full Code Here

      {
        return null;
      }
      // write the encoded picture ...
      final String filename = IOUtils.getInstance().stripFileExtension(data.getOriginalFileName());
      final ContentItem dataFile = dataLocation.createItem
          (dataNameGenerator.generateName(filename, data.getMimeType()));
      final String contentURL = rewriterService.rewriteContentDataItem(dataFile);

      // a png encoder is included in JCommon ...
      final OutputStream out = new BufferedOutputStream(dataFile.getOutputStream());
      try
      {
        out.write(data.getImageData());
        out.flush();
      }
View Full Code Here

      final MasterReport masterReport = getReport();
      final Configuration configuration = masterReport.getConfiguration();

      final ContentLocation contentLocation = getBodyContentLocation();
      final NameGenerator nameGenerator = getBodyNameGenerator();
      final ContentItem contentItem =
          contentLocation.createItem(nameGenerator.generateName(null, "application/rtf"));
      final OutputStream outputStream = contentItem.getOutputStream();

      try
      {
        final StreamRTFOutputProcessor outputProcessor =
            new StreamRTFOutputProcessor(configuration, outputStream, masterReport.getResourceManager());
View Full Code Here

TOP

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

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.