http://git-wip-us.apache.org/repos/asf/airavata/blob/9a6eaaae/modules/workflow-model/workflow-model-core/src/main/java/org/apache/airavata/workflow/model/wf/Workflow.java ---------------------------------------------------------------------- diff --git a/modules/workflow-model/workflow-model-core/src/main/java/org/apache/airavata/workflow/model/wf/Workflow.java b/modules/workflow-model/workflow-model-core/src/main/java/org/apache/airavata/workflow/model/wf/Workflow.java index c475747..eb6ebf7 100644 --- a/modules/workflow-model/workflow-model-core/src/main/java/org/apache/airavata/workflow/model/wf/Workflow.java +++ b/modules/workflow-model/workflow-model-core/src/main/java/org/apache/airavata/workflow/model/wf/Workflow.java @@ -64,23 +64,23 @@ import org.apache.airavata.workflow.model.graph.util.GraphUtil; import org.apache.airavata.workflow.model.graph.ws.WSGraph; import org.apache.airavata.workflow.model.graph.ws.WSGraphFactory; import org.apache.airavata.workflow.model.graph.ws.WSNode; -import org.apache.airavata.workflow.model.ode.ODEBPELTransformer; -import org.apache.airavata.workflow.model.ode.ODEDeploymentDescriptor; -import org.apache.airavata.workflow.model.ode.ODEWSDLTransformer; -import org.apache.airavata.workflow.model.ode.WSDLCleaner; +//import org.apache.airavata.workflow.model.ode.ODEBPELTransformer; +//import org.apache.airavata.workflow.model.ode.ODEDeploymentDescriptor; +//import org.apache.airavata.workflow.model.ode.ODEWSDLTransformer; +//import org.apache.airavata.workflow.model.ode.WSDLCleaner; import org.apache.airavata.workflow.model.utils.ApplicationVersion; import org.apache.airavata.workflow.model.utils.WorkflowConstants; import org.apache.commons.codec.binary.Base64; -import org.gpel.GpelConstants; -import org.gpel.model.GpelProcess; +//import org.gpel.GpelConstants; +//import org.gpel.model.GpelProcess; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.xmlpull.infoset.XmlElement; import org.xmlpull.infoset.XmlInfosetBuilder; import org.xmlpull.infoset.XmlNamespace; -import xsul5.XmlConstants; -import xsul5.wsdl.WsdlDefinitions; +//import xsul5.XmlConstants; +//import xsul5.wsdl.WsdlDefinitions; public class Workflow implements Cloneable { @@ -128,35 +128,35 @@ public class Workflow implements Cloneable { private URI gpelInstanceID; - private GpelProcess gpelProcess; - - private WsdlDefinitions workflowWSDL; - - private WsdlDefinitions odeInvokableWSDL; - - private WsdlDefinitions odeWorkflowWSDL; - - private GpelProcess odeProcess; - - private Map<String, WsdlDefinitions> odeWsdlMap; +// private GpelProcess gpelProcess; +// +// private WsdlDefinitions workflowWSDL; +// +// private WsdlDefinitions odeInvokableWSDL; +// +// private WsdlDefinitions odeWorkflowWSDL; +// +// private GpelProcess odeProcess; +// +// private Map<String, WsdlDefinitions> odeWsdlMap; private boolean editable=true; /** * used only during the parsing xwf or loading from GPEL. */ - private Map<String, WsdlDefinitions> wsdlMap; +// private Map<String, WsdlDefinitions> wsdlMap; private XmlElement odeDeploymentDiscriptor; private volatile WorkflowExecutionState executionState = WorkflowExecutionState.NONE; - private WsdlDefinitions tridentWSDL; +// private WsdlDefinitions tridentWSDL; /** * Constructs a Workflow. */ public Workflow() { - this.wsdlMap = new HashMap<String, WsdlDefinitions>(); +// this.wsdlMap = new HashMap<String, WsdlDefinitions>(); // Create a empty graph here to avoid null checks. this.graph = WSGraphFactory.createGraph(); @@ -335,84 +335,84 @@ public class Workflow implements Cloneable { this.image = image; } - /** - * Returns the gpelProcess. - * - * @return The gpelProcess - */ - public GpelProcess getGpelProcess() { - return this.gpelProcess; - } - - /** - * Sets gpelProcess. - * - * @param gpelProcess - * The gpelProcess to set. - */ - public void setGpelProcess(GpelProcess gpelProcess) { - this.gpelProcess = gpelProcess; - } - - /** - * Returns the workflowWSDL. - * - * @return The workflowWSDL - */ - public WsdlDefinitions getWorkflowWSDL() { - return this.workflowWSDL; - } - - /** - * Sets workflowWSDL. - * - * @param workflowWSDL - * The workflowWSDL to set. - */ - public void setWorkflowWSDL(WsdlDefinitions workflowWSDL) { - this.workflowWSDL = workflowWSDL; - } - - /** - * @return The set of WSDLs - */ - public Map<String, WsdlDefinitions> getWSDLs() { - - Map<String, WsdlDefinitions> wsdls = new LinkedHashMap<String, WsdlDefinitions>(); -// Map<WsdlDefinitions, String> ids = new HashMap<WsdlDefinitions, String>(); -// // Use LinkedHashMap to preserve the order of WSDLs, which is useful for -// // some unit tests. +// /** +// * Returns the gpelProcess. +// * +// * @return The gpelProcess +// */ +// public GpelProcess getGpelProcess() { +// return this.gpelProcess; +// } // -// for (WSNode node : GraphUtil.getNodes(this.graph, WSNode.class)) { -// WsdlDefinitions wsdl = node.getComponent().getWSDL(); -// if (wsdls.containsValue(wsdl)) { -// String id = ids.get(wsdl); -// node.setWSDLID(id); -// } else { -// // Assign unique key -// String name = WSDLUtil.getWSDLName(wsdl); -// String id = StringUtil.convertToJavaIdentifier(name); -// while (wsdls.containsKey(id)) { -// id = StringUtil.incrementName(id); -// } -// wsdls.put(id, wsdl); -// ids.put(wsdl, id); -// node.setWSDLID(id); -// } -// } - return wsdls; - } - - /** - * This method is called by GPELClient during loading a workflow. - * - * @param id - * @param wsdl - */ - public void addWSDL(String id, WsdlDefinitions wsdl) { - logger.debug("id: " + id); - this.wsdlMap.put(id, wsdl); - } +// /** +// * Sets gpelProcess. +// * +// * @param gpelProcess +// * The gpelProcess to set. +// */ +// public void setGpelProcess(GpelProcess gpelProcess) { +// this.gpelProcess = gpelProcess; +// } +// +// /** +// * Returns the workflowWSDL. +// * +// * @return The workflowWSDL +// */ +// public WsdlDefinitions getWorkflowWSDL() { +// return this.workflowWSDL; +// } +// +// /** +// * Sets workflowWSDL. +// * +// * @param workflowWSDL +// * The workflowWSDL to set. +// */ +// public void setWorkflowWSDL(WsdlDefinitions workflowWSDL) { +// this.workflowWSDL = workflowWSDL; +// } +// +// /** +// * @return The set of WSDLs +// */ +// public Map<String, WsdlDefinitions> getWSDLs() { +// +// Map<String, WsdlDefinitions> wsdls = new LinkedHashMap<String, WsdlDefinitions>(); +//// Map<WsdlDefinitions, String> ids = new HashMap<WsdlDefinitions, String>(); +//// // Use LinkedHashMap to preserve the order of WSDLs, which is useful for +//// // some unit tests. +//// +//// for (WSNode node : GraphUtil.getNodes(this.graph, WSNode.class)) { +//// WsdlDefinitions wsdl = node.getComponent().getWSDL(); +//// if (wsdls.containsValue(wsdl)) { +//// String id = ids.get(wsdl); +//// node.setWSDLID(id); +//// } else { +//// // Assign unique key +//// String name = WSDLUtil.getWSDLName(wsdl); +//// String id = StringUtil.convertToJavaIdentifier(name); +//// while (wsdls.containsKey(id)) { +//// id = StringUtil.incrementName(id); +//// } +//// wsdls.put(id, wsdl); +//// ids.put(wsdl, id); +//// node.setWSDLID(id); +//// } +//// } +// return wsdls; +// } +// +// /** +// * This method is called by GPELClient during loading a workflow. +// * +// * @param id +// * @param wsdl +// */ +// public void addWSDL(String id, WsdlDefinitions wsdl) { +// logger.debug("id: " + id); +// this.wsdlMap.put(id, wsdl); +// } /** * Creates a node from a specified component and adds it to the graph. @@ -551,16 +551,16 @@ public class Workflow implements Cloneable { } // BPEL - if (this.gpelProcess != null) { - XmlElement bpelElement = workflowElement.addElement(NS_XWF, BPEL_TAG); - bpelElement.setText(this.gpelProcess.xmlStringPretty()); - } - - // Workflow WSDL - if (this.workflowWSDL != null) { - XmlElement workflowWSDLElement = workflowElement.addElement(NS_XWF, WORKFLOW_WSDL_TAG); - workflowWSDLElement.setText(this.workflowWSDL.xmlStringPretty()); - } +// if (this.gpelProcess != null) { +// XmlElement bpelElement = workflowElement.addElement(NS_XWF, BPEL_TAG); +// bpelElement.setText(this.gpelProcess.xmlStringPretty()); +// } +// +// // Workflow WSDL +// if (this.workflowWSDL != null) { +// XmlElement workflowWSDLElement = workflowElement.addElement(NS_XWF, WORKFLOW_WSDL_TAG); +// workflowWSDLElement.setText(this.workflowWSDL.xmlStringPretty()); +// } return workflowElement; } @@ -603,22 +603,22 @@ public class Workflow implements Cloneable { for (WSNode node : GraphUtil.getWSNodes(this.graph)) { String id = node.getWSDLID(); logger.debug("id: " + id); - WsdlDefinitions wsdl = this.wsdlMap.get(id); - - if (wsdl == null) { - // XXX This happens while loading a workflow that is created by - // the version 2.2.6_2 or below from GPEL. - // Need to look for wsdl manually. - // id should be look like - // {http://www.extreme.indiana.edu/math/}Adder - for (WsdlDefinitions w : this.wsdlMap.values()) { - QName name = WSDLUtil.getWSDLQName(w); - if (name.toString().equals(id)) { - wsdl = w; - break; - } - } - } +// WsdlDefinitions wsdl = this.wsdlMap.get(id); +// +// if (wsdl == null) { +// // XXX This happens while loading a workflow that is created by +// // the version 2.2.6_2 or below from GPEL. +// // Need to look for wsdl manually. +// // id should be look like +// // {http://www.extreme.indiana.edu/math/}Adder +// for (WsdlDefinitions w : this.wsdlMap.values()) { +// QName name = WSDLUtil.getWSDLQName(w); +// if (name.toString().equals(id)) { +// wsdl = w; +// break; +// } +// } +// } // if (wsdl == null) { // continue; // } @@ -699,22 +699,22 @@ public class Workflow implements Cloneable { // Graph XmlElement graphElement = workflowElement.element(GraphSchema.GRAPH_TAG); this.graph = WSGraphFactory.createGraph(graphElement); - WsdlDefinitions wsdl = null; - XmlElement wsdlsElement = workflowElement.element(WSDLS_TAG); - for (XmlElement wsdlElement : wsdlsElement.elements(null, WSDL_TAG)) { - String wsdlText = wsdlElement.requiredText(); - try { - wsdl = WSDLUtil.stringToWSDL(wsdlText); - } catch (UtilsException e) { - logger.error(e.getMessage(), e); - } - String id = wsdlElement.attributeValue(NS_XWF, ID_ATTRIBUTE); - if (id == null || id.length() == 0) { - // xwf up to 2.2.6_2 doesn't have ID. - id = WSDLUtil.getWSDLQName(wsdl).toString(); - } - addWSDL(id, wsdl); - } +// WsdlDefinitions wsdl = null; +// XmlElement wsdlsElement = workflowElement.element(WSDLS_TAG); +// for (XmlElement wsdlElement : wsdlsElement.elements(null, WSDL_TAG)) { +// String wsdlText = wsdlElement.requiredText(); +// try { +// wsdl = WSDLUtil.stringToWSDL(wsdlText); +// } catch (UtilsException e) { +// logger.error(e.getMessage(), e); +// } +// String id = wsdlElement.attributeValue(NS_XWF, ID_ATTRIBUTE); +// if (id == null || id.length() == 0) { +// // xwf up to 2.2.6_2 doesn't have ID. +// id = WSDLUtil.getWSDLQName(wsdl).toString(); +// } +// addWSDL(id, wsdl); +// } bindComponents(); @@ -737,8 +737,8 @@ public class Workflow implements Cloneable { try { String bpelString = bpelElement.requiredText(); XmlNamespace gpelNS = XmlInfosetBuilder.newInstance().newNamespace(BPELScript.GPEL, BPELScript.GPELNS); - GpelConstants.GPEL_NS = gpelNS; - this.gpelProcess = new GpelProcess(XMLUtil.stringToXmlElement(bpelString)); +// GpelConstants.GPEL_NS = gpelNS; +// this.gpelProcess = new GpelProcess(XMLUtil.stringToXmlElement(bpelString)); } catch (RuntimeException e) { String error = "Failed to parse the BPEL document."; throw new GraphException(error, e); @@ -749,7 +749,7 @@ public class Workflow implements Cloneable { if (workflowWSDLElement != null) { try { String wsdlText = workflowWSDLElement.requiredText(); - this.workflowWSDL = new WsdlDefinitions(XMLUtil.stringToXmlElement(wsdlText)); +// this.workflowWSDL = new WsdlDefinitions(XMLUtil.stringToXmlElement(wsdlText)); } catch (RuntimeException e) { String error = "Failed to parse the workflow WSDL."; throw new GraphException(error, e); @@ -784,134 +784,134 @@ public class Workflow implements Cloneable { public XmlElement getODEDeploymentDescriptor(URI dscUrl, String odeEprEndingWithPort) throws GraphException, ComponentException { - if (this.odeDeploymentDiscriptor == null) { - this.odeDeploymentDiscriptor = new ODEDeploymentDescriptor().generate(this.getName(), - getOdeWorkflowWSDL(dscUrl, odeEprEndingWithPort), getOdeProcess(dscUrl, odeEprEndingWithPort), - getOdeServiceWSDLs(dscUrl, odeEprEndingWithPort)); - } +// if (this.odeDeploymentDiscriptor == null) { +// this.odeDeploymentDiscriptor = new ODEDeploymentDescriptor().generate(this.getName(), +// getOdeWorkflowWSDL(dscUrl, odeEprEndingWithPort), getOdeProcess(dscUrl, odeEprEndingWithPort), +// getOdeServiceWSDLs(dscUrl, odeEprEndingWithPort)); +// } return this.odeDeploymentDiscriptor; } - /** - * Returns the odeWorkflowWSDL. - * - * @return The odeWorkflowWSDL - * @throws GraphException - * @throws ComponentException - */ - public WsdlDefinitions getOdeInvokableWSDL(URI dscUrl, String odeEprEndingWithPort) throws GraphException, - ComponentException { - if (this.odeInvokableWSDL == null) { - generateODEScripts(dscUrl, odeEprEndingWithPort); - } - return this.odeInvokableWSDL; - } - - /** - * Returns the odeProcess. - * - * @return The odeProcess - * @throws ComponentException - * @throws GraphException - */ - public GpelProcess getOdeProcess(URI dscUrl, String odeEprEndingWithPort) throws GraphException, ComponentException { - if (this.odeProcess == null) { - generateODEScripts(dscUrl, odeEprEndingWithPort); - } - return this.odeProcess; - } - - /** - * Returns the odeWsdlMap. - * - * @return The odeWsdlMap - * @throws ComponentException - * @throws GraphException - */ - public Map<String, WsdlDefinitions> getOdeServiceWSDLs(URI dscUrl, String odeEprEndingWithPort) - throws GraphException, ComponentException { - if (this.odeWsdlMap == null) { - generateODEScripts(dscUrl, odeEprEndingWithPort); - } - - return this.odeWsdlMap; - } - - /** - * Returns the odeWorkflowWSDL. - * - * @return The odeWorkflowWSDL - * @throws ComponentException - * @throws GraphException - */ - public WsdlDefinitions getOdeWorkflowWSDL(URI dscUrl, String odeEprEndingWithPort) throws GraphException, - ComponentException { - if (this.odeWorkflowWSDL == null) { - generateODEScripts(dscUrl, odeEprEndingWithPort); - } - - return this.odeWorkflowWSDL; - } - - public WsdlDefinitions getTridentWorkflowWSDL(URI dscUrl, String odeEprEndingWithPort) throws GraphException, - ComponentException { - if (this.tridentWSDL == null) { - generateODEScripts(dscUrl, odeEprEndingWithPort); - } - - return this.tridentWSDL; - } - - private void generateODEScripts(URI dscUrl, String odeEprEndingWithPort) throws GraphException, ComponentException { - this.getGraph().setID(this.getName()); - - BPELScript script = null; - - script = new BPELScript(this); - ODEWSDLTransformer wsdlTransformer = new ODEWSDLTransformer(); - script.create(BPELScriptType.BPEL2); - this.odeProcess = script.getGpelProcess(); - this.odeProcess.setTargetNamespace(WorkflowConstants.LEAD_NS); - - WsdlDefinitions abstractWorkflowWsdl = script.getWorkflowWSDL().getWsdlDefinitions(); - this.odeWorkflowWSDL = abstractWorkflowWsdl; - try { - this.odeInvokableWSDL = WSDLUtil.stringToWSDL(abstractWorkflowWsdl.xmlString()); - wsdlTransformer.makeWorkflowWSDLConcrete(this.odeInvokableWSDL, this.getName(), dscUrl); - wsdlTransformer.setOdeLocation(odeEprEndingWithPort, this.getName(), this.odeInvokableWSDL); - - this.odeWsdlMap = new HashMap<String, WsdlDefinitions>(); - Collection<XmlElement> itr = script.getWSDLs(); - for (XmlElement xmlElement : itr) { - WsdlDefinitions wsdl = WSDLUtil.stringToWSDL(XmlConstants.BUILDER.serializeToString(xmlElement)); - String id = xmlElement.attributeValue(NS_XWF, ID_ATTRIBUTE); - if (id == null || id.length() == 0) { - // xwf up to 2.2.6_2 doesn't have ID. - id = WSDLUtil.getWSDLQName(wsdl).toString(); - if (null == id || "".equals(id) || (id.startsWith("{") && id.endsWith("}"))) { - QName wsdlQname = new QName(NS_XWF.getName(), WSDLUtil.getFirstOperationName(wsdl, - WSDLUtil.getFirstPortTypeQName(wsdl))); - id = wsdlQname.toString(); - wsdl.xml().setAttributeValue("name", wsdlQname.getLocalPart()); - } - } - WSDLCleaner.cleanWSDL(wsdl); - this.odeWsdlMap.put(id, wsdl); - } - } catch (Exception e) { - logger.error(e.getMessage(), e); - } - new ODEBPELTransformer() - .generateODEBPEL(this.odeProcess, this.getName(), this.odeWorkflowWSDL, this.odeWsdlMap); - - wsdlTransformer.trasnformToODEWsdls(this.getName(), dscUrl, this.odeWorkflowWSDL, this.odeWsdlMap); - - String wsdlString = XMLUtil.xmlElementToString(this.odeWorkflowWSDL.xml()); - this.tridentWSDL = new WsdlDefinitions(XMLUtil.stringToXmlElement(wsdlString)); - new TridentTransformer().process(this.tridentWSDL); - - } +// /** +// * Returns the odeWorkflowWSDL. +// * +// * @return The odeWorkflowWSDL +// * @throws GraphException +// * @throws ComponentException +// */ +// public WsdlDefinitions getOdeInvokableWSDL(URI dscUrl, String odeEprEndingWithPort) throws GraphException, +// ComponentException { +// if (this.odeInvokableWSDL == null) { +// generateODEScripts(dscUrl, odeEprEndingWithPort); +// } +// return this.odeInvokableWSDL; +// } +// +// /** +// * Returns the odeProcess. +// * +// * @return The odeProcess +// * @throws ComponentException +// * @throws GraphException +// */ +// public GpelProcess getOdeProcess(URI dscUrl, String odeEprEndingWithPort) throws GraphException, ComponentException { +// if (this.odeProcess == null) { +// generateODEScripts(dscUrl, odeEprEndingWithPort); +// } +// return this.odeProcess; +// } +// +// /** +// * Returns the odeWsdlMap. +// * +// * @return The odeWsdlMap +// * @throws ComponentException +// * @throws GraphException +// */ +// public Map<String, WsdlDefinitions> getOdeServiceWSDLs(URI dscUrl, String odeEprEndingWithPort) +// throws GraphException, ComponentException { +// if (this.odeWsdlMap == null) { +// generateODEScripts(dscUrl, odeEprEndingWithPort); +// } +// +// return this.odeWsdlMap; +// } +// +// /** +// * Returns the odeWorkflowWSDL. +// * +// * @return The odeWorkflowWSDL +// * @throws ComponentException +// * @throws GraphException +// */ +// public WsdlDefinitions getOdeWorkflowWSDL(URI dscUrl, String odeEprEndingWithPort) throws GraphException, +// ComponentException { +// if (this.odeWorkflowWSDL == null) { +// generateODEScripts(dscUrl, odeEprEndingWithPort); +// } +// +// return this.odeWorkflowWSDL; +// } +// +// public WsdlDefinitions getTridentWorkflowWSDL(URI dscUrl, String odeEprEndingWithPort) throws GraphException, +// ComponentException { +// if (this.tridentWSDL == null) { +// generateODEScripts(dscUrl, odeEprEndingWithPort); +// } +// +// return this.tridentWSDL; +// } +// +// private void generateODEScripts(URI dscUrl, String odeEprEndingWithPort) throws GraphException, ComponentException { +// this.getGraph().setID(this.getName()); +// +// BPELScript script = null; +// +// script = new BPELScript(this); +// ODEWSDLTransformer wsdlTransformer = new ODEWSDLTransformer(); +// script.create(BPELScriptType.BPEL2); +// this.odeProcess = script.getGpelProcess(); +// this.odeProcess.setTargetNamespace(WorkflowConstants.LEAD_NS); +// +// WsdlDefinitions abstractWorkflowWsdl = script.getWorkflowWSDL().getWsdlDefinitions(); +// this.odeWorkflowWSDL = abstractWorkflowWsdl; +// try { +// this.odeInvokableWSDL = WSDLUtil.stringToWSDL(abstractWorkflowWsdl.xmlString()); +// wsdlTransformer.makeWorkflowWSDLConcrete(this.odeInvokableWSDL, this.getName(), dscUrl); +// wsdlTransformer.setOdeLocation(odeEprEndingWithPort, this.getName(), this.odeInvokableWSDL); +// +// this.odeWsdlMap = new HashMap<String, WsdlDefinitions>(); +// Collection<XmlElement> itr = script.getWSDLs(); +// for (XmlElement xmlElement : itr) { +// WsdlDefinitions wsdl = WSDLUtil.stringToWSDL(XmlConstants.BUILDER.serializeToString(xmlElement)); +// String id = xmlElement.attributeValue(NS_XWF, ID_ATTRIBUTE); +// if (id == null || id.length() == 0) { +// // xwf up to 2.2.6_2 doesn't have ID. +// id = WSDLUtil.getWSDLQName(wsdl).toString(); +// if (null == id || "".equals(id) || (id.startsWith("{") && id.endsWith("}"))) { +// QName wsdlQname = new QName(NS_XWF.getName(), WSDLUtil.getFirstOperationName(wsdl, +// WSDLUtil.getFirstPortTypeQName(wsdl))); +// id = wsdlQname.toString(); +// wsdl.xml().setAttributeValue("name", wsdlQname.getLocalPart()); +// } +// } +// WSDLCleaner.cleanWSDL(wsdl); +// this.odeWsdlMap.put(id, wsdl); +// } +// } catch (Exception e) { +// logger.error(e.getMessage(), e); +// } +// new ODEBPELTransformer() +// .generateODEBPEL(this.odeProcess, this.getName(), this.odeWorkflowWSDL, this.odeWsdlMap); +// +// wsdlTransformer.trasnformToODEWsdls(this.getName(), dscUrl, this.odeWorkflowWSDL, this.odeWsdlMap); +// +// String wsdlString = XMLUtil.xmlElementToString(this.odeWorkflowWSDL.xml()); +// this.tridentWSDL = new WsdlDefinitions(XMLUtil.stringToXmlElement(wsdlString)); +// new TridentTransformer().process(this.tridentWSDL); +// +// } /** * @return @@ -975,9 +975,9 @@ public class Workflow implements Cloneable { public void createScript() throws GraphException { // Generate a BPEL process. BPELScript script = new BPELScript(this); - script.create(BPELScriptType.GPEL); - this.setGpelProcess(script.getGpelProcess()); - this.setWorkflowWSDL(script.getWorkflowWSDL().getWsdlDefinitions()); +// script.create(BPELScriptType.GPEL); +// this.setGpelProcess(script.getGpelProcess()); +// this.setWorkflowWSDL(script.getWorkflowWSDL().getWsdlDefinitions()); } public List<String> getWorkflowServiceNodeIDs() {
http://git-wip-us.apache.org/repos/asf/airavata/blob/9a6eaaae/modules/xbaya-gui/pom.xml ---------------------------------------------------------------------- diff --git a/modules/xbaya-gui/pom.xml b/modules/xbaya-gui/pom.xml index 82f7c3f..64eb014 100644 --- a/modules/xbaya-gui/pom.xml +++ b/modules/xbaya-gui/pom.xml @@ -103,6 +103,11 @@ </dependency> <dependency> <groupId>org.ogce</groupId> + <artifactId>xsul5</artifactId> + <version>${xsul5.version}</version> + </dependency> + <dependency> + <groupId>org.ogce</groupId> <artifactId>xsul</artifactId> <version>${xsul.version}</version> </dependency> http://git-wip-us.apache.org/repos/asf/airavata/blob/9a6eaaae/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/BPELFiler.java ---------------------------------------------------------------------- diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/BPELFiler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/BPELFiler.java index 2e0f4f5..cd3954a 100644 --- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/BPELFiler.java +++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/BPELFiler.java @@ -120,25 +120,25 @@ public class BPELFiler { // Add ".wsdl" at the end of the file name File wsdlFile = new File(path + XBayaConstants.WSDL_SUFFIX); - try { - // Create the script. - bpel.create(BPELScriptType.BPEL2); - - GpelProcess gpelProcess = bpel.getGpelProcess(); - XMLUtil.saveXML(gpelProcess.xml(), bpelFile); - - WorkflowWSDL workflowWSDL = bpel.getWorkflowWSDL(); - XMLUtil.saveXML(workflowWSDL.getWsdlDefinitions().xml(), wsdlFile); - - } catch (IOException e) { - this.engine.getGUI().getErrorWindow().error(ErrorMessages.WRITE_FILE_ERROR, e); - } catch (GraphException e) { - this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_NOT_READY_ERROR, e); - } catch (RuntimeException e) { - this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e); - } catch (Error e) { - this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e); - } +// try { +// // Create the script. +// bpel.create(BPELScriptType.BPEL2); +// +// GpelProcess gpelProcess = bpel.getGpelProcess(); +// XMLUtil.saveXML(gpelProcess.xml(), bpelFile); +// +// WorkflowWSDL workflowWSDL = bpel.getWorkflowWSDL(); +// XMLUtil.saveXML(workflowWSDL.getWsdlDefinitions().xml(), wsdlFile); +// +// } catch (IOException e) { +// this.engine.getGUI().getErrorWindow().error(ErrorMessages.WRITE_FILE_ERROR, e); +// } catch (GraphException e) { +// this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_NOT_READY_ERROR, e); +// } catch (RuntimeException e) { +// this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e); +// } catch (Error e) { +// this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e); +// } } } http://git-wip-us.apache.org/repos/asf/airavata/blob/9a6eaaae/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ODEScriptFiler.java ---------------------------------------------------------------------- diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ODEScriptFiler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ODEScriptFiler.java index 7df94a7..7649754 100644 --- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ODEScriptFiler.java +++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ODEScriptFiler.java @@ -122,45 +122,45 @@ public class ODEScriptFiler { } catch (URISyntaxException e) { log.error(e.getMessage(), e); } - process = wf.getOdeProcess(WSDLUtil.appendWSDLQuary(temp), this.engine.getConfiguration().getODEURL()); - String processString = process.xmlStringPretty(); - FileWriter writer = new FileWriter(bpelFile); - writer.write(processString); - writer.close(); - - WsdlDefinitions workflowWSDL = wf.getOdeWorkflowWSDL(this.engine.getConfiguration().getDSCURL(), - this.engine.getConfiguration().getODEURL()); - String workflowWsdlStr = XmlConstants.BUILDER.serializeToStringPretty(workflowWSDL.xml()); - writer = new FileWriter(wsdlFile); - writer.write(workflowWsdlStr); - - Map<String, WsdlDefinitions> wsdlMap = wf.getOdeServiceWSDLs( - this.engine.getConfiguration().getDSCURL(), this.engine.getConfiguration().getODEURL()); - Set<String> keySet = wsdlMap.keySet(); - for (String string : keySet) { - writer = new FileWriter(new File(wsdlFile.getParent(), QName.valueOf(string).getLocalPart())); - writer.write(XmlConstants.BUILDER.serializeToStringPretty(wsdlMap.get(string).xml())); - writer.close(); - } - - XmlElement deployDescriptor = wf.getODEDeploymentDescriptor(this.engine.getConfiguration().getDSCURL(), - this.engine.getConfiguration().getODEURL()); - writer = new FileWriter(new File(wsdlFile.getParent(), "deploy.xml")); - writer.write(XmlConstants.BUILDER.serializeToString(deployDescriptor)); - writer.close(); - +// process = wf.getOdeProcess(WSDLUtil.appendWSDLQuary(temp), this.engine.getConfiguration().getODEURL()); +// String processString = process.xmlStringPretty(); +// FileWriter writer = new FileWriter(bpelFile); +// writer.write(processString); +// writer.close(); +// +// WsdlDefinitions workflowWSDL = wf.getOdeWorkflowWSDL(this.engine.getConfiguration().getDSCURL(), +// this.engine.getConfiguration().getODEURL()); +// String workflowWsdlStr = XmlConstants.BUILDER.serializeToStringPretty(workflowWSDL.xml()); +// writer = new FileWriter(wsdlFile); +// writer.write(workflowWsdlStr); +// +// Map<String, WsdlDefinitions> wsdlMap = wf.getOdeServiceWSDLs( +// this.engine.getConfiguration().getDSCURL(), this.engine.getConfiguration().getODEURL()); +// Set<String> keySet = wsdlMap.keySet(); +// for (String string : keySet) { +// writer = new FileWriter(new File(wsdlFile.getParent(), QName.valueOf(string).getLocalPart())); +// writer.write(XmlConstants.BUILDER.serializeToStringPretty(wsdlMap.get(string).xml())); +// writer.close(); +// } +// +// XmlElement deployDescriptor = wf.getODEDeploymentDescriptor(this.engine.getConfiguration().getDSCURL(), +// this.engine.getConfiguration().getODEURL()); +// writer = new FileWriter(new File(wsdlFile.getParent(), "deploy.xml")); +// writer.write(XmlConstants.BUILDER.serializeToString(deployDescriptor)); +// writer.close(); +// } - - } catch (IOException e) { - this.engine.getGUI().getErrorWindow().error(ErrorMessages.WRITE_FILE_ERROR, e); - } catch (GraphException e) { - this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e); +// +// } catch (IOException e) { +// this.engine.getGUI().getErrorWindow().error(ErrorMessages.WRITE_FILE_ERROR, e); +// } catch (GraphException e) { +// this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e); } catch (RuntimeException e) { this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e); } catch (Error e) { this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e); - } catch (ComponentException e) { - this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e); +// } catch (ComponentException e) { +// this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e); } } http://git-wip-us.apache.org/repos/asf/airavata/blob/9a6eaaae/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/factory/InvokerFactory.java ---------------------------------------------------------------------- diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/factory/InvokerFactory.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/factory/InvokerFactory.java index 75d5677..c03c756 100644 --- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/factory/InvokerFactory.java +++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/factory/InvokerFactory.java @@ -50,11 +50,11 @@ public class InvokerFactory { if (definitions != null && definitions.getServices().iterator().hasNext()) { // check if this web service supports asynchronous invocation - if (WSDLUtil.isAsynchronousSupported(WSDLUtil.wsdlDefinitions3ToWsdlDefintions5(definitions))) { - invoker = new AsynchronousInvoker(definitions, messageBoxURL); - } else { +// if (WSDLUtil.isAsynchronousSupported(WSDLUtil.wsdlDefinitions3ToWsdlDefintions5(definitions))) { +// invoker = new AsynchronousInvoker(definitions, messageBoxURL); +// } else { invoker = new SimpleInvoker(definitions); - } +// } } else if (gfacURL != null && gfacURL.length() != 0) { invoker = new GFacInvoker(portTypeQName, gfacURL, messageBoxURL, leadContext); } @@ -72,11 +72,11 @@ public class InvokerFactory { if (definitions != null && definitions.getServices().iterator().hasNext()) { // check if this web service supports asynchronous invocation - if (WSDLUtil.isAsynchronousSupported(WSDLUtil.wsdlDefinitions3ToWsdlDefintions5(definitions))) { - invoker = new AsynchronousInvoker(definitions, messageBoxURL); - } else { +// if (WSDLUtil.isAsynchronousSupported(WSDLUtil.wsdlDefinitions3ToWsdlDefintions5(definitions))) { +// invoker = new AsynchronousInvoker(definitions, messageBoxURL); +// } else { invoker = new SimpleInvoker(definitions); - } +// } } else if (gfacURL != null && gfacURL.length() != 0) { invoker = new GFacInvoker(portTypeQName, gfacURL, messageBoxURL, builder); } http://git-wip-us.apache.org/repos/asf/airavata/blob/9a6eaaae/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicNodeWindow.java ---------------------------------------------------------------------- diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicNodeWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicNodeWindow.java index 3f0a97f..c4d9790 100644 --- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicNodeWindow.java +++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicNodeWindow.java @@ -338,42 +338,42 @@ public class DynamicNodeWindow { WSNode fromWsNode = (WSNode) fromNode; if (null != fromPort && fromPort instanceof DataPort) { DataPort fromDataPort = (DataPort) fromPort; - WsdlDefinitions wsdl = engine.getGUI().getWorkflow().getWSDLs().get(fromWsNode.getWSDLID()); - Iterator<XmlNamespace> itr = wsdl.xml().namespaces().iterator(); - try { - XmlElement schema = wsdl.getTypes().element("schema").clone(); - // do not change the following ordering of setting - // namespaces. - schema.setNamespace(xsul5.XmlConstants.BUILDER.newNamespace("http://www.w3.org/2001/XMLSchema")); - while (itr.hasNext()) { - XmlNamespace next = itr.next(); - if (!"".equals(next.getPrefix()) && null != next.getPrefix()) { - schema.setAttributeValue("xmlns:" + next.getPrefix(), next.getName()); - } - - } - - try { - xsul5.XmlConstants.BUILDER - .serializeToOutputStream(schema, new FileOutputStream(rootDir.getCanonicalPath() - + File.separatorChar + "types.xsd")); - } catch (Exception e) { - log.error(e.getMessage(), e); - } - - typesPath = rootDir.getCanonicalPath() + File.separatorChar + "mytype.jar"; - String[] args = new String[] { "-d", classesDir.getCanonicalPath(), "-src", - srcDir.getCanonicalPath(), "-out", typesPath, - rootDir.getCanonicalPath() + File.separatorChar + "types.xsd" }; - SchemaCompilerUtil.compile(args); - - } catch (XmlBuilderException e) { - this.engine.getGUI().getErrorWindow().error(e); - } catch (CloneNotSupportedException e) { - this.engine.getGUI().getErrorWindow().error(e); - } catch (IOException e) { - log.error(e.getMessage(), e); - } +// WsdlDefinitions wsdl = engine.getGUI().getWorkflow().getWSDLs().get(fromWsNode.getWSDLID()); +// Iterator<XmlNamespace> itr = wsdl.xml().namespaces().iterator(); +// try { +// XmlElement schema = wsdl.getTypes().element("schema").clone(); +// // do not change the following ordering of setting +// // namespaces. +// schema.setNamespace(xsul5.XmlConstants.BUILDER.newNamespace("http://www.w3.org/2001/XMLSchema")); +// while (itr.hasNext()) { +// XmlNamespace next = itr.next(); +// if (!"".equals(next.getPrefix()) && null != next.getPrefix()) { +// schema.setAttributeValue("xmlns:" + next.getPrefix(), next.getName()); +// } +// +// } +// +// try { +// xsul5.XmlConstants.BUILDER +// .serializeToOutputStream(schema, new FileOutputStream(rootDir.getCanonicalPath() +// + File.separatorChar + "types.xsd")); +// } catch (Exception e) { +// log.error(e.getMessage(), e); +// } +// +// typesPath = rootDir.getCanonicalPath() + File.separatorChar + "mytype.jar"; +// String[] args = new String[] { "-d", classesDir.getCanonicalPath(), "-src", +// srcDir.getCanonicalPath(), "-out", typesPath, +// rootDir.getCanonicalPath() + File.separatorChar + "types.xsd" }; +// SchemaCompilerUtil.compile(args); +// +// } catch (XmlBuilderException e) { +// this.engine.getGUI().getErrorWindow().error(e); +// } catch (CloneNotSupportedException e) { +// this.engine.getGUI().getErrorWindow().error(e); +// } catch (IOException e) { +// log.error(e.getMessage(), e); +// } } else { throw new WorkflowRuntimeException("Unknown port for code generation" + fromPort); http://git-wip-us.apache.org/repos/asf/airavata/blob/9a6eaaae/tools/gsissh/pom.xml ---------------------------------------------------------------------- diff --git a/tools/gsissh/pom.xml b/tools/gsissh/pom.xml index 1e48e03..4ccc340 100644 --- a/tools/gsissh/pom.xml +++ b/tools/gsissh/pom.xml @@ -35,7 +35,7 @@ <dependency> <groupId>com.jcraft</groupId> <artifactId>jsch</artifactId> - <version>0.1.50</version> + <version>0.1.51</version> </dependency> <dependency> <groupId>org.jglobus</groupId> @@ -76,10 +76,14 @@ <version>6.1.1</version> <scope>test</scope> </dependency> - <dependency> + <!-- dependency> <groupId>org.ogce</groupId> <artifactId>bcgss</artifactId> <version>146</version> + </dependency> --> + <dependency> + <groupId>org.bouncycastle</groupId> + <artifactId>bcprov-jdk15on</artifactId> </dependency> <dependency> <groupId>org.apache.xmlbeans</groupId> http://git-wip-us.apache.org/repos/asf/airavata/blob/9a6eaaae/tools/gsissh/src/main/java/com/jcraft/jsch/ExtendedSession.java ---------------------------------------------------------------------- diff --git a/tools/gsissh/src/main/java/com/jcraft/jsch/ExtendedSession.java b/tools/gsissh/src/main/java/com/jcraft/jsch/ExtendedSession.java index 5d21a41..f3ead64 100644 --- a/tools/gsissh/src/main/java/com/jcraft/jsch/ExtendedSession.java +++ b/tools/gsissh/src/main/java/com/jcraft/jsch/ExtendedSession.java @@ -21,8 +21,6 @@ package com.jcraft.jsch; -import com.jcraft.jsch.*; - import org.apache.airavata.gsi.ssh.api.authentication.GSIAuthenticationInfo; public class ExtendedSession extends Session {
