/** * @param definitions * @return The cloned WsdlDefinitions */ public static WsdlDefinitions deepClone(WsdlDefinitions definitions) throws UtilsException { return new WsdlDefinitions(XMLUtil.deepClone(definitions.xml())); }
+ WSDLUtil.getWSDLQName(serviceWSDL)); this.definitions.getTypes().addChild(XMLUtil.deepClone(newSchema));
this.metadata = XMLUtil.deepClone(metadata); } catch (UtilsException e) { e.printStackTrace();
/** * @see java.lang.Object#clone() */ @Override public Workflow clone() { XmlElement originalXML = toXML(); try { XmlElement newXML = XMLUtil.deepClone(originalXML); Workflow newWorkflow = new Workflow(newXML); return newWorkflow; } catch (GraphException e) { // This should not happen. throw new WorkflowRuntimeException(e); } catch (WorkflowException e) { // This should not happen. throw new WorkflowRuntimeException(e); } catch (UtilsException e) { // This should not happen. throw new WorkflowRuntimeException(e); } }
@Override protected XmlElement addConfigurationElement(XmlElement nodeElement) { XmlElement configElement = nodeElement.addElement(GraphSchema.NS, GraphSchema.NODE_CONFIG_TAG); if (this.configured) { // Don't save the name here if this node has not been configured. XmlElement nameElement = configElement.addElement(GraphSchema.NS, NAME_TAG); nameElement.addChild(this.configuredName); } if (this.description != null) { XmlElement descriptionElement = configElement.addElement(GraphSchema.NS, DESCRIPTION_TAG); descriptionElement.addChild(this.description); } if (this.parameterType != null) { XmlElement qnameElement = configElement.addElement(GraphSchema.NS, DATA_TYPE_QNAME_TAG); qnameElement.addChild(this.parameterType.toString()); } if (this.metadata != null) { XmlElement metadataElement = configElement.addElement(GraphSchema.NS, METADATA_TAG); // Clone the metadata to avoid parent problem because this can be // called multiple times. try { metadataElement.addChild(XMLUtil.deepClone(this.metadata)); } catch (UtilsException e) { e.printStackTrace(); } } return configElement; }
/** * @param name * @param appinfo * @param schema * @return The sequence element. */ private XmlElement setupParameterType(String name, XmlElement appinfo, XmlElement schema) { XmlElement element = schema.addElement(WSConstants.ELEMENT_TAG); element.setAttributeValue(WSConstants.NAME_ATTRIBUTE, name); String type = name + TYPE_SUFFIX; element.setAttributeValue(WSConstants.TYPE_ATTRIBUTE, WSConstants.TYPE_NS_PREFIX + ":" + type); // add metadata if (appinfo != null) { XmlElement annotation = element.addElement(WSConstants.ANNOTATION_TAG); try { annotation.addElement(XMLUtil.deepClone(appinfo)); } catch (UtilsException e) { e.printStackTrace(); } } XmlElement complex = schema.addElement(WSConstants.COMPLEX_TYPE_TAG); complex.setAttributeValue(WSConstants.NAME_ATTRIBUTE, type); XmlElement sequence = complex.addElement(WSConstants.SEQUENCE_TAG); return sequence; }
clonedElementElement = XMLUtil.deepClone(elementElement); } catch (UtilsException e) { e.printStackTrace();