# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: C:\nam\gavotte\xml\wsdl\api # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: src/org/netbeans/modules/xml/wsdl/model/extensions/xsd/impl/SchemaReferenceImpl.java *** C:\nam\gavotte\xml\wsdl\api\src\org\netbeans\modules\xml\wsdl\model\extensions\xsd\impl\SchemaReferenceImpl.java Base (1.2.2.7) --- C:\nam\gavotte\xml\wsdl\api\src\org\netbeans\modules\xml\wsdl\model\extensions\xsd\impl\SchemaReferenceImpl.java Locally Modified (Based On 1.2.2.7) *************** *** 19,38 **** package org.netbeans.modules.xml.wsdl.model.extensions.xsd.impl; - import java.util.List; import javax.xml.XMLConstants; import org.netbeans.modules.xml.schema.model.ReferenceableSchemaComponent; import org.netbeans.modules.xml.schema.model.Schema; import org.netbeans.modules.xml.schema.model.SchemaModel; import org.netbeans.modules.xml.schema.model.SchemaModelFactory; ! import org.netbeans.modules.xml.schema.model.visitor.FindGlobalReferenceVisitor; ! import org.netbeans.modules.xml.wsdl.model.WSDLModel; import org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent; import org.netbeans.modules.xml.xam.dom.AbstractNamedComponentReference; import org.netbeans.modules.xml.xam.dom.NamedComponentReference; /** --- 19,39 ---- package org.netbeans.modules.xml.wsdl.model.extensions.xsd.impl; import javax.xml.XMLConstants; import org.netbeans.modules.xml.schema.model.ReferenceableSchemaComponent; import org.netbeans.modules.xml.schema.model.Schema; import org.netbeans.modules.xml.schema.model.SchemaModel; import org.netbeans.modules.xml.schema.model.SchemaModelFactory; ! import org.netbeans.modules.xml.schema.model.impl.SchemaImpl; ! import org.netbeans.modules.xml.schema.model.impl.SchemaModelImpl; ! import org.netbeans.modules.xml.wsdl.model.Import; ! import org.netbeans.modules.xml.wsdl.model.impl.ImportImpl; ! import org.netbeans.modules.xml.wsdl.model.spi.WSDLComponentBase; import org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent; import org.netbeans.modules.xml.xam.dom.AbstractNamedComponentReference; + import org.netbeans.modules.xml.xam.dom.DocumentModel; import org.netbeans.modules.xml.xam.dom.NamedComponentReference; + import org.netbeans.modules.xml.xam.locator.CatalogModelException; /** * *************** *** 51,90 **** super(type, parent, refString); } ! protected List findSchemas(String namespace) { ! List schemas = ((WSDLModel)getParent().getModel()).findSchemas(namespace); ! if (schemas.isEmpty() && XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(namespace)) { SchemaModel primitiveModel = SchemaModelFactory.getDefault().getPrimitiveTypesModel(); ! schemas.add(primitiveModel.getSchema()); } - return schemas; } ! ! public T get() { ! if (super.getReferenced() == null) { ! List schemas = findSchemas(getEffectiveNamespace()); ! for (Schema schema : schemas) { ! String localName = getLocalName(); ! T target = getType().cast(new FindGlobalReferenceVisitor().find(getType(), localName, schema)); if (target != null) { - setReferenced(target); break; } } } return getReferenced(); } public String getEffectiveNamespace() { if (refString == null) { assert getReferenced() != null; return getReferenced().getModel().getSchema().getTargetNamespace(); } else { ! return ((AbstractDocumentComponent)getParent()).lookupNamespaceURI(getPrefix()); } } } --- 55,119 ---- super(type, parent, refString); } ! public T get() { ! if (getReferenced() == null) { ! String localName = getLocalName(); ! String namespace = getEffectiveNamespace(); ! T target = null; ! ! if (XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(namespace)) { SchemaModel primitiveModel = SchemaModelFactory.getDefault().getPrimitiveTypesModel(); ! target = ((SchemaModelImpl)primitiveModel).resolve(namespace, localName, getType()); ! } else { ! for (Schema s : getParent().getModel().getDefinitions().getTypes().getSchemas()) { ! target = ((SchemaImpl)s).getModel().resolve(namespace, localName, getType()); ! if (target != null) { ! break; } } ! if (target == null) { ! for (Import i : getParent().getModel().getDefinitions().getImports()) { ! DocumentModel m = null; ! try { ! m = ((ImportImpl)i).resolveImportedModel(); ! } catch(CatalogModelException ex) { ! // checked for null so ignore ! } ! if (m instanceof SchemaModelImpl) { ! target = ((SchemaModelImpl)m).resolve(namespace, localName, getType()); ! } if (target != null) { break; } } } + } + + if (target != null) { + setReferenced(target); + } + } return getReferenced(); } + public WSDLComponentBase getParent() { + return (WSDLComponentBase) super.getParent(); + } + public String getEffectiveNamespace() { if (refString == null) { assert getReferenced() != null; return getReferenced().getModel().getSchema().getTargetNamespace(); } else { ! if (getPrefix() == null) { ! return null; ! } else { ! return getParent().lookupNamespaceURI(getPrefix()); } } } + } Index: src/org/netbeans/modules/xml/wsdl/model/impl/GlobalReferenceImpl.java *** C:\nam\gavotte\xml\wsdl\api\src\org\netbeans\modules\xml\wsdl\model\impl\GlobalReferenceImpl.java Base (1.2.2.6) --- C:\nam\gavotte\xml\wsdl\api\src\org\netbeans\modules\xml\wsdl\model\impl\GlobalReferenceImpl.java Locally Modified (Based On 1.2.2.6) *************** *** 20,35 **** package org.netbeans.modules.xml.wsdl.model.impl; import org.netbeans.modules.xml.wsdl.model.Definitions; import org.netbeans.modules.xml.wsdl.model.ReferenceableWSDLComponent; import org.netbeans.modules.xml.wsdl.model.WSDLModel; import org.netbeans.modules.xml.wsdl.model.spi.WSDLComponentBase; import org.netbeans.modules.xml.wsdl.model.visitor.FindReferencedVisitor; - import org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent; import org.netbeans.modules.xml.xam.dom.AbstractNamedComponentReference; import org.netbeans.modules.xml.xam.dom.NamedComponentReference; /** --- 20,33 ---- package org.netbeans.modules.xml.wsdl.model.impl; import org.netbeans.modules.xml.wsdl.model.Definitions; + import org.netbeans.modules.xml.wsdl.model.Import; import org.netbeans.modules.xml.wsdl.model.ReferenceableWSDLComponent; import org.netbeans.modules.xml.wsdl.model.WSDLModel; import org.netbeans.modules.xml.wsdl.model.spi.WSDLComponentBase; import org.netbeans.modules.xml.wsdl.model.visitor.FindReferencedVisitor; import org.netbeans.modules.xml.xam.dom.AbstractNamedComponentReference; import org.netbeans.modules.xml.xam.dom.NamedComponentReference; + import org.netbeans.modules.xml.xam.locator.CatalogModelException; /** * *************** *** 62,82 **** WSDLComponentBase wparent = WSDLComponentBase.class.cast(getParent()); if (super.getReferenced() == null) { String localName = getLocalName(); T target = null; ! for (WSDLModel model : wparent.getWSDLModel().findWSDLModel(getEffectiveNamespace())) { target = new FindReferencedVisitor(model.getDefinitions()).find(localName, getType()); if (target != null) { break; } } setReferenced(target); } return getReferenced(); } public String getEffectiveNamespace() { if (refString == null) { --- 63,99 ---- WSDLComponentBase wparent = WSDLComponentBase.class.cast(getParent()); if (super.getReferenced() == null) { String localName = getLocalName(); + String namespace = getEffectiveNamespace(); + WSDLModel model = wparent.getWSDLModel(); T target = null; ! if (namespace != null && namespace.equals(model.getDefinitions().getTargetNamespace())) { target = new FindReferencedVisitor(model.getDefinitions()).find(localName, getType()); + } + if (target == null) { + for (Import i : wparent.getWSDLModel().getDefinitions().getImports()) { + if (! i.getNamespace().equals(namespace)) { + continue; + } + try { + model = i.getImportedWSDLModel(); + } catch(CatalogModelException ex) { + continue; + } + target = new FindReferencedVisitor(model.getDefinitions()).find(localName, getType()); if (target != null) { break; } } + } setReferenced(target); } return getReferenced(); } + public WSDLComponentBase getParent() { + return (WSDLComponentBase) super.getParent(); + } + public String getEffectiveNamespace() { if (refString == null) { assert getReferenced() != null;