Package org.pentaho.reporting.libraries.resourceloader

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


    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


    }

    try
    {
      final ResourceKey resourceKey = createKey(resourceManager, contextKey);
      final Resource resource = resourceManager.create(resourceKey, contextKey, Document.class);
      final Document document = (Document) resource.getResource();
      final Node node = XMLHandler.getSubNode(document, TransMeta.XML_TAG);
      final TransMeta meta = new TransMeta();
      meta.loadXML(node, repository, true, null, null);
      final String filename = computeFullFilename(resourceKey);
      if (filename != null)
View Full Code Here

        if (reportResource == null)
        {
            throw new JobDefinitionException("Report definition name must be given");
        }

        final Resource res = resourceManager.createDirectly("sun:oo://" + reportResource, OfficeDocument.class);
        final OfficeDocument tempReport = (OfficeDocument) res.getResource();
        tempReport.setDataFactory(new StarReportDataFactory(dataSourceFactory));
        tempReport.setJobProperties(definition.getProcessingParameters().copy());
        final ReportParameters inputParameters = tempReport.getInputParameters();

        final ParameterMap queryParameters = definition.getQueryParameters();
View Full Code Here

        final ResourceManager resourceManager = new ResourceManager();
        resourceManager.registerDefaults();
        try
        {
            final Resource res = resourceManager.createDirectly("res://com/sun/star/report/pentaho/parser/selectors.properties", Properties.class);
            final Properties resProps = (Properties) res.getResource();
            props.putAll(resProps);
        }
        catch (ResourceException e)
        {
            LOGGER.warn("Unable to load mapping rules. Parsing services may not be available.", 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();
      this.styleSheet.addStyleSheet(styleSheet);
    }
    catch (ResourceException e)
    {
      // ignore ..
View Full Code Here

          }
        }

        final byte[] responseBody = method.getResponseBody();
        final ResourceManager manager = new ResourceManager();
        final Resource resource = manager.createDirectly(responseBody, ParameterDocument.class);
        final ParameterDocument o = (ParameterDocument) resource.getResource();
        parameters = o.getParameter();
      }
      catch (Exception e)
      {
        error = e;
View Full Code Here

  public void testLayoutEmptyBand() throws Exception
  {
    final URL url = ReportLayouterTest.class.getResource("report-layouter-01.prpt");
    final ResourceManager resourceManager = new ResourceManager();
    resourceManager.registerDefaults();
    final Resource resource = resourceManager.createDirectly(url, MasterReport.class);
    final MasterReport report = (MasterReport) resource.getResource();

    final ReportLayouter l = new ReportLayouter
        (new ReportRenderContext(report, report, null, new GlobalAuthenticationStore()));
    final LogicalPageBox layout = l.layout();
  //  ModelPrinter.print(layout);
View Full Code Here

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

    ReportRenderContext rcontext = new ReportRenderContext(report, report, null, new GlobalAuthenticationStore());
    final ReportLayouter layouter = new ReportLayouter(rcontext);
    final LogicalPageBox logicalPageBox = layouter.layout();
View Full Code Here

      final String xulDocument = configuration.getConfigProperty
          ("org.pentaho.reporting.designer.core.editor.drilldown.xul-document." + configurationTag, // NON-NLS
              "res://org/pentaho/reporting/designer/core/editor/drilldown/basic/basic-drilldown.xul"); // NON-NLS

      final ResourceManager resourceManager = new ResourceManager();
      final Resource resource = resourceManager.createDirectly(xulDocument, Document.class);
      final Document document = (Document) resource.getResource();
      final DOMReader domReader = new DOMReader();
      final XulDomContainer container = loader.loadXulFragment(domReader.read(document));


      // Create our main Controller
View Full Code Here

    {
      try
      {
        // Update the definition source to be the location from which the file is saved
        final ResourceManager resourceManager = report.getResourceManager();
        final Resource bundleResource = resourceManager.createDirectly(target, DocumentBundle.class);
        final DocumentBundle bundle = (DocumentBundle) bundleResource.getResource();
        final ResourceKey bundleKey = bundle.getBundleKey();
        report.setDefinitionSource(bundleKey);
        report.setContentBase(bundleKey);
        report.setResourceManager(bundle.getResourceManager());
        activeContext.resetChangeTracker();
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.