Package org.pentaho.reporting.libraries.resourceloader

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


    final Map factoryParameters = key.getFactoryParameters();
    final boolean embedded = Boolean.TRUE.equals(factoryParameters.get(BaseFontResourceFactory.EMBEDDED));
    final String encoding = String.valueOf(factoryParameters.get(BaseFontResourceFactory.ENCODING));
    final String fontType = String.valueOf(factoryParameters.get(BaseFontResourceFactory.FONTNAME));

    final DependencyCollector dc = new DependencyCollector
        (key, data.getVersion(manager));

    final byte[] ttfAfm = data.getResource(manager);
    byte[] pfb = null;
    if (embedded && (fontType.endsWith(".afm") || fontType.endsWith(".pfm")))
    {
      final String pfbFileName = fontType.substring
          (0, fontType.length() - 4) + ".pfb";
      try
      {
        final ResourceKey pfbKey = manager.deriveKey(key, pfbFileName);
        final ResourceData res = manager.load(pfbKey);
        pfb = res.getResource(manager);
        dc.add(pfbKey, res.getVersion(manager));
      }
      catch (ResourceException e)
      {
        // ignore ..
      }
View Full Code Here


        map.put(key, rootHandler.getHelperObject(name));
      }
      map.put(new FactoryParameterKey(ReportParserUtil.INCLUDE_PARSING_KEY), ReportParserUtil.INCLUDE_PARSING_VALUE);

      final ResourceKey target = resourceManager.deriveKey(source, file, map);
      final DependencyCollector dc = rootHandler.getDependencyCollector();

      final Object maybeReport = getRootHandler().getHelperObject(ReportParserUtil.HELPER_OBJ_REPORT_NAME);
      if (maybeReport == null)
      {
        throw new ParseException("Illegal State: No valid report", getRootHandler().getDocumentLocator());
      }

      final Class targetType;
      if (maybeReport instanceof SubReport)
      {
        targetType = SubReport.class;
      }
      else if (maybeReport instanceof MasterReport)
      {
        targetType = MasterReport.class;
      }
      else
      {
        throw new ParseException("Illegal State: No valid report", getRootHandler().getDocumentLocator());
      }

      final Resource resource = resourceManager.create(target, rootHandler.getContext(), targetType);
      dc.add(resource);

    }
    catch (ResourceKeyCreationException e)
    {
      throw new ParseException("Failure while building the resource-key.", e, getLocator());
View Full Code Here

    this.styleKeyRegistry = styleKeyRegistry;
    this.resourceManager = resourceManager;
    this.source = source;
    if (source != null)
    {
      this.dependencies = new DependencyCollector(source, version);
    }

    this.parentRules.clear();
    if (parentRule != null)
    {
View Full Code Here

      handler.initParseContext(inputSource);
      handler.setStyleRule(new CSSStyleRule(null, null));
      parser.parseStyleDeclaration(inputSource);

      final DependencyCollector dependencies = handler.getDependencies();
      if (context != null)
      {
        dependencies.add(data.getKey(), data.getVersion(manager));
      }

      CSSParserContext.getContext().destroy();

      final CSSDeclarationRule styleRule = handler.getStyleRule();
View Full Code Here

      final InputStream stream = data.getResourceAsStream(manager);
      final InputSource inputSource = new InputSource();
      inputSource.setByteStream(stream);
      parser.parseStyleSheet(inputSource);

      final DependencyCollector dependencies = handler.getDependencies();
      if (context != null)
      {
        dependencies.add(data.getKey(), data.getVersion(manager));
      }

      CSSParserContext.getContext().destroy();

      return new CompoundResource
View Full Code Here

        map.put(key, rootHandler.getHelperObject(name));
      }
      map.put(new FactoryParameterKey(ReportParserUtil.INCLUDE_PARSING_KEY), ReportParserUtil.INCLUDE_PARSING_VALUE);

      final ResourceKey target = resourceManager.deriveKey(source, file, map);
      final DependencyCollector dc = rootHandler.getDependencyCollector();

      final Object maybeReport = getRootHandler().getHelperObject(ReportParserUtil.HELPER_OBJ_REPORT_NAME);
      if (maybeReport == null)
      {
        throw new ParseException("Illegal State: No valid report", getRootHandler().getDocumentLocator());
      }

      final Class targetType;
      if (maybeReport instanceof SubReport)
      {
        targetType = SubReport.class;
      }
      else if (maybeReport instanceof MasterReport)
      {
        targetType = MasterReport.class;
      }
      else
      {
        throw new ParseException("Illegal State: No valid report", getRootHandler().getDocumentLocator());
      }

      final Resource resource = resourceManager.create(target, rootHandler.getContext(), targetType);
      dc.add(resource);

    }
    catch (ResourceKeyCreationException e)
    {
      throw new ParseException("Failure while building the resource-key.", e, getLocator());
View Full Code Here

    final Map factoryParameters = key.getFactoryParameters();
    final boolean embedded = Boolean.TRUE.equals(factoryParameters.get(BaseFontResourceFactory.EMBEDDED));
    final String encoding = String.valueOf(factoryParameters.get(BaseFontResourceFactory.ENCODING));
    final String fontType = String.valueOf(factoryParameters.get(BaseFontResourceFactory.FONTNAME));

    final DependencyCollector dc = new DependencyCollector
        (key, data.getVersion(manager));

    final byte[] ttfAfm = data.getResource(manager);
    byte[] pfb = null;
    if (embedded && (fontType.endsWith(".afm") || fontType.endsWith(".pfm")))
    {
      final String pfbFileName = fontType.substring
          (0, fontType.length() - 4) + ".pfb";
      try
      {
        final ResourceKey pfbKey = manager.deriveKey(key, pfbFileName);
        final ResourceData res = manager.load(pfbKey);
        pfb = res.getResource(manager);
        dc.add(pfbKey, res.getVersion(manager));
      }
      catch (ResourceException e)
      {
        // ignore ..
      }
View Full Code Here

    }
    this.firstCall = true;
    this.manager = manager;
    this.source = source;
    this.context = context;
    this.dependencyCollector = new DependencyCollector(source, version);
    this.objectRegistry = new HashMap<String,Object>();
    this.parserConfiguration = new DefaultConfiguration();
    this.commentHandler = new CommentHandler();
    this.namespaces = new FastStack<String>();
  }
View Full Code Here

    {
      final ResourceManager resourceManager = rootHandler.getResourceManager();
      final ResourceKey source = rootHandler.getSource();

      final ResourceKey target = resourceManager.deriveKey(source, file, map);
      final DependencyCollector dc = rootHandler.getDependencyCollector();

      final Resource resource = resourceManager.create(target, rootHandler.getContext(), targetClass);
      dc.add(resource);
      return resource.getResource();
    }
    catch (ResourceLoadingException rle)
    {
      throw rle;
View Full Code Here

    }
    this.firstCall = true;
    this.manager = manager;
    this.source = source;
    this.context = context;
    this.dependencyCollector = new DependencyCollector(source, version);
    this.objectRegistry = new HashMap();
    this.parserConfiguration = new DefaultConfiguration();
    this.commentHandler = new CommentHandler();
    this.namespaces = new FastStack();
  }
View Full Code Here

TOP

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

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.