Package org.xmlpull.infoset

Examples of org.xmlpull.infoset.XmlNamespace


                if (last == null || !isAssign(last)) {
                    throw new WorkflowRuntimeException("Assign activity not found for the Invoke" + next.xmlStringPretty());
                }

                // we are good and should add the header copy.
                XmlNamespace ns = last.xml().getNamespace();
                GpelAssignCopyFrom headerFrom = new GpelAssignCopyFrom(ns);
                headerFrom.xml().setAttributeValue(PART_STR, LEAD_HEADER_STR);
                headerFrom.xml().setAttributeValue(VARIABLE_STR, WORKFLOW_INPUT_STR);

                GpelAssignCopyTo headerTo = new GpelAssignCopyTo(ns);
View Full Code Here


                this.definitions.getTypes().addChild(XMLUtil.deepClone(newSchema));

                String prefix = declareNamespaceIfNecessary(paramType.getPrefix(), paramType.getNamespaceURI(), false);
                return new QName(paramType.getNamespaceURI(), paramType.getLocalPart(), prefix);
            } else {
                XmlNamespace namespace = this.definitions.xml().lookupNamespaceByName(paramType.getNamespaceURI());
                return new QName(paramType.getNamespaceURI(), paramType.getLocalPart(), namespace.getPrefix());
            }
        } catch (UtilsException e) {
            e.printStackTrace();
        }
        return null;
View Full Code Here

        }
        return portType;
    }

    private String declareNamespaceIfNecessary(String prefixCandidate, String uri, boolean alwaysUseSuffix) {
        XmlNamespace namespace = this.definitions.xml().lookupNamespaceByName(uri);
        if (namespace == null) {
            return declareNamespace(prefixCandidate, uri, alwaysUseSuffix);
        } else {
            return namespace.getPrefix();
        }
    }
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

            Port fromPort = port.getFromPort();
            if (fromPort != null) {
                String variableName = port.getID() + INPUT_SUFFIX;

                GpelVariable ifVar = new GpelVariable(this.process.xml().getNamespace(), variableName);
                XmlNamespace xsdNS = process.xml().lookupNamespaceByName(WSConstants.XSD_NS_URI);
                if (null != xsdNS && xsdNS.getPrefix() != null) {
                    ifVar.xml().setAttributeValue("element",
                            xsdNS.getPrefix() + ":" + WSConstants.XSD_ANY_TYPE.getLocalPart());
                } else {
                    this.process.xml().declareNamespace(WSConstants.XSD_NS);
                    ifVar.xml().setAttributeValue("element",
                            WSConstants.XSD_NS.getPrefix() + ":" + WSConstants.XSD_ANY_TYPE.getLocalPart());
                }
                this.process.getVariables().addVariable(ifVar);

                GpelAssignCopyFrom from = createAssignCopyFrom(fromPort);
                GpelAssignCopyTo to = new GpelAssignCopyTo(this.bpelNS);
                to.setVariable(variableName);
                GpelAssignCopy copy = new GpelAssignCopy(this.bpelNS, from, to);
                copies.add(copy);

                booleanExpression = booleanExpression.replaceAll("\\$" + i, "\\$" + variableName);
            }
        }
        if (copies.size() > 0) {
            GpelAssign assign = new GpelAssign(this.bpelNS, copies);
            sequence.addActivity(assign);
        }
        GpelCondition condition = new GpelCondition(this.bpelNS, booleanExpression);

        //
        // If block
        //
        EndifNode endifNode = getEndifNode(ifNode);
        GpelSequence ifSequence = createIfSequence(ifNode, endifNode, true, parentBlock);
        GpelIf gpelIf = new GpelIf(this.bpelNS, condition, ifSequence);

        //
        // Else block
        //
        GpelSequence elseSequence = createIfSequence(ifNode, endifNode, false, parentBlock);
        GpelElse gpelElse = new GpelElse(this.bpelNS, elseSequence);
        gpelIf.setElse(gpelElse);

        //
        // Create global variables for endif.
        //
        for (Port outputPort : endifNode.getOutputPorts()) {
            String variable = outputPort.getID() + OUTPUT_SUFFIX;
            GpelVariable ifVar = new GpelVariable(this.process.xml().getNamespace(), variable);
            XmlNamespace xsdNS = process.xml().lookupNamespaceByName(WSConstants.XSD_NS_URI);
            if (null != xsdNS && xsdNS.getPrefix() != null) {
                ifVar.xml().setAttributeValue("element",
                        xsdNS.getPrefix() + ":" + WSConstants.XSD_ANY_TYPE.getLocalPart());
            } else {
                this.process.xml().declareNamespace(WSConstants.XSD_NS);
                ifVar.xml().setAttributeValue("element",
                        WSConstants.XSD_NS.getPrefix() + ":" + WSConstants.XSD_ANY_TYPE.getLocalPart());
            }
View Full Code Here

        WsdlPortType portType = this.workflowWSDL.addReceivePortType(operationName, node);
        QName portTypeQName = portType.getQName();

        // Partner link
        String partnerLinkName = createPartnerLinkName(id);
        XmlNamespace partnerLinkTypeNS = this.targetNamespace;
        String partnerLinkTypeName = id + PARTNER_LINK_TYPE_SUFFIX;
        String myRollName = id + MY_ROLE_SUFFIX;
        this.process.addPartnerLink(partnerLinkName, partnerLinkTypeNS, partnerLinkTypeName, myRollName, null);
        this.workflowWSDL.addPartnerLinkTypeAndRoll(partnerLinkTypeName, myRollName, portTypeQName);
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

     */
    public static EventType getType(XmlElement event) {
        if (event == null) {
            throw new IllegalArgumentException("null");
        }
        XmlNamespace ns = event.getNamespace();
        String name = event.getName();
        if (XBAYA_EVENTS_NS.equals(ns)) {
            if (GOT_RESULT_EVENT_TAG.equals(name)) {
                return EventType.WORKFLOW_TERMINATED;
            } else {
View Full Code Here

     */
    public static EventType getType(XmlElement event) {
        if (event == null) {
            throw new IllegalArgumentException("null");
        }
        XmlNamespace ns = event.getNamespace();
        String name = event.getName();
        if (XBAYA_EVENTS_NS.equals(ns)) {
            if (GOT_RESULT_EVENT_TAG.equals(name)) {
                return EventType.WORKFLOW_TERMINATED;
            } else {
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.