WSDLEditor.WSDLWizardExtension

WSDL Wizard Extension

Web Service Description Language a.k.a WSDL supports multiple extensibility elements like binding/ports etc. Currently WSDL editor supports extension of UI elements for supporting multiple wsdl extensions i.e. various protocol bindings in addition to soap (like file, jms, scheduler, database etc). This has been supported since version 6.0. (See developers guide to use extension api's ).

The wsdl wizard provides standard panels for abstract type definition (portype creation) and concrete protocol binding configuration. The binding configuration panel utilizes the wsdl binding support SPI for automatically populating various values.

But the feedback received suggests that the auto population of common values is not enough, because most of the protocol bindings are non-standard, and editing values is cumbersome. And to overcome this problem, some of the complex binding components wrote their own wizards. The binding component developer needs to have a choice of customizing the wizard (rather than relying on standard panels), so that all important configuration can be done through the wizard. So it was proposed that the wsdl editor extension mechanism be improved to incorporate this.

Solution

The solution was to enable on-the-fly addition of new steps to the WSDL wizard based on values chosen. This enables different binding modules to provide their own WSDLWizardExtensionIterator, which provides customized steps. So when a particular type of binding is chosen, the custom iterator is plugged into the wsdl iterator, thus showing custom panels. It also provides following advantages:

  1. On the spot validation in the wizard.
  2. Provides for dependency validation. (if one property depends on value of another)
  3. Custom validation can be done. (e.g. Test database connection)
  4. Guidance through embedded help links on the dialog.
  5. Binding Component developers have full freedom to customize the usability of the binding configuration.

The new SPI/APIs are defined in xml.wsdl.bindingsupport.api module.

Changed SPI (new non-abstract methods in class):

org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider New Methods:

    /**
     * Implementation of this is required if there are wsdl template files defined in the template.xml
     * filePath parameter will provide the relative path specified in the wsdlTemplate file attribute.
     * Not abstract because, some implementation may not use this.
     * 
     * @param filePath relative path of the file
     * @return InputStream of the file
     */
     public InputStream getTemplateFileInputStream(String filePath) {
         return null;
     }
    
     /**
      * Implementation of this is required for customizing the wsdl wizard. If you do not want to add custom panels,
      * do not implement it the default wsdl iterator will be used.
      * 
      * 
      * @param context the WSDLWizardContext object
      * @return the iterator.
      */
     public WSDLWizardExtensionIterator getWSDLWizardExtensionIterator(WSDLWizardContext context) {
         return null;
     }

New SPI:

org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementConfigurationEditorProvider

    /**
     * Return the namespace for which this plugin provides components.
     * 
     * @return String namespace corresponding to BC's schema file.
     */
    public abstract String getNamespace();
    
    
    /**
     * Provides component at current context using qname and/or wsdlcomponent.
     * Return an appropriate EditorComponent corresponding to the qname and/or wsdlcomponent.
     * @param qname QName of the element in the wsdl
     * @param component WSDLComponent in the wsdl.
     * @return
     */
    public abstract ExtensibilityElementConfigurationEditorComponent getComponent(QName qname, WSDLComponent component);

    
    /**
     * If configuration is supported on the extensibility element, return true, else false.
     * @param qname qname of the extensibility element
     * @return boolean
     */
    public boolean isConfigurationSupported(QName qname) {
        return true;
    }
    
    /**Override if you want the dialog to be not modal.
     * 
     * @return boolean
     */
    public boolean isModal() {
        return true;
    }

    
    /**
     * The next two methods are interlinked. It allows for binding configuration per operation.
     * This is the entry point from casa editor, the skeleton template is loaded from the template.xml at this point.
     * It is recommended that the port and the link direction is cached and reused when the getComponent(Operation operation) is called.
     * 
     * @param component
     * @param linkDirection
     * @return
     */
    public void initOperationBasedEditingSupport(WSDLComponent component, String linkDirection) {
        
    }

    /**
     * Return the component for the operation. This can be called multiple times, so it is recommended to cache it.
     * 
     * @param operation
     * @return
     */
    public ExtensibilityElementConfigurationEditorComponent getOperationBasedEditorComponent(Operation operation) {
        return null;
    }


    /**
     * Called when OK is pressed in the dialog, commit all the panels related to each operation in the operation list.
     * 
     * @param operationList
     * @return true if successfully committed
     */
    public boolean commitOperationBasedEditor(ArrayList<Operation> operationList) {
        return false;
    }
    
    /**
     * Called when dialog is cancelled/closed, rollback all the panels related to each operation in the operation list.
     * Can be used to cleanup.
     * @param operationList
     */
    public void rollbackOperationBasedEditor(ArrayList<Operation> operationList) {
        
    }

  

Other new classes used by the SPI's.

Implementation

This has been implemented and tested on 6.1 codebase as part of http://hg.netbeans.org/soa-dev repository. And many binding modules (wsdlextensions.*) have successfully implemented the provided SPI.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo