Package org.pentaho.reporting.libraries.resourceloader

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


      }
    }
    try
    {
      final ResourceKey contentBase = runtime.getProcessingContext().getContentBase();
      final ResourceManager resManager = runtime.getProcessingContext().getResourceManager();
      final ResourceKey key;
      if (value instanceof ResourceKey)
      {
        key = (ResourceKey) value;
      }
      else if (value instanceof Blob)
      {
        final Blob b = (Blob) value;
        final byte[] data = IOUtils.getInstance().readBlob(b);
        key = resManager.createKey(data);
      }
      else if (value instanceof String)
      {
        final Object baseURL = element.getAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.CONTENT_BASE);
        if (baseURL instanceof String)
        {
          final ResourceKey baseKey = createKeyFromString(resManager, null, (String) baseURL);
          key = createKeyFromString(resManager, baseKey, (String) value);
        }
        else if (baseURL instanceof ResourceKey)
        {
          final ResourceKey baseKey = (ResourceKey) baseURL;
          key = createKeyFromString(resManager, baseKey, (String) value);
        }
        else if (baseURL != null)
        {
          // if a base-url object is given, we assume that it is indeed valid.
          final ResourceKey baseKey = resManager.createKey(baseURL);
          key = createKeyFromString(resManager, baseKey, (String) value);
        }
        else
        {
          key = createKeyFromString(resManager, contentBase, (String) value);
        }
      }
      else
      {
        key = resManager.createKey(value);
      }
      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


  private ResourceManager locateResourceManager()
  {
    final ReportDefinition reportDefinition = getReportDefinition();
    if (reportDefinition instanceof AbstractReportDefinition == false)
    {
      final ResourceManager retval = new ResourceManager();
      retval.registerDefaults();
      return retval;
    }

    final AbstractReportDefinition abstractReportDefinition = (AbstractReportDefinition) reportDefinition;
    return abstractReportDefinition.getResourceManager();
View Full Code Here

      throw new NullPointerException("URL must not be null.");
    }

    try
    {
      final ResourceManager resourceManager = new ResourceManager();
      resourceManager.registerDefaults();
      final Resource resource = resourceManager.createDirectly(url, Image.class);

      this.url = url;
      this.resourceKey = resource.getSource();
      this.image = (Image) resource.getResource();
    }
View Full Code Here

        return masterReport.getResourceManager();
      }
      parent = parent.getParentSection();
    }

    final ResourceManager manager = new ResourceManager();
    manager.registerDefaults();
    return manager;
  }
View Full Code Here

   */
  protected void startParsing(final Attributes attrs) throws SAXException
  {
    super.startParsing(attrs);

    final ResourceManager resourceManager = getRootHandler().getResourceManager();
    final ResourceKey context = getRootHandler().getContext();

    final Configuration configuration = ClassicEngineBoot.getInstance().getGlobalConfig();
    final Iterator keys = configuration.findPropertyKeys(ElementMetaDataParser.GLOBAL_INCLUDES_PREFIX);
    while (keys.hasNext())
    {
      final String key = (String) keys.next();
      final String href = configuration.getConfigProperty(key);
      if (StringUtils.isEmpty(href, true))
      {
        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

  private transient ResourceManager resourceManager;
  private transient ResourceKey contextKey;

  public SimplePmdDataFactory()
  {
    resourceManager = new ResourceManager();
    resourceManager.registerDefaults();
  }
View Full Code Here

    this.resourceManager = resourceManager;
    this.contextKey = contextKey;

    if (this.resourceManager == null)
    {
      this.resourceManager = new ResourceManager();
      this.resourceManager.registerDefaults();
    }
  }
View Full Code Here

  {
    final File file = new File (textField.getText());

    try
    {
      ResourceManager manager = new ResourceManager();
      manager.registerDefaults();
      Resource res = manager.createDirectly(file, MasterReport.class);
      return (MasterReport) res.getResource();
    }
    catch (Exception e)
    {
      throw new ReportDefinitionException("Parsing failed", e);
View Full Code Here

  private transient ResourceKey contextKey;

  public XPathDataFactory()
  {
    queries = new HashMap<String, String>();
    resourceManager = new ResourceManager();
    resourceManager.registerDefaults();
  }
View Full Code Here

        }

        this.masterValues = (ArrayList) jobProperties.getProperty(ReportEngineParameterNames.INPUT_MASTER_VALUES);
        this.detailColumns = (ArrayList) jobProperties.getProperty(ReportEngineParameterNames.INPUT_DETAIL_COLUMNS);

        this.resourceManager = new ResourceManager();
        this.resourceManager.registerDefaults();
        this.resourceManager.registerLoader(new InputRepositoryLoader(inputRepository));

        try
        {
View Full Code Here

TOP

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

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.