Examples of ResourceManager


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

    if (fieldName == null)
    {
      throw new SAXException("Required attribute 'fieldname' is missing.");
    }
    elementFactory.setFieldname(fieldName);
    final ResourceManager resourceManager = getRootHandler().getResourceManager();
    elementFactory.setBaseURL(resourceManager.toURL(getRootHandler().getContext()));
  }
View Full Code Here

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

        }
        else
        {
          try
          {
            final ResourceManager resourceManager = getResourceManager();
            final com.lowagie.text.Image instance;
            final Object maybeImage = imageCache.get(resource);
            if (maybeImage != null)
            {
              instance = (com.lowagie.text.Image) maybeImage;
            }
            else
            {
              final ResourceData data = resourceManager.load(resource);
              instance = com.lowagie.text.Image.getInstance(data.getResource(resourceManager));
              imageCache.put(resource, instance);
            }

            final Resource imageWrapped = resourceManager.create(resource, null, Image.class);
            final Image image = (Image) imageWrapped.getResource();

            if (drawImage(content, image, instance))
            {
              drawImageMap(content);
View Full Code Here

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

    final ModifiableConfiguration repConf =
        new HierarchicalConfiguration(report.getReportConfiguration());
    final ResourceKey contentBase = report.getContentBase();
    if (contentBase != null)
    {
      final ResourceManager resourceManager = report.getResourceManager();
      final URL value = resourceManager.toURL(contentBase);
      if (value != null)
      {
        repConf.setConfigProperty
            (AbstractXmlResourceFactory.CONTENTBASE_KEY, value.toExternalForm());
      }
View Full Code Here

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

    handleSource(atts);
  }

  private void handleSource(final PropertyAttributes atts)
  {
    final ResourceManager resourceManager = getRootHandler().getResourceManager();
    elementFactory.setBaseURL(resourceManager.toURL(getRootHandler().getContext()));
    elementFactory.setContent(atts.getValue(getUri(), ImageRefReadHandler.SRC_ATT));
  }
View Full Code Here

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

  {
    outputProcessorMetaData = new GenericOutputProcessorMetaData();
    layoutSupport = new DefaultLayoutSupport(true, true);
    resourceBundleFactory = new DefaultResourceBundleFactory();
    configuration = ClassicEngineBoot.getInstance().getGlobalConfig();
    resourceManager = new ResourceManager();
    resourceManager.registerDefaults();
    reportEnvironment = new DefaultReportEnvironment(configuration);
    try
    {
      this.contentBase = resourceManager.createKey(new File("."));
View Full Code Here

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

   * @throws ResourceException if parsing or loading failed for some reason.
   */
  private MasterReport parse(final URL file, final URL contentBase)
      throws ResourceException
  {
    final ResourceManager resourceManager = new ResourceManager();
    resourceManager.registerDefaults();

    final ResourceKey contextKey = resourceManager.createKey(contentBase);

    // Build the main key. That key also contains all context/parse-time
    // parameters as they will influence the resulting report. It is not
    // wise to keep caching independent from that.
    final HashMap map = new HashMap();
    final Iterator it = this.helperObjects.keySet().iterator();
    while (it.hasNext())
    {
      final String name = (String) it.next();
      map.put(new FactoryParameterKey(name), helperObjects.get(name));
    }

    final ResourceKey key = resourceManager.createKey(file, map);
    final Resource resource = resourceManager.create(key, contextKey, MasterReport.class);
    return (MasterReport) resource.getResource();
  }
View Full Code Here

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

    if (file.isDirectory())
    {
      throw new IOException("File is not a directory.");
    }
    final File contentBase = file.getCanonicalFile().getParentFile();
    final ResourceManager resourceManager = new ResourceManager();
    resourceManager.registerDefaults();

    final ResourceKey contextKey = resourceManager.createKey(contentBase);

    // Build the main key. That key also contains all context/parse-time
    // parameters as they will influence the resulting report. It is not
    // wise to keep caching independent from that.
    final HashMap map = new HashMap();
    final Iterator it = this.helperObjects.keySet().iterator();
    while (it.hasNext())
    {
      final String name = (String) it.next();
      map.put(new FactoryParameterKey(name), helperObjects.get(name));
    }

    final ResourceKey key = resourceManager.createKey(file, map);
    final Resource resource = resourceManager.create(key, contextKey, MasterReport.class);
    return (MasterReport) resource.getResource();
  }
View Full Code Here

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

      return parseReportDirectly(input, contentBase);
    }

    final byte[] bytes = extractData(input);
    final ResourceManager resourceManager = new ResourceManager();
    resourceManager.registerDefaults();

    final ResourceKey contextKey;
    if (contentBase != null)
    {
      contextKey = resourceManager.createKey(contentBase);
    }
    else
    {
      contextKey = null;
    }
    final HashMap map = new HashMap();

    final Iterator it = this.helperObjects.keySet().iterator();
    while (it.hasNext())
    {
      final String name = (String) it.next();
      map.put(new FactoryParameterKey(name), helperObjects.get(name));
    }

    final ResourceKey key = resourceManager.createKey(bytes, map);
    final Resource resource = resourceManager.create(key, contextKey, MasterReport.class);
    return (MasterReport) resource.getResource();
  }
View Full Code Here

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

  }

  private MasterReport parseReportDirectly(final InputSource input, final URL contentBase)
      throws ResourceKeyCreationException, ResourceCreationException, ResourceLoadingException
  {
    final ResourceManager manager = new ResourceManager();
    manager.registerDefaults();

    final HashMap map = new HashMap();

    final Iterator it = this.helperObjects.keySet().iterator();
    while (it.hasNext())
    {
      final String name = (String) it.next();
      map.put(new FactoryParameterKey(name), helperObjects.get(name));
    }

    final MasterReportXmlResourceFactory resourceFactory = new MasterReportXmlResourceFactory();
    resourceFactory.initializeDefaults();
    if (contentBase != null)
    {
      return (MasterReport) resourceFactory.parseDirectly(manager, input, manager.createKey(contentBase), map);
    }
    else
    {
      return (MasterReport) resourceFactory.parseDirectly(manager, input, null, map);
    }
View Full Code Here

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

                                  final ResourceKey contextKey)
      throws ResourceException
  {
    if (manager == null)
    {
      manager = new ResourceManager();
      manager.registerDefaults();
    }

    final HashMap map = new HashMap(input.getFactoryParameters());
    final Iterator it = this.helperObjects.keySet().iterator();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.