Examples of ZipRepository


Examples of org.pentaho.reporting.libraries.repository.zipwriter.ZipRepository

    final Resource resource = resourceManager.createDirectly(reportUrl, MasterReport.class);
    final MasterReport report = (MasterReport) resource.getResource();
    report.setReportEnvironment(new SessionReportEnvironment(report.getReportEnvironment(), request.getSession()));

    final ByteArrayOutputStream out = new ByteArrayOutputStream();
    final ZipRepository zipRepository = new ZipRepository(out);
    final ContentLocation root = zipRepository.getRoot();
    final ContentLocation data = RepositoryUtilities.createLocation
        (zipRepository, RepositoryUtilities.splitPath("data", "/"));

    final FlowHtmlOutputProcessor outputProcessor = new FlowHtmlOutputProcessor();

    final HtmlPrinter printer = new AllItemsHtmlPrinter(report.getResourceManager());
    printer.setContentWriter(root, new DefaultNameGenerator(root, "report.html"));
    printer.setDataWriter(data, new DefaultNameGenerator(data, "content"));

    String urlPattern = getInitParameter("url-pattern");
    if (urlPattern == null)
    {
      final String requestURL = String.valueOf(request.getRequestURL());
      final int parameterStart = requestURL.indexOf('?');
      final String params = String.format("?report.name=%s&filename={0}",
          URLEncoder.encode(report.getTitle(), request.getCharacterEncoding()));

      if (parameterStart == -1)
      {
        urlPattern = requestURL + params;
      }
      else
      {
        urlPattern = requestURL.substring(0, parameterStart) + params;
      }
    }
    printer.setUrlRewriter(new WebAppURLRewriter(urlPattern, request.getCharacterEncoding()));
    outputProcessor.setPrinter(printer);

    final FlowReportProcessor sp = new FlowReportProcessor(report, outputProcessor);
    sp.processReport();
    sp.close();
    zipRepository.close();
    request.getSession().setAttribute("report:" + report.getTitle(), out.toByteArray());
    return report.getTitle();
  }
View Full Code Here

Examples of org.pentaho.reporting.libraries.repository.zipwriter.ZipRepository

  {
    OutputStream fout = null;
    try
    {
      fout = new BufferedOutputStream(new FileOutputStream(targetFile));
      final ZipRepository zipRepository = new ZipRepository(fout);
      final ContentLocation root = zipRepository.getRoot();
      final ContentLocation data = RepositoryUtilities.createLocation
          (zipRepository, RepositoryUtilities.split(dataDirectory, "/"));
      final StreamingReportProcessor sp = new StreamingReportProcessor();

      final HtmlOutputProcessor outputProcessor = createOutputProcessor();
View Full Code Here

Examples of org.ringojs.repository.ZipRepository

        if (ringoHome == null) {
            ringoHome = ".";
        }
        File file = new File(ringoHome);
        Repository home = file.isFile() && StringUtils.isZipOrJarFile(ringoHome) ?
                new ZipRepository(file) : new FileRepository(file);
        String extraPath = System.getProperty("ringo.modulepath");
        if (extraPath == null) {
            extraPath = System.getenv("RINGO_MODULE_PATH");
        }
        if (extraPath != null) {
View Full Code Here

Examples of org.ringojs.repository.ZipRepository

                SoftReference<Repository> ref = cache.get(str);
                repo = ref == null ? null : ref.get();
                if (repo == null) {
                    File file = new File(str);
                    if (file.isFile() && StringUtils.isZipOrJarFile(str)) {
                        repo = new ZipRepository(str);
                    } else {
                        repo = new FileRepository(str);
                    }
                    cache.put(repo.getPath(), new SoftReference<Repository>(repo));
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.