1 /*2 * The contents of this file are subject to the terms of the Common Development3 * and Distribution License (the License). You may not use this file except in4 * compliance with the License.5 * 6 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html7 * or http://www.netbeans.org/cddl.txt.8 * 9 * When distributing Covered Code, include this CDDL Header Notice in each file10 * and include the License file at http://www.netbeans.org/cddl.txt.11 * If applicable, add the following below the CDDL Header, with the fields12 * enclosed by brackets [] replaced by your own identifying information:13 * "Portions Copyrighted [year] [name of copyright owner]"14 * 15 * The Original Software is NetBeans. The Initial Developer of the Original16 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun17 * Microsystems, Inc. All Rights Reserved.18 */19 20 package org.netbeans.modules.xml.wsdlextui.template;21 22 import java.io.InputStream ;23 import java.util.Collection ;24 import java.util.Iterator ;25 import java.util.List ;26 import org.netbeans.modules.xml.wsdl.model.Binding;27 import org.netbeans.modules.xml.wsdl.model.BindingFault;28 import org.netbeans.modules.xml.wsdl.model.BindingInput;29 import org.netbeans.modules.xml.wsdl.model.BindingOperation;30 import org.netbeans.modules.xml.wsdl.model.BindingOutput;31 import org.netbeans.modules.xml.wsdl.model.ExtensibilityElement;32 import org.netbeans.modules.xml.wsdl.model.Operation;33 import org.netbeans.modules.xml.wsdl.model.Port;34 import org.netbeans.modules.xml.wsdl.model.PortType;35 import org.netbeans.modules.xml.wsdl.model.WSDLModel;36 import org.netbeans.modules.xml.wsdl.model.extensions.soap.SOAPBinding;37 import org.netbeans.modules.xml.wsdl.model.extensions.soap.SOAPBody;38 39 import org.netbeans.modules.xml.wsdl.ui.spi.ExtensibilityElementTemplateProvider;40 import org.netbeans.modules.xml.wsdl.ui.spi.ValidationInfo;41 import org.netbeans.modules.xml.xam.Reference;42 import org.openide.util.NbBundle;43 44 public class SoapTemplateProvider extends ExtensibilityElementTemplateProvider {45 46 static final String soapTemplateUrl = "/org/netbeans/modules/xml/wsdlextui/template/template.xml";47 48 49 public InputStream getTemplateInputStream() {50 return SoapTemplateProvider.class.getResourceAsStream(soapTemplateUrl);51 }52 53 54 public String getLocalizedMessage(String str, Object [] objects) {55 return NbBundle.getMessage(SoapTemplateProvider.class, str, objects);56 }57 58 /**59 * Do any post processing on Binding and its child elements based on60 * the information available in corresponding PortType. This will be called61 * when binding is about to be added to definition. Note this binding is not yet added to definition.62 * @param wsdlTargetNamespace targetNamespace of wsdl where this binding will be added.63 * @param binding Binding for portType64 */65 public void postProcess(String wsdlTargetNamespace, Binding binding) {66 SoapBindingPostProcessor processor = new SoapBindingPostProcessor();67 processor.postProcess(wsdlTargetNamespace, binding);68 }69 70 public void postProcess(String wsdlTargetNamespace, Port port) {71 SoapBindingPostProcessor processor = new SoapBindingPostProcessor();72 processor.postProcess(wsdlTargetNamespace, port);73 }74 75 /**76 * validate Binding and its child elements based on77 * the information available in corresponding PortType. This will be called78 * when binding user goes from portType configuration wizard to binding79 * configuration or when user changes subtype of binding in binding configuration.80 * Note this binding is not yet added to definition.81 * @param binding Binding for portType82 */83 public List <ValidationInfo> validate(Binding binding) {84 SoapBindingValidator validator = new SoapBindingValidator();85 return validator.validate(binding);86 }87 88 public List <ValidationInfo> validate(Port port) {89 return null;90 }91 92 93 94 95 96 }97