/** * @return the LSID of this result */ public String getLSID() { return thing.getLSID(thing.getDataObject()); }
void getAllInputs(DataThing thing, Collection inputLSIDs) { if (thing != null) { ArrayList moreInputs = (ArrayList) provenance.get(thing.getLSID(thing.getDataObject())); if (moreInputs != null) { inputLSIDs.addAll(moreInputs); } } }
public String toString() { String datStr = theDataObject.toString(); boolean trimmed = false; int nl = datStr.indexOf('\n'); if (nl > -1) { datStr = datStr.substring(0, nl); trimmed = true; } if (datStr.length() > 30) { datStr = datStr.substring(0, 27); trimmed = true; } if (trimmed) { datStr += "..."; } return super.toString() + "\n\tValue=" + datStr + "\n\tLSID=" + getLSID(theDataObject) + "\n"; }
/** * Utility method to find the input or output name for a given LSID, returns * the empty string if none is found. This only searches within the scope of * this event! */ public String findNameFromLSID(String LSID) { for (Iterator i = this.inputMap.keySet().iterator(); i.hasNext();) { String name = (String) i.next(); DataThing thing = (DataThing) inputMap.get(name); if (thing.getLSID(thing.getDataObject()).equals(LSID)) { return name; } } for (Iterator i = this.outputMap.keySet().iterator(); i.hasNext();) { String name = (String) i.next(); DataThing thing = (DataThing) outputMap.get(name); if (thing.getLSID(thing.getDataObject()).equals(LSID)) { return name; } } return ""; } }
public String toString() { StringBuffer sb = new StringBuffer(); sb.append("Workflow '" + workflowInstance.getID() + "' completed with outputs\n"); Map outputs = workflowInstance.getOutput(); for (Iterator i = outputs.keySet().iterator(); i.hasNext();) { String outputName = (String) i.next(); DataThing outputValue = (DataThing) outputs.get(outputName); String outputLSID = outputValue .getLSID(outputValue.getDataObject()); sb.append(" " + outputLSID + "->'" + outputName + "'\n"); } return sb.toString(); } }
/** * Print a summary of the event details */ public String toString() { StringBuffer sb = new StringBuffer(); sb.append("NestedWorkflow '" + processor.getName() + "' complete "); if (isIterating) { sb.append("(iterating)"); } else { sb.append("(simple)"); } sb.append("\n"); String prefix = "in "; for (Iterator i = inputMap.keySet().iterator(); i.hasNext();) { String inputKey = (String) i.next(); DataThing inputThing = (DataThing) inputMap.get(inputKey); String mainLSID = inputThing.getLSID(inputThing.getDataObject()); sb.append(prefix + "'" + inputKey + "'->" + mainLSID + "\n"); prefix = " "; } prefix = "out "; for (Iterator i = outputMap.keySet().iterator(); i.hasNext();) { String outputKey = (String) i.next(); DataThing outputThing = (DataThing) outputMap.get(outputKey); String mainLSID = outputThing.getLSID(outputThing.getDataObject()); sb.append(prefix + "" + mainLSID + "->'" + outputKey + "'\n"); prefix = " "; } return sb.toString(); }
/** * Print a summary of the event details */ public String toString() { StringBuffer sb = new StringBuffer(); sb.append("Process '" + processor.getName() + "' complete "); if (isIterating) { sb.append("(iterating)"); } else { sb.append("(simple)"); } sb.append("\n"); String prefix = "in "; for (Iterator i = inputMap.keySet().iterator(); i.hasNext();) { String inputKey = (String) i.next(); DataThing inputThing = (DataThing) inputMap.get(inputKey); String mainLSID = inputThing.getLSID(inputThing.getDataObject()); sb.append(prefix + "'" + inputKey + "'->" + mainLSID + "\n"); prefix = " "; } prefix = "out "; for (Iterator i = outputMap.keySet().iterator(); i.hasNext();) { String outputKey = (String) i.next(); DataThing outputThing = (DataThing) outputMap.get(outputKey); String mainLSID = outputThing.getLSID(outputThing.getDataObject()); sb.append(prefix + "" + mainLSID + "->'" + outputKey + "'\n"); prefix = " "; } return sb.toString(); }
String lsid = resultValue.getLSID(o); if (o instanceof Collection)
dt.setLSID(newValue, dt.getLSID(value));
private void addResult(DataThing thing, HashMap provenance, Collection inputLSIDs) { Collection inputList = new HashSet(); if (inputLSIDs != null) { inputList.addAll(inputLSIDs); } Collection moreInputs = (Collection) provenance.get(thing.getLSID(thing.getDataObject())); if (moreInputs != null) { inputList.addAll(moreInputs); } String[] lsids = new String[inputList.size()]; inputList.toArray(lsids); ResultThing result = new ResultThing(this, thing, lsids); results.put(result.getLSID(), result); if (thing.getDataObject() instanceof Collection) { Iterator childIterator = thing.childIterator(); while (childIterator.hasNext()) { DataThing child = (DataThing) childIterator.next(); addResult(child, provenance, inputList); } } }
/** * Override toString() */ public String toString() { StringBuffer sb = new StringBuffer(); sb.append("Workflow '" + workflowInstance.getID() + "' created with " + inputs.size() + " input" + (inputs.size() != 1 ? "s" : "") + "\n"); for (Iterator i = inputs.keySet().iterator(); i.hasNext();) { String inputName = (String) i.next(); DataThing inputValue = (DataThing) inputs.get(inputName); String inputLSID = inputValue.getLSID(inputValue.getDataObject()); sb.append(" '" + inputName + "'->" + inputLSID + "\n"); } sb.append("Created from workflow definition " + model.getDescription().getLSID() + "\n"); UserContext workflowContext = workflowInstance.getUserContext(); if (workflowContext == null) { sb.append("No user context supplied\n"); } else { sb.append("Workflow context :\n"); sb.append(" 'Person'->" + workflowContext.getPersonLSID() + "\n"); sb.append(" 'ExperimentDesign'->" + workflowContext.getExperimentDesignLSID() + "\n"); sb.append(" 'Organization'->" + workflowContext.getOrganizationLSID() + "\n"); } return sb.toString(); }
/** * Return an XML Jdom Element object for the DataThing supplied as the * argument */ public static Element getElement(DataThing theDataThing) { Element rootElement = new Element("myGridDataDocument", namespace); rootElement.setAttribute("lsid", theDataThing.getLSID(theDataThing)); rootElement.setAttribute("syntactictype", theDataThing .getSyntacticType()); rootElement.addContent(theDataThing.getMetadata() .getConfigurationElement()); rootElement.addContent(elementForObject(theDataThing.getDataObject(), theDataThing)); return rootElement; }
poElement.setAttribute("lsid", theDataThing.getLSID(o)); Element relationListElement = new Element("relationList", namespace); Element listElement = new Element("itemList", namespace); dataElement.setAttribute("lsid", theDataThing.getLSID(o)); try { SemanticMarkup sm = theDataThing.getMetadataForObject(o, false);
DataThing findThing(DataThing thing, String lsid, Collection inputLSIDs) { if (lsid.equals(thing.getLSID(thing.getDataObject()))) { getAllInputs(thing, inputLSIDs); return thing; } if (thing.getDataObject() instanceof List) { Iterator children = thing.childIterator(); while (children.hasNext()) { DataThing child = (DataThing) children.next(); DataThing result = findThing(child, lsid, inputLSIDs); if (result != null) { getAllInputs(thing, inputLSIDs); return result; } } } return null; } }
String inputName = (String) i.next(); DataThing inputValue = inputMap.get(inputName); String objectLSID = inputValue.getLSID(inputValue .getDataObject()); if (objectLSID != null && objectLSID.equals("") == false) { String outputName = (String) i.next(); DataThing outputValue = outputMap.get(outputName); String objectLSID = outputValue.getLSID(outputValue .getDataObject()); if (objectLSID != null && objectLSID.equals("") == false) {
/** * * @param thing * @param startRow * @return a */ private ResultTableCell createCollection(ResultThing thing, int startRow) { int currentRow = startRow; Iterator children = thing.getDataThing().childIterator(); ResultTableCellCollection collection = new ResultTableCellCollection(); while (children.hasNext()) { DataThing child = (DataThing) children.next(); ResultThing childResult = getResultThing(child.getLSID(child.getDataObject())); if (childResult != null) { ResultTableCell cell = createCell(collection, childResult, currentRow); currentRow = cell.endRow + 1; } } ResultTableCell cell = new ResultTableCell(startRow); cell.endRow = currentRow - 1; return cell; }
if (!oldData.equals(newData)) { String oldLSID = StructureTreeListener.this.thing.getLSID(thing.getDataObject()); DataThing thing = StructureTreeListener.this.thing.drillAndSet(
return; String oldLSID = this.thing.getLSID(thing.getDataObject()); DataThing thing = this.thing.drillAndSet(dataThing, newData); if (thing != null