Search in sources :

Example 51 with XmlSchemaComplexType

use of org.apache.ws.commons.schema.XmlSchemaComplexType in project convertigo by convertigo.

the class StepWithExpressions method getXmlSchemaParticle.

protected XmlSchemaParticle getXmlSchemaParticle(XmlSchemaCollection collection, XmlSchema schema, XmlSchemaGroupBase group) {
    XmlSchemaParticle particle = group;
    if (isOutput()) {
        XmlSchemaElement element = (XmlSchemaElement) super.getXmlSchemaObject(collection, schema);
        XmlSchemaComplexType cType = XmlSchemaUtils.makeDynamic(this, new XmlSchemaComplexType(schema));
        SchemaMeta.setContainerXmlSchemaGroupBase(element, group);
        element.setType(cType);
        cType.setParticle(group);
        particle = element;
    }
    return particle;
}
Also used : XmlSchemaElement(org.apache.ws.commons.schema.XmlSchemaElement) XmlSchemaParticle(org.apache.ws.commons.schema.XmlSchemaParticle) XmlSchemaComplexType(org.apache.ws.commons.schema.XmlSchemaComplexType)

Example 52 with XmlSchemaComplexType

use of org.apache.ws.commons.schema.XmlSchemaComplexType in project convertigo by convertigo.

the class Transaction method addSchemaResponseElement.

protected XmlSchemaElement addSchemaResponseElement(XmlSchema xmlSchema) {
    String nsURI = xmlSchema.getTargetNamespace();
    String prefix = xmlSchema.getNamespaceContext().getPrefix(nsURI);
    String localName = getXsdResponseElementName();
    XmlSchemaElement xmlSchemaElement = new XmlSchemaElement();
    xmlSchemaElement.setName(localName);
    xmlSchemaElement.setQName(new QName(nsURI, localName, prefix));
    XmlSchemaComplexType xmlSchemaComplexType = new XmlSchemaComplexType(xmlSchema);
    XmlSchemaSequence xmlSchemaSequence = new XmlSchemaSequence();
    XmlSchemaElement responseElement = new XmlSchemaElement();
    responseElement.setName("response");
    responseElement.setSchemaTypeName(new QName(nsURI, getXsdResponseTypeName(), prefix));
    xmlSchemaSequence.getItems().add(responseElement);
    xmlSchemaComplexType.setParticle(xmlSchemaSequence);
    xmlSchemaElement.setSchemaType(xmlSchemaComplexType);
    XmlSchemaUtils.add(xmlSchema, xmlSchemaElement);
    return xmlSchemaElement;
}
Also used : XmlSchemaSequence(org.apache.ws.commons.schema.XmlSchemaSequence) XmlSchemaElement(org.apache.ws.commons.schema.XmlSchemaElement) QName(javax.xml.namespace.QName) XmlSchemaComplexType(org.apache.ws.commons.schema.XmlSchemaComplexType)

Example 53 with XmlSchemaComplexType

use of org.apache.ws.commons.schema.XmlSchemaComplexType in project convertigo by convertigo.

the class TransactionWithVariables method addSchemaRequestDataType.

@Override
protected XmlSchemaComplexType addSchemaRequestDataType(XmlSchema xmlSchema) {
    XmlSchemaComplexType xmlSchemaComplexType = super.addSchemaRequestDataType(xmlSchema);
    int len = numberOfVariables();
    if (len > 0) {
        XmlSchemaSequence xmlSchemaSequence = new XmlSchemaSequence();
        for (int i = 0; i < len; i++) {
            RequestableVariable variable = (RequestableVariable) getVariable(i);
            if (variable.isWsdl()) {
                XmlSchemaElement xmlSchemaElement = new XmlSchemaElement();
                xmlSchemaElement.setName(variable.getName());
                if (variable.isMultiValued()) {
                    xmlSchemaElement.setMaxOccurs(Long.MAX_VALUE);
                }
                // String[] qn = variable.getSchemaType().split(":");
                // QName typeName = new QName(xmlSchema.getNamespaceContext().getNamespaceURI(qn[0]), qn[1], qn[0]);
                // xmlSchemaElement.setSchemaTypeName(typeName);
                xmlSchemaElement.setSchemaTypeName(variable.getTypeAffectation());
                addSchemaCommentAnnotation(xmlSchemaElement, variable.getComment(), variable.getDescription());
                xmlSchemaSequence.getItems().add(xmlSchemaElement);
            }
        }
        xmlSchemaComplexType.setParticle(xmlSchemaSequence);
    }
    return xmlSchemaComplexType;
}
Also used : XmlSchemaSequence(org.apache.ws.commons.schema.XmlSchemaSequence) XmlSchemaElement(org.apache.ws.commons.schema.XmlSchemaElement) XmlSchemaComplexType(org.apache.ws.commons.schema.XmlSchemaComplexType) RequestableVariable(com.twinsoft.convertigo.beans.variables.RequestableVariable)

Example 54 with XmlSchemaComplexType

use of org.apache.ws.commons.schema.XmlSchemaComplexType in project convertigo by convertigo.

the class SessionGetObjectStep method getXmlSchemaObject.

@Override
public XmlSchemaElement getXmlSchemaObject(XmlSchemaCollection collection, XmlSchema schema) {
    XmlSchemaElement element = XmlSchemaUtils.makeDynamic(this, new XmlSchemaElement());
    element.setName(getStepNodeName());
    if (!getXmlElementRefAffectation().isEmpty()) {
        XmlSchemaComplexType eType = XmlSchemaUtils.makeDynamic(this, new XmlSchemaComplexType(schema));
        element.setType(eType);
        XmlSchemaSequence eSequence = XmlSchemaUtils.makeDynamic(this, new XmlSchemaSequence());
        eType.setParticle(eSequence);
        SchemaMeta.setContainerXmlSchemaGroupBase(element, eSequence);
        XmlSchemaElement el = XmlSchemaUtils.makeDynamic(this, new XmlSchemaElement());
        eSequence.getItems().add(el);
        el.setRefName(getElementRefAffectation());
        el.setMinOccurs(0);
        el.setMaxOccurs(1);
    } else {
        XmlQName xmlQName = getXmlComplexTypeAffectation();
        if (xmlQName.isEmpty()) {
            xmlQName = getXmlSimpleTypeAffectation();
            if (xmlQName.isEmpty()) {
                xmlQName = new XmlQName(Constants.XSD_STRING);
            }
        }
        element.setSchemaTypeName(xmlQName.getQName());
    }
    return element;
}
Also used : XmlSchemaSequence(org.apache.ws.commons.schema.XmlSchemaSequence) XmlQName(com.twinsoft.convertigo.beans.common.XmlQName) XmlSchemaElement(org.apache.ws.commons.schema.XmlSchemaElement) XmlSchemaComplexType(org.apache.ws.commons.schema.XmlSchemaComplexType)

Example 55 with XmlSchemaComplexType

use of org.apache.ws.commons.schema.XmlSchemaComplexType in project convertigo by convertigo.

the class SessionRemoveStep method getXmlSchemaObject.

@Override
public XmlSchemaElement getXmlSchemaObject(XmlSchemaCollection collection, XmlSchema schema) {
    XmlSchemaElement element = XmlSchemaUtils.makeDynamic(this, new XmlSchemaElement());
    element.setName(getStepNodeName());
    QName qname = new QName(schema.getTargetNamespace(), "SessionRemoveObjectType");
    if (schema.getTypeByName(qname) == null) {
        XmlSchemaComplexType eType = new XmlSchemaComplexType(schema);
        eType.setName("SessionRemoveObjectType");
        XmlSchemaSimpleContent sContent = new XmlSchemaSimpleContent();
        eType.setContentModel(sContent);
        XmlSchemaSimpleContentExtension sContentExt = new XmlSchemaSimpleContentExtension();
        sContentExt.setBaseTypeName(Constants.XSD_STRING);
        sContent.setContent(sContentExt);
        XmlSchemaAttribute attribute = new XmlSchemaAttribute();
        attribute.setName("key");
        attribute.setSchemaTypeName(Constants.XSD_STRING);
        sContentExt.getAttributes().add(attribute);
        schema.addType(eType);
        schema.getItems().add(eType);
    }
    element.setSchemaTypeName(qname);
    return element;
}
Also used : XmlSchemaSimpleContentExtension(org.apache.ws.commons.schema.XmlSchemaSimpleContentExtension) XmlSchemaSimpleContent(org.apache.ws.commons.schema.XmlSchemaSimpleContent) XmlSchemaElement(org.apache.ws.commons.schema.XmlSchemaElement) QName(javax.xml.namespace.QName) XmlSchemaComplexType(org.apache.ws.commons.schema.XmlSchemaComplexType) XmlSchemaAttribute(org.apache.ws.commons.schema.XmlSchemaAttribute)

Aggregations

XmlSchemaComplexType (org.apache.ws.commons.schema.XmlSchemaComplexType)136 XmlSchemaElement (org.apache.ws.commons.schema.XmlSchemaElement)101 XmlSchemaSequence (org.apache.ws.commons.schema.XmlSchemaSequence)71 QName (javax.xml.namespace.QName)59 XmlSchemaSimpleType (org.apache.ws.commons.schema.XmlSchemaSimpleType)33 XmlSchema (org.apache.ws.commons.schema.XmlSchema)32 XmlSchemaType (org.apache.ws.commons.schema.XmlSchemaType)31 XmlSchemaAttribute (org.apache.ws.commons.schema.XmlSchemaAttribute)23 XmlSchemaObject (org.apache.ws.commons.schema.XmlSchemaObject)20 XmlSchemaObjectCollection (org.apache.ws.commons.schema.XmlSchemaObjectCollection)18 Test (org.junit.Test)18 XmlSchemaParticle (org.apache.ws.commons.schema.XmlSchemaParticle)16 XmlSchemaComplexContentExtension (org.apache.ws.commons.schema.XmlSchemaComplexContentExtension)15 ArrayList (java.util.ArrayList)13 XmlSchemaGroupBase (org.apache.ws.commons.schema.XmlSchemaGroupBase)12 XmlSchemaSequenceMember (org.apache.ws.commons.schema.XmlSchemaSequenceMember)12 XmlSchemaSimpleContentExtension (org.apache.ws.commons.schema.XmlSchemaSimpleContentExtension)12 XmlSchemaComplexContentRestriction (org.apache.ws.commons.schema.XmlSchemaComplexContentRestriction)8 FeatureMetacardType (org.codice.ddf.spatial.ogc.wfs.catalog.common.FeatureMetacardType)8 ParameterInfo (org.talend.designer.webservice.ws.wsdlinfo.ParameterInfo)8