Package org.xmlpull.infoset

Examples of org.xmlpull.infoset.XmlNamespace


            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


                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,
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

            // 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

     */
    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

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

        return element;
    }

    private void setTypeAttribute(XmlElement element, QName type) {
        String namespaceURI = type.getNamespaceURI();
        XmlNamespace namespace = element.lookupNamespaceByName(namespaceURI);
        element.setAttributeValue(WSConstants.TYPE_ATTRIBUTE, namespace
                .getPrefix()
                + ":" + type.getLocalPart());

    }
View Full Code Here

            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());
        }
    }
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

   */
  private String findNamespacePrefix(GpelProcess gpelProcess,
      QName messageQname) {
    Iterator<XmlNamespace> iterator = gpelProcess.xml().namespaces().iterator();
    while (iterator.hasNext()) {
      XmlNamespace xmlNamespace = (XmlNamespace) iterator.next();
      if(xmlNamespace.getName().equals(messageQname.getNamespaceURI())){
        return xmlNamespace.getPrefix();
      }
    }
   
    throw new XBayaRuntimeException("Cannot locate the Namespace  for Qname:"+messageQname+" in the BPEL");
  }
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.