Package org.pentaho.reporting.libraries.resourceloader

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


    final ResourceManager resourceManager = getRootHandler().getResourceManager();
    final ResourceKey context = getRootHandler().getContext();
    try
    {
      final ResourceKey resourceKey = resourceManager.deriveKey(context, href);
      final Resource resource = resourceManager.create(resourceKey, null, GlobalMetaDefinition.class);
      result = (GlobalMetaDefinition) resource.getResource();
    }
    catch (ResourceException e)
    {
      throw new ParseException("Failed to parse included global definitions", e, getLocator());
View Full Code Here


      else
      {
        target = SubReport.class;
      }

      final Resource resource = resManager.create(key, contentBase, target);
      final Object resourceContent = resource.getResource();
      if (resourceContent instanceof Element)
      {
        return resourceContent;
      }
View Full Code Here

      if (key == null)
      {
        return null;
      }

      final Resource resource = resManager.create(key, contentBase, ContentType.TARGETS);
      final Object resourceContent = resource.getResource();
      if (resourceContent instanceof DrawableWrapper)
      {
        return resourceContent;
      }
View Full Code Here

        continue;
      }
      try
      {
        final ResourceKey resourceKey = resourceManager.deriveKey(context, href);
        final Resource resource = resourceManager.create(resourceKey, null, GlobalMetaDefinition.class);
        globalMetaDefinition.merge((GlobalMetaDefinition) resource.getResource());
      }
      catch (ResourceException e)
      {
        logger.warn("Failed to parse included global definitions: " + getLocator(), e);
View Full Code Here

      else
      {
        key = manager.deriveKey(source, uri);
      }

      final Resource res = manager.create(key, source, StyleSheet.class);
      if (res == null)
      {
        return;
      }
      final StyleSheet styleSheet = (StyleSheet) res.getResource();
View Full Code Here

    p1.store(outputStream, "run 1");
    outputStream.close();

    final ResourceManager resourceManager = bundle.getResourceManager();
    final ResourceKey key = resourceManager.deriveKey(bundle.getBundleMainKey(), "test.properties");
    final Resource res1 = resourceManager.create(key, null, Properties.class);
    assertEquals(p1, res1.getResource());

    bundle.removeEntry("test.properties");

    final Properties p2 = new Properties();
View Full Code Here

    final OutputStream outputStream2 = bundle.createEntry("test.properties", "text/plain");
    p2.store(outputStream2, "run 2");
    outputStream2.close();

    final Resource res2 = resourceManager.create(key, null, Properties.class);
    assertEquals(p2, res2.getResource());
  }


  public void testPrd4680() throws IOException, ResourceException, InterruptedException
View Full Code Here

      {
        throw new FunctionEvaluationException
            ("Failed to create URI: Resource loading failed: Key not derivable");
      }

      final Resource res = manager.create(key, baseKey, type);
      return new CSSResourceValue(res);
    }
    catch (Exception e)
    {
      throw new FunctionEvaluationException
View Full Code Here

    try
    {
      final ResourceManager resourceManager = getRootHandler().getResourceManager();
      final ResourceKey key = resourceManager.deriveKey(getRootHandler().getSource(), href);
      final Resource resource = resourceManager.create(key, null, MasterReport.class);
      report = (MasterReport) resource.getResource();
    }
    catch (ResourceException re)
    {
      throw new ParseException("Mandatory attribute 'href' is not pointing to a valid report.", re, getLocator());
View Full Code Here

      final ResourceKey key = getRootHandler().getSource();
      final ResourceManager manager = getRootHandler().getResourceManager();
      try
      {
        final ResourceKey derivedKey = manager.deriveKey(key, href);
        final Resource resource = manager.create(derivedKey, null, DataFactory.class);
        getRootHandler().getDependencyCollector().add(resource);
        dataFactory = (DataFactory) resource.getResource();
      }
      catch (ResourceKeyCreationException e)
      {
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.