Package org.pentaho.reporting.libraries.resourceloader

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceCreationException


                                final ResourceKey context) throws ResourceCreationException, ResourceLoadingException
  {
    final CrosstabElement report = (CrosstabElement)res;
    if (report == null)
    {
      throw new ResourceCreationException("Report has not been parsed.");
    }

    // subreports use the content-base of their master-report for now. This is safe for the old platform reports
    // and for bundle-reports.
    report.setDefinitionSource(data.getKey());
View Full Code Here


                                final ResourceKey context) throws ResourceCreationException, ResourceLoadingException
  {
    final SubReport report = (SubReport) res;
    if (report == null)
    {
      throw new ResourceCreationException("Report has not been parsed.");
    }

    // subreports use the content-base of their master-report for now. This is safe for the old platform reports
    // and for bundle-reports.
    report.setDefinitionSource(data.getKey());
View Full Code Here

      }
      return null;
    }
    catch (ParserConfigurationException e)
    {
      throw new ResourceCreationException("Unable to initialize the XML-Parser", e);
    }
    catch (SAXException e)
    {
      throw new ResourceCreationException("Unable to parse the document.", e);
    }
    catch (IOException e)
    {
      throw new ResourceCreationException("Unable to parse the document.", e);
    }
  }
View Full Code Here

          (fontType, encoding, embedded, false, ttfAfm, pfb);
      return new CompoundResource(key, dc, baseFont, getFactoryType());
    }
    catch (Exception e)
    {
      throw new ResourceCreationException
          ("Failed to create the font " + fontType, e);
    }
  }
View Full Code Here

      final ResourceDataInputSource input = new ResourceDataInputSource(data, manager);
      return new DomResource(data.getKey(), db.parse(input), data.getVersion(manager));
    }
    catch (ParserConfigurationException e)
    {
      throw new ResourceCreationException("Unable to initialize the XML-Parser", e);
    }
    catch (SAXException e)
    {
      throw new ResourceCreationException("Unable to parse the document: " + data.getKey(), e);
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Unable to read the stream from document: " + data.getKey(), e);
    }
View Full Code Here

  public Resource create(final ResourceManager caller, final ResourceData data, final ResourceKey context) throws ResourceCreationException, ResourceLoadingException
  {
    if (parent == null)
    {
      throw new ResourceCreationException("Cannot create resource: Batik libraries are not available.");
    }
    return parent.create(caller, data, context);
  }
View Full Code Here

  public Resource create(final ResourceManager caller, final ResourceData data, final ResourceKey context) throws ResourceCreationException, ResourceLoadingException
  {
    if (parent == null)
    {
      throw new ResourceCreationException("Cannot create resource: Batik libraries are not available.");
    }
    return parent.create(caller, data, context);
  }
View Full Code Here

  public Resource create(final ResourceManager caller, final ResourceData data, final ResourceKey context) throws ResourceCreationException, ResourceLoadingException
  {
    if (parent == null)
    {
      throw new ResourceCreationException("Cannot create resource: Pixie library is not available.");
    }
    return parent.create(caller, data, context);
  }
View Full Code Here

    {
      image = createImage(resource);
    }
    catch (IOException e)
    {
      throw new ResourceCreationException("Failed to load the image.", e);
    }
   
    if (image == null)
    {
      throw new ResourceCreationException("Failed to load the image. ImageIO#read returned null");
    }

    return new SimpleResource(data.getKey(), image, Image.class, version);
  }
View Full Code Here

      final XMLReader reader = parser.getXMLReader();
      final XmlFactoryModule[] rootHandlers = getModules();
      if (rootHandlers.length == 0)
      {
        throw new ResourceCreationException("There are no root-handlers registered for the factory for type " + getFactoryType());
      }

      final ResourceDataInputSource input = new ResourceDataInputSource(data, manager);

      final ResourceKey contextKey;
      final long version;
      final ResourceKey targetKey = data.getKey();
      if (context == null)
      {
        contextKey = targetKey;
        version = data.getVersion(manager);
      }
      else
      {
        contextKey = context;
        version = -1;
      }

      final RootXmlReadHandler handler = createRootHandler(manager, targetKey, rootHandlers, contextKey, version);

      final DefaultConfiguration parserConfiguration = handler.getParserConfiguration();
      final URL value = manager.toURL(contextKey);
      if (value != null)
      {
        parserConfiguration.setConfigProperty(CONTENTBASE_KEY, value.toExternalForm());
      }

      configureReader(reader, handler);
      reader.setContentHandler(handler);
      reader.setDTDHandler(handler);
      reader.setEntityResolver(handler.getEntityResolver());
      reader.setErrorHandler(getErrorHandler());

      final Map parameters = targetKey.getFactoryParameters();
      final Iterator it = parameters.keySet().iterator();
      while (it.hasNext())
      {
        final Object o = it.next();
        if (o instanceof FactoryParameterKey)
        {
          final FactoryParameterKey fpk = (FactoryParameterKey) o;
          handler.setHelperObject(fpk.getName(), parameters.get(fpk));
        }
      }

      reader.parse(input);

      final Object createdProduct = finishResult
          (handler.getResult(), manager, data, contextKey);
      handler.getDependencyCollector().add(targetKey, data.getVersion(manager));
      return createResource(targetKey, handler, createdProduct, getFactoryType());
    }
    catch (ParserConfigurationException e)
    {
      throw new ResourceCreationException("Unable to initialize the XML-Parser", e);
    }
    catch (SAXException e)
    {
      throw new ResourceCreationException("Unable to parse the document: " + data.getKey(), e);
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Unable to read the stream from document: " + data.getKey(), e);
    }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.resourceloader.ResourceCreationException

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.