[MOBY-guts] biomoby commit

Paul Gordon gordonp at dev.open-bio.org
Sun Apr 11 20:15:28 UTC 2010


gordonp
Sun Apr 11 16:15:28 EDT 2010
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui
In directory dev.open-bio.org:/tmp/cvs-serv17912/src/main/ca/ucalgary/seahawk/gui

Modified Files:
	MobyContentPane.java 
Log Message:
Updates for proper support of data filtering when submitting to forward services
moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyContentPane.java,1.25,1.26
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentPane.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentPane.java	2010/04/10 00:40:17	1.25
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentPane.java	2010/04/11 20:15:28	1.26
@@ -532,7 +532,7 @@
 		isContentsXML = true;
 		// Is it the second stage of wrapping, where data results are being seen?
 		if(urlString.indexOf(WRAPPING_RESULTFILE_PREFIX) != -1){
-		    System.err.println("Wrapping service results");
+		    //System.err.println("Wrapping service results");
 		    isWrapping = true;
 		}
 		else{
@@ -1191,7 +1191,7 @@
 
 	// Complex case, load the doc fragment from the MOBY XML source file
 	if(docFragID != null && docFragID.length() > 0 && !targetURL.getHost().equals("moby")){
-	    return DataUtils.loadMobyDataFromXPointer(targetURL, filterHistory.get(getCurrentURL()));
+	    return DataUtils.loadMobyDataFromXPointer(targetURL, filteredData, filterHistory.get(getCurrentURL()));
 	}
 
 	// Simple case, build the object using the values encoded in the URL itself.
@@ -1256,8 +1256,13 @@
 
 	    // Get the input data for the *previous* service
 	    MobyDataJob inputData = DataUtils.getInputSample(srcDoc, SeahawkOptions.getRegistry());
+	    if(inputData == null){
+		// should only happen if Moby XML was loaded manually by a user, otherwise we've recorded this info...
+		logger.warn("No previous service info in Moby XML, 'previous input' option will not be displayed");
+		return;
+	    }
 	    for(MobyDataInstance previousMDI: inputData.getPrimaryData()){		
-		// add conditional of the current service as a criteria in user data for each previousMDI, 
+		    // add conditional of the current service as a criteria in user data for each previousMDI, 
 		// so PbE will properly reflect the logic of if(f1(x) matches filter){f2(x)}
 		DataUtils.addUserData(previousMDI, srcURL, getFilter());
 
@@ -1478,11 +1483,11 @@
                     }
 		else if(regex.matcher(((Element) node).getTextContent()).find()){
 		    matchingXPtrs.put(elementXPtr, Boolean.TRUE);
-		    System.err.println("Adding " + elementXPtr + " as " + matchingXPtrs.get(elementXPtr));
+		    //System.err.println("Adding " + elementXPtr + " as " + matchingXPtrs.get(elementXPtr));
 		}
 		else{
 		    matchingXPtrs.put(elementXPtr, Boolean.FALSE);
-		    System.err.println("Adding " + elementXPtr + " as " + matchingXPtrs.get(elementXPtr));
+		    //System.err.println("Adding " + elementXPtr + " as " + matchingXPtrs.get(elementXPtr));
 		}
 	    }
 	    else if(node instanceof Attr){
@@ -1494,12 +1499,12 @@
 		else if(regex.matcher(((Attr) node).getValue()).find()){
 		    // Mark the element to which the attribute belongs
 		    matchingXPtrs.put(attrParentXPtr, Boolean.TRUE);
-		    System.err.println("Adding " + attrParentXPtr + " attr parent as " + matchingXPtrs.get(attrParentXPtr));
+		    //System.err.println("Adding " + attrParentXPtr + " attr parent as " + matchingXPtrs.get(attrParentXPtr));
 		}
 		// so false doesn't override true for multi-attr elements
 		else if(!matchingXPtrs.containsKey(attrParentXPtr)){ 
 		    matchingXPtrs.put(attrParentXPtr, Boolean.FALSE);
-		    System.err.println("Adding " + attrParentXPtr + " attr parent as " + matchingXPtrs.get(attrParentXPtr));
+		    //System.err.println("Adding " + attrParentXPtr + " attr parent as " + matchingXPtrs.get(attrParentXPtr));
 		}
 		
 	    }
@@ -1518,7 +1523,7 @@
 		    if(!parentMatchingXPtrs.containsKey(currXPtr) || 
 		       !inversed && !parentMatchingXPtrs.get(currXPtr).booleanValue() ||
 		       inversed && parentMatchingXPtrs.get(currXPtr).booleanValue()){
-			System.err.println("Adding "+ matchingXPtr.getValue() + " for " + currXPtr);
+			//System.err.println("Adding "+ matchingXPtr.getValue() + " for " + currXPtr);
 			parentMatchingXPtrs.put(currXPtr, matchingXPtr.getValue());
 		    }
 		}
@@ -1732,7 +1737,7 @@
 	List<javax.swing.text.Element> links = new Vector<javax.swing.text.Element>();
 	for(int i = 0; i < el.getElementCount(); i++){
 	    javax.swing.text.Element childEl = el.getElement(i);
-	    System.err.println("Found child element " + childEl.getName());
+	    //System.err.println("Found child element " + childEl.getName());
 	    if(HTML.Tag.A.equals(childEl.getName())){
 		links.add(childEl);
 	    }
@@ -1979,10 +1984,10 @@
 	// normally it'd go to mouseDragged, but sometimes that's flakey so check manually for the 
 	// mouse button being down here.
 	if(overHyperlink && (e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == MouseEvent.BUTTON1_DOWN_MASK){
-	    System.err.println("Got wonky drag");
+	    //System.err.println("Got wonky drag");
 	    lastHyperlinkDragged = lastHyperlinkHovered;
 	    status.setText("Drop the hyperlink onto a Web form field to populate it");
-	    System.err.println("Dragging "+lastHyperlinkDragged);
+	    //System.err.println("Dragging "+lastHyperlinkDragged);
 	    getTransferHandler().exportAsDrag(this, e, TransferHandler.COPY);
 	}
 	else if(dragging){
@@ -1991,6 +1996,6 @@
     }
 
     public void lostOwnership(Clipboard clipboard, Transferable contents){
-	System.err.println("Lost clipboard ownership");
+	//System.err.println("Lost clipboard ownership");
     }
 }




More information about the MOBY-guts mailing list