Package org.pentaho.platform.api.util

Examples of org.pentaho.platform.api.util.IVersionHelper


  public void error( final String message, final Throwable error ) {
    if ( loggingLevel <= ILogger.ERROR ) {
      if ( messages != null ) {
        messages.add( Messages.getInstance().getString( "Message.USER_ERROR", message, getClass().getName() ) ); //$NON-NLS-1$
      }
      IVersionHelper versionHelper = PentahoSystem.get( IVersionHelper.class, null );
      getLogger().error( "Error Start: Pentaho " + versionHelper.getVersionInformation( this.getClass() ) ); //$NON-NLS-1$
      getLogger().error( getLogId() + message, error );
      getLogger().error( "Error end:" ); //$NON-NLS-1$
    }
  }
View Full Code Here


  public void fatal( final String message, final Throwable error ) {
    if ( loggingLevel <= ILogger.FATAL ) {
      if ( messages != null ) {
        messages.add( Messages.getInstance().getString( "Message.USER_ERROR", message, getClass().getName() ) ); //$NON-NLS-1$
      }
      IVersionHelper versionHelper = PentahoSystem.get( IVersionHelper.class, null );
      getLogger().error( "Error: Pentaho " + versionHelper.getVersionInformation( this.getClass() ) ); //$NON-NLS-1$
      getLogger().fatal( getLogId() + message, error );
      getLogger().error( "Error end:" ); //$NON-NLS-1$
    }
  }
View Full Code Here

      while ( messageIterator.hasNext() ) {
        messageBuffer.append( StringEscapeUtils.escapeHtml( (String) messageIterator.next() ) ).append( "<br/>" ); //$NON-NLS-1$
      }
      messageBuffer.append( "</td></tr></table><p>" ); //$NON-NLS-1$
      if ( PentahoSystem.getObjectFactory().objectDefined( IVersionHelper.class.getSimpleName() ) ) {
        IVersionHelper versionHelper = PentahoSystem.get( IVersionHelper.class, null );
        messageBuffer
            .append( "&nbsp;&nbsp;" + Messages.getInstance().getString( "MessageFormatter.USER_SERVER_VERSION", versionHelper.getVersionInformation( PentahoSystem.class ) ) ); //$NON-NLS-1$ //$NON-NLS-2$
      }
      messageBuffer.append( "</body></html>" ); //$NON-NLS-1$
    }
  }
View Full Code Here

      templateFile = StringUtils.replace( templateFile, "%EXCEPTION_MESSAGES_LABEL%", Messages.getInstance() //$NON-NLS-1$
          .getString( "MessageFormatter.RESPONSE_EXCEPTION_MESSAGES_LABEL" ) ); //$NON-NLS-1$

      // %SERVER_INFO% (if available)
      if ( PentahoSystem.getObjectFactory().objectDefined( IVersionHelper.class.getSimpleName() ) ) {
        IVersionHelper versionHelper = PentahoSystem.get( IVersionHelper.class );
        templateFile = StringUtils.replace( templateFile, "%SERVER_INFO%", Messages.getInstance().getString( //$NON-NLS-1$
            "MessageFormatter.USER_SERVER_VERSION", versionHelper.getVersionInformation( PentahoSystem.class ) ) ); //$NON-NLS-1$
      }

      messageBuffer.append( templateFile );
    }
  }
View Full Code Here

    Assert.assertNotNull( "Publishers description document could not be generated", publishersXml ); //$NON-NLS-1$
  }

  public void testVersion() {
    Assert.assertTrue( "Initialization of the platform failed", init() );
    IVersionHelper versionHelper = PentahoSystem.get( IVersionHelper.class, null );
    String version = versionHelper.getVersionInformation( PentahoSystem.class );
    Assert.assertNotNull( version );
    Assert.assertNotSame( version, "" ); //$NON-NLS-1$
    Assert.assertNotSame( version, "1.0.0" ); //$NON-NLS-1$
  }
View Full Code Here

        template.replaceAll( "text/html; charset=utf-8", "text/html; charset=" + LocaleHelper.getSystemEncoding() ); //$NON-NLS-1$//$NON-NLS-2$
    template = template.replaceAll( "\\{text-direction\\}", LocaleHelper.getTextDirection() ); //$NON-NLS-1$
    template = template.replaceAll( "\\{logout\\}", Messages.getInstance().getString( "UI.USER_LOGOUT" ) ); //$NON-NLS-1$ //$NON-NLS-2$
    template = template.replaceAll( "\\{portal\\}", Messages.getInstance().getString( "UI.USER_PORTAL" ) ); //$NON-NLS-1$ //$NON-NLS-2$
    if ( PentahoSystem.getObjectFactory().objectDefined( IVersionHelper.class.getSimpleName() ) ) {
      IVersionHelper versionHelper = PentahoSystem.get( IVersionHelper.class, session );
      template =
          template
              .replaceAll( "\\{version\\}", "Version: " + versionHelper.getVersionInformation( PentahoSystem.class ) ); //$NON-NLS-1$ //$NON-NLS-2$
    }
    template = template.replaceAll( "\\{system\\}", PentahoSystem.getSystemName() ); //$NON-NLS-1$
    template = template.replaceAll( "\\{isLoggedIn\\}", session.isAuthenticated() ? "true" : "false" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    template = template.replaceAll( "\\{background-alert\\}", session.getBackgroundExecutionAlert() ? "true" : "false" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    template = template.replaceAll( "\\{header-content\\}", headerContent ); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

    // if it is blank, no big deal, we'll simply fall back on defaults
  }

  public void showInitializationMessage( final boolean initOk, final String fullyQualifiedServerUrl ) {
    if ( PentahoSystem.getObjectFactory().objectDefined( IVersionHelper.class.getSimpleName() ) ) {
      IVersionHelper helper = PentahoSystem.get( IVersionHelper.class, null ); // No session yet
      if ( initOk ) {
        System.out
          .println( Messages
            .getInstance()
            .getString(
              "SolutionContextListener.INFO_SYSTEM_READY",
              "(" + helper.getVersionInformation( PentahoSystem.class ) + ")", fullyQualifiedServerUrl,
              SolutionContextListener.solutionPath ) ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
      } else {
        System.err
          .println( Messages
            .getInstance()
            .getString(
              "SolutionContextListener.INFO_SYSTEM_NOT_READY",
              "(" + helper.getVersionInformation( PentahoSystem.class ) + ")", fullyQualifiedServerUrl,
              SolutionContextListener.solutionPath ) ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
      }
    }
  }
View Full Code Here

      // data. So, log an info message and be done with it. We also don't want an if-check to be
      // done on every cell for this boundary case.
      //
      getLogger().info( Messages.getInstance().getErrorString( "PentahoTableModel.ERROR_0001_GET_VALUE_AT" ) ); //$NON-NLS-1$
    } catch ( Throwable t ) {
      IVersionHelper versionHelper = PentahoSystem.get( IVersionHelper.class, null );
      getLogger().error( "Error Start: Pentaho " + versionHelper.getVersionInformation( this.getClass() ) ); //$NON-NLS-1$
      getLogger().error( Messages.getInstance().getErrorString( "PentahoTableModel.ERROR_0001_GET_VALUE_AT" ), t ); //$NON-NLS-1$
      getLogger().error( "Error end:" ); //$NON-NLS-1$
    }

    return val;
View Full Code Here

    }
  }

  public void error( final String message, final Throwable error ) {
    if ( loggingLevel <= ILogger.ERROR ) {
      IVersionHelper helper = PentahoSystem.get( IVersionHelper.class, null );
      if ( helper != null ) {
        getLogger().error( "Error Start: Pentaho " + helper.getVersionInformation( PentahoSystem.class ) ); //$NON-NLS-1$
      } else {
        getLogger().error( "Error Start: Pentaho " ); //$NON-NLS-1$
      }
      getLogger().error( getLogId() + message, error );
      getLogger().error( "Error end:" ); //$NON-NLS-1$
View Full Code Here

    }
  }

  public void fatal( final String message, final Throwable error ) {
    if ( loggingLevel <= ILogger.FATAL ) {
      IVersionHelper helper = PentahoSystem.get( IVersionHelper.class, null );
      if ( helper != null ) {
        getLogger().error( "Error Start: Pentaho " + helper.getVersionInformation( PentahoSystem.class ) ); //$NON-NLS-1$
      } else {
        getLogger().error( "Error Start: Pentaho " ); //$NON-NLS-1$
      }
      getLogger().fatal( getLogId() + message, error );
      getLogger().error( "Error end:" ); //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of org.pentaho.platform.api.util.IVersionHelper

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.