Example #1
0
  /**
   * Get a ForceProject from an IProject.
   *
   * @param project
   * @return ForceProject
   */
  public ForceProject materializeForceProject(IProject project) {
    if (Utils.isEmpty(project) || !project.exists()) return null;

    ForceProject forceProject =
        ContainerDelegate.getInstance()
            .getServiceLocator()
            .getProjectService()
            .getForceProject(project);
    return forceProject;
  }
Example #2
0
  /**
   * Initialize Tooling connection.
   *
   * @param forceProject
   * @throws ForceConnectionException
   * @throws ForceRemoteException
   */
  private void initializeConnection(ForceProject forceProject)
      throws ForceConnectionException, ForceRemoteException {
    if (toolingRESTConnection != null && toolingStubExt != null) return;

    toolingRESTConnection = new HTTPConnection(forceProject, TOOLING_ENDPOINT);
    toolingRESTConnection.initialize();
    toolingStubExt =
        ContainerDelegate.getInstance()
            .getFactoryLocator()
            .getToolingFactory()
            .getToolingStubExt(forceProject);
  }
  protected void prepareResultsViewComposite(
      DeploymentResultsComposite resultsComposite,
      DeploymentController deploymentWizardController) {

    DeploymentResult deploymentResult = deploymentWizardController.getDeploymentResult();
    if (deploymentResult == null) {
      logger.warn(
          DeploymentMessages.getString("DeploymentWizard.BaseDeploymentPage.NoResults.message"));
      Utils.openQuestion(
          DeploymentMessages.getString("DeploymentWizard.BaseDeploymentPage.NoResults.title"),
          DeploymentMessages.getString("DeploymentWizard.BaseDeploymentPage.NoResults.message"));
      return;
    }

    // set page description
    resultsComposite.setLblResult(deploymentResult.isSuccess());
    DeployResultExt result = deploymentResult.getDeployResultHandler();
    if (!deploymentResult.isSuccess()) {
      if (result != null && result.getMessageCount() == 0) {
        resultsComposite.setLblReason(result.getMessageHandler().getDisplayMessages()[0]);
      } else if (result != null && result.getMessageCount() > 1) {
        resultsComposite.setLblReason(
            DeploymentMessages.getString("DeploymentWizard.Results.MultipleProblems.message"));
      }
    } else {
      resultsComposite.setLblReason(
          DeploymentMessages.getString("DeploymentWizard.Results.Success.message"));
    }

    // create results tree
    DeployResultsViewAssembler assembler =
        new DeployResultsViewAssembler(
            result == null ? new EmptyDeployResultExt() : result,
            resultsComposite.getTreeResults(),
            deploymentWizardController.getProject(),
            ContainerDelegate.getInstance().getServiceLocator().getProjectService());
    assembler.assembleDeployResultsTree();

    LogViewShell logView =
        new LogViewShell(
            getShell(),
            deploymentResult.getDeployLog(),
            deploymentResult.getRemoteDeployLog(),
            deploymentWizardController.getDeploymentWizardModel().getProjectName());
    resultsComposite.setLogShellView(logView);
  }
 public SalesforceEndpoints getSalesforceEndpoints() {
   return ContainerDelegate.getInstance()
       .getFactoryLocator()
       .getConnectionFactory()
       .getSalesforceEndpoints();
 }
Example #5
0
 protected IContainerDelegate getContainerInstance() throws ForceProjectException {
   return ContainerDelegate.getInstance();
 }