[MOBY-guts] biomoby commit

Paul Gordon gordonp at dev.open-bio.org
Tue Jun 9 19:20:59 UTC 2009


gordonp
Tue Jun  9 15:20:59 EDT 2009
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services
In directory dev.open-bio.org:/tmp/cvs-serv20747/src/main/ca/ucalgary/services

Modified Files:
	LegacyService.java 
Log Message:
Made registry-savvy, added convenience method to do MOB transform
moby-live/Java/src/main/ca/ucalgary/services LegacyService.java,1.4,1.5
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/LegacyService.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/LegacyService.java	2008/10/30 02:33:24	1.4
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/LegacyService.java	2009/06/09 19:20:59	1.5
@@ -28,6 +28,19 @@
     // Initialized after createServiceFromConfig()
     protected MobyDataType binaryDataType;
 
+    protected MobyDataInstance getMobyData(String legacyData, 
+					   MobyPrimaryData mobyDataTemplate)
+	throws Exception{	
+	try{
+	    return mobyClient.getMobyObject(legacyData, mobyDataTemplate);
+	} catch(MobyServiceException mse){
+	    //getMobyObject() throws untransformed-data warnings
+	    addException(mse);
+	}
+
+	return null;
+    }
+    
     protected MobyDataInstance getMobyData(Map<String,byte[]> legacyDataParts, 
 					   MobyPrimaryData mobyDataTemplate)
 	throws Exception{	
@@ -40,7 +53,7 @@
 
 	return null;
     }
-    
+
     protected MobyDataInstance getMobyData(org.w3c.dom.Node legacyDOMNode, 
 					   MobyPrimaryData mobyDataTemplate)
 	throws Exception{	
@@ -84,6 +97,10 @@
 	return textClient.canProduceTextTypeFromMoby(legacyFormatName, mobyPrimaryInput);
     }
 
+    protected MobyClient getMobyClient(){
+	return mobyClient;
+    }
+
     public MobyService createServiceFromConfig(javax.servlet.http.HttpServletRequest request)
 	throws Exception{
 	MobyService service = super.createServiceFromConfig(request);
@@ -185,7 +202,7 @@
 	mobyClient = new MobyClient(registry);
 
 	// Instantiate the MOBY data -> string mapping engine
-	textClient = new TextClient();
+	textClient = new TextClient(registry);
 	textClient.addMappingsFromURL(xsltRulesURL);
 
 	binaryDataType = MobyDataType.getDataType(MobyDataBytes.BASE64_DATATYPE, registry);




More information about the MOBY-guts mailing list