Package org.pentaho.platform.api.engine

Examples of org.pentaho.platform.api.engine.IPentahoPublisher


  }

  @SuppressWarnings( "cast" )
  @Test
  public void testPluginAdapterAsPublisher() throws Exception {
    IPentahoPublisher asPublisher = (IPentahoPublisher) pluginAdapter;

    assertEquals( Messages.getInstance().getString( "PluginAdapter.USER_PLUGIN_MANAGER" ), asPublisher.getName() ); //$NON-NLS-1$
    assertNotSame( "!PluginAdapter.USER_PLUGIN_MANAGER!", asPublisher.getName() ); //$NON-NLS-1$

    assertEquals(
        Messages.getInstance().getString( "PluginAdapter.USER_REFRESH_PLUGINS" ), asPublisher.getDescription() ); //$NON-NLS-1$
    assertNotSame( "!PluginAdapter.USER_REFRESH_PLUGINS!", asPublisher.getName() ); //$NON-NLS-1$

    String str = asPublisher.publish( session, ILogger.DEBUG );
    // If we see 'Discovered plugin' anywhere in the result string we know that the plugin adapter was able to invoke
    // the plugin manager properly
    assertTrue( "Result string '" + str + "' did not contain 'Discovered plugin'",
        str.indexOf( "Discovered plugin" ) > 0 );
  }
View Full Code Here


    IPentahoSession session = new StandaloneSession( "test user" ); //$NON-NLS-1$

    PluginAdapter mgr = new PluginAdapter();
    assertTrue( mgr instanceof IPentahoPublisher );
    IPentahoPublisher publisher = (IPentahoPublisher) mgr;

    assertEquals( Messages.getInstance().getString( "PluginAdapter.USER_PLUGIN_MANAGER" ), publisher.getName() ); //$NON-NLS-1$
    assertNotSame( "!PluginAdapter.USER_PLUGIN_MANAGER!", publisher.getName() ); //$NON-NLS-1$

    assertEquals( Messages.getInstance().getString( "PluginAdapter.USER_REFRESH_PLUGINS" ), publisher.getDescription() ); //$NON-NLS-1$
    assertNotSame( "!PluginAdapter.USER_REFRESH_PLUGINS!", publisher.getName() ); //$NON-NLS-1$

    String str = publisher.publish( session, ILogger.DEBUG );
    assertEquals( str, Messages.getInstance().getString( "PluginAdapter.ERROR_0001_PLUGIN_MANAGER_NOT_CONFIGURED" ) ); //$NON-NLS-1$
    finishTest();
  }
View Full Code Here

      Logger.debug( PentahoSystem.class, "Publisher execution" ); //$NON-NLS-1$
    }
    Iterator<IPentahoPublisher> publisherIterator = PentahoSystem.administrationPlugins.iterator();
    // TODO: audit this
    while ( publisherIterator.hasNext() ) {
      IPentahoPublisher publisher = publisherIterator.next();
      if ( ( publisher != null ) && ( ( className == null ) || className.equals( publisher.getClass().getName() ) ) ) {
        try {
          if ( debug ) {
            Logger.debug( PentahoSystem.class, "Publisher publish: " + publisher.getClass().getName() ); //$NON-NLS-1$
          }
          return publisher.publish( session, PentahoSystem.loggingLevel );
        } catch ( Throwable e ) {
          e.printStackTrace();
        }
      }
    }
View Full Code Here

    if ( administrationPlugins != null ) {
      Iterator publisherIterator = PentahoSystem.administrationPlugins.iterator();
      // TODO: audit this
      // refresh the system settings
      while ( publisherIterator.hasNext() ) {
        IPentahoPublisher publisher = (IPentahoPublisher) publisherIterator.next();
        if ( publisher != null ) {
          try {
            Element publisherNode = root.addElement( "publisher" ); //$NON-NLS-1$
            publisherNode.addElement( "name" ).setText( publisher.getName() ); //$NON-NLS-1$
            publisherNode.addElement( "description" ).setText( publisher.getDescription() ); //$NON-NLS-1$
            publisherNode.addElement( "class" ).setText( publisher.getClass().getName() ); //$NON-NLS-1$

          } catch ( Throwable e ) {
            // ignore
          }
        }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.api.engine.IPentahoPublisher

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.