From kawas at dev.open-bio.org Fri Jun 1 09:01:16 2007
From: kawas at dev.open-bio.org (Eddie Kawas)
Date: Fri, 1 Jun 2007 09:01:16 -0400
Subject: [MOBY-guts] biomoby commit
Message-ID: <200706011301.l51D1GZ5007989@dev.open-bio.org>
kawas
Fri Jun 1 09:01:15 EDT 2007
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory dev.open-bio.org:/tmp/cvs-serv7954
Modified Files:
Central.pm
Log Message:
fixed the embedded cdata bug found by irri
what happened was that in the message child of a registration element, we try to let the user know why the rdf was bad. Unfortunately, it was wrapped in a CDATA element. Now it isnt.
moby-live/Perl/MOBY Central.pm,1.282,1.283
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v
retrieving revision 1.282
retrieving revision 1.283
diff -u -r1.282 -r1.283
--- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2007/02/20 01:02:01 1.282
+++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2007/06/01 13:01:15 1.283
@@ -1447,8 +1447,9 @@
"Registration successful but RDF is not correctly formatted:\n\n $RDF",
$SVC->lsid, "" );
}
+ # wrap RDF in CDATA - moved it here, so that we can return the 'bad' rdf above
return &_success( "Registration successful", $SVC->lsid,
- $RDF );
+ "" );
}
sub _getServiceInstanceRDF {
@@ -1467,7 +1468,9 @@
my $response = $browser->get($url);
if ($response) {
my $rdfXML = $response->content;
- return "" unless ( $rdfXML =~ /title>Service Instance Not Found );
+ # removed cdata element because i want to ensure that we can pass the error in the message.
+ # fixes the embedded CDATA bug found by IRRI
+ return "$rdfXML" unless ( $rdfXML =~ /title>Service Instance Not Found );
}
return "";
}
From kawas at dev.open-bio.org Thu Jun 7 10:26:47 2007
From: kawas at dev.open-bio.org (Eddie Kawas)
Date: Thu, 7 Jun 2007 10:26:47 -0400
Subject: [MOBY-guts] biomoby commit
Message-ID: <200706071426.l57EQl49023249@dev.open-bio.org>
kawas
Thu Jun 7 10:26:46 EDT 2007
Update of /home/repository/moby/moby-live/Docs/MOBY-S_API
In directory dev.open-bio.org:/tmp/cvs-serv23214/MOBY-S_API
Modified Files:
XMLPayloads.html
Log Message:
retrieveService end element was missing a '/'
moby-live/Docs/MOBY-S_API XMLPayloads.html,1.18,1.19
===================================================================
RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2007/02/05 14:30:46 1.18
+++ /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2007/06/07 14:26:46 1.19
@@ -382,7 +382,7 @@
From kawas at dev.open-bio.org Thu Jun 7 11:30:01 2007
From: kawas at dev.open-bio.org (Eddie Kawas)
Date: Thu, 7 Jun 2007 11:30:01 -0400
Subject: [MOBY-guts] biomoby commit
Message-ID: <200706071530.l57FU1SM023629@dev.open-bio.org>
kawas
Thu Jun 7 11:30:01 EDT 2007
Update of /home/repository/moby/moby-live/Docs/MOBY-S_API
In directory dev.open-bio.org:/tmp/cvs-serv23593/MOBY-S_API
Modified Files:
XMLPayloads.html
Log Message:
xml from retrieveService was missing a '>' at the cdata element level
moby-live/Docs/MOBY-S_API XMLPayloads.html,1.19,1.20
===================================================================
RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2007/06/07 14:26:46 1.19
+++ /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2007/06/07 15:30:01 1.20
@@ -392,7 +392,7 @@
From gordonp at dev.open-bio.org Thu Jun 7 19:55:42 2007
From: gordonp at dev.open-bio.org (Paul Gordon)
Date: Thu, 7 Jun 2007 19:55:42 -0400
Subject: [MOBY-guts] biomoby commit
Message-ID: <200706072355.l57Ntg5u025474@dev.open-bio.org>
gordonp
Thu Jun 7 19:55:42 EDT 2007
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client
In directory dev.open-bio.org:/tmp/cvs-serv25439/src/main/org/biomoby/client
Modified Files:
CentralCachedCallsImpl.java
Log Message:
First stage commit of update: now concurrent requests for the sameCentral call are blocked, excepted for the first one
moby-live/Java/src/main/org/biomoby/client CentralCachedCallsImpl.java,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralCachedCallsImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralCachedCallsImpl.java 2006/07/07 04:12:39 1.1
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralCachedCallsImpl.java 2007/06/07 23:55:42 1.2
@@ -1,13 +1,15 @@
/**
* Implements the functionality of caching by reusing identical calls to
* MOBY central (e.g. asking multiple times what services take a DNA
- * sequence in the gi namespace).
+ * sequence in the gi namespace). This is an in-memory cache in CentralImpl,
+ * but a filesystem cache backs it up here, so calls can be cached between
+ * JVM instances.
*/
package org.biomoby.client;
import org.biomoby.shared.MobyException;
-import java.util.Properties;
+import java.util.*;
public class CentralCachedCallsImpl extends CentralImpl{
@@ -15,6 +17,8 @@
protected static final long THE_EPOCH = 0; // don't care when the call is made, it shouldn't affect the onto mapping of calls to IDs
protected static final Properties PROPERTIES = null; // don't have any properties for the call
+ protected Map inProgressCalls; // used to synchronize concurrent, redundant calls to Central
+
/*************************************************************************
* Default constructor. It connects to a default Moby registry
* (as defined in {@link #DEFAULT_ENDPOINT}) using a default namespace
@@ -23,6 +27,7 @@
public CentralCachedCallsImpl()
throws MobyException {
super (DEFAULT_ENDPOINT, DEFAULT_NAMESPACE);
+ inProgressCalls = new HashMap();
}
/*************************************************************************
@@ -34,6 +39,7 @@
public CentralCachedCallsImpl (String endpoint)
throws MobyException {
super (endpoint, DEFAULT_NAMESPACE);
+ inProgressCalls = new HashMap();
}
/*************************************************************************
@@ -47,20 +53,59 @@
public CentralCachedCallsImpl (String endpoint, String namespace)
throws MobyException {
super (endpoint, namespace);
+ inProgressCalls = new HashMap();
}
+ /**
+ * The implementation of this method is smart enough that if the same call
+ * is made more than once, even concurrently(!), we only go to the server once,
+ * and use a cached value for all other invocations.
+ */
protected Object doCall (String method, Object[] parameters)
throws MobyException {
- String callKey = createId(method, parameters);
- if(getCacheMode() && existsInCache(callKey)){
- return getContents(callKey);
- }
+ Object result = null;
- Object result = super.doCall(method, parameters);
-
+ String callKey = createId(method, parameters);
if(getCacheMode()){
- setContents(callKey, result);
+
+ // It's in the cache?
+ if(existsInCache(callKey)){
+ return getContents(callKey);
+ }
+
+ // The same request is already in progress, in another thread?
+ Object inProgressCall = null;
+ synchronized(inProgressCalls){
+ String threadName = inProgressCalls.get(callKey);
+ if(threadName == null){
+ // No one's currently doing this request...claim it for this thread
+ threadName = Thread.currentThread().getName();
+ inProgressCalls.put(callKey, threadName);
+ }
+ inProgressCall = threadName;
+ }
+
+ // The first thread making a call will block subsequent ones with the same callKey
+ synchronized(inProgressCall){
+ // Should be true for subsequent calls
+ if(existsInCache(callKey)){
+ return getContents(callKey);
+ }
+ // Should get here only if I'm the first caller for the callKey,
+ // or subsequent call when previous doCall() for this callKey throws an exception
+ // i.e. setContents() isn't called after doCall()
+ try{
+ result = super.doCall(method, parameters);
+ setContents(callKey, result);
+ } finally{
+ // Remove the blocker, regardless of whether an Exception was thrown or not.
+ inProgressCalls.remove(callKey);
+ }
+ }
+ }
+ else{
+ result = super.doCall(method, parameters);
}
return result;
From gordonp at dev.open-bio.org Fri Jun 8 10:03:01 2007
From: gordonp at dev.open-bio.org (Paul Gordon)
Date: Fri, 8 Jun 2007 10:03:01 -0400
Subject: [MOBY-guts] biomoby commit
Message-ID: <200706081403.l58E31vM028646@dev.open-bio.org>
gordonp
Fri Jun 8 10:03:01 EDT 2007
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/test
In directory dev.open-bio.org:/tmp/cvs-serv28612/src/main/ca/ucalgary/seahawk/util/test
Log Message:
Directory /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/test added to the repository
moby-live/Java/src/main/ca/ucalgary/seahawk/util/test - New directory
rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/test/RCS/-,v: No such file or directory
rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/test/RCS/New,v: No such file or directory
rcsdiff: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/test/RCS/directory,v: No such file or directory
From gordonp at dev.open-bio.org Fri Jun 8 10:04:27 2007
From: gordonp at dev.open-bio.org (Paul Gordon)
Date: Fri, 8 Jun 2007 10:04:27 -0400
Subject: [MOBY-guts] biomoby commit
Message-ID: <200706081404.l58E4Rsh028710@dev.open-bio.org>
gordonp
Fri Jun 8 10:04:27 EDT 2007
Update of /home/repository/moby/moby-live/Java
In directory dev.open-bio.org:/tmp/cvs-serv28675
Modified Files:
build.xml
Log Message:
Commit of Seahawk 1.0 updates and associated core updates
moby-live/Java build.xml,1.63,1.64
===================================================================
RCS file: /home/repository/moby/moby-live/Java/build.xml,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- /home/repository/moby/moby-live/Java/build.xml 2007/02/08 17:00:21 1.63
+++ /home/repository/moby/moby-live/Java/build.xml 2007/06/08 14:04:27 1.64
@@ -552,7 +552,16 @@
-
+
+
+
+
+
+
+
+
+
+
From gordonp at dev.open-bio.org Fri Jun 8 10:04:27 2007
From: gordonp at dev.open-bio.org (Paul Gordon)
Date: Fri, 8 Jun 2007 10:04:27 -0400
Subject: [MOBY-guts] biomoby commit
Message-ID: <200706081404.l58E4RT1028730@dev.open-bio.org>
gordonp
Fri Jun 8 10:04:27 EDT 2007
Update of /home/repository/moby/moby-live/Java/src/Clients
In directory dev.open-bio.org:/tmp/cvs-serv28675/src/Clients
Modified Files:
HelloMOBY2.java
Log Message:
Commit of Seahawk 1.0 updates and associated core updates
moby-live/Java/src/Clients HelloMOBY2.java,1.3,1.4
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/Clients/HelloMOBY2.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Java/src/Clients/HelloMOBY2.java 2006/04/06 13:42:44 1.3
+++ /home/repository/moby/moby-live/Java/src/Clients/HelloMOBY2.java 2007/06/08 14:04:27 1.4
@@ -32,7 +32,9 @@
// Ignoring start of request here, nothing for us to do
// requestID is a unique ID for this invocation
- public void start(MobyRequest request, int requestID){
+ public void start(MobyRequestEvent mre){
+ System.out.println("Data being sent is: ");
+ System.out.println(mre.getContent().toString());
}
// Called by MobyRequest when the response is available
From gordonp at dev.open-bio.org Fri Jun 8 10:04:27 2007
From: gordonp at dev.open-bio.org (Paul Gordon)
Date: Fri, 8 Jun 2007 10:04:27 -0400
Subject: [MOBY-guts] biomoby commit
Message-ID: <200706081404.l58E4RrM028790@dev.open-bio.org>
gordonp
Fri Jun 8 10:04:27 EDT 2007
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui
In directory dev.open-bio.org:/tmp/cvs-serv28675/src/main/ca/ucalgary/seahawk/gui
Modified Files:
FileAndTextTransferHandler.java MobyContentClipboard.java
MobyContentGUI.java MobyContentHelpPane.java
MobyContentPane.java MobyDataObjectWidget.java
MobyObjectTransferHandler.java MobySaveDialog.java
MobyServicesGUI.java MobyShimmer.java
Added Files:
MobyContentProducer.java SeahawkOptionsGUI.java
Log Message:
Commit of Seahawk 1.0 updates and associated core updates
moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyContentProducer.java,NONE,1.1 SeahawkOptionsGUI.java,NONE,1.1 FileAndTextTransferHandler.java,1.5,1.6 MobyContentClipboard.java,1.3,1.4 MobyContentGUI.java,1.8,1.9 MobyContentHelpPane.java,1.2,1.3 MobyContentPane.java,1.7,1.8 MobyDataObjectWidget.java,1.1,1.2 MobyObjectTransferHandler.java,1.1,1.2 MobySaveDialog.java,1.2,1.3 MobyServicesGUI.java,1.10,1.11 MobyShimmer.java,1.2,1.3
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/FileAndTextTransferHandler.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/FileAndTextTransferHandler.java 2007/04/26 15:15:45 1.5
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/FileAndTextTransferHandler.java 2007/06/08 14:04:27 1.6
@@ -33,7 +33,6 @@
}
public boolean importData(JComponent c, Transferable t) {
- System.err.println("importData called for file and text transfer handler");
if (!canImport(c, t.getTransferDataFlavors())) {
System.err.println("Cannot drop data into Seahawk: " + t);
return false;
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentClipboard.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentClipboard.java 2007/04/03 02:34:08 1.3
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentClipboard.java 2007/06/08 14:04:27 1.4
@@ -1,13 +1,10 @@
package ca.ucalgary.seahawk.gui;
+import ca.ucalgary.seahawk.util.DataRecorder;
+
import org.biomoby.client.MobyRequestEventHandler;
-import org.biomoby.shared.data.MobyContentInstance;
-import org.biomoby.shared.data.MobyDataInstance;
-import org.biomoby.shared.data.MobyDataJob;
-import org.biomoby.shared.data.MobyDataObject;
-import org.biomoby.shared.data.MobyDataObjectSet;
-import org.biomoby.shared.data.MobyDataUtils;
+import org.biomoby.shared.data.*;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
@@ -51,8 +48,8 @@
private MobyDataInstance itemToDelete;
private static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(MobyContentClipboard.class);
public MobyContentClipboard(MobyContentGUI cGUI, MobyServicesGUI sGUI, JTabbedPane parentComponent,
- JLabel statusBar){
- super(cGUI, sGUI, parentComponent, statusBar);
+ DataRecorder recorder, JLabel statusBar){
+ super(cGUI, sGUI, parentComponent, recorder, statusBar);
ClassLoader cl = getClass().getClassLoader();
if(cl == null){
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java 2007/04/26 15:23:59 1.8
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java 2007/06/08 14:04:27 1.9
@@ -19,8 +19,9 @@
import org.biomoby.client.MobyRequest;
import org.biomoby.client.MobyRequestEvent;
import org.biomoby.client.MobyRequestEventHandler;
+import org.biomoby.shared.*;
import org.biomoby.shared.data.*;
-import ca.ucalgary.seahawk.util.DescriptiveFileFilter;
+import ca.ucalgary.seahawk.util.*;
/**
* Main interface component: textually displays the data in a MOBY content XML document.
@@ -38,6 +39,7 @@
public final static String SAVE_BUTTON_NAME = "MCGsaveButton";
public final static String PRINT_BUTTON_NAME = "MCGprintButton";
public final static String HELP_BUTTON_NAME = "MCGhelpButton";
+ public final static String SETTINGS_BUTTON_NAME = "MCGsettingsButton";
public final static String OPEN_OPTION_NAME = "MCGopenPopup";
public final static String FILE_OPEN_OPTION_NAME = "MCGopenPopupFileOption";
public final static String WEB_OPEN_OPTION_NAME = "MCGopenPopupWebOption";
@@ -69,11 +71,13 @@
private JButton saveButton;
private JButton printButton;
private JButton helpButton;
+ private JButton settingsButton;
private Transformer moby2HTMLConverter; // XSLT engine
private MobyServicesGUI servicesGUI;
private DocumentBuilder docBuilder = null;
private MobyContentClipboard clipboard;
private MobyContentHelpPane helpPane;
+ private DataRecorder dataRecorder; // used for workflow export, etc.
private boolean setup;
private Map request2tab;
private int activeTabIndex = -1;
@@ -163,6 +167,15 @@
gridbag.setConstraints(helpButton, c);
statusPanel.add(helpButton);
+ settingsButton = new JButton(new ImageIcon(cl.getResource("ca/ucalgary/seahawk/resources/images/settings.gif")));
+ settingsButton.setToolTipText("Show program options");
+ settingsButton.setPreferredSize(buttonSize);
+ settingsButton.setEnabled(true);
+ settingsButton.addActionListener(this);
+ settingsButton.setName(SETTINGS_BUTTON_NAME);
+ gridbag.setConstraints(settingsButton, c);
+ statusPanel.add(settingsButton);
+
status = new JLabel(DEFAULT_STATUS_MSG, SwingConstants.LEFT);
JPanel labelPanel = new JPanel();
labelPanel.setLayout(new BorderLayout());
@@ -182,9 +195,16 @@
tabbedPane.setToolTipText("Hit to display a new tab");
tabbedPane.addKeyListener(this);
+ try{
+ dataRecorder = new DataRecorder(servicesGUI.getMobyCentralImpl());
+ } catch(Exception e){
+ e.printStackTrace();
+ }
+
clipboard = new MobyContentClipboard(this,
servicesGUI,
- tabbedPane,
+ tabbedPane,
+ dataRecorder,
status);
getContentPane().add(tabbedPane, java.awt.BorderLayout.CENTER);
@@ -293,19 +313,20 @@
* Called by MOBYRequest when the service request is being sent. We
* can create the GUI and wait message here.
*/
- public void start(MobyRequest request, int requestID){
+ public void start(MobyRequestEvent requestEvent){
if(!setup){
setup();
}
MobyContentPane tab = createTab("New Request");
- request2tab.put(new Integer(requestID), tab);
- tab.start(request, requestID);
+ request2tab.put(new Integer(requestEvent.getID()), tab);
+ tab.start(requestEvent);
}
protected MobyContentPane createTab(String title){
MobyContentPane tab = new MobyContentPane(this,
servicesGUI,
- tabbedPane,
+ tabbedPane,
+ dataRecorder,
status);
setVisible(true);
tab.setPreferredSize(getContentSize());
@@ -469,9 +490,10 @@
public int showHelpTab(){
if(helpPane == null){
helpPane = new MobyContentHelpPane(this,
- servicesGUI,
- tabbedPane,
- status);
+ servicesGUI,
+ tabbedPane,
+ dataRecorder,
+ status);
}
// Not a tab in the display yet
@@ -877,44 +899,28 @@
java.util.Locale.setDefault(java.util.Locale.ENGLISH);
// Unless overridden on the command line, use xerces
- if(System.getProperty("javax.xml.parsers.DocumentBuilderFactory") == null){
- System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
- "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
- }
+ //if(System.getProperty("javax.xml.parsers.DocumentBuilderFactory") == null){
+ // System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
+ // "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
+ //}
// Unless overridden on the command line, use xalan
- if(System.getProperty("javax.xml.transform.TransformerFactory") == null){
- System.setProperty("javax.xml.transform.TransformerFactory",
- "org.apache.xalan.processor.TransformerFactoryImpl");
- }
+ //if(System.getProperty("javax.xml.transform.TransformerFactory") == null){
+ // System.setProperty("javax.xml.transform.TransformerFactory",
+ // "org.apache.xalan.processor.TransformerFactoryImpl");
+ //}
// Setting this explicitly prevents repeated calls to the META-INF file encoding the same
- if(System.getProperty("org.apache.xerces.xni.parser.XMLParserConfiguration") == null){
- System.setProperty("org.apache.xerces.xni.parser.XMLParserConfiguration",
- "org.apache.xerces.parsers.StandardParserConfiguration");
- }
+ //if(System.getProperty("org.apache.xerces.xni.parser.XMLParserConfiguration") == null){
+ // System.setProperty("org.apache.xerces.xni.parser.XMLParserConfiguration",
+ // "org.apache.xerces.parsers.StandardParserConfiguration");
+ //}
-// if(System.getProperty("org.apache.commons.logging.Log") == null){
-// System.setProperty("org.apache.commons.logging.Log",
-// "org.apache.commons.logging.impl.SimpleLog");
-// }
-
-// if(System.getProperty("org.apache.commons.logging.simplelog.defaultlog") == null){
-// System.setProperty("org.apache.commons.logging.simplelog.defaultlog",
-// "error");
-// }
+ // First, restore any user preferences (uses default settings file location)
+ SeahawkOptions.restoreSettings();
- // The following command will cache all data type definitions for this session
- new Thread(){
- public void run(){org.biomoby.shared.MobyDataType.getDataType("Object");}
- }.start();
- new Thread(){
- public void run(){org.biomoby.shared.MobyServiceType.getServiceType("Analysis");}
- }.start();
- // And the service definitions
- //new Thread(){
- // public void run(){org.biomoby.shared.MobyService.getService("","");}
- // }.start();
+ // Asynchronously load up ontology data so it's ready when the user needs it.
+ cacheOntologies();
MobyContentGUI gui = ca.ucalgary.seahawk.util.MobyUtils.getMobyContentGUI(new JLabel());
gui.setDefaultCloseOperation(defaultCloseOperation);
@@ -942,6 +948,43 @@
}
}
+ protected static void cacheOntologies(){
+ final org.biomoby.registry.meta.Registry preferredRegistry = SeahawkOptions.getRegistry();
+
+ // Redirect the registry endpoints to local cache files if available
+ // preferredRegistry and/or dataDefURL may be null, if not cached, but that's okay to pass around
+
+ // The following command will cache all data type definitions for this session
+ new Thread(){
+ public void run(){
+ URL dataDefURL = RegistryCache.getDataTypeOntologyURL(preferredRegistry);
+ if(dataDefURL != null){
+ // Use the cached file rather than actually going to the registry
+ MobyDataType.loadDataTypes(dataDefURL, preferredRegistry);
+ }
+ else{
+ MobyDataType.getDataType("Object", preferredRegistry);
+ }
+ }
+ }.start();
+ new Thread(){
+ public void run(){
+ URL serviceTypeDefURL = RegistryCache.getServiceTypeOntologyURL(preferredRegistry);
+ if(serviceTypeDefURL != null){
+ // Use the cached file rather than actually going to the registry
+ MobyServiceType.loadServiceTypes(serviceTypeDefURL, preferredRegistry);
+ }
+ else{
+ MobyServiceType.getServiceType("Analysis", preferredRegistry);
+ }
+ }
+ }.start();
+ // And the service definitions
+ //new Thread(){
+ // public void run(){org.biomoby.shared.MobyService.getService("","");}
+ // }.start();
+ }
+
/**
* Method to be called when an applet is being decommissioned.
*/
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentHelpPane.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentHelpPane.java 2007/02/08 16:59:57 1.2
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentHelpPane.java 2007/06/08 14:04:27 1.3
@@ -1,6 +1,8 @@
package ca.ucalgary.seahawk.gui;
+import ca.ucalgary.seahawk.util.DataRecorder;
+
import org.biomoby.client.MobyRequestEventHandler;
import org.biomoby.shared.data.MobyContentInstance;
import org.biomoby.shared.data.MobyDataInstance;
@@ -39,8 +41,8 @@
private static URL helpHTMLURL;
private static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(MobyContentHelpPane.class);
public MobyContentHelpPane(MobyContentGUI cGUI, MobyServicesGUI sGUI, JTabbedPane parentComponent,
- JLabel statusBar){
- super(cGUI, sGUI, parentComponent, statusBar);
+ DataRecorder recorder, JLabel statusBar){
+ super(cGUI, sGUI, parentComponent, recorder, statusBar);
// So JFCUnit tests can find it
setName(HELP_TAB_NAME);
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentPane.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentPane.java 2007/04/18 16:04:06 1.7
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentPane.java 2007/06/08 14:04:27 1.8
@@ -1,8 +1,7 @@
package ca.ucalgary.seahawk.gui;
-// For external links
-import ca.ucalgary.seahawk.util.BrowserLauncher;
+import ca.ucalgary.seahawk.util.*;
import org.biomoby.client.MobyRequest;
import org.biomoby.client.MobyRequestEvent;
@@ -19,14 +18,10 @@
import org.apache.xpath.*;
import org.apache.xpath.objects.*;
-import ca.ucalgary.seahawk.util.*;
-
import javax.swing.*;
import javax.swing.event.*;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Point;
+import java.awt.*;
import java.awt.print.*;
import java.awt.event.*;
import java.io.*;
@@ -67,17 +62,19 @@
private int lastClickY = 1;
private boolean hasFailed = false;
private boolean isContentsXML = false;
+ private DataRecorder dataRecorder;
// Text selection members
private int dot;
private int mark;
private String selectedTextData;
private static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(MobyContentPane.class);
- public MobyContentPane(MobyContentGUI cGUI, MobyServicesGUI sGUI, JTabbedPane parentComponent, JLabel statusBar){
+ public MobyContentPane(MobyContentGUI cGUI, MobyServicesGUI sGUI, JTabbedPane parentComponent, DataRecorder recorder, JLabel statusBar){
tabbedPane = parentComponent;
status = statusBar;
contentGUI = cGUI;
servicesGUI = sGUI;
+ dataRecorder = recorder;
// The next line is what provides the drag 'n' drop capability
addKeyListener(this);
@@ -89,7 +86,6 @@
editorPane = new PrintableJEditorPane();
editorPane.addKeyListener(this);
editorPane.setTransferHandler(getTransferHandler());
- //editorPane.setPreferredSize(parentComponent.getPreferredSize());
editorPane.setEditable(false);
editorPane.addMouseListener(this);
editorPane.addHyperlinkListener(this);
@@ -254,11 +250,12 @@
else if(htmlContents.indexOf(" ") != -1){
htmlContents = htmlContents.replaceAll(">([^<]+ [^<]+)<", ">
$1
<");
}
- //else{
+ else{
// Break up any really long DNA/AA stretches
- htmlContents = htmlContents.replaceAll("([a-zA-Z]{60,})", "
$1
");
- htmlContents = htmlContents.replaceAll("([a-zA-Z]{60})", "$1\n");
- //}
+ System.err.println("Trying to break up long streches");
+ htmlContents = htmlContents.replaceAll("([a-zA-Z]{60})", "\n $1");
+ htmlContents = htmlContents.replaceAll("([a-zA-Z]{60})([a-zA-Z]{1,})", "$1\n $2 \n");
+ }
// Otherwise assume it's formatted
resultBuffer.append(htmlContents);
}
@@ -286,9 +283,7 @@
// Assume it's plain text, or whatever the JEditorPane can glean from the content-type
// such as a remote HTML or RTF doc, because result buffer will be empty in condition below
else{
- editorPane.setContentType("text/plain");
isContentsXML = false;
- editorPane.setFont(java.awt.Font.getFont("Monospaced"));
}
if(resultBuffer.length() == 0){
@@ -313,7 +308,12 @@
logger.error("Failure in loading MOBYfied binary data:\n" + e);
}
// Shouldn't get here unless either not binary, or the binary data load failed
- editorPane.setPage(url);
+ System.err.println("Is plain text");
+ editorPane.setContentType("text/html");
+ resultBuffer = new StringBuffer("
");
+ editorPane.setText(resultBuffer.toString());
}
else{
editorPane.setText(resultBuffer.toString());
@@ -322,6 +322,8 @@
}
// Regardless of the doc, scroll to a reference called "start:" if available.
// By default the pane will annoyingly scroll to the bottom when new data is loaded.
+ try{Thread.sleep(1000);} // Give it time to paint before scrolling
+ catch(Exception te){}
editorPane.scrollToReference("start");
}
catch (java.io.IOException ioe) {
@@ -385,11 +387,19 @@
* Called by MOBYRequest when the service request is being sent. We
* can create the GUI and wait message here.
*/
- public void start(MobyRequest request, int requestID){
+ public void start(MobyRequestEvent requestEvent){
hasFailed = false;
tabbedPane.setSelectedComponent(this);
- tabbedPane.setTitleAt(tabbedPane.indexOfComponent(this), ""+requestID+"-"+request.getService().getName());
+ tabbedPane.setTitleAt(tabbedPane.indexOfComponent(this),
+ ""+requestEvent.getID()+"-"+requestEvent.getService().getName());
setWaitScreen();
+ // Store the request being sent (w/ 2ndary params and all),
+ // for reference (e.g. when exporting a workflow)
+ try{
+ dataRecorder.saveInputData(requestEvent);
+ } catch(Exception e){
+ e.printStackTrace();
+ }
}
public void stop(MobyRequest request, int requestID){
@@ -474,6 +484,20 @@
return hasFailed;
}
+ public String toScufl() throws Exception{
+ URL[] historyToExport = (URL[]) history.toArray(new URL[history.size()]);
+ if(historyIndex != historyToExport.length-1){
+ // Shorten the array if we aren't cuurently on the last doc (i.e.
+ // we don't want to export documents forward in the history)
+ URL[] truncatedHistory = new URL[historyIndex];
+ System.arraycopy(historyToExport, 0, truncatedHistory, 0, historyIndex);
+ historyToExport = truncatedHistory;
+ }
+ ByteArrayOutputStream output = new ByteArrayOutputStream();
+ dataRecorder.exportWorkflow(historyToExport, output, DataRecorder.TAVERNA15);
+ return output.toString();
+ }
+
// Save the MOBY data to a file, then tell NewBrowser to load that local file URL
protected void loadDataInBrowser(MobyRequestEvent mre){
@@ -509,21 +533,12 @@
}
try {
- // Create temp file.
- File temp = File.createTempFile(serviceToFilePrefix(mobyRequest.getService()), ".xml");
-
- // Delete temp file when program exits.
- temp.deleteOnExit();
-
- // Write to temp file
- FileWriter out = new FileWriter(temp);
- out.write(mre.getContentsXML());
- out.close();
- gotoURL(temp.toURL(), true);
- } catch (IOException ioe) {
+ URL outputURL = dataRecorder.saveOutputData(mre);
+ gotoURL(outputURL, true);
+ } catch (Exception e) {
failed("Could not write a local file");
- editorPane.setText("ERROR: Could not write temporary file for MOBY results: " + ioe);
- ioe.printStackTrace();
+ editorPane.setText("ERROR: Could not write temporary file for MOBY results: " + e);
+ e.printStackTrace();
return;
}
succeeded(responseType);
@@ -821,12 +836,12 @@
}
if(mobyString != null){
- mobyData = new MobyDataString("", mobyString);
+ mobyData = new MobyDataString("", mobyString, SeahawkOptions.getRegistry());
}
else{
- mobyData = new MobyDataObject("");
+ mobyData = new MobyDataObject("", SeahawkOptions.getRegistry());
}
- mobyData.addNamespace(MobyNamespace.getNamespace(namespace));
+ mobyData.addNamespace(MobyNamespace.getNamespace(namespace, SeahawkOptions.getRegistry()));
if(mobyID != null){
mobyData.setId(mobyID);
@@ -952,8 +967,8 @@
* This method tries to figure out what kinds of MOBY Data could be
* created from the string given. e.g. Keywords, DNASequence, etc.
*/
- protected MobyDataInstance[] loadMobyDataFromString(String data, boolean reverseSelected){
- return MobyUtils.convertStringToObjects(data, reverseSelected);
+ protected MobyDataInstance[] loadMobyDataFromString(String data){
+ return MobyUtils.convertStringToObjects(data);
}
public boolean isMobyURL(URL u){
@@ -964,8 +979,8 @@
// MouseListener interface implementation
public void mouseClicked(MouseEvent e){
// Allow middle button paste
- if(e.getButton() == MouseEvent.BUTTON3 ||
- e.getButton() == MouseEvent.BUTTON2 && e.isAltDown()){
+ if(e.getButton() == MouseEvent.BUTTON2 ||
+ e.getButton() == MouseEvent.BUTTON3 && e.isAltDown()){
paste();
}
}
@@ -999,7 +1014,7 @@
if(selectedTextData == null){
return;
}
- MobyDataInstance[] mobyData = loadMobyDataFromString(selectedTextData, mark > dot);
+ MobyDataInstance[] mobyData = loadMobyDataFromString(selectedTextData);
if(mobyData == null || mobyData.length == 0){
logger.warn("No MobyData could be made from the selected text");
return;
@@ -1066,111 +1081,6 @@
status.setText("Click your selection to use as MOBY data!");
}
- private MobyService getService(int index) throws Exception{
- String filename = ((URL) history.elementAt(index)).getPath();
- if(filename.lastIndexOf('/') != -1){
- filename = filename.substring(filename.lastIndexOf('/')+1);
- }
- return filePrefixToService(filename);
- }
-
- private String getScuflProcessor(int index) throws Exception{
- MobyService service = getService(index);
-
- if(service == null){ //data was loaded from file, not from a service
- return "";
- }
-
- StringBuffer secondaryParams = new StringBuffer();
- // example input human
-
- return " \n"+
- " "+service.getDescription()+"\n" +
- " \n"+
- " "+servicesGUI.getMobyCentralImpl().getRegistryEndpoint()+"\n"+
- " "+service.getName()+"\n"+
- " "+service.getAuthority()+"\n"+
- secondaryParams.toString() +
- " \n"+
- " \n";
-
- }
-
- public String toScufl() throws Exception{
-
- StringBuffer scufl = new StringBuffer();
- scufl.append("\n" +
- "\n" +
- " \n");
-
- // The first service to be called
- int i = 0;
- MobyService firstService = getService(i);
- while(firstService == null){
- firstService = getService(++i);
- }
- MobyPrimaryData[] inputData = firstService.getPrimaryInputs();
- if(inputData != null && inputData.length != 0){
- // Seahawk only deals with single input services for now
- scufl.append(" \n"+
- " Generates "+inputData[0].getDataType().getDescription()+"\n"+
- " \n"+
- " "+servicesGUI.getMobyCentralImpl().getRegistryEndpoint()+"\n"+
- " "+inputData[0].getDataType().getName()+"\n"+
- " \n"+
- " \n"+
- " \n");
-
- MobyNamespace[] inputNS = inputData[0].getNamespaces();
- String nsNames = "Object";
- if(inputNS != null && inputNS.length != 0){
- String firstNS = inputNS[0].getName().replaceAll("urn:lsid:biomoby.org:namespacetype:(.*?):.*", "$1");
- nsNames = firstNS;
- for(int j = 1; j < inputNS.length; j++){
- nsNames = nsNames + "_or_" + inputNS[j].getName().replaceAll("[^A-Za-z0-9_]", "_");
- }
- nsNames = nsNames.replaceAll("[^A-Za-z0-9_]", "_");
- nsNames = nsNames + "_";
- // Predefine the namespace for the user since it's available
- scufl.append(""
- + firstNS + "\n");
- }
- else{
- scufl.append("\n");
- }
- scufl.append("\n" +
- " text/plain\n"+
- "\n");
-
- scufl.append(getScuflProcessor(i));
-
- scufl.append("\n" +
- "\n" +
- "");
- }
- else{
- // service has no input if we're here...
- scufl.append(getScuflProcessor(i));
- }
-
- // for each history element, there was a service execution that generated the data
- for(; i < historyIndex; i++){
- scufl.append(getScuflProcessor(i+1));
- scufl.append("\n");
- }
- scufl.append("\n");
- scufl.append("" +
- "text/xml"+
- "\n");
- scufl.append("\n");
-
- return scufl.toString();
- }
-
/**
* Implemented to provide paste functionality (control-v or the paste button on a Sun keyboard),
* since the editor panes are not editable and therefore by default do not respond to
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyDataObjectWidget.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyDataObjectWidget.java 2007/04/26 15:19:58 1.1
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyDataObjectWidget.java 2007/06/08 14:04:27 1.2
@@ -16,7 +16,7 @@
* the user to drop data onto it via a MobyObjectTransferHandler
* (hence the implementation of MobyObjectReceiver).
*/
-public class MobyDataObjectWidget extends JLabel implements MobyObjectReceiver{
+public class MobyDataObjectWidget extends JLabel implements MobyObjectReceiver, MobyContentProducer{
public static final int PARAM_TOOLTIP_WIDTH = 50;
public static final Color INSTANTIATED_FG_COLOUR = Color.DARK_GRAY;
public static final Color UNINSTANTIATED_FG_COLOUR = Color.RED;
@@ -58,7 +58,17 @@
setTransferHandler(MobyObjectTransferHandler.getHandler(client));
}
+ // Enables copying of MOBY data to the clipboard
+ addMouseListener(new DragMouseAdapter());
+ }
+ // Shamelessly copied from the Java DnD tutorial's LabalDND.java
+ private class DragMouseAdapter extends MouseAdapter {
+ public void mousePressed(MouseEvent e) {
+ JComponent c = (JComponent)e.getSource();
+ TransferHandler handler = c.getTransferHandler();
+ handler.exportAsDrag(c, e, TransferHandler.COPY);
+ }
}
private Icon getInstantiatedIcon(){
@@ -221,4 +231,11 @@
acceptableData.put(name, targetData);
return acceptableData;
}
+
+ /**
+ * Used to send data out to the clipboard.
+ */
+ public MobyContentInstance exportMobyContent(){
+ return null;
+ }
}
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyObjectTransferHandler.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyObjectTransferHandler.java 2007/04/26 15:19:58 1.1
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyObjectTransferHandler.java 2007/06/08 14:04:27 1.2
@@ -1,6 +1,7 @@
package ca.ucalgary.seahawk.gui;
import ca.ucalgary.seahawk.util.HTMLUtils;
+import ca.ucalgary.seahawk.util.MobyUtils;
import ca.ucalgary.seahawk.services.MobyClient;
import org.biomoby.shared.MobyPrefixResolver;
import org.biomoby.shared.*;
@@ -28,7 +29,7 @@
* be convertible into a desired Moby Object data type in order to be dropped. Components using this
* class as their TransferHandler should implement MobyObjectReceiver for this to do something meaningful.
*/
-public class MobyObjectTransferHandler extends FileAndTextTransferHandler {
+public class MobyObjectTransferHandler extends FileAndTextTransferHandler implements ClipboardOwner{
private MobyClient client;
private static Map handlers;
@@ -309,5 +310,34 @@
keeper.put(key, entry.getValue());
}
}
-}
+ /**
+ * Drag and copy functiunality.
+ */
+ public void exportToClipboard(JComponent comp,
+ Clipboard clip,
+ int action) throws IllegalStateException{
+ Transferable createdData = null;
+ try{
+ if(!(comp instanceof MobyContentProducer)){
+ throw new IllegalStateException("Component calling exportToClipboard " +
+ "was not a MobyObjectProducer as expected, export aborted");
+ }
+ createdData = MobyUtils.createTransferable(((MobyContentProducer) comp).exportMobyContent());
+ clip.setContents(createdData, this);
+ } catch(IllegalStateException e){
+ // To be consistent with the normal transfer handler, call exportDone
+ // even if we failed
+ exportDone(comp, createdData, TransferHandler.NONE);
+ throw e;
+ }
+ exportDone(comp, createdData, action);
+ }
+
+ /**
+ * To satisfy the ClipboardOwner interface.
+ */
+ public void lostOwnership(Clipboard clipboard, Transferable contents){
+
+ }
+}
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobySaveDialog.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobySaveDialog.java 2007/02/08 16:59:57 1.2
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobySaveDialog.java 2007/06/08 14:04:27 1.3
@@ -113,6 +113,7 @@
ostream.flush();
ostream.close();
} catch (Exception ex) {
+ ex.printStackTrace();
JOptionPane.showMessageDialog(null, "Cannot save the Seahawk tab history as a Taverna workflow: "+ex,
"Error saving", JOptionPane.ERROR_MESSAGE);
}
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2007/04/26 15:26:24 1.10
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2007/06/08 14:04:27 1.11
@@ -2,20 +2,23 @@
import ca.ucalgary.seahawk.services.MobyClient;
import ca.ucalgary.seahawk.util.HTMLUtils;
-import javax.swing.*;
-import org.w3c.dom.*;
+import ca.ucalgary.seahawk.util.SeahawkOptions;
+
import org.biomoby.shared.*;
import org.biomoby.shared.data.*;
import org.biomoby.client.MobyRequest;
import org.biomoby.client.MobyRequestEventHandler;
-import java.lang.ref.WeakReference;
+import org.w3c.dom.*;
+
import java.awt.event.*;
import java.awt.*;
import java.io.*;
+import java.lang.ref.WeakReference;
import java.text.Collator;
import java.net.URL;
import java.util.*;
+import javax.swing.*;
import javax.swing.event.PopupMenuListener;
import javax.swing.event.PopupMenuEvent;
@@ -249,8 +252,8 @@
// Need to choose among multiple parameters
if(paramMatch.size() > 1){
targetParamName = (String) JOptionPane.showInputDialog(null,
- "Choose the service parameter the chosen " +
- "object represents",
+ "Choose the service parameter\n"+
+ "the chosen object represents",
"Service Parameter Choice",
JOptionPane.QUESTION_MESSAGE,
null,
@@ -783,7 +786,8 @@
MobyDataType outputType = null;
if(output != null && output.length != 0 && output[0] instanceof MobyPrimaryData){
- outputType = MobyDataType.getDataType(((MobyPrimaryData) output[0]).getDataType().getName());
+ outputType = MobyDataType.getDataType(((MobyPrimaryData) output[0]).getDataType().getName(),
+ SeahawkOptions.getRegistry());
}
if(outputType == null){
logger.warn("No output data type (ontology) was associated with service " +
@@ -1176,7 +1180,7 @@
}
// Make sure we have a fully documented data type object
- mobyDataType = MobyDataType.getDataType(targetData.getDataType().getName());
+ mobyDataType = MobyDataType.getDataType(targetData.getDataType().getName(), SeahawkOptions.getRegistry());
String desc = null;
String datatype = null;
if(mobyDataType == null){
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyShimmer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyShimmer.java 2007/02/08 16:59:57 1.2
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyShimmer.java 2007/06/08 14:04:27 1.3
@@ -115,7 +115,7 @@
}
}
- public void start(MobyRequest request, int requestID){
+ public void start(MobyRequestEvent requestEvent){
}
public void processEvent(MobyRequestEvent mre){
From gordonp at dev.open-bio.org Fri Jun 8 10:04:27 2007
From: gordonp at dev.open-bio.org (Paul Gordon)
Date: Fri, 8 Jun 2007 10:04:27 -0400
Subject: [MOBY-guts] biomoby commit
Message-ID: <200706081404.l58E4Rrh028892@dev.open-bio.org>
gordonp
Fri Jun 8 10:04:27 EDT 2007
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util
In directory dev.open-bio.org:/tmp/cvs-serv28675/src/main/ca/ucalgary/seahawk/util
Modified Files:
HTMLUtils.java MobyUtils.java
Added Files:
DataRecorder.java MobyDataTransferable.java RegistryCache.java
SeahawkOptions.java
Log Message:
Commit of Seahawk 1.0 updates and associated core updates
moby-live/Java/src/main/ca/ucalgary/seahawk/util DataRecorder.java,NONE,1.1 MobyDataTransferable.java,NONE,1.1 RegistryCache.java,NONE,1.1 SeahawkOptions.java,NONE,1.1 HTMLUtils.java,1.2,1.3 MobyUtils.java,1.6,1.7
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/HTMLUtils.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/HTMLUtils.java 2007/04/26 15:15:45 1.2
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/HTMLUtils.java 2007/06/08 14:04:27 1.3
@@ -180,21 +180,25 @@
org.w3c.dom.Element data = db.parse(new ByteArrayInputStream(xmltext.getBytes())).getDocumentElement();
if(data.getLocalName().equals(MobyTags.MOBY)){
- content = MobyDataUtils.fromXMLDocument(data);
+ content = MobyDataUtils.fromXMLDocument(data, SeahawkOptions.getRegistry());
}
else if(data.getLocalName().equals(MobyTags.MOBYCONTENT)){
- content = new MobyContentInstance(data);
+ content = new MobyContentInstance(data, SeahawkOptions.getRegistry());
}
else if(data.getLocalName().equals(MobyTags.MOBYDATA)){
content = new MobyContentInstance();
- content.parseDataGroup(data);
+ content.parseDataGroup(data, SeahawkOptions.getRegistry());
}
else{
// Any other data can be processed by the base object class
- content = new MobyContentInstance(MobyDataObject.createInstanceFromDOM(data), "Drag 'n' Drop data");
+ content = new MobyContentInstance(MobyDataObject.createInstanceFromDOM(data, SeahawkOptions.getRegistry()),
+ "Drag 'n' Drop data");
}
} catch(Exception e){
e.printStackTrace();
+ System.err.println("This issue may be related to your choice of registry ("+
+ (SeahawkOptions.getRegistry() == null ? "MOBY default" : SeahawkOptions.getRegistry().getSynonym())
+ +")");
}
return content;
}
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java 2007/04/18 15:55:18 1.6
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java 2007/06/08 14:04:27 1.7
@@ -4,10 +4,12 @@
import ca.ucalgary.seahawk.gui.MobyServicesGUI;
import ca.ucalgary.seahawk.services.MobyClient;
+import org.biomoby.registry.meta.Registry;
import org.biomoby.shared.data.*;
import org.biomoby.shared.MobyDataType;
import org.biomoby.shared.MobyNamespace;
+import java.awt.datatransfer.Transferable;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.URL;
@@ -24,6 +26,10 @@
private static MobyContentGUI mobyContentGUI = null;
private static MobyServicesGUI mobyServicesGUI = null;
+
+ public static Transferable createTransferable(MobyContentInstance contents){
+ return null;
+ }
/**
* The purpose of this method is to create a MOBY document to encapsulate
@@ -47,20 +53,22 @@
// Find MOBY Objects in it
MobyDataObject[] foundObjects = client.getMobyObjects(bytes.toByteArray(),
- MobyDataType.getDataType(MobyDataBytes.BASE64_DATATYPE));
+ MobyDataType.getDataType(MobyDataBytes.BASE64_DATATYPE,
+ SeahawkOptions.getRegistry()));
// Did we unambiguously find one binary object?
if(foundObjects != null && foundObjects.length == 1){
MobyContentInstance mci = new MobyContentInstance();
String[] dataName = url.getPath().split("/");
MobyDataJob job = new MobyDataJob();
job.put(dataName[dataName.length-1], foundObjects[0]);
+ System.err.println("Namespace of found object was " + foundObjects[0].getPrimaryNamespace().getName());
mci.put(dataName[dataName.length-1], job); // name the data by the last part of the URL path
return mci;
}
return null;
}
- public static MobyDataInstance[] convertStringToObjects(String data, boolean reverseSelected){
+ public static MobyDataInstance[] convertStringToObjects(String data){
if(data == null){
return new MobyDataInstance[0];
}
@@ -74,23 +82,13 @@
}
// Can always use the data as a string
- MobyDataString strObject = new MobyDataString(objectName, data);
+ MobyDataString strObject = new MobyDataString(objectName, data, SeahawkOptions.getRegistry());
strObject.setPrimaryNamespace(new MobyNamespace("seahawk"));
objects.add(strObject);
// See if it's sequence
MobyDataComposite mdc = createMobySequence(data, "user-selection");
if(mdc != null){
- // reverse complement DNA if necessary
- if(reverseSelected &&
- (mdc.getDataType() == MobyDataType.getDataType("DNASequence") ||
- mdc.getDataType() == MobyDataType.getDataType("RNASequence"))){
-
- MobyDataComposite nucObject = (MobyDataComposite) mdc;
- MobyDataString seq = (MobyDataString) nucObject.get("SequenceString");
- seq.setValue(Sequence.reverseComplement(seq.toString()));
- }
-
mdc.setName(objectName);
objects.add(mdc);
}
@@ -99,8 +97,9 @@
if(data.trim().matches("^[A-Za-z0-9_-]{3,35}$")){
objects.add(new MobyDataComposite("Global_Keyword",
"dummy_name",
- "seahawk",
- data.trim()));
+ "unknown",
+ data.trim(),
+ SeahawkOptions.getRegistry()));
}
}
@@ -163,19 +162,22 @@
sequence = new MobyDataComposite("DNASequence",
"dummy_name",
"seahawk",
- id);
+ id,
+ SeahawkOptions.getRegistry());
}
else if(Sequence.isRNA(sequenceData)){
sequence = new MobyDataComposite("RNASequence",
"dummy_name",
"seahawk",
- id);
+ id,
+ SeahawkOptions.getRegistry());
}
else if(Sequence.isProtein(sequenceData)){
sequence = new MobyDataComposite("AminoAcidSequence",
"dummy_name",
"seahawk",
- id);
+ id,
+ SeahawkOptions.getRegistry());
}
// Not a recognized type of sequence
else{
@@ -183,8 +185,8 @@
}
sequenceData = sequenceData.replaceAll("[ \t\r\n0-9]", ""); // strip whitespace and possible milestone digits
- sequence.put("SequenceString", new MobyDataString(sequenceData));
- sequence.put("Length", new MobyDataInt(sequenceData.length()));
+ sequence.put("SequenceString", new MobyDataString(sequenceData, SeahawkOptions.getRegistry()));
+ sequence.put("Length", new MobyDataInt(sequenceData.length(), SeahawkOptions.getRegistry()));
return sequence;
}
From gordonp at dev.open-bio.org Fri Jun 8 10:04:27 2007
From: gordonp at dev.open-bio.org (Paul Gordon)
Date: Fri, 8 Jun 2007 10:04:27 -0400
Subject: [MOBY-guts] biomoby commit
Message-ID: <200706081404.l58E4RdT028818@dev.open-bio.org>
gordonp
Fri Jun 8 10:04:27 EDT 2007
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources
In directory dev.open-bio.org:/tmp/cvs-serv28675/src/main/ca/ucalgary/seahawk/resources
Modified Files:
MobyContentGUIHelp.html mobyBuilderRules.xml startup.html
Log Message:
Commit of Seahawk 1.0 updates and associated core updates
moby-live/Java/src/main/ca/ucalgary/seahawk/resources MobyContentGUIHelp.html,1.1,1.2 mobyBuilderRules.xml,1.4,1.5 startup.html,1.3,1.4
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/MobyContentGUIHelp.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/MobyContentGUIHelp.html 2006/10/25 02:33:22 1.1
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/MobyContentGUIHelp.html 2007/06/08 14:04:27 1.2
@@ -49,6 +49,12 @@
How do I create data?
+
Drag and Drop / Cut and Paste
+
+ The easiest way to create data is to simply drag a file, text selection, or Web link
+ onto the Seahawk interface. Seahawk will try to display the data you drop.
+
+
Loading documents
Click the folder/Web icon on the bottom toolbar will give you the option of
@@ -64,14 +70,13 @@
With the mouse, you can highlight arbitrary sections of text in the Seahawk display.
Clicking within selected text will raise a popup menu showing MOBY service
options. Seahawk will try to determine the type of data highlighted are
- potentially show services for the selection as a:
+ potentially show services for the selection as a, among other things:
String
Search Keyword
Database Identifier
Protein Sequence
-
DNA/RNA Sequence (note that highlighting sequence right-to-left
- will create the reverse complement)
+
DNA/RNA Sequence
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/mobyBuilderRules.xml,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/seahawk/resources/mobyBuilderRules.xml 2007/04/26 15:30:01 1.4
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/mobyBuilderRules.xml 2007/06/08 14:04:27 1.5
@@ -4,15 +4,26 @@
http://www.bioxml.info/dtd/tigrxml.dtdhttp://www.bioxml.info/dtd/Bioseq.dtd
-
+
+
+
+
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/startup.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/startup.html 2007/04/26 15:31:00 1.3
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/startup.html 2007/06/08 14:04:27 1.4
@@ -14,6 +14,8 @@
For example data, and more help on using Seahawk to automatically discover and run Web-based analysis services,
please click the help icon at the bottom of this window.
-
+