Add a new API to access all WSDL PortTypes. before_merge_pfe_newscope_root_trunk
authorjqian@netbeans.org
Tue, 05 Jun 2007 22:31:55 +0000
changeset 584baf7b01c59f4
parent 583 73366386ab56
child 585 307411fba7ea
Add a new API to access all WSDL PortTypes.
compapp.casaeditor/src/org/netbeans/modules/compapp/casaeditor/model/casa/CasaWrapperModel.java
     1.1 --- a/compapp.casaeditor/src/org/netbeans/modules/compapp/casaeditor/model/casa/CasaWrapperModel.java	Tue Jun 05 21:20:50 2007 +0000
     1.2 +++ b/compapp.casaeditor/src/org/netbeans/modules/compapp/casaeditor/model/casa/CasaWrapperModel.java	Tue Jun 05 22:31:55 2007 +0000
     1.3 @@ -903,7 +903,8 @@
     1.4  //        }
     1.5  //    }
     1.6      
     1.7 -    // mapping bc namspace to bc name?
     1.8 +    // Mapping binding component name to binding type, 
     1.9 +    // e.x., sun-ftp-binding => ftp. FIXME THIS IS WRONG!
    1.10      private Map<String, String> bcNameMap;
    1.11      
    1.12      // FIXME: should we get bcs from design time or run time?
    1.13 @@ -942,6 +943,27 @@
    1.14      }
    1.15      
    1.16      /**
    1.17 +     * Gets a list of WSDL PortTypes in the composite application and its 
    1.18 +     * JBI modules.
    1.19 +     */
    1.20 +    public List<PortType> getPortTypes() {
    1.21 +        List<PortType> ret = new ArrayList<PortType>();
    1.22 +        
    1.23 +        CasaPortTypes portTypes = getRootComponent().getPortTypes();
    1.24 +        for (CasaLink link : portTypes.getLinks()) {
    1.25 +            String href = link.getHref();
    1.26 +            try {
    1.27 +                PortType pt = (PortType) getWSDLComponentFromXLinkHref(href);
    1.28 +                ret.add(pt);
    1.29 +            } catch (Exception ex) {
    1.30 +                System.out.println("Failed to Fetch: " + href);
    1.31 +            }
    1.32 +        }
    1.33 +        
    1.34 +        return ret;
    1.35 +    }
    1.36 +    
    1.37 +    /**
    1.38       * Gets the WSDL PortType of a given CasaPort.
    1.39       */
    1.40      public PortType getCasaPortType(final CasaPort casaPort) {