Beispiel #1
0
 public static void rebuildBinaries() {
   if (Window.confirm(Constants.INSTANCE.SnapshotRebuildWarning())) {
     LoadingPopup.showMessage(
         Constants.INSTANCE.RebuildingSnapshotsPleaseWaitThisMayTakeSomeTime());
     ModuleServiceAsync moduleService = GWT.create(ModuleService.class);
     moduleService.rebuildSnapshots(
         new GenericCallback<java.lang.Void>() {
           public void onSuccess(Void v) {
             LoadingPopup.close();
             Window.alert(Constants.INSTANCE.SnapshotsWereRebuiltSuccessfully());
           }
         });
   }
 }
Beispiel #2
0
  private Widget getCompareWidget(final String packageName, final String snapshotName) {
    HorizontalPanel hPanel = new HorizontalPanel();
    hPanel.add(new Label("Compare to:"));

    ModuleServiceAsync moduleService = GWT.create(ModuleService.class);
    moduleService.listSnapshots(
        this.parentConf.getName(),
        new GenericCallback<SnapshotInfo[]>() {
          public void onSuccess(SnapshotInfo[] info) {
            for (int i = 0; i < info.length; i++) {
              if (!snapshotName.equals(info[i].getName())) {
                box.addItem(info[i].getName());
              }
            }
          }
        });
    hPanel.add(box);

    Button button = new Button("Compare");
    button.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            if (table != null) {
              vert.remove(table);
            }
            table =
                new SnapshotComparisonPagedTable(
                    packageName,
                    snapshotName,
                    box.getItemText(box.getSelectedIndex()),
                    clientFactory);
            vert.add(table);
          }
        });

    hPanel.add(button);

    return hPanel;
  }
  private void refreshModuleList(String selectedWorkspaceName) {
    if (selectedWorkspaceName == null || "".equals(selectedWorkspaceName)) {
      return;
    }

    LoadingPopup.showMessage(constants.LoadingWorkspaces());
    moduleService.listModules(
        selectedWorkspaceName,
        new GenericCallback<Module[]>() {
          public void onSuccess(Module[] packageConfigData) {
            selectedModulesListBox.clear();
            for (Module p : packageConfigData) {
              selectedModulesListBox.addItem(p.getName());
            }
            LoadingPopup.close();
          }
        });

    LoadingPopup.showMessage(constants.LoadingWorkspaces());
    moduleService.listModules(
        new GenericCallback<Module[]>() {
          public void onSuccess(Module[] packageConfigData) {
            availableModulesListBox.clear();
            for (Module p : packageConfigData) {
              boolean isSelected = false;
              for (int i = 0; i < selectedModulesListBox.getItemCount(); i++) {
                if (p.getName().equals(selectedModulesListBox.getItemText(i))) {
                  isSelected = true;
                }
              }
              if (!isSelected) {
                availableModulesListBox.addItem(p.getName());
              }
            }
            LoadingPopup.close();
          }
        });
  }
Beispiel #4
0
  /** This should popup a view of the chosen historical version. */
  private void showVersion(final String versionUUID) {

    LoadingPopup.showMessage(constants.LoadingVersionFromHistory());

    if (isPackage) {
      ModuleServiceAsync moduleService = GWT.create(ModuleService.class);
      moduleService.loadModule(
          versionUUID,
          new GenericCallback<Module>() {
            public void onSuccess(Module conf) {
              Image image = new Image(images.snapshot());
              image.setAltText(ConstantsCore.INSTANCE.Snapshot());
              final FormStylePopup pop =
                  new FormStylePopup(
                      image,
                      constants.VersionNumber0Of1(conf.getVersionNumber(), conf.getName()),
                      800);

              ModuleEditorWrapper ed = new ModuleEditorWrapper(conf, clientFactory, eventBus, true);
              ed.setWidth("100%");
              ed.setHeight("100%");
              // pop.addRow( restore );
              pop.addRow(ed);
              pop.show();

              // LoadingPopup.close();
            }
          });
    } else {
      AssetServiceAsync assetService = GWT.create(AssetService.class);
      assetService.loadRuleAsset(
          versionUUID,
          new GenericCallback<Asset>() {

            public void onSuccess(final Asset asset) {
              asset.setReadonly(true);
              // asset.metaData.name = metaData.name;
              Image image = new Image(images.snapshot());
              image.setAltText(ConstantsCore.INSTANCE.Snapshot());
              final FormStylePopup pop =
                  new FormStylePopup(
                      image,
                      constants.VersionNumber0Of1(asset.getVersionNumber(), asset.getName()),
                      800);

              Button restore = new Button(constants.RestoreThisVersion());
              restore.addClickHandler(
                  new ClickHandler() {

                    public void onClick(ClickEvent event) {
                      restore(
                          (Widget) event.getSource(),
                          versionUUID,
                          new Command() {
                            public void execute() {
                              eventBus.fireEvent(
                                  new RefreshAssetEditorEvent(
                                      asset.getMetaData().getModuleName(), uuid));
                              // fire after check-in event
                              eventBus.fireEvent(new AfterAssetEditorCheckInEvent(uuid, null));
                              pop.hide();
                            }
                          });
                    }
                  });

              RuleViewerWrapper viewer =
                  new RuleViewerWrapper(clientFactory, eventBus, asset, true);
              viewer.setWidth("100%");
              viewer.setHeight("100%");

              pop.addRow(restore);
              pop.addRow(viewer);
              pop.show();
            }
          });
    }
  }