Package org.xmlpull.infoset

Examples of org.xmlpull.infoset.XmlNamespace


        XmlElement bpelElement = workflowElement.element(BPEL_TAG);
        if (bpelElement != null) {
            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));
            } catch (RuntimeException e) {
                String error = "Failed to parse the BPEL document.";
                throw new GraphException(error, e);
View Full Code Here


                        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 {
View Full Code Here

     * @param element
     * @return The namespace found or declared.
     */
    public static XmlNamespace declareNamespaceIfNecessary(String prefixCandidate, String uri, boolean alwaysUseSuffix,
            XmlElement element) {
        XmlNamespace namespace = element.lookupNamespaceByName(uri);
        if (namespace == null) {
            return declareNamespace(prefixCandidate, uri, alwaysUseSuffix, element);
        } else {
            return namespace;
        }
View Full Code Here

            prefix = prefixCandidate + i;
            while (element.lookupNamespaceByPrefix(prefix) != null) {
                i++;
            }
        }
        XmlNamespace namespace = element.declareNamespace(prefix, uri);
        return namespace;
    }
View Full Code Here

            // TODO fix this.
            this.type = WSConstants.XSD_ANY_TYPE;
        } else {
            String typeName = XMLUtil.getLocalPartOfQName(typeQNameString);
            String prefix = XMLUtil.getPrefixOfQName(typeQNameString);
            XmlNamespace namespace = null;
            if (prefix == null) {
                if ("string".equals(typeName) || "int".equals(typeName)) {
                    namespace = XmlConstants.BUILDER.newNamespace("xsd", WSConstants.XSD_NS_URI);
                    prefix = "xsd";
                } else {
                    throw new ComponentException("Namespace prefix, " + prefix + ", is not defined");
                }
            } else {
                namespace = element.lookupNamespaceByPrefix(prefix);
            }
            this.type = new QName(namespace.getName(), typeName, prefix);
        }

        // annotation
        this.annotation = element.element(null, WSConstants.ANNOTATION_TAG);
        if (this.annotation != null) {
View Full Code Here

            return -1;
        }
        String typeQNameString = type.getValue();
        String typeName = XMLUtil.getLocalPartOfQName(typeQNameString);
        String prefix = XMLUtil.getPrefixOfQName(typeQNameString);
        XmlNamespace namespace = element.lookupNamespaceByPrefix(prefix);
        if (namespace == null) {
            return -1;
        }
        QName typeQname = new QName(namespace.getName(), typeName, prefix);
        int simpleTypeIndex = getSimpleTypeIndex(typeQname);
        if (-1 == simpleTypeIndex) {
            return -1;
        }
View Full Code Here

                        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 {
View Full Code Here

        WSComponent wsdlComponent = node.getComponent();
        String operation = wsdlComponent.getOperationName();

        QName portTypeQName = wsdlComponent.getPortTypeQName();
        XmlNamespace namespace = XMLUtil.declareNamespaceIfNecessary(id.toLowerCase(), portTypeQName.getNamespaceURI(),
                false, this.process.xml());

        // Variable
        String inputVariableName = id + INPUT_SUFFIX;
        this.process.addMessageVariable(inputVariableName, namespace, portTypeQName.getLocalPart());
        String outputVariableName = id + OUTPUT_SUFFIX;
        this.process.addMessageVariable(outputVariableName, namespace, portTypeQName.getLocalPart());

        // Assign
        List<GpelAssignCopy> copies = new ArrayList<GpelAssignCopy>();
        for (Port port : node.getInputPorts()) {
            Port fromPort = port.getFromPort();
            if (fromPort == null) {
                // optional input
                continue;
            }
            GpelAssignCopyFrom from = createAssignCopyFrom(port);
            GpelAssignCopyTo to = createAssignCopyTo(port, true);

            GpelAssignCopy copy = new GpelAssignCopy(this.bpelNS, from, to);
            copies.add(copy);
        }

        GpelAssign assign = new GpelAssign(this.bpelNS, copies);
        sequence.addActivity(assign);

        PartnerLinkRole partnerRoll = this.workflowWSDL.getPartnerRoll(portTypeQName);
        if (partnerRoll == null) {
            String partnerLinkTypeName = id + PARTNER_LINK_TYPE_SUFFIX;
            String partnerRollName = id + PARTNER_ROLE_SUFFIX;
            partnerRoll = this.workflowWSDL.addPartnerLinkTypeAndRoll(partnerLinkTypeName, partnerRollName,
                    portTypeQName);
        }
        PartnerLinkType partnerLinkType = partnerRoll.getPartnerLinkType();

        // partnerLink
        String partnerLinkName = createPartnerLinkName(id);
        XmlNamespace partnerLinkTypeNS = this.targetNamespace;
        this.process.addPartnerLink(partnerLinkName, partnerLinkTypeNS, partnerLinkType.getName(), null,
                partnerRoll.getName());

        // Invoke
        GpelInvoke invoke = new GpelInvoke(this.bpelNS, partnerLinkName, namespace, portTypeQName.getLocalPart(),
View Full Code Here

            from.setVariable(fromID + OUTPUT_SUFFIX);
            from.setPart(fromWsdlComponent.getOutputPartName());

            if (fromWsdlPort.isSchemaUsed()) {
                String typesTargetNamespace = fromWsdlPort.getTargetNamespace();
                XmlNamespace namespace = XMLUtil.declareNamespaceIfNecessary(fromID.toLowerCase() + TYPENS_SUFFIX,
                        typesTargetNamespace, false, this.process.xml());

                from.setQuery("/" + namespace.getPrefix() + ":" + fromWsdlComponent.getOutputTypeName() + "/"
                        + fromWsdlPort.getName());
            } else {
                // No query needed?
            }
        } else if (fromNode instanceof ForEachNode) {
View Full Code Here

            if (toComponentPort.isSchemaUsed()) {
                // Normal case.
                // e.g. <part name="name" type="typens:fooType">
                String typesTargetNamespace = toComponentPort.getTargetNamespace();
                XmlNamespace namespace = XMLUtil.declareNamespaceIfNecessary(toID.toLowerCase() + TYPENS_SUFFIX,
                        typesTargetNamespace, false, this.process.xml());

                String typeName = input ? toWSComponent.getInputTypeName() : toWSComponent.getOutputTypeName();
                to.setQuery("/" + namespace.getPrefix() + ":" + typeName + "/" + toComponentPort.getName());
            } else {
                // e.g. <part name="name" type="xsd:string">
                // No query is needed?
            }
        }
View Full Code Here

TOP

Related Classes of org.xmlpull.infoset.XmlNamespace

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.