Package org.pentaho.reporting.libraries.repository

Examples of org.pentaho.reporting.libraries.repository.ContentLocation


    super(configuration);

    this.metaData = new HtmlOutputProcessorMetaData
        (HtmlOutputProcessorMetaData.PAGINATION_MANUAL);

    final ContentLocation contentLocation = new DummyRepository().getRoot();
    final NameGenerator contentNameGenerator = new DefaultNameGenerator(contentLocation);
    final ContentLocation dataLocation = new DummyRepository().getRoot();
    final NameGenerator dataNameGenerator = new DefaultNameGenerator(dataLocation);

    this.printer = new HtmlPrinter();
    this.printer.setContentWriter(contentLocation, contentNameGenerator);
    this.printer.setDataWriter(dataLocation, dataNameGenerator);
View Full Code Here


    final FontStorage fontStorage = new DefaultFontStorage(fontRegistry);
    this.metaData = new HtmlOutputProcessorMetaData
        (fontStorage, HtmlOutputProcessorMetaData.PAGINATION_FULL);


    final ContentLocation contentLocation = new DummyRepository().getRoot();
    final NameGenerator contentNameGenerator = new DefaultNameGenerator(contentLocation);
    final ContentLocation dataLocation = new DummyRepository().getRoot();
    final NameGenerator dataNameGenerator = new DefaultNameGenerator(dataLocation);

    this.printer = new HtmlPrinter();
    this.printer.setContentWriter(contentLocation, contentNameGenerator);
    this.printer.setDataWriter(dataLocation, dataNameGenerator);
View Full Code Here

      }

      final IApplicationContext ctx = PentahoSystem.getApplicationContext();

      final URLRewriter rewriter;
      final ContentLocation dataLocation;
      final NameGenerator dataNameGenerator;
      if ( ctx != null ) {
        File dataDirectory = new File( ctx.getFileOutputPath( "system/tmp/" ) ); //$NON-NLS-1$
        if ( dataDirectory.exists() && ( dataDirectory.isDirectory() == false ) ) {
          dataDirectory = dataDirectory.getParentFile();
          if ( dataDirectory.isDirectory() == false ) {
            throw new ReportProcessingException( Messages.getInstance().getErrorString(
                "JFreeReportDirectoryComponent.ERROR_0001_INVALID_DIR", dataDirectory.getPath() ) ); //$NON-NLS-1$
          }
        } else if ( dataDirectory.exists() == false ) {
          dataDirectory.mkdirs();
        }

        final FileRepository dataRepository = new FileRepository( dataDirectory );
        dataLocation = dataRepository.getRoot();
        dataNameGenerator = new DefaultNameGenerator( dataLocation );
        rewriter = new PentahoURLRewriter( contentHandlerPattern );
      } else {
        dataLocation = null;
        dataNameGenerator = null;
        rewriter = new PentahoURLRewriter( contentHandlerPattern );
      }

      final StreamRepository targetRepository = new StreamRepository( null, outputStream );
      final ContentLocation targetRoot = targetRepository.getRoot();

      final HtmlOutputProcessor outputProcessor = new StreamHtmlOutputProcessor( report.getConfiguration() );
      final HtmlPrinter printer = new AllItemsHtmlPrinter( report.getResourceManager() );
      printer.setContentWriter( targetRoot, new DefaultNameGenerator( targetRoot, "index", "html" ) ); //$NON-NLS-1$//$NON-NLS-2$
      printer.setDataWriter( dataLocation, dataNameGenerator );
View Full Code Here

  @Override
  protected boolean performExport( final MasterReport report, final OutputStream outputStream ) {
    try {

      final StreamRepository targetRepository = new StreamRepository( null, outputStream );
      final ContentLocation targetRoot = targetRepository.getRoot();

      final HtmlOutputProcessor outputProcessor = new StreamHtmlOutputProcessor( report.getConfiguration() );
      final HtmlPrinter printer = new AllItemsHtmlPrinter( report.getResourceManager() );
      printer.setContentWriter( targetRoot, new DefaultNameGenerator( targetRoot, "index", "html" ) ); //$NON-NLS-1$//$NON-NLS-2$
      printer.setDataWriter( null, null );
View Full Code Here

      }

      final IApplicationContext ctx = PentahoSystem.getApplicationContext();

      final URLRewriter rewriter;
      final ContentLocation dataLocation;
      final NameGenerator dataNameGenerator;
      if ( ctx != null ) {
        File dataDirectory = new File( ctx.getFileOutputPath( "system/tmp/" ) ); //$NON-NLS-1$
        if ( dataDirectory.exists() && ( dataDirectory.isDirectory() == false ) ) {
          dataDirectory = dataDirectory.getParentFile();
          if ( dataDirectory.isDirectory() == false ) {
            throw new ReportProcessingException( Messages.getInstance().getErrorString(
                "JFreeReportDirectoryComponent.ERROR_0001_INVALID_DIR", dataDirectory.getPath() ) ); //$NON-NLS-1$
          }
        } else if ( dataDirectory.exists() == false ) {
          dataDirectory.mkdirs();
        }

        final FileRepository dataRepository = new FileRepository( dataDirectory );
        dataLocation = dataRepository.getRoot();
        dataNameGenerator = new DefaultNameGenerator( dataLocation );
        rewriter = new PentahoURLRewriter( htmlContentHandlerUrlPattern );
      } else {
        dataLocation = null;
        dataNameGenerator = null;
        rewriter = new PentahoURLRewriter( htmlContentHandlerUrlPattern );
      }

      final StreamRepository targetRepository = new StreamRepository( null, outputStream );
      final ContentLocation targetRoot = targetRepository.getRoot();

      final HtmlOutputProcessor outputProcessor = new StreamHtmlOutputProcessor( report.getConfiguration() );
      final HtmlPrinter printer = new AllItemsHtmlPrinter( report.getResourceManager() );
      printer.setContentWriter( targetRoot, new DefaultNameGenerator( targetRoot, "index", "html" ) ); //$NON-NLS-1$//$NON-NLS-2$
      printer.setDataWriter( dataLocation, dataNameGenerator );
View Full Code Here

      if ( dataDirectory == null ) {
        dataDirectory = "data"; //$NON-NLS-1$
      }

      final ZipRepository zipRepository = new ZipRepository();
      final ContentLocation root = zipRepository.getRoot();
      final ContentLocation data =
          RepositoryUtilities.createLocation( zipRepository, RepositoryUtilities.split( dataDirectory, "/" ) ); //$NON-NLS-1$

      final FlowHtmlOutputProcessor outputProcessor = new FlowHtmlOutputProcessor();

      final HtmlPrinter printer = new AllItemsHtmlPrinter( report.getResourceManager() );
View Full Code Here

      } else if ( dataDirectory.exists() == false ) {
        dataDirectory.mkdirs();
      }

      final FileRepository targetRepository = new FileRepository( targetDirectory );
      final ContentLocation targetRoot = targetRepository.getRoot();

      final FileRepository dataRepository = new FileRepository( dataDirectory );
      final ContentLocation dataRoot = dataRepository.getRoot();

      final FlowHtmlOutputProcessor outputProcessor = new FlowHtmlOutputProcessor();

      final HtmlPrinter printer = new AllItemsHtmlPrinter( report.getResourceManager() );
      printer.setContentWriter( targetRoot, new DefaultNameGenerator( targetRoot, targetFile.getName() ) );
View Full Code Here

  public String rewrite( final ContentEntity contentEntry, final ContentEntity dataEntity ) throws URLRewriteException {
    try {
      final ArrayList<String> entityNames = new ArrayList<String>();
      entityNames.add( dataEntity.getName() );

      ContentLocation location = dataEntity.getParent();
      while ( location != null ) {
        entityNames.add( location.getName() );
        location = location.getParent();
      }

      final ArrayList<String> contentNames = new ArrayList<String>();
      location = dataEntity.getRepository().getRoot();

      while ( location != null ) {
        contentNames.add( location.getName() );
        location = location.getParent();
      }

      // now remove all path elements that are equal ..
      while ( ( contentNames.isEmpty() == false ) && ( entityNames.isEmpty() == false ) ) {
        final String lastEntity = (String) entityNames.get( entityNames.size() - 1 );
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.repository.ContentLocation

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.