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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations