Package org.pentaho.platform.plugin.services.pluginmgr

Examples of org.pentaho.platform.plugin.services.pluginmgr.PlatformPlugin


    }
  }

  public static class Tst10PluginProvider implements IPluginProvider {
    public List<IPlatformPlugin> getPlugins( IPentahoSession session ) throws PlatformPluginRegistrationException {
      PlatformPlugin p = new PlatformPlugin();
      p.setId( "test10Plugin" );

      ContentInfo type = new ContentInfo();
      type.setDescription( "test10type1-description" );
      type.setExtension( "test10type1-ext" );
      type.setMimeType( "test10type1-mimeType" );
      type.setTitle( "test10type1-title" );
      type.setIconUrl( "test10type1-url" );

      type.addOperation( new PluginOperation( "test10type1-oper1-id" ) );
      PluginOperation oper2 = new PluginOperation( "test10type1-oper2-id" );
      oper2.setPerspective( "test10type1-oper2-perspective" );
      type.addOperation( oper2 );

      p.addContentInfo( type );

      type = new ContentInfo();
      type.setExtension( "test10type2-ext" );
      p.addContentInfo( type );

      // //////////////////
      // For 10b only
      //
      p.getMetaProviderMap().put( "test10type1-ext", Tst10bMetaProvider.class.getName() );

      ContentGeneratorInfo cg1 = new ContentGeneratorInfo();
      cg1.setDescription( "test 10b plugin description" );
      cg1.setId( "test10type1-ext" ); // setting to same string as extension to verify that names do not collide causing
      // classcastexception
      cg1.setType( "test10type1-ext" );
      cg1.setTitle( "Test Generator 10b" );
      cg1.setUrl( "/test10burl" );
      cg1.setClassname( "org.pentaho.test.platform.plugin.pluginmgr.ContentGenerator1" );
      p.addContentGenerator( cg1 );
      //
      // //////////////////

      return Arrays.asList( (IPlatformPlugin) p );
    }
View Full Code Here


    }
  }

  public static class Tst11PluginProvider implements IPluginProvider {
    public List<IPlatformPlugin> getPlugins( IPentahoSession session ) throws PlatformPluginRegistrationException {
      PlatformPlugin p = new PlatformPlugin();
      p.setId( "test11Plugin" );
      PluginServiceDefinition pws = new PluginServiceDefinition();
      pws.setTitle( "ws11title" );
      pws.setDescription( "ws11description" );
      pws.setServiceBeanId( "org.pentaho.test.platform.engine.core.EchoServiceBean" );
      p.addWebservice( pws );

      // defining bean with null id, the classname will be used as the id
      p.addBean( new PluginBeanDefinition( null, "org.pentaho.test.platform.engine.core.EchoServiceBean" ) );

      return Arrays.asList( (IPlatformPlugin) p );
    }
View Full Code Here

    }
  }

  public static class Tst12PluginProvider implements IPluginProvider {
    public List<IPlatformPlugin> getPlugins( IPentahoSession session ) throws PlatformPluginRegistrationException {
      PlatformPlugin p = new PlatformPlugin();
      p.setId( "test12Plugin" );
      return Arrays.asList( (IPlatformPlugin) p );
    }
View Full Code Here

    }
  }

  public static class Tst13PluginProvider implements IPluginProvider {
    public List<IPlatformPlugin> getPlugins( IPentahoSession session ) throws PlatformPluginRegistrationException {
      PlatformPlugin p = new PlatformPlugin();

      p.setId( "test13Plugin" );

      ContentGeneratorInfo cg1 = new ContentGeneratorInfo();
      cg1.setDescription( "test 9 plugin description" );
      cg1.setId( "test13cgId" );
      cg1.setType( "test13type" );
      cg1.setTitle( "Test Generator 13" );
      cg1.setUrl( "/test13url" );
      cg1.setClassname( "org.pentaho.test.platform.plugin.pluginmgr.ContentGenerator1" );
      p.addContentGenerator( cg1 );

      p.addStaticResourcePath( "/test/13/static/url", "/tmp" );

      PlatformPlugin pExt = new PlatformPlugin();

      pExt.setId( "test13Plugin-ext" );
      pExt.addStaticResourcePath( "/test-ext/13/static/url", "/tmp" );

      return Arrays.asList( (IPlatformPlugin) p, (IPlatformPlugin) pExt );
    }
View Full Code Here

    }
  }

  public static class Tst14PluginProvider implements IPluginProvider {
    public List<IPlatformPlugin> getPlugins( IPentahoSession session ) throws PlatformPluginRegistrationException {
      PlatformPlugin p = new PlatformPlugin();
      p.setId( "test14Plugin" );
      PluginServiceDefinition pws = new PluginServiceDefinition();
      pws.setTypes( new String[] { "gwt" } );
      pws.setTitle( "ws14title" );
      pws.setDescription( "ws14description" );
      pws.setServiceClass( "org.pentaho.test.platform.engine.core.EchoServiceBean" );
      p.addWebservice( pws );

      return Arrays.asList( (IPlatformPlugin) p );
    }
View Full Code Here

  public static class Tst15PluginProvider_DistinctNames implements IPluginProvider {
    public List<IPlatformPlugin> getPlugins( IPentahoSession session ) throws PlatformPluginRegistrationException {
      List<IPlatformPlugin> plugins = new ArrayList<IPlatformPlugin>();

      PlatformPlugin p = new PlatformPlugin();
      p.setId( "distinctTest15Plugin1" );
      plugins.add( p );

      PlatformPlugin p2 = new PlatformPlugin();
      p2.setId( "distinctTest15Plugin2" );
      plugins.add( p2 );

      return plugins;
    }
View Full Code Here

  public static class Tst15PluginProvider_DupNames implements IPluginProvider {
    public List<IPlatformPlugin> getPlugins( IPentahoSession session ) throws PlatformPluginRegistrationException {
      List<IPlatformPlugin> plugins = new ArrayList<IPlatformPlugin>();

      PlatformPlugin p = new PlatformPlugin();
      p.setId( "dupTest15Plugin" );
      plugins.add( p );

      PlatformPlugin p2 = new PlatformPlugin();
      p2.setId( "dupTest15Plugin" );
      plugins.add( p2 );

      return plugins;
    }
View Full Code Here

    }
  }

  public static class Tst16PluginProvider implements IPluginProvider {
    public List<IPlatformPlugin> getPlugins( IPentahoSession session ) throws PlatformPluginRegistrationException {
      PlatformPlugin p = new PlatformPlugin( new DefaultListableBeanFactory() );
      BeanDefinition def =
        BeanDefinitionBuilder.rootBeanDefinition( "org.pentaho.nowhere.PluginOnlyClass" ).getBeanDefinition();
      p.getBeanFactory().registerBeanDefinition( "PluginOnlyClass", def );
      p.setId( "test16Plugin" );
      // need to set source description - classloader needs it
      p.setSourceDescription( "good-plugin1" );

      return Arrays.asList( (IPlatformPlugin) p );
    }
View Full Code Here

  public static class Tst16Plugin implements IPluginProvider {
    public List<IPlatformPlugin> getPlugins( IPentahoSession session ) throws PlatformPluginRegistrationException {
      List<IPlatformPlugin> plugins = new ArrayList<IPlatformPlugin>();

      PlatformPlugin p = new PlatformPlugin();
      p.setId( "externalPlugin" );
      p.addExternalResource( "area1", "testScript.js" );
      plugins.add( p );

      return plugins;
    }
View Full Code Here

  public static class TestPlugin implements IPluginProvider {
    public List<IPlatformPlugin> getPlugins( IPentahoSession session ) throws PlatformPluginRegistrationException {
      List<IPlatformPlugin> plugins = new ArrayList<IPlatformPlugin>();

      PlatformPlugin p = new PlatformPlugin( new DefaultListableBeanFactory() );
      p.setId( "test-plugin" );

      p.addStaticResourcePath( "notused", "public" );

      BeanDefinition def =
          BeanDefinitionBuilder.rootBeanDefinition( JUnitContentGenerator.class.getName() ).getBeanDefinition();
      p.getBeanFactory().registerBeanDefinition( "xjunit.viewer", def );

      def =
          BeanDefinitionBuilder.rootBeanDefinition( JUnitServiceContentGenerator.class.getName() ).getBeanDefinition();
      p.getBeanFactory().registerBeanDefinition( "testservice", def );

      def = BeanDefinitionBuilder.rootBeanDefinition( ReportContentGenerator.class.getName() ).getBeanDefinition();
      p.getBeanFactory().registerBeanDefinition( "xjunit.report", def );

      ContentInfo contentInfo = new ContentInfo();
      contentInfo.setDescription( "JUnit file type" );
      contentInfo.setExtension( "xjunit" );
      contentInfo.setMimeType( "application/zip" );
      contentInfo.setTitle( "JUNIT" );
      p.addContentInfo( contentInfo );

      plugins.add( p );

      return plugins;
    }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.plugin.services.pluginmgr.PlatformPlugin

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.