Ejemplo n.º 1
0
 public void setFocus(Widget panel) {
   if (panel.getClass().equals(databaseOptionsPanel.getClass())) {
     deploymentOptionsPanel.setFocus();
   } else if (panel.getClass().equals(appBrowserPanel.getClass())) {
     projectOptionsPanel.setFocus();
   } else if (panel.getClass().equals(projectOptionsPanel.getClass())) {
     databaseOptionsPanel.setFocus();
   }
 }
Ejemplo n.º 2
0
 private void reset() {
   projectOptionsPanel.reset();
   appBrowserPanel.reset();
   databaseOptionsPanel.reset();
   deploymentOptionsPanel.reset();
   setupBreadCrumbs();
   deployerDeckPanel.showWidget(0);
   currentPanelIndex = 0;
 }
Ejemplo n.º 3
0
 private void setupBreadCrumbs() {
   String[] crumbs = {
     appBrowserPanel.getTitle(),
     projectOptionsPanel.getTitle(),
     databaseOptionsPanel.getTitle(),
     deploymentOptionsPanel.getTitle()
   };
   eventBus.fireEvent(new BreadCrumbEvent(BreadCrumbEvent.Action.SET_CRUMBS, crumbs));
 }
Ejemplo n.º 4
0
 private void setupDeployerDeckPanel() {
   deployerDeckPanel.add(appBrowserPanel);
   deployerDeckPanel.add(projectOptionsPanel);
   deployerDeckPanel.add(databaseOptionsPanel);
   deployerDeckPanel.add(deploymentOptionsPanel);
   appBrowserPanel.setTitle("Application Browser");
   projectOptionsPanel.setTitle("Project Options");
   databaseOptionsPanel.setTitle("Database Options");
   deploymentOptionsPanel.setTitle("Deployment Options");
   deployerDeckPanel.showWidget(0);
   appBrowserPanel.setHeight("");
   appBrowserPanel.setWidth("");
 }
Ejemplo n.º 5
0
  private void deployProject() {
    createdProjectName = deploymentOptionsPanel.getProjectName();

    ArrayList<String> paths = appBrowserPanel.getAppPaths();
    ArrayList<String> apptypes = appBrowserPanel.getAppTypes();
    ArrayList<String> appNames = appBrowserPanel.getAppNames();

    StringBuffer formBuilder = new StringBuffer();
    formBuilder.append("csrfmiddlewaretoken=");
    formBuilder.append(URL.encodeQueryString(jsVarHandler.getCSRFTokenURL()));

    formBuilder.append("&form-TOTAL_FORMS=");
    formBuilder.append(URL.encodeQueryString(String.valueOf(paths.size())));
    formBuilder.append("&form-INITIAL_FORMS=");
    formBuilder.append(URL.encodeQueryString(String.valueOf(0)));
    formBuilder.append("&form-MAX_NUM_FORMS=");

    for (int i = 0; i < paths.size(); i++) {
      formBuilder.append("&form-" + i + "-apptype=");
      formBuilder.append(apptypes.get(i));

      formBuilder.append("&form-" + i + "-apppath=");
      formBuilder.append(paths.get(i));

      formBuilder.append("&form-" + i + "-appname=");
      formBuilder.append(appNames.get(i));
    }

    formBuilder.append(deploymentOptionsPanel.getPostData());
    formBuilder.append(projectOptionsPanel.getPostData());
    formBuilder.append(databaseOptionsPanel.getPostData());

    RequestBuilder builder =
        new RequestBuilder(RequestBuilder.POST, "/deployments/" + createdProjectName + "/");
    builder.setHeader("Content-type", "application/x-www-form-urlencoded");
    // builder.setHeader(header, value);

    try {
      Request request =
          builder.sendRequest(
              formBuilder.toString(),
              new RequestCallback() {
                public void onError(Request request, Throwable exception) {
                  ErrorPanel ep = new ErrorPanel(clientFactory);
                  ep.errorHTML.setHTML("<p>Error Occured</p>");
                  deployerDeckPanel.add(ep);
                  deployerDeckPanel.showWidget(deployerDeckPanel.getWidgetIndex(ep));
                }

                public void onResponseReceived(Request request, Response response) {
                  if (response.getText().contains("Back to")) {
                    loadingPopup.hide();
                    eventBus.fireEvent(new AsyncRequestEvent("addProject", createdProjectName));
                  } else {
                    loadingPopup.hide();
                    ErrorPanel ep = new ErrorPanel(clientFactory);
                    ep.errorHTML.setHTML(response.getText());
                    deployerDeckPanel.add(ep);
                    deployerDeckPanel.showWidget(deployerDeckPanel.getWidgetIndex(ep));
                  }
                }
              });
    } catch (RequestException e) {

    }

    loadingPopup.setGlassEnabled(true);
    loadingPopup.setGlassStyleName(style.loadingGlass());
    loadingPopup.show();
    int left = (Window.getClientWidth() / 2) - 150;
    int top = (Window.getClientHeight() / 2) - 10;
    loadingPopup.setPopupPosition(left, top);
    loadingPopup.show();
  }