[MOBY-guts] biomoby commit

senger@ebi.ac.uk senger at pub.open-bio.org
Fri Nov 12 23:02:31 UTC 2004


senger
Fri Nov 12 18:02:30 EST 2004
Update of /home/repository/moby/moby-live/Java/src/Clients
In directory pub.open-bio.org:/tmp/cvs-serv12053/src/Clients

Modified Files:
	MobyCmdLineClient.java MobyGraphs.java 
Log Message:
command-line client is able now to call services easier

moby-live/Java/src/Clients MobyCmdLineClient.java,1.6,1.7 MobyGraphs.java,1.5,1.6
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java	2004/09/23 10:20:29	1.6
+++ /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java	2004/11/12 23:02:30	1.7
@@ -521,7 +521,7 @@
 	    }
 
 	    //
-	    // call a raw method (for debugging)
+	    // call a raw method (for debugging, mostly)
 	    //
 	    params = null;
 	    if ((params = cmd.getParam ("-call", 2)) != null ) {
@@ -539,6 +539,47 @@
 		}
 	    }
 
+	    //
+	    // call a service instead of a Moby Central
+	    //
+	    params = null;
+	    if ((params = cmd.getParam ("-scall", 2)) != null ) {
+		if (params[0] != null && params[1] != null) {
+
+		    // find URL of the wanted service
+		    decorationLn ("Looking for service '" + params[0] + "':");
+		    String serviceName = null;
+		    int pos = params[0].indexOf (",");
+		    MobyService[] services;
+		    if (pos == -1) {
+			serviceName = params[0];
+			services = worker.findService (new MobyService (params[0]));
+		    } else if (pos == params[0].length() - 1) {
+			serviceName = params[0].substring (0, pos);
+			services = worker.findService (new MobyService (serviceName));
+		    } else {
+			serviceName = params[0].substring (0, pos);
+			MobyService pattern = new MobyService (serviceName);
+			pattern.setAuthority (params[0].substring (pos+1));
+			services = worker.findService (pattern);
+		    }
+		    if (services != null && services.length > 0) {
+			String serviceURL = services[0].getURL();
+			if (! serviceURL.equals ("")) {
+
+			    // call the service
+			    decorationLn ("Calling service '" + serviceName + "' with the input from '" + params[1] + "':");
+			    if (new File (params[1]).exists())
+				params[1] =  FileUtils.getFile (params[1]);
+			    decorationLn (params[1]);
+			    decorationLn ("---------------");
+			    Central serviceWorker = new CentralImpl (serviceURL, "http://biomoby.org/");
+			    System.out.println (serviceWorker.call (serviceName, params[1]));
+			}
+		    }
+		}
+	    }
+
 	} catch (PendingCurationException e) {
 	    System.err.println ("===ERROR===");
 	    System.err.println ("Pending Curation");

===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java	2004/10/18 14:35:05	1.5
+++ /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java	2004/11/12 23:02:30	1.6
@@ -173,6 +173,9 @@
 		    DataServiceEdge[] startingEdges = ServiceConnections.findStartingEdges (sourceData, dataTypes, services);
 		    DataServiceEdge[] endingEdges = ServiceConnections.findEndingEdges (targetData, dataTypes, services);
 
+		    System.out.println ("SE: " + startingEdges.length);
+		    System.out.println ("EE: " + endingEdges.length);
+
 		    // this creates *all* pathes, but some of them have cycles and inside branches
 		    separatePaths = FilterServices.dataPaths (startingEdges, edges, endingEdges);
 		    if (separatePaths.length == 0) {
@@ -180,10 +183,16 @@
 					    pathEnds[0] + "' and '" + pathEnds[1] + "'");
 			System.exit(1);
 		    }
+		    System.out.println ("SP: " + separatePaths.length);
+
 		    allPaths = FilterServices.joinPaths (separatePaths);
 
+		    System.out.println ("AP: " + allPaths.length);
+
 		    // this separate paths to straight paths (no cycles, no branches)
 		    separatePaths = FilterServices.straightDataPaths (startingEdges, allPaths, endingEdges);
+
+		    System.out.println ("SP2: " + separatePaths.length);
 		}
 
 		// create a graph (in whatever format)




More information about the MOBY-guts mailing list