Package org.pentaho.platform.api.engine

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


    String perspective = null;
    StringBuffer buffer = null;
    String url = null;
    String path = FileResource.idToPath( pathId );
    String extension = path.substring( path.lastIndexOf( '.' ) + 1 );
    IPluginManager pluginManager = PentahoSystem.get( IPluginManager.class, PentahoSessionHolder.getSession() );
    IContentInfo info = pluginManager.getContentTypeInfo( extension );
    for ( IPluginOperation operation : info.getOperations() ) {
      if ( operation.getId().equalsIgnoreCase( "RUN" ) ) { //$NON-NLS-1$
        perspective = operation.getPerspective();
        break;
      }
View Full Code Here


      response.getWriter().write(
          Messages.getInstance().getErrorString( "PluggableUploadFileServlet.ERROR_0006_NO_UPLOADER_FOUND" ) ); //$NON-NLS-1$
      return null;
    }

    IPluginManager pluginManager = PentahoSystem.get( IPluginManager.class );

    if ( !pluginManager.isBeanRegistered( uploaderBeanId ) ) {
      response.getWriter().write(
          Messages.getInstance().getErrorString(
            "PluggableUploadFileServlet.ERROR_0008_NO_UPLOADER_BY_ID", uploaderBeanId ) ); //$NON-NLS-1$
      return null;
    }

    Object uploaderBean = pluginManager.getBean( uploaderBeanId );
    if ( !( uploaderBean instanceof IUploadFileServletPlugin ) ) {
      response.getWriter().write(
          Messages.getInstance().getErrorString(
              "PluggableUploadFileServlet.ERROR_0007_UPLOADER_WRONG_TYPE", IUploadFileServletPlugin.class.getName() ) ); //$NON-NLS-1$
      return null;
View Full Code Here

   *          a path to a plugin resource
   * @return the ClassLoader that serves the (plugin-supplied) service, or <code>null</code> if the service was not
   *         plugin-supplied or the plugin manager cannot identify the service.
   */
  public static ClassLoader getClassLoaderForService( String path ) {
    IPluginManager pluginManager = PentahoSystem.get( IPluginManager.class, PentahoSessionHolder.getSession() );
    return pluginManager.getClassLoader( getPluginIdFromPath( path ) );
  }
View Full Code Here

   * @param path
   *          a path to a plugin resource
   * @return the Id of the plugin
   */
  public static String getPluginIdFromPath( String path ) {
    IPluginManager pluginManager = PentahoSystem.get( IPluginManager.class, PentahoSessionHolder.getSession() );
    if ( path.startsWith( "content" ) || path.startsWith( "/content" ) ) { //$NON-NLS-1$
      path = path.substring( path.indexOf( '/', 1 ) );
    }
    // The plugin manager can tell us which plugin handles requests like the one for the serialization file
    //
    String servicePluginId = pluginManager.getServicePlugin( path );

    if ( servicePluginId == null ) {
      int start = path.indexOf( "repos/" ) + "repos/".length(); //$NON-NLS-1$ //$NON-NLS-2$
      servicePluginId = path.substring( start, path.indexOf( '/', start ) );
    }
View Full Code Here

    boolean ok = false;
    if ( pojo == null && isDefinedInput( "class" ) ) { //$NON-NLS-1$
      String className = getInputStringValue( "class" ); //$NON-NLS-1$

      // try to load the class from a plugin
      IPluginManager pluginMgr = PentahoSystem.get( IPluginManager.class, getSession() );
      if ( pluginMgr != null && pluginMgr.isBeanRegistered( className ) ) {
        try {
          pojo = pluginMgr.getBean( className ); // "className" is actually the plugin bean id in this case
        } catch ( PluginBeanException e ) {
          error( "Could not load bean class from plugin", e ); //$NON-NLS-1$
          return false;
        }
      }
View Full Code Here

public class PluginAdapter implements IPentahoSystemListener, IPentahoPublisher {

  public boolean startup( IPentahoSession session ) {

    // from IPentahoSystemListener
    IPluginManager pluginManager = PentahoSystem.get( IPluginManager.class, "IPluginManager", session );
    if ( pluginManager == null ) {
      // we cannot continue without the PluginSettings
      Logger.error( getClass().toString(), Messages.getInstance().getErrorString(
          "PluginAdapter.ERROR_0001_PLUGIN_MANAGER_NOT_CONFIGURED" ) ); //$NON-NLS-1$
      return false;
    }
    pluginManager.reload();
    return true;
  }
View Full Code Here

    pluginManager.reload();
    return true;
  }

  public void shutdown() {
    IPluginManager pluginManager = PentahoSystem.get( IPluginManager.class, null );
    if ( pluginManager != null ) {
      pluginManager.unloadAllPlugins();
    }
  }
View Full Code Here

  public String publish( IPentahoSession session, int loggingLevel ) {
    // from IPentahoPublisher
    try {
      PluginMessageLogger.clear();
      IPluginManager pluginManager = PentahoSystem.get( IPluginManager.class, "IPluginManager", session );
      if ( pluginManager == null ) {
        // we cannot continue without the PluginSettings
        Logger.error( getClass().toString(), Messages.getInstance().getErrorString(
            "PluginAdapter.ERROR_0001_PLUGIN_MANAGER_NOT_CONFIGURED" ) ); //$NON-NLS-1$
        return Messages.getInstance().getString( "PluginAdapter.ERROR_0001_PLUGIN_MANAGER_NOT_CONFIGURED" ); //$NON-NLS-1$
      }
      pluginManager.reload( session );
      String rtn = PluginMessageLogger.getAll().toString();
      return rtn;
    } finally {
      PluginMessageLogger.clear();
    }
View Full Code Here

  @GET
  @Path( "/overlays" )
  @Produces( { APPLICATION_JSON } )
  @Facet( name = "Unsupported" )
  public List<Overlay> getOverlays( @QueryParam( "id" ) @DefaultValue( "" ) String id ) {
    IPluginManager pluginManager = PentahoSystem.get( IPluginManager.class, PentahoSessionHolder.getSession() ); //$NON-NLS-1$
    List<XulOverlay> overlays = pluginManager.getOverlays();
    ArrayList<Overlay> result = new ArrayList<Overlay>();
    for ( XulOverlay overlay : overlays ) {
      if ( !id.isEmpty() && !overlay.getId().equals( id ) ) {
        continue;
      }
View Full Code Here

  @Path( "/ids" )
  @Produces( { APPLICATION_JSON } )
  @Facet ( name = "Unsupported" )
  public Response getPluginIds() {
    if ( canAdminister() ) {
      IPluginManager pluginManager = PentahoSystem.get( IPluginManager.class, PentahoSessionHolder.getSession() );
      return Response.ok( new StringListWrapper( pluginManager.getRegisteredPlugins() ), MediaType.APPLICATION_JSON )
          .build();
    } else {
      return Response.status( UNAUTHORIZED ).build();
    }
  }
View Full Code Here

TOP

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

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.