Author: jgao
Date: 2010-09-03 15:17:27 -0700 (Fri, 03 Sep 2010)
New Revision: 21697
Modified:
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/service/CyThesaurusNamespace.java
Log:
CyThesaurus: commands improvement
Modified:
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/service/CyThesaurusNamespace.java
===================================================================
---
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/service/CyThesaurusNamespace.java
2010-09-03 22:17:06 UTC (rev 21696)
+++
csplugins/trunk/soc/jgao/IDMapping/src/csplugins/id/mapping/service/CyThesaurusNamespace.java
2010-09-03 22:17:27 UTC (rev 21697)
@@ -163,7 +163,7 @@
addDescription(CHECK_ID_EXIST, "Check if ID exists.");
addArgument(GUESS_TYPE, SOURCE_ID);
- addDescription(CHECK_ID_EXIST, "Guess ID types from a set of IDs.");
+ addDescription(GUESS_TYPE, "Guess ID types from a set of IDs.");
}
@@ -725,25 +725,23 @@
String id = getArg(command, SOURCE_ID, args);
String type = getArg(command, SOURCE_TYPE, args);
-
- if (id==null || type==null)
if (id==null || type==null) {
throw new CyCommandException("Null argument of "+SOURCE_ID+" or
"+SOURCE_TYPE);
- } else {
- if (!DataSource.getFullNames().contains(type)) {
- throw new CyCommandException("Type \""+type+"\" does not
exist.");
- } else {
- DataSource ds = DataSource.getByFullName(type);
- IDMapperStack stack =
IDMapperClientManager.selectedIDMapperStack();
- try {
- result.addResult(stack.xrefExists(new Xref(id, ds)));
- } catch (Exception e) {
- throw new CyCommandException(e);
- }
- }
}
+ if (!DataSource.getFullNames().contains(type)) {
+ throw new CyCommandException("Type \""+type+"\" does not exist.");
+ }
+
+ DataSource ds = DataSource.getByFullName(type);
+ IDMapperStack stack = IDMapperClientManager.selectedIDMapperStack();
+ try {
+ result.addResult(stack.xrefExists(new Xref(id, ds)));
+ } catch (Exception e) {
+ throw new CyCommandException(e);
+ }
+
return result;
}
--
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.