protected String getSuffix( final String filename ) { final String suffix = IOUtils.getInstance().getFileExtension( filename ); if ( suffix.length() == 0 ) { return ""; //$NON-NLS-1$ } return suffix.substring( 1 ); } }
/** * Creates a new PDF export task. */ public ReportExportTask( final MasterReport report, final SwingGuiContext swingGuiContext, String targetPath, Boolean createParentFolder ) { if ( report == null ) { throw new NullPointerException( "ReportExportTask(..): Report parameter cannot be null" ); } this.report = report; this.statusListener = swingGuiContext.getStatusListener(); // Check if the current Locale is supported: // If not, use the default (US) locale. Locale locale = swingGuiContext.getLocale(); try { ResourceBundle.getBundle( BASE_RESOURCE_CLASS, swingGuiContext.getLocale() ); } catch ( MissingResourceException e ) { locale = Locale.US; } this.messages = new Messages( locale, BASE_RESOURCE_CLASS, ObjectUtilities.getClassLoader( ReportExportTask.class ) ); this.targetPath = targetPath; this.createParentFolder = createParentFolder; }
@Override protected void execute() throws Exception { FileObject targetDirectory = targetFile.getParent(); FileObjectRepository targetRepository = new FileObjectRepository( targetDirectory ); targetRoot = targetRepository.getRoot(); suffix = getSuffix( targetPath ); filename = IOUtils.getInstance().stripFileExtension( targetFile.getName().toString() ); ReportProcessor reportProcessor = createReportProcessor( null ); try { reportProcessor.processReport(); } finally { reportProcessor.close(); } }
private DefaultFlowController( final DefaultFlowController fc, final MasterDataRow dataRow ) { ArgumentNullException.validate( "fc", fc ); ArgumentNullException.validate( "dataRow", dataRow ); this.performanceMonitorContext = fc.performanceMonitorContext; this.reportContext = fc.reportContext; this.exportDescriptor = fc.exportDescriptor; this.dataContextStack = fc.dataContextStack.clone(); this.expressionsStack = fc.expressionsStack.clone(); this.advanceRequested = fc.advanceRequested; this.storedAdvanceRequested = fc.storedAdvanceRequested; this.dataRow = dataRow; this.parameters = fc.parameters; }
public static PerformanceLoggingStopWatch startNew( final String tag, final Object message ) { PerformanceLoggingStopWatch loggingStopWatch = new LoggingStopWatch( tag, message ); loggingStopWatch.start(); return loggingStopWatch; }
public void start() { if ( isStarted() ) { return; } super.start(); if ( firstStartTime == 0 ) { firstStartTime = super.getStartTime(); } restartCount += 1; }
/** * When an object implementing interface <code>Runnable</code> is used to create a thread, starting the thread causes * the object's <code>run</code> method to be called in that separately executing thread. * <p/> * The general contract of the method <code>run</code> is that it may take any action whatsoever. * * @see Thread#run() */ public void run() { try { targetFile = KettleVFS.getFileObject( targetPath ); if ( targetFile.exists() ) { if ( !targetFile.delete() ) { throw new ReportProcessingException( messages.getErrorString( "ReportExportTask.ERROR_0001_TARGET_EXISTS" ) ); //$NON-NLS-1$ } } if ( createParentFolder ) { targetFile.getParent().createFolder(); } execute(); } catch ( Exception ex ) { statusListener.setStatus( StatusType.ERROR, messages.getString( "ReportExportTask.USER_EXPORT_FAILED" ), ex ); //$NON-NLS-1$ logger.error( "Failed" ); //$NON-NLS-1$ } }
public static PerformanceLoggingStopWatch startNew( final String tag, final String pattern, final Object... message ) { return startNew( tag, new FormattedMessage( pattern, message ) ); }
BufferedImage bitmap = ImageIO.read( inputStream ); WaitingImageObserver wia = new WaitingImageObserver( bitmap ); wia.waitImageLoaded();
reportProcessor = createReportProcessor( fout ); reportProcessor.processReport(); statusListener.setStatus( StatusType.INFORMATION, messages.getString( "ReportExportTask.USER_EXPORT_COMPLETE" ), //$NON-NLS-1$ null ); reportProcessor.close();
public static void performPentahoReportingBoot( LogChannelInterface log, Class<?> referenceClass ) { // Boot the Pentaho reporting engine! // if ( ClassicEngineBoot.getInstance().isBootDone() == false ) { ObjectUtilities.setClassLoader( referenceClass.getClassLoader() ); ObjectUtilities.setClassLoaderSource( ObjectUtilities.CLASS_CONTEXT ); LibLoaderBoot.getInstance().start(); LibFontBoot.getInstance().start(); ClassicEngineBoot.getInstance().start(); Exception exception = ClassicEngineBoot.getInstance().getBootFailureReason(); if ( exception != null ) { log.logError( "Error booting the Pentaho reporting engine", exception ); } } }
/** * Returns the display name for the export action. * * @return The display name. */ public String getDisplayName() { return resources.getString( "action.lastpage.name" ); //$NON-NLS-1$ }
@Override protected void execute() throws Exception { FileObject targetDirectory = targetFile.getParent(); FileObjectRepository targetRepository = new FileObjectRepository( targetDirectory ); targetRoot = targetRepository.getRoot(); suffix = getSuffix( targetPath ); Path p = Paths.get( targetFile.getName().getPath() ); filename = IOUtils.getInstance().stripFileExtension( p.getFileName().toString() ); ReportProcessor reportProcessor = createReportProcessor( null ); try { reportProcessor.processReport(); } finally { reportProcessor.close(); } }
public static PerformanceLoggingStopWatch startNew(final String tag, final Object message) { PerformanceLoggingStopWatch loggingStopWatch = new LoggingStopWatch(tag, message); loggingStopWatch.start(); return loggingStopWatch; }
public void start() { if (isStarted()) { return; } super.start(); if (firstStartTime == 0) { firstStartTime = super.getStartTime(); } restartCount += 1; }
public static PerformanceLoggingStopWatch startNew(final String tag, final String pattern, final Object... message) { return startNew(tag, new FormattedMessage(pattern, message)); }
BufferedImage bitmap = ImageIO.read( inputStream ); WaitingImageObserver wia = new WaitingImageObserver( bitmap ); wia.waitImageLoaded();
ObjectUtilities.setClassLoader( getClass().getClassLoader() ); ObjectUtilities.setClassLoaderSource( ObjectUtilities.CLASS_CONTEXT );
/** * Returns the display name for the export action. * * @return The display name. */ public String getDisplayName() { return resources.getString( "action.gotopage.name" ); //$NON-NLS-1$ }
BufferedImage bitmap = ImageIO.read( inputStream ); WaitingImageObserver wia = new WaitingImageObserver( bitmap ); wia.waitImageLoaded();