Package org.pentaho.reporting.libraries.resourceloader

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceManager.createKey()


        catch (ResourceKeyCreationException ex)
        {
          // ignore ..
        }
      }
      return resourceManager.createKey(uri);
    }
    catch (Exception e)
    {
      return null;
    }
View Full Code Here


    {
      try
      {
        final ResourceManager mgr = new ResourceManager();
        mgr.registerDefaults();
        final ResourceKey key = mgr.createKey(target);
        final Resource resource = mgr.create(key, null, DatabaseConnectionCollection.class);
        final DatabaseConnectionCollection collection = (DatabaseConnectionCollection) resource.getResource();
        for (final IDatabaseConnection connection : collection.getConnections())
        {
          final String id = connection.getId();
View Full Code Here

   */
  private MasterReport parse(final URL file, final URL contentBase)
      throws ResourceException
  {
    final ResourceManager resourceManager = new ResourceManager();
    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();
View Full Code Here

    {
      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

    {
      throw new IOException("File is not a directory.");
    }
    final File contentBase = file.getCanonicalFile().getParentFile();
    final ResourceManager resourceManager = new ResourceManager();
    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();
View Full Code Here

    {
      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

    final byte[] bytes = extractData(input);
    final ResourceManager resourceManager = new ResourceManager();
    final ResourceKey contextKey;
    if (contentBase != null)
    {
      contextKey = resourceManager.createKey(contentBase);
    }
    else
    {
      contextKey = null;
    }
View Full Code Here

    {
      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();
  }

  private MasterReport parseReportDirectly(final InputSource input, final URL contentBase)
View Full Code Here

    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

    parameters.put(ClassicEngineFactoryParameters.PATTERN, pattern);
    parameters.put(ClassicEngineFactoryParameters.EMBED, "true");

    // Add the image as the value attribute
    final ResourceManager resourceManager = report.getResourceManager();
    final ResourceKey imageResourceKey = resourceManager.createKey(image,  parameters);
    element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, imageResourceKey);

    // Add the element to the report
    report.getPageHeader().addElement(element);
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.