[MOBY-guts] biomoby commit
Paul Gordon
gordonp at dev.open-bio.org
Mon Dec 17 18:39:30 UTC 2007
gordonp
Mon Dec 17 13:39:30 EST 2007
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services
In directory dev.open-bio.org:/tmp/cvs-serv6107/src/main/ca/ucalgary/seahawk/services
Modified Files:
MobyComplexBuilder.java
Log Message:
Changed registry spec source from SeahawkOptions to parent MobyClient
moby-live/Java/src/main/ca/ucalgary/seahawk/services MobyComplexBuilder.java,1.13,1.14
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyComplexBuilder.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyComplexBuilder.java 2007/12/06 23:46:34 1.13
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyComplexBuilder.java 2007/12/17 18:39:30 1.14
@@ -1,7 +1,5 @@
package ca.ucalgary.seahawk.services;
-import ca.ucalgary.seahawk.util.SeahawkOptions;
-
import org.biomoby.shared.*;
import org.biomoby.shared.data.MobyDataBytes;
import org.biomoby.shared.data.MobyDataComposite;
@@ -50,7 +48,7 @@
}
public MobyComplexBuilder(String dataType, Map<String,String[]> members, Map<String,String> nameSpaces, MobyClient cl, String articleName) throws Exception{
- mobyDataType = MobyDataType.getDataType(dataType, SeahawkOptions.getRegistry());
+ mobyDataType = MobyDataType.getDataType(dataType, cl.getRegistry());
// Not an existing Ontology data type
if(mobyDataType == null){
mobyDataType = new MobyDataType(dataType);
@@ -114,9 +112,9 @@
MobyRelationship child = mobyDataType.getChild(member.getKey());
String defaultDataTypeName = child.getDataTypeName();
MobyDataType castType = MobyDataType.getDataType(memberDataTypeSetting,
- SeahawkOptions.getRegistry());
+ client.getRegistry());
MobyDataType origType = MobyDataType.getDataType(defaultDataTypeName,
- SeahawkOptions.getRegistry());
+ client.getRegistry());
if(castType == null){
System.err.println("Could not find the data type "+memberDataTypeSetting+
" in the ontology, ignoring the data type cast"+
@@ -152,7 +150,7 @@
String ns = (String) iter.next();
// Give the namespace a meaningful description from the MOBY registry
- mobyNS[i] = MobyNamespace.getNamespace(ns, SeahawkOptions.getRegistry());
+ mobyNS[i] = MobyNamespace.getNamespace(ns, client.getRegistry());
if(mobyNS[i] == null){
System.err.println("Namespace '"+ns+"' is not registered in MOBY Central");
// Not a registered namespace in MOBY Central's ontology
@@ -170,9 +168,9 @@
MobyDataObject mobyObj = null;
if(mobyDataType.getName().equals("Object")){
- mobyObj = new MobyDataObject("", SeahawkOptions.getRegistry());
+ mobyObj = new MobyDataObject("", client.getRegistry());
}
- else if(mobyDataType.inheritsFrom(MobyDataType.getDataType(MobyDataBytes.BASE64_DATATYPE, SeahawkOptions.getRegistry()))){
+ else if(mobyDataType.inheritsFrom(MobyDataType.getDataType(MobyDataBytes.BASE64_DATATYPE, client.getRegistry()))){
mobyObj = new MobyDataBytes("", (String) null);
mobyObj.setDataType(mobyDataType);
}
@@ -212,7 +210,7 @@
}
else{
// ... the subsequent ones are saved as cross-references
- mobyObj.addCrossReference(new MobyDataObject(mobyNS[i].getName(), result, SeahawkOptions.getRegistry()));
+ mobyObj.addCrossReference(new MobyDataObject(mobyNS[i].getName(), result, client.getRegistry()));
}
}
}
@@ -286,9 +284,9 @@
for(String result: results){
if(PrimitiveTypes.isPrimitive(dataTypeName) ||
- MobyDataType.getDataType(dataTypeName, SeahawkOptions.getRegistry()).inheritsFrom(MobyDataType.getDataType(MobyDataBytes.BASE64_DATATYPE, SeahawkOptions.getRegistry()))){
+ MobyDataType.getDataType(dataTypeName, client.getRegistry()).inheritsFrom(MobyDataType.getDataType(MobyDataBytes.BASE64_DATATYPE, client.getRegistry()))){
((MobyDataComposite) mobyObj).put(memberName,
- MobyDataObject.createInstanceFromString(dataTypeName, result, SeahawkOptions.getRegistry()));
+ MobyDataObject.createInstanceFromString(dataTypeName, result, client.getRegistry()));
}
else{
// Recursively call the object creator for complex members
@@ -501,7 +499,7 @@
MobyDataObject mobyObj = null;
if(mobyDataType.getName().equals("Object")){
- mobyObj = new MobyDataObject("", SeahawkOptions.getRegistry());
+ mobyObj = new MobyDataObject("", client.getRegistry());
}
// else ifs for other primitives in the future maybe?
else{
@@ -526,7 +524,7 @@
}
else{
// ... the subsequent ones are saved as cross-references
- mobyObj.addCrossReference(new MobyDataObject(mobyNS[i].getName(), value, SeahawkOptions.getRegistry()));
+ mobyObj.addCrossReference(new MobyDataObject(mobyNS[i].getName(), value, client.getRegistry()));
}
}
}
@@ -541,7 +539,7 @@
String value = xpath.evaluate(expr, result);
((MobyDataComposite) mobyObj).put(memberName,
- MobyDataObject.createInstanceFromString(children[i].getDataTypeName(), value, SeahawkOptions.getRegistry()));
+ MobyDataObject.createInstanceFromString(children[i].getDataTypeName(), value, client.getRegistry()));
}
}
}
More information about the MOBY-guts
mailing list