/** * Returns a instance of the IMetadataDomainRepository for the current session * * @return */ protected IMetadataDomainRepository getMetadataRepository() { IMetadataDomainRepository mdr = PentahoSystem.get( IMetadataDomainRepository.class, PentahoSessionHolder.getSession() ); if ( mdr instanceof ILogger ) { ( (ILogger) mdr ).setLoggingLevel( getLoggingLevel() ); } return mdr; }
content.append( xformHeader ); } catch ( Exception e ) { logger.error( Messages.getInstance().getErrorString( "FilterPanel.ERROR_0004_COULD_NOT_CREATE_CONTENT" ), e ); //$NON-NLS-1$ logger.debug( content.toString() ); logger.error( Messages.getInstance().getErrorString( "FilterPanel.ERROR_0004_COULD_NOT_CREATE_CONTENT" ), e ); //$NON-NLS-1$
@Deprecated public static Object createObject( final String className, final ILogger logger ) { Object object = null; try { Class componentClass = Class.forName( className.trim() ); object = componentClass.newInstance(); } catch ( Throwable t ) { String msg = Messages.getInstance().getErrorString( "PentahoSystem.ERROR_0013_COULD_NOT_CREATE_OBEJCT", className ); //$NON-NLS-1$ if ( null == logger ) { Logger.fatal( PentahoSystem.class.getName(), msg, t ); } else { logger.fatal( msg, t ); } } return object; }
private static void logTheAuditError( final ILogger logger, Exception e ) { String msg = null; try { msg = ( ( e.getMessage() != null ) ? e.getMessage() : Messages.getInstance().getErrorString( "AUDITHELPER.ERROR_0001_AUDIT_ENTRY_ERROR" ) ); //$NON-NLS-1$ } catch ( Throwable ignored ) { msg = Messages.getInstance().getErrorString( "AUDITHELPER.ERROR_0001_AUDIT_ENTRY_ERROR" ); //$NON-NLS-1$ } if ( ( msg.toLowerCase().indexOf( "not found" ) >= 0 ) ) { //$NON-NLS-1$ e = null; // Prevent Stack Trace } if ( logger != null ) { if ( e != null ) { logger.error( msg, e ); } else { logger.error( msg ); } } else { if ( e != null ) { Logger.error( AuditHelper.class.getName(), msg, e ); } else { Logger.error( AuditHelper.class.getName(), msg ); } } }
logger.error( Messages.getInstance().getErrorString( "ChartHelper.ERROR_0001_IO_PROBLEM_GETTING_CHART_TYPE" ), e ); //$NON-NLS-1$ PentahoSystem logger.error( Messages.getInstance().getString( "ChartHelper.ERROR_0002_COULD_NOT_DETERMINE_CHART_TYPE" ) ); //$NON-NLS-1$ PentahoSystem .get( IMessageFormatter.class, userSession ) default: logger.error( Messages.getInstance().getString( "ChartHelper.ERROR_0003_INVALID_CHART_TYPE", chartTypeStr, Integer.toString( chartType ) ) ); //$NON-NLS-1$ PentahoSystem.get( IMessageFormatter.class, userSession ).formatErrorMessage( try { chartComponent.setLoggingLevel( logger.getLoggingLevel() ); chartComponent.validate( userSession, null ); chartComponent.setDataAction( actionPath ); logger.error( Messages.getInstance().getErrorString( "Widget.ERROR_0001_COULD_NOT_CREATE_WIDGET" ), e ); //$NON-NLS-1$ logger.error( Messages.getInstance().getErrorString( "Widget.ERROR_0001_COULD_NOT_CREATE_WIDGET" ), e ); //$NON-NLS-1$
messages ); if ( logger != null ) { chartComponent.setLoggingLevel( logger.getLoggingLevel() );
logger.warn( Messages.getInstance().getErrorString( "FilterDefinition.ERROR_0004_FILTER_DEFINITION_EMPTY" ) ); //$NON-NLS-1$ } else { while ( row != null ) {
SequenceDefinition.parseParameters( sequenceRootNode, logger, "outputs/*", outputDefinitions, null, false ); //$NON-NLS-1$ if ( errorCode != ISequenceDefinition.ACTION_SEQUENCE_DEFINITION_OK ) { logger.info( Messages.getInstance().getString( "SequenceDefinition.INFO_OUTPUT_PARAMETERS_NOT_DEFINED" ) ); //$NON-NLS-1$ logger.info( Messages.getInstance().getString( "SequenceDefinition.INFO_RESOURCES_PARAMETERS_NOT_DEFINED" ) ); //$NON-NLS-1$
logger.error( Messages.getInstance().getErrorString( "SequenceDefinition.ERROR_0006_PARSING_RESOURCE" ), e ); //$NON-NLS-1$
+ File.separator + chartName, width, height, urlFactory, messages ); if ( logger != null ) { widget.setLoggingLevel( logger.getLoggingLevel() );
/** * Returns a instance of the IMetadataDomainRepository for the current session * * @return */ protected IMetadataDomainRepository getMetadataRepository() { IMetadataDomainRepository mdr = PentahoSystem.get( IMetadataDomainRepository.class, PentahoSessionHolder.getSession() ); if ( mdr instanceof ILogger ) { ( (ILogger) mdr ).setLoggingLevel( getLoggingLevel() ); } return mdr; }
@Override protected IPentahoResultSet getResultSet( final Map parameterProviders ) { String sessionAttribute = XmlDom4JHelper.getNodeText( "session-attribute", node ); //$NON-NLS-1$ try { IPentahoResultSet data = (IPentahoResultSet) session.getAttribute( sessionAttribute ); return data; } catch ( Exception e ) { logger.error( Messages.getInstance().getString( "FilterDefinition.ERROR_0003_NOT_IN_SESSION", sessionAttribute ), e ); //$NON-NLS-1$ } return null; }
ActionParameterSource variable = new ActionParameterSource( variableSource, variableName ); if ( SequenceDefinition.debug ) { logger.debug( Messages.getInstance().getString( "SequenceDefinition.DEBUG_ADDING_SOURCE_FOR_PARAMETER", variableSource, parameterName ) ); //$NON-NLS-1$ } catch ( Exception e ) { logger .error( Messages .getInstance() logger.debug( Messages.getInstance().getString( "SequenceDefinition.DEBUG_USING_DEFAULT_VALUE", defaultValue.toString(), parameterName ) ); //$NON-NLS-1$ logger.error( Messages.getInstance().getErrorString( "SequenceDefinition.ERROR_0005_PARSING_PARAMETERS" ), e ); //$NON-NLS-1$
@Override public boolean start() throws PlatformInitializationException { PentahoSystem.setSystemSettingsService( new PathBasedSystemSettings() ); // initialize log4j to write to the console BasicConfigurator.configure(); boolean ret = super.start(); // set log levels // FIXME: find a better way to set log levels programmatically than this.. this can cause NPEs // and other errors, not to mention it's inefficient try { Object o = PentahoSystem.get( ISolutionEngine.class ); if ( o != null && o instanceof ILogger ) { ( (ILogger) o ).setLoggingLevel( ILogger.DEBUG ); } } catch ( Throwable e ) { logger.error( "Failed to set DEBUG log level due to ISolutionEngine not being available in MicroPlatform" ); } return ret; }
@Override protected IPentahoResultSet getResultSet( final Map parameterProviders ) { String globalAttribute = XmlDom4JHelper.getNodeText( "global-attribute", node ); //$NON-NLS-1$ try { IPentahoResultSet data = (IPentahoResultSet) PentahoSystem.getGlobalParameters().getParameter( globalAttribute ); return data; } catch ( Exception e ) { logger.error( Messages.getInstance().getString( "FilterDefinition.ERROR_0003_NOT_IN_SESSION", globalAttribute ), e ); //$NON-NLS-1$ } return null; }
public static IActionSequence ActionSequenceFactory( final Document document, final String solutionPath, final ILogger logger, final IApplicationContext applicationContext, final int loggingLevel ) { // Check for a sequence document Node sequenceDefinitionNode = document.selectSingleNode( "//action-sequence" ); //$NON-NLS-1$ if ( sequenceDefinitionNode == null ) { logger.error( Messages.getInstance().getErrorString( "SequenceDefinition.ERROR_0002_NO_ACTION_SEQUENCE_NODE", "", solutionPath, "" ) ); //$NON-NLS-1$ return null; } ISequenceDefinition seqDef = new SequenceDefinition( sequenceDefinitionNode, solutionPath, logger, applicationContext ); Node actionNode = sequenceDefinitionNode.selectSingleNode( "actions" ); //$NON-NLS-1$ return ( SequenceDefinition.getNextLoopGroup( seqDef, actionNode, solutionPath, logger, loggingLevel ) ); }
static IConditionalExecution parseConditionalExecution( final Node actionRootNode, final ILogger logger, final String nodePath ) { try { Node condition = actionRootNode.selectSingleNode( nodePath ); if ( condition == null ) { return null; } String script = condition.getText(); IConditionalExecution ce = PentahoSystem.get( IConditionalExecution.class, null ); ce.setScript( script ); return ce; } catch ( Exception ex ) { logger.error( Messages.getInstance().getErrorString( "SequenceDefinition.ERROR_0005_PARSING_PARAMETERS" ), ex ); //$NON-NLS-1$ } return null; }
|| ( resourceType == IActionSequenceResource.FILE_RESOURCE ) ) { if ( resourceLocation == null ) { logger.error( Messages.getInstance().getErrorString( "SequenceDefinition.ERROR_0008_RESOURCE_NO_LOCATION", resourceName ) ); //$NON-NLS-1$ continue; resourceDefinitions.put( resourceName, resource ); } else { logger.error( Messages.getInstance().getErrorString( "SequenceDefinition.ERROR_0007_RESOURCE_NO_MIME_TYPE", resourceName ) ); //$NON-NLS-1$ logger.error( Messages.getInstance().getErrorString( "SequenceDefinition.ERROR_0006_PARSING_RESOURCE" ), e ); //$NON-NLS-1$
JFreeChartEngine.saveChart( chart, filePath, width, height, outputType, writer, info ); } catch ( IOException e ) { logger.error( Messages.getInstance().getString( "ChartEngine.ERROR_0001_COULD_NOT_CREATE_CHART" ), e ); //$NON-NLS-1$
logger.error( Messages.getInstance().getString( "ChartEngine.ERROR_0002_COULD_NOT_CREATE_CHART" ) ); //$NON-NLS-1$ } else {