コード例 #1
0
  private boolean sourceHasProcedure() {
    if (!sourceModelExists()) {
      return false;
    }

    try {
      IResource sourceModel =
          ModelGeneratorWsdlUiUtil.getModelFile(
              this.importManager.getSourceModelLocation().getFullPath().toOSString(),
              this.sourceModelFileText.getText());

      ModelResource smr = ModelUtilities.getModelResourceForIFile((IFile) sourceModel, false);
      if (smr != null) {
        return FlatFileRelationalModelFactory.procedureExists(
            smr, FlatFileRelationalModelFactory.INVOKE);
      }
    } catch (ModelWorkspaceException ex) {
      ModelGeneratorWsdlUiConstants.UTIL.log(
          IStatus.ERROR,
          ex,
          NLS.bind(
              Messages.Error_DeterminingSourceModelHas_0_Procedure,
              FlatFileRelationalModelFactory.INVOKE));
    }

    return false;
  }
コード例 #2
0
  private boolean sourceModelHasSameConnectionProfile() {
    if (!sourceModelExists()) {
      return false;
    }

    try {
      IResource sourceModel =
          ModelGeneratorWsdlUiUtil.getModelFile(
              this.importManager.getSourceModelLocation().getFullPath().toOSString(),
              this.sourceModelFileText.getText());

      ModelResource smr = ModelUtilities.getModelResourceForIFile((IFile) sourceModel, false);
      if (smr != null) {
        IConnectionProfile profile = connectionInfoHelper.getConnectionProfile(smr);
        if (profile == null || this.importManager.getConnectionProfile() == null) {
          return false;
        }

        if (profile
            .getName()
            .equalsIgnoreCase(this.importManager.getConnectionProfile().getName())) {
          return true;
        }
      }
    } catch (ModelWorkspaceException ex) {
      ModelGeneratorWsdlUiConstants.UTIL.log(
          IStatus.ERROR, ex, Messages.Error_DeterminingSourceModelHasMatchingProfile);
    }

    return false;
  }
コード例 #3
0
  private boolean sourceModelExists() {
    if (this.importManager.getSourceModelLocation() == null) {
      return false;
    }

    return ModelGeneratorWsdlUiUtil.modelExists(
        importManager.getSourceModelLocation().getFullPath().toOSString(),
        this.sourceModelFileText.getText());
  }