Author: scooter
Date: 2010-12-21 11:33:44 -0800 (Tue, 21 Dec 2010)
New Revision: 23256

Modified:
   csplugins/trunk/ucsf/scooter/bioCycPlugin/build.xml
   csplugins/trunk/ucsf/scooter/bioCycPlugin/resources/plugin.props
   
csplugins/trunk/ucsf/scooter/bioCycPlugin/src/bioCycPlugin/commands/BioCycCommandHandler.java
Log:
Added new command to switch repositories


Modified: csplugins/trunk/ucsf/scooter/bioCycPlugin/build.xml
===================================================================
--- csplugins/trunk/ucsf/scooter/bioCycPlugin/build.xml 2010-12-21 01:57:49 UTC 
(rev 23255)
+++ csplugins/trunk/ucsf/scooter/bioCycPlugin/build.xml 2010-12-21 19:33:44 UTC 
(rev 23256)
@@ -23,7 +23,7 @@
 
     <!-- The version of your plugin. To support plugin.props, make sure the 
          version is expressed in decimal notation, e.g. 3.0, 3.1, 3.14, etc. 
-->
-    <property name="version" value="0.9"/>
+    <property name="version" value="0.91"/>
 
     <!-- The version of Cytoscape that you depend on. -->
     <property name="cytoscape.version" value="2.8.0"/>

Modified: csplugins/trunk/ucsf/scooter/bioCycPlugin/resources/plugin.props
===================================================================
--- csplugins/trunk/ucsf/scooter/bioCycPlugin/resources/plugin.props    
2010-12-21 01:57:49 UTC (rev 23255)
+++ csplugins/trunk/ucsf/scooter/bioCycPlugin/resources/plugin.props    
2010-12-21 19:33:44 UTC (rev 23256)
@@ -13,7 +13,7 @@
 pluginDescription=This plugin provides a web services interface to Pathway 
Tools repositories
 
 # Plugin version number, this must be two numbers separated by a decimlal.  
Ex. 0.2, 14.03
-pluginVersion=0.9
+pluginVersion=0.91
 
 # Compatible Cytoscape version
 cytoscapeVersion=2.8

Modified: 
csplugins/trunk/ucsf/scooter/bioCycPlugin/src/bioCycPlugin/commands/BioCycCommandHandler.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/bioCycPlugin/src/bioCycPlugin/commands/BioCycCommandHandler.java
       2010-12-21 01:57:49 UTC (rev 23255)
+++ 
csplugins/trunk/ucsf/scooter/bioCycPlugin/src/bioCycPlugin/commands/BioCycCommandHandler.java
       2010-12-21 19:33:44 UTC (rev 23256)
@@ -47,6 +47,7 @@
 import cytoscape.layout.Tunable;
 import cytoscape.logger.CyLogger;
 
+import bioCycPlugin.BioCycPlugin;
 import bioCycPlugin.model.Database;
 import bioCycPlugin.model.Gene;
 import bioCycPlugin.model.Pathway;
@@ -55,7 +56,7 @@
 
 enum Command {
   LISTDATABASES("list databases", 
-                       "List all of the available databases", ""),
+                       "List all of the available databases", null),
   LISTGENES("list genes", 
                    "List all of the genes that meet the criteria",
                    "database=ecoli|name"),
@@ -70,7 +71,10 @@
                    "database=ecoli|protein|gene"),
        LOADPATHWAY("load pathway",
                    "Load a pathway in biopax format",
-                   "database=ecoli|pathway");
+                   "database=ecoli|pathway"),
+       OPENRESOURCE("open resource",
+                   "Open a Pathway Tools Resource",
+                   "url");
 
   private String command = null;
   private String argList = null;
@@ -104,6 +108,7 @@
        public static final String PROTEIN = "protein";
        public static final String REACTION = "reaction";
        public static final String SUBSTRATE = "substrate";
+       public static final String URL = "url";
 
        public BioCycCommandHandler(String namespace, CyLogger logger) {
                super(CyCommandManager.reserveNamespace(namespace));
@@ -139,11 +144,28 @@
                        return result;
                }
 
+               // OPENRESOURCE("open resource",
+               //              "Open a Pathway Tools Resource",
+               //              "url");
+               if (Command.OPENRESOURCE.equals(command)) {
+                       String url = getArg(command, URL, args);
+                       if (url == null || url.length() == 0)
+                               throw new CyCommandException("Must specify a 
url for the resource");
+                       
+                       String oldUrl = BioCycPlugin.getBaseUrl();
+                       BioCycPlugin.setProp(BioCycPlugin.WEBSERVICE_URL, url);
+                       result.addMessage("Switched resource from "+oldUrl+" to 
"+url);
+                       return result;
+               }
+
                // All of the rest of these require a database
                String database = getArg(command, DATABASE, args);
                if (database == null)
                        throw new CyCommandException("Must specify a database");
 
+               // Databases are upper-case
+               database = database.toUpperCase();
+
                // LOADPATHWAY("load pathway",
                //            "Load a pathway in biopax format",
                //            "database=ecoli|pathway");

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to