Search in sources :

Example 1 with ContentGeneratorInfo

use of org.pentaho.platform.engine.core.solution.ContentGeneratorInfo in project pentaho-platform by pentaho.

the class DefaultPluginManagerIT method test17_getPluginIdForType.

@Test
public void test17_getPluginIdForType() throws PlatformInitializationException, PluginBeanException {
    IPluginProvider provider = new IPluginProvider() {

        public List<IPlatformPlugin> getPlugins(IPentahoSession session) throws PlatformPluginRegistrationException {
            PlatformPlugin p = new PlatformPlugin(new DefaultListableBeanFactory());
            p.setId("testPlugin");
            ContentGeneratorInfo cg1 = new ContentGeneratorInfo();
            cg1.setDescription("test 9 plugin description");
            cg1.setId("oldworldCGid");
            cg1.setType("oldworldCGtype");
            cg1.setTitle("test");
            cg1.setClassname("org.pentaho.test.platform.plugin.pluginmgr.ContentGenerator1");
            // cg1.setFileInfoGeneratorClassname("org.pentaho.test.platform.plugin.pluginmgr.FileInfoGenerator");
            p.addContentGenerator(cg1);
            BeanDefinition beanDef = BeanDefinitionBuilder.rootBeanDefinition("org.pentaho.test.platform.plugin.pluginmgr.ContentGenerator1").setScope(BeanDefinition.SCOPE_PROTOTYPE).getBeanDefinition();
            p.getBeanFactory().registerBeanDefinition("springDefinedCGid", beanDef);
            p.getBeanFactory().registerAlias("springDefinedCGid", "springDefinedCGtype");
            return Arrays.asList((IPlatformPlugin) p);
        }
    };
    microPlatform.defineInstance(IPluginProvider.class, provider).start();
    pluginManager.reload();
    assertEquals("testPlugin", pluginManager.getPluginIdForType("oldworldCGtype"));
    assertEquals("testPlugin", pluginManager.getPluginIdForType("springDefinedCGtype"));
}
Also used : IPentahoSession(org.pentaho.platform.api.engine.IPentahoSession) DefaultListableBeanFactory(org.springframework.beans.factory.support.DefaultListableBeanFactory) PlatformPlugin(org.pentaho.platform.plugin.services.pluginmgr.PlatformPlugin) IPlatformPlugin(org.pentaho.platform.api.engine.IPlatformPlugin) ContentGeneratorInfo(org.pentaho.platform.engine.core.solution.ContentGeneratorInfo) IPluginProvider(org.pentaho.platform.api.engine.IPluginProvider) PluginBeanDefinition(org.pentaho.platform.api.engine.PluginBeanDefinition) BeanDefinition(org.springframework.beans.factory.config.BeanDefinition) IPlatformPlugin(org.pentaho.platform.api.engine.IPlatformPlugin) Test(org.junit.Test)

Example 2 with ContentGeneratorInfo

use of org.pentaho.platform.engine.core.solution.ContentGeneratorInfo in project pentaho-platform by pentaho.

the class ContentGeneratorInfoTest method testContentGeneratorInfo.

public void testContentGeneratorInfo() {
    ContentGeneratorInfo cgi = new ContentGeneratorInfo();
    cgi.setClassname("test classname");
    cgi.setDescription("test description");
    cgi.setId("test id");
    cgi.setTitle("test title");
    cgi.setType("test type");
    cgi.setUrl("test url");
    assertEquals("wrong field", "test classname", cgi.getClassname());
    assertEquals("wrong field", "test description", cgi.getDescription());
    assertEquals("wrong field", "test id", cgi.getId());
    assertEquals("wrong field", "test title", cgi.getTitle());
    assertEquals("wrong field", "test type", cgi.getType());
    assertEquals("wrong field", "test url", cgi.getUrl());
}
Also used : ContentGeneratorInfo(org.pentaho.platform.engine.core.solution.ContentGeneratorInfo)

Example 3 with ContentGeneratorInfo

use of org.pentaho.platform.engine.core.solution.ContentGeneratorInfo in project pentaho-platform by pentaho.

the class SystemPathXmlPluginProvider method createContentGenerator.

private static IContentGeneratorInfo createContentGenerator(PlatformPlugin plugin, String id, String title, String description, String type, String url, String className, IPentahoSession session, String location) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
    ContentGeneratorInfo info = new ContentGeneratorInfo();
    info.setId(id);
    info.setTitle(title);
    info.setDescription(description);
    // $NON-NLS-1$
    info.setUrl((url != null) ? url : "");
    info.setType(type);
    info.setClassname(className);
    return info;
}
Also used : ContentGeneratorInfo(org.pentaho.platform.engine.core.solution.ContentGeneratorInfo) IContentGeneratorInfo(org.pentaho.platform.api.engine.IContentGeneratorInfo)

Aggregations

ContentGeneratorInfo (org.pentaho.platform.engine.core.solution.ContentGeneratorInfo)3 Test (org.junit.Test)1 IContentGeneratorInfo (org.pentaho.platform.api.engine.IContentGeneratorInfo)1 IPentahoSession (org.pentaho.platform.api.engine.IPentahoSession)1 IPlatformPlugin (org.pentaho.platform.api.engine.IPlatformPlugin)1 IPluginProvider (org.pentaho.platform.api.engine.IPluginProvider)1 PluginBeanDefinition (org.pentaho.platform.api.engine.PluginBeanDefinition)1 PlatformPlugin (org.pentaho.platform.plugin.services.pluginmgr.PlatformPlugin)1 BeanDefinition (org.springframework.beans.factory.config.BeanDefinition)1 DefaultListableBeanFactory (org.springframework.beans.factory.support.DefaultListableBeanFactory)1