public static List<WSDLModel> getNonImportedModels(TMapModel tMapModel, PortType ptTreeFilter) {
    assert tMapModel != null;
    List<WSDLModel> result = new ArrayList<WSDLModel>();
    Project project = SoaUtil.getProject(SoaUtil.getFileObjectByModel(tMapModel));
    if (project == null) {
      LOGGER.log(
          Level.WARNING,
          NbBundle.getMessage(ServiceParamTreeModel.class, "MSG_EMPTY_PROJECT")); // NOI18N
      return result;
    }
    List<FileObject> wsdlFiles = new ArrayList<FileObject>();
    List<ReferenceFile> projectWsdlFiles = ReferenceUtil.getWSDLResources(project);
    if (projectWsdlFiles == null) {
      return result;
    }
    for (ReferenceFile projectWSDL : projectWsdlFiles) {
      wsdlFiles.add(projectWSDL.getFile());
    }

    for (FileObject wsdlFo : wsdlFiles) {
      if (wsdlFo == null) {
        continue;
      }
      ModelSource ms = Utilities.getModelSource(wsdlFo, false);
      if (ms == null) {
        continue;
      }
      WSDLModel wsdlModel = WSDLModelFactory.getDefault().getModel(ms);
      if (wsdlModel != null && hasPortType(wsdlModel, ptTreeFilter)) {
        result.add(wsdlModel);
      }
    }

    result.removeAll(getImportedModels(tMapModel, ptTreeFilter));

    return result;
  }
Example #2
0
 public WSDLModel getImportModel() throws CatalogModelException {
   ModelSource ms = resolveModel(getLocation());
   return WSDLModelFactory.getDefault().getModel(ms);
 }