Examples of IPluginManager


Examples of net.sourceforge.squirrel_sql.client.plugin.IPluginManager

   * @return a set of plugin internal names
   */
  public Set<String> getInstalledPlugins()
  {
    Set<String> result = new HashSet<String>();
    IPluginManager pmgr = _app.getPluginManager();
    PluginInfo[] infos = pmgr.getPluginInformation();
    for (PluginInfo info : infos)
    {
      result.add(info.getInternalName());
    }
    return result;
View Full Code Here

Examples of net.sourceforge.squirrel_sql.client.plugin.IPluginManager

  // TODO: This is a nasty quick hack. Needs an API to do this.
  private boolean isOsxPluginLoaded()
  {
    if (SystemProperties.isRunningOnOSX())
    {
      final IPluginManager mgr = _app.getPluginManager();
      PluginInfo[] ar = mgr.getPluginInformation();
      for (int i = 0; i < ar.length; ++i)
      {
        if (ar[i].getInternalName().equals("macosx"))
        {
          return ar[i].isLoaded();
View Full Code Here

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

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

      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

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

   *          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

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

   * @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

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

    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

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

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

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

    pluginManager.reload();
    return true;
  }

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

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

  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
TOP
Copyright © 2018 www.massapi.com. 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.