Package org.pentaho.reporting.libraries.resourceloader

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


    {
      return;
    }

    final String contentBasePath = String.valueOf(contentBasePathRaw);
    final ResourceManager resourceManager = state.getMasterReport().getResourceManager();

    for (int i = 0; i < datas.length; i++)
    {
      final ExpressionPropertyMetaData attributeMetaData = datas[i];
      final Object attValue = beanUtility.getProperty(attributeMetaData.getName());
View Full Code Here


          element.setAttribute(namespace, name, attributeValue);
          return;
        }
        if ("resource-key".equals(type))
        {
          final ResourceManager resourceManager = getRootHandler().getResourceManager();
          final ResourceKey key = getRootHandler().getContext();
          final ResourceKey parent = key.getParent();
          final ResourceKey valueKey = resourceManager.deserialize(parent, attributeValue);

          // make local ..
          final ResourceKey resourceKey = localizeKey(resourceManager, valueKey);
          element.setAttribute(namespace, name, resourceKey);
          return;
View Full Code Here

      throw new SAXException("Required attribute 'src' is missing.");
    }


    elementFactory.setContent(content);
    final ResourceManager resourceManager = getRootHandler().getResourceManager();
    elementFactory.setBaseURL(resourceManager.toURL(getRootHandler().getContext()));
  }
View Full Code Here

    {
      throw new NullPointerException();
    }
    final DefaultFontStorage fontStorage = new DefaultFontStorage(new AWTFontRegistry());
    metaData = new GraphicsOutputProcessorMetaData(configuration, fontStorage);
    resourceManager = new ResourceManager();
    resourceManager.registerDefaults();
  }
View Full Code Here

    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

        }
        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

    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

    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

  {
    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

   * @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

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.