Package org.pentaho.reporting.libraries.resourceloader

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


    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


        throw new IllegalStateException("No definition for " + report);
      }

      try
      {
        final Resource res = resManager.createDirectly(url, MasterReport.class);
        final Object resource = res.getResource();
        assertNotNull(resource);
      }
      finally
      {
        System.out.println("Failed: " + report);
View Full Code Here

  {
    final URL url = getClass().getResource("prd-2933.prpt");
    assertNotNull(url);
    final ResourceManager resourceManager = new ResourceManager();
    resourceManager.registerDefaults();
    final Resource directly = resourceManager.createDirectly(url, MasterReport.class);
    final MasterReport report = (MasterReport) directly.getResource();
    final EventMonitorFunction eventMonitorFunction = new EventMonitorFunction("Name");
    eventMonitorFunction.setDeepTraversing(true);
    report.addExpression(eventMonitorFunction);

    final PrintReportProcessor prc = new PrintReportProcessor(report);
View Full Code Here

  private String computeNameFromMetadata(final ResourceManager resourceManager, final ResourceKey key)
  {
    try
    {
      final Resource res = resourceManager.create(key, null, new Class[]{DocumentBundle.class});
      final DocumentBundle rawResource = (DocumentBundle) res.getResource();
      final Object possibleTitle = rawResource.getMetaData().getBundleAttribute
          (ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.TITLE);
      if (possibleTitle != null)
      {
        return possibleTitle.toString();
View Full Code Here

  private String computeNameFromReport(final ResourceManager resourceManager, final ResourceKey key)
  {
    try
    {
      final Resource res = resourceManager.create(key, null, new Class[]{MasterReport.class});
      final MasterReport rawResource = (MasterReport) res.getResource();
      final Object possibleTitle = rawResource.getName();
      if (possibleTitle != null)
      {
        return possibleTitle.toString();
      }
View Full Code Here

  private AbstractReportDefinition loadDefinitionFromFile(final File filename)
  {
    try
    {
      final ResourceKey selectedFile = resourceManager.createKey(filename);
      final Resource directly = resourceManager.create(selectedFile, null, new Class[]{MasterReport.class});
      final MasterReport resource = (MasterReport) directly.getResource();
      final DocumentBundle bundle = resource.getBundle();
      if (bundle == null)
      {
        // Ok, that should not happen if we work with the engine's parsers, but better safe than sorry.
        final MemoryDocumentBundle documentBundle = new MemoryDocumentBundle(resource.getContentBase());
View Full Code Here

  {
    final URL url = getClass().getResource("prd-2884.prpt");
    assertNotNull(url);
    final ResourceManager resourceManager = new ResourceManager();
    resourceManager.registerDefaults();
    final Resource directly = resourceManager.createDirectly(url, MasterReport.class);
    final MasterReport report = (MasterReport) directly.getResource();
    final EventMonitorFunction eventMonitorFunction = new EventMonitorFunction("Name");
    eventMonitorFunction.setDeepTraversing(true);
    report.addExpression(eventMonitorFunction);

    final PrintReportProcessor prc = new PrintReportProcessor(report);
View Full Code Here

  {
    final URL url = getClass().getResource("prd-2884-2.prpt");
    assertNotNull(url);
    final ResourceManager resourceManager = new ResourceManager();
    resourceManager.registerDefaults();
    final Resource directly = resourceManager.createDirectly(url, MasterReport.class);
    final MasterReport report = (MasterReport) directly.getResource();

    final PrintReportProcessor prc = new PrintReportProcessor(report);
    if (prc.isError())
    {
      prc.getErrorReason().printStackTrace();
View Full Code Here

    }
    try
    {
      final ResourceManager resourceManager = new ResourceManager();
      resourceManager.registerDefaults();
      final Resource resource = resourceManager.createDirectly(expressionMetaSource,
          DrillDownProfileCollection.class);
      final DrillDownProfileCollection typeCollection = (DrillDownProfileCollection) resource.getResource();
      final DrillDownProfile[] types = typeCollection.getData();
      for (int i = 0; i < types.length; i++)
      {
        final DrillDownProfile metaData = types[i];
        if (metaData != null)
View Full Code Here

  {
    final URL url = getClass().getResource("prd-2887.prpt");
    assertNotNull(url);
    final ResourceManager resourceManager = new ResourceManager();
    resourceManager.registerDefaults();
    final Resource directly = resourceManager.createDirectly(url, MasterReport.class);
    final MasterReport report = (MasterReport) directly.getResource();
    final EventMonitorFunction eventMonitorFunction = new EventMonitorFunction("Name");
    eventMonitorFunction.setDeepTraversing(true);
    report.addExpression(eventMonitorFunction);

    final PrintReportProcessor prc = new PrintReportProcessor(report);
View Full Code Here

TOP

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

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.