Package org.pentaho.platform.engine.core.solution

Examples of org.pentaho.platform.engine.core.solution.ContentInfo


        String description = XmlDom4JHelper.getNodeText( "description", node, "" ); //$NON-NLS-1$ //$NON-NLS-2$
        String mimeType = node.attributeValue( "mime-type", "" ); //$NON-NLS-1$ //$NON-NLS-2$
        String iconUrl = XmlDom4JHelper.getNodeText( "icon-url", node, "" ); //$NON-NLS-1$ //$NON-NLS-2$
        String metaProviderClass = XmlDom4JHelper.getNodeText( "meta-provider", node, "" ); //$NON-NLS-1$ //$NON-NLS-2$

        ContentInfo contentInfo = new ContentInfo();
        contentInfo.setDescription( description );
        contentInfo.setTitle( title );
        contentInfo.setExtension( extension );
        contentInfo.setMimeType( mimeType );
        contentInfo.setIconUrl( iconUrl );

        List<?> operationNodes = node.selectNodes( "operations/operation" ); //$NON-NLS-1$
        for ( Object operationObj : operationNodes ) {
          Element operationNode = (Element) operationObj;
          String id = XmlDom4JHelper.getNodeText( "id", operationNode, "" ); //$NON-NLS-1$ //$NON-NLS-2$
          String perspective = XmlDom4JHelper.getNodeText( "perspective", operationNode, "" ); //$NON-NLS-1$ //$NON-NLS-2$
          if ( StringUtils.isNotEmpty( id ) ) {
            PluginOperation operation = new PluginOperation( id );
            if ( StringUtils.isNotEmpty( perspective ) ) {
              operation.setPerspective( perspective );
            }

            contentInfo.addOperation( operation );
          }
        }

        plugin.addContentInfo( contentInfo );
        if ( !StringUtils.isEmpty( metaProviderClass ) ) {
          plugin.getMetaProviderMap().put( contentInfo.getExtension(), metaProviderClass );
        }
        PluginMessageLogger.add( Messages.getInstance().getString(
          "PluginManager.USER_CONTENT_TYPE_REGISTERED", extension, title ) ); //$NON-NLS-1$
      } else {
        PluginMessageLogger.add( Messages.getInstance().getString(
View Full Code Here


  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
      //
View Full Code Here

      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.engine.core.solution.ContentInfo

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.