Author: jgao
Date: 2010-02-18 19:33:30 -0800 (Thu, 18 Feb 2010)
New Revision: 19384

Modified:
   
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/IDMapperClientImplTunables.java
   
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/ui/CyThesaurusDialog.java
   
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/ui/IDMappingSourceConfigDialog.java
   
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/ui/IDMappingSourceSelectionTree.java
Log:
CyThesaurus: disable AttributeMapping for BridgeRest (the service is too slow)

Modified: 
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/IDMapperClientImplTunables.java
===================================================================
--- 
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/IDMapperClientImplTunables.java
 2010-02-19 01:54:14 UTC (rev 19383)
+++ 
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/IDMapperClientImplTunables.java
 2010-02-19 03:33:30 UTC (rev 19384)
@@ -216,6 +216,13 @@
                 Class.forName(getClassString());
                 mapper = BridgeDb.connect(getConnectionString());
                 preprocess(mapper);
+
+                // in case the current type is wrong, update it.
+                ClientType type = ClientType.getClientType(mapper);
+                if (type!=getClientType()) {
+                    clientType.setValue(type.name());
+                    props.saveProperties(clientType);
+                }
             } catch (Exception e) {
                 e.printStackTrace();
                 return null;

Modified: 
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/ui/CyThesaurusDialog.java
===================================================================
--- 
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/ui/CyThesaurusDialog.java
       2010-02-19 01:54:14 UTC (rev 19383)
+++ 
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/ui/CyThesaurusDialog.java
       2010-02-19 03:33:30 UTC (rev 19384)
@@ -636,6 +636,10 @@
                     continue;
                 }
 
+                // TODO: remove next two lines after the problem of 
AttributeMapper in BridgeRest is solved.
+                if (mapper instanceof 
org.bridgedb.webservice.bridgerest.BridgeRest)
+                    continue;
+
                 if (!(mapper instanceof AttributeMapper))
                     continue;
 
@@ -684,15 +688,20 @@
             IDMapperStack stack = new IDMapperStack();
             for (IDMapperClient client : 
IDMapperClientManager.selectedClients()) {
                 IDMapper mapper = client.getIDMapper();
-                if (mapper==null) {
+                if (mapper==null)
                     continue;
-                }
 
-                if (!(mapper instanceof IDMapperBiomart)) {
-                    // TODO: this is temperory solution
-                    // there should be a AttributeMapperCapacities or 
something like that
-                    stack.addIDMapper(mapper);
-                }
+                // TODO: IDMapperBiomart does not support mapping from 
attribute
+                // this is temperory solution
+                // there should be a AttributeMapperCapacities or something 
like that
+                if (mapper instanceof IDMapperBiomart)
+                    continue;
+
+                // TODO: remove next line after the problem of AttributeMapper 
in BridgeRest is solved.
+                if (mapper instanceof 
org.bridgedb.webservice.bridgerest.BridgeRest)
+                    continue;
+
+                stack.addIDMapper(mapper);
             }
             try {
                 srcAttrs = stack.getAttributeSet();
@@ -716,6 +725,10 @@
                 if (mapper==null || !(mapper instanceof AttributeMapper))
                     continue;
 
+                // TODO: remove next two lines after the problem of 
AttributeMapper in BridgeRest is solved.
+                if (mapper instanceof 
org.bridgedb.webservice.bridgerest.BridgeRest)
+                    continue;
+
                 Set<String> attrs = null;
                 Set<DataSource> srcTypes = null;
                 try {

Modified: 
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/ui/IDMappingSourceConfigDialog.java
===================================================================
--- 
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/ui/IDMappingSourceConfigDialog.java
     2010-02-19 01:54:14 UTC (rev 19383)
+++ 
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/ui/IDMappingSourceConfigDialog.java
     2010-02-19 03:33:30 UTC (rev 19384)
@@ -266,7 +266,7 @@
         
         IDMapperClientManager.reloadFromCytoscapeGlobalProperties();
 
-        srcTree.reload();
+        srcTree.reset();
         JOptionPane.showMessageDialog(this, "The default resources has been 
loaded.");
     }//GEN-LAST:event_loadDefaultButtonActionPerformed
 
@@ -379,6 +379,8 @@
     //        desc.append(capabilities.isFreeSearchSupported()? 
"\tYes":"\tNo");
     //        desc.append("\n");
 
+            // TODO: remove next line after the problem of AttributeMapper in 
BridgeRest is solved.
+            if (!(idMapper instanceof 
org.bridgedb.webservice.bridgerest.BridgeRest))
             if (idMapper instanceof AttributeMapper) {
                 desc.append(">>Supported Attributes\n");
                 Set<String> attrs = 
((AttributeMapper)idMapper).getAttributeSet();

Modified: 
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/ui/IDMappingSourceSelectionTree.java
===================================================================
--- 
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/ui/IDMappingSourceSelectionTree.java
    2010-02-19 01:54:14 UTC (rev 19383)
+++ 
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/ui/IDMappingSourceSelectionTree.java
    2010-02-19 03:33:30 UTC (rev 19384)
@@ -115,13 +115,17 @@
 
         selection_Model = checkTreeManager.getSelectionModel();
 
-        reload();
+        initTree();
     }
 
-    public void reload() {
+    public void reset() {
+        initTree();
+        modified = true;
+    }
+
+    private void initTree() {
         setupTree();
         setupMouse();
-        modified = true;
     }
 
     public boolean isModified() {

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