/** * 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$ } }
/** * Returns the errort message string of this throwable object. * * @return the error message string of this <code>Throwable</code> object if it was created with an error message * string; or <code>null</code> if it was created with no error message. */ public String getMessage() { return super.getMessage() + ": " + childExceptions.size() + " exceptions occured."; }
/** * Prints the stack trace to the specified writer. * * @param writer * the writer. */ public void printStackTrace( final PrintWriter writer ) { super.printStackTrace( writer ); for ( int i = 0; i < childExceptions.size(); i++ ) { writer.print( "Exception #" ); writer.println( i ); final Exception ex = (Exception) childExceptions.get( i ); if ( ex != null ) { ex.printStackTrace( writer ); } else { writer.println( "<not defined>" ); } } }
final Locale locale = getLocale( parameterContext.getReportEnvironment() ); result.addError( entry.getName(), new ValidationMessage( Messages.getInstance( locale ).formatMessage( "FormulaParameterEvaluator.PostProcessingInitFailed", e.getLocalizedMessage() ) ) );
/** * Prints the stack trace to the specified stream. * * @param stream * the output stream. */ public void printStackTrace( final PrintStream stream ) { super.printStackTrace( stream ); for ( int i = 0; i < childExceptions.size(); i++ ) { stream.print( "Exception #" ); stream.println( i ); final Exception ex = (Exception) childExceptions.get( i ); if ( ex != null ) { ex.printStackTrace( stream ); } else { stream.println( "<not defined>" ); } } } }
public void summaryRow( final DefaultOutputFunction outputFunction, final ReportEvent event ) throws ReportProcessingException { throw new ReportProcessingException( "A crosstab-group cannot contain a summary band. Never." ); } }
private JScrollPane createParametersPanel() { parametersPanel = new ParameterReportControllerPane(); try { parametersPanel.setReport( masterReport ); } catch ( ReportProcessingException e ) { parametersPanel.setErrorMessage( e.getMessage() ); logger.error( "Failed to query parameters", e ); // NON-NLS } parametersPanel.hideControls(); final JPanel carrierPanel = new JPanel( new BorderLayout() ); carrierPanel.setBorder( BorderFactory.createEmptyBorder( 10, 10, 10, 10 ) ); carrierPanel.add( parametersPanel, BorderLayout.NORTH ); final JScrollPane result = new JScrollPane( carrierPanel ); result.setVerticalScrollBarPolicy( ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED ); return result; }
public void summaryRow( final DefaultOutputFunction outputFunction, final ReportEvent event ) throws ReportProcessingException { throw new ReportProcessingException( "A crosstab-other-group cannot contain a summary band. Never." ); } }
/** * Called when the report controller gets removed. * * @param pane */ public void deinitialize( final PreviewPane pane ) { try { this.previewPane.removePropertyChangeListener( PreviewPane.REPORT_JOB_PROPERTY, reportUpdateHandler ); this.controllerPane.setReport( null ); } catch ( ReportProcessingException e ) { // Cannot recover from that controllerPane.setErrorMessage( e.getMessage() ); logger.debug( "Failed", e ); // NON-NLS } } }
private CrosstabRowGroup findLastRowGroup() throws ReportProcessingException { for ( int i = groups.length - 1; i >= 0; i -= 1 ) { final Group group = groups[i]; if ( group instanceof CrosstabRowGroup ) { return (CrosstabRowGroup) group; } } // This is a hard error. No point in waiting to fail here. throw new ReportProcessingException( "Trying to find a crosstab-row, but there is none." ); }
protected void performUpdate() { isUpdating = true; try { report.getParameterValues().clear(); report.getParameterValues().putAll( reportParameterValues ); setReport( report ); final ChangeEvent event = new ChangeEvent( this ); for ( int i = 0; i < changeListeners.size(); i++ ) { final ChangeListener listener = changeListeners.get( i ); listener.stateChanged( event ); } } catch ( ReportProcessingException e ) { ExceptionDialog.showExceptionDialog( this, messages.getString( "ParameterReportControllerPane.Error" ), messages .getString( "ParameterReportControllerPane.ErrorWhileConfiguringParameterUI", e.getMessage() ), e ); } isUpdating = false; }
public void summaryRowEnd( final DefaultOutputFunction outputFunction, final ReportEvent event ) throws ReportProcessingException { throw new ReportProcessingException( "A crosstab-other-group cannot contain a summary band. Never." ); }
public void reportDone( final ReportEvent event ) { try { if ( event.getState().isSubReportEvent() == false ) { this.template.finishReport(); } } catch ( ReportProcessingException pre ) { throw new InvalidReportStateException( pre.getMessage(), pre ); } }
public void itemsStarted( final DefaultOutputFunction outputFunction, final ReportEvent event ) throws ReportProcessingException { throw new ReportProcessingException( "A crosstab-row cannot contain a detail band. Never." ); }
/** * This method gets called when a bound property is changed. * * @param evt * A PropertyChangeEvent object describing the event source and the property that has changed. */ public void propertyChange( final PropertyChangeEvent evt ) { final MasterReport report = getPreviewPane().getReportJob(); final ParameterReportControllerPane reportControllerPane = getControllerPane(); try { reportControllerPane.setReport( report ); } catch ( ReportProcessingException e ) { // Cannot recover from that reportControllerPane.setErrorMessage( e.getMessage() ); logger.debug( "Failed", e ); // NON-NLS } } }
public void summaryRowStart( final DefaultOutputFunction outputFunction, final ReportEvent event ) throws ReportProcessingException { throw new ReportProcessingException( "A crosstab-group cannot contain a summary band. Never." ); }
public void initialize( final PreviewPane pane ) { try { if ( this.previewPane != null ) { this.previewPane.removePropertyChangeListener( PreviewPane.REPORT_JOB_PROPERTY, reportUpdateHandler ); this.controllerPane.setReport( null ); } this.previewPane = pane; if ( this.previewPane != null ) { this.previewPane.addPropertyChangeListener( PreviewPane.REPORT_JOB_PROPERTY, reportUpdateHandler ); this.controllerPane.setReport( previewPane.getReportJob() ); } } catch ( ReportProcessingException e ) { // Cannot recover from that controllerPane.setErrorMessage( e.getMessage() ); logger.debug( "Failed", e ); // NON-NLS } }
public void itemsFinished( final DefaultOutputFunction outputFunction, final ReportEvent event ) throws ReportProcessingException { throw new ReportProcessingException( "A crosstab-row cannot contain a detail band. Never." ); }
public void summaryRow( final DefaultOutputFunction outputFunction, final ReportEvent event ) throws ReportProcessingException { throw new ReportProcessingException( "Crosstab-column groups handler cannot contain summary-rows" ); } }
public void summaryRowEnd( final DefaultOutputFunction outputFunction, final ReportEvent event ) throws ReportProcessingException { throw new ReportProcessingException( "Crosstab-column groups handler cannot contain summary-rows" ); }