Cytoscape 2.5.1 (c) 2006,2007 ISB, MSKCC, UCSD

cytoscape.plugin
Class PluginManager

java.lang.Object
  extended by cytoscape.plugin.PluginManager

public class PluginManager
extends Object

Author:
skillcoy

Method Summary
 void delete()
          Takes all objects on the "to-delete" list and deletes them.
 void delete(PluginInfo Obj)
          Marks the given object for deletion the next time Cytoscape is restarted.
 PluginInfo download(PluginInfo Obj)
          Downloads given object to the temporary directory.
 PluginInfo download(PluginInfo Obj, cytoscape.task.TaskMonitor taskMonitor)
          Downloads given object to the temporary directory.
 List<PluginInfo> findUpdates(PluginInfo Plugin)
           
 List<PluginInfo> findUpdates(PluginInfo Plugin, cytoscape.task.ui.JTaskConfig jTaskConfig)
          Get list of plugins that would update the given plugin.
static URLClassLoader getClassLoader()
          Replaces CytoscapeInit.getClassLoader()
 cytoscape.plugin.PluginManager.InquireTask getInquireTask(String Url, PluginInquireAction Action)
          Creates a Task for inquiring through a site about plugins.
 File getPluginManageDirectory()
           
static PluginManager getPluginManager()
          Get the PluginManager object.
 List<PluginInfo> getPlugins(PluginStatus Status)
          Get a list of plugins by status.
static List<URL> getPluginURLs()
          Replaces CytoscapeInit.getPluginURLs()
static List<String> getResourcePlugins()
          Replaces CytoscapeInit.getResourcePlugins()
 List<PluginInfo> inquire(String Url)
          Calls the given url, expects document describing plugins available for download
 void install()
          Sets all plugins on the "install" list to "current"
 void install(PluginInfo obj)
          Change the given plugin from "install" to "current" status
 void loadPlugin(PluginInfo p)
          Load a single plugin based on the PluginInfo object given
 void loadPlugins(List<String> p)
          Parses the plugin input strings and transforms them into the appropriate URLs or resource names.
static void setPluginManageDirectory(String loc)
           
 void update(PluginInfo Current, PluginInfo New)
          Finds the given version of the new object, sets the old object for deletion and downloads new object to temporary directory
 void update(PluginInfo Current, PluginInfo New, cytoscape.task.TaskMonitor taskMonitor)
          Finds the given version of the new object, sets the old object for deletion and downloads new object to temporary directory
static boolean usingWebstartManager()
          Returns true/false based on the System property.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getClassLoader

public static URLClassLoader getClassLoader()
Replaces CytoscapeInit.getClassLoader()

Returns:
URLClassLoader used to load plugins.

getResourcePlugins

public static List<String> getResourcePlugins()
Replaces CytoscapeInit.getResourcePlugins()

Returns:
Set of resource plugins

getPluginURLs

public static List<URL> getPluginURLs()
Replaces CytoscapeInit.getPluginURLs()

Returns:
Set of plugin URL's

usingWebstartManager

public static boolean usingWebstartManager()
Returns true/false based on the System property. This is what is checked to find out if install/delete/download methods are permitted.

Returns:
true if Cytoscape is in webstart

getPluginManager

public static PluginManager getPluginManager()
Get the PluginManager object.

Returns:
PluginManager

setPluginManageDirectory

public static void setPluginManageDirectory(String loc)
Parameters:
loc - Location of plugin download/install directory. If this method is not called the default is .cytoscape/[cytoscape version]/plugins

getPluginManageDirectory

public File getPluginManageDirectory()

getPlugins

public List<PluginInfo> getPlugins(PluginStatus Status)
Get a list of plugins by status. CURRENT: currently installed INSTALL: plugins to be installed DELETE: plugins to be deleted

Parameters:
Status -
Returns:

inquire

public List<PluginInfo> inquire(String Url)
                         throws IOException,
                                org.jdom.JDOMException
Calls the given url, expects document describing plugins available for download

Parameters:
Url -
Returns:
List of PluginInfo objects
Throws:
IOException
org.jdom.JDOMException

getInquireTask

public cytoscape.plugin.PluginManager.InquireTask getInquireTask(String Url,
                                                                 PluginInquireAction Action)
Creates a Task for inquiring through a site about plugins.

Parameters:
Url - Plugin site to connect to
Action - Code to run on the results of the inquiry
Returns:

install

public void install()
Sets all plugins on the "install" list to "current"


install

public void install(PluginInfo obj)
Change the given plugin from "install" to "current" status

Parameters:
obj -

delete

public void delete(PluginInfo Obj)
            throws WebstartException
Marks the given object for deletion the next time Cytoscape is restarted.

Parameters:
Obj -
Throws:
WebstartException

delete

public void delete()
            throws ManagerException
Takes all objects on the "to-delete" list and deletes them. This can only occur at start up, CytoscapeInit should be the only class to call this.

Throws:
ManagerException - If all files fail to delete
WebstartException - If this method is called from a webstart instance

findUpdates

public List<PluginInfo> findUpdates(PluginInfo Plugin)
                             throws IOException,
                                    org.jdom.JDOMException
Throws:
IOException
org.jdom.JDOMException

findUpdates

public List<PluginInfo> findUpdates(PluginInfo Plugin,
                                    cytoscape.task.ui.JTaskConfig jTaskConfig)
                             throws IOException,
                                    org.jdom.JDOMException
Get list of plugins that would update the given plugin.

Parameters:
Plugin -
Returns:
List
Throws:
ManagerException
IOException
org.jdom.JDOMException

update

public void update(PluginInfo Current,
                   PluginInfo New)
            throws IOException,
                   ManagerException,
                   WebstartException
Finds the given version of the new object, sets the old object for deletion and downloads new object to temporary directory

Parameters:
Current - PluginInfo object currently installed
New - PluginInfo object to install
Throws:
IOException - Fails to download the file.
ManagerException - If the plugins don't match or the new one is not a newer version.
WebstartException

update

public void update(PluginInfo Current,
                   PluginInfo New,
                   cytoscape.task.TaskMonitor taskMonitor)
            throws IOException,
                   ManagerException,
                   WebstartException
Finds the given version of the new object, sets the old object for deletion and downloads new object to temporary directory

Parameters:
Current - PluginInfo object currently installed
New - PluginInfo object to install
taskMonitor - TaskMonitor for downloads
Throws:
IOException - Fails to download the file.
ManagerException - If the plugins don't match or the new one is not a newer version.
WebstartException

download

public PluginInfo download(PluginInfo Obj)
                    throws IOException,
                           ManagerException
Downloads given object to the temporary directory.

Parameters:
Obj - PluginInfo object to be downloaded
Returns:
File downloaded
Throws:
IOException
ManagerException

download

public PluginInfo download(PluginInfo Obj,
                           cytoscape.task.TaskMonitor taskMonitor)
                    throws IOException,
                           ManagerException
Downloads given object to the temporary directory. Uses a task monitor if available.

Parameters:
Obj - PluginInfo object to be downloaded
taskMonitor - TaskMonitor
tempDirectory - Download to a different temporary directory. Default is .cytoscape/plugins/[cytoscape version number]
Returns:
File downloaded
Throws:
IOException
ManagerException

loadPlugin

public void loadPlugin(PluginInfo p)
                throws MalformedURLException,
                       IOException,
                       ClassNotFoundException,
                       PluginException
Load a single plugin based on the PluginInfo object given

Parameters:
PluginInfo - The plugin to load
Throws:
MalformedURLException
IOException
ClassNotFoundException
PluginException

loadPlugins

public void loadPlugins(List<String> p)
                 throws MalformedURLException,
                        IOException,
                        ClassNotFoundException,
                        PluginException
Parses the plugin input strings and transforms them into the appropriate URLs or resource names. The method first checks to see if the

Throws:
MalformedURLException
IOException
ClassNotFoundException
PluginException

www.cytoscape.org