Example #1
0
  /** open a category */
  public void openCategory(String title, String widgetID) {
    if (!explorerViewCenterPanel.showIfOpen(widgetID)) {
      final String categoryPath = widgetID.substring(widgetID.indexOf("-") + 1);
      final CategoryPagedTable table =
          new CategoryPagedTable(
              categoryPath,
              createEditEvent(),
              GWT.getModuleBaseURL()
                  + "feed/category?name="
                  + categoryPath
                  + "&viewUrl="
                  + Util.getSelfURL());
      final ServerPushNotification push =
          new ServerPushNotification() {
            public void messageReceived(PushResponse response) {
              if (response.messageType.equals("categoryChange")
                  && response.message.equals(categoryPath)) {
                table.refresh();
              }
            }
          };
      PushClient.instance().subscribe(push);
      table.addUnloadListener(
          new Command() {
            public void execute() {
              PushClient.instance().unsubscribe(push);
            }
          });

      explorerViewCenterPanel.addTab((constants.CategoryColon()) + title, table, widgetID);
    }
  }
Example #2
0
  /** open a state or category ! */
  public void openState(String title, String widgetID) {
    if (!explorerViewCenterPanel.showIfOpen(widgetID)) {
      final String stateName = widgetID.substring(widgetID.indexOf("-") + 1);
      final StatePagedTable table = new StatePagedTable(stateName, createEditEvent());

      final ServerPushNotification push =
          new ServerPushNotification() {
            public void messageReceived(PushResponse response) {
              if (response.messageType.equals("statusChange")
                  && (response.message).equals(stateName)) {
                table.refresh();
              }
            }
          };
      PushClient.instance().subscribe(push);
      table.addUnloadListener(
          new Command() {
            public void execute() {
              PushClient.instance().unsubscribe(push);
            }
          });

      explorerViewCenterPanel.addTab(constants.Status() + title, table, widgetID);
    }
  }
Example #3
0
 public void openVerifierView(String packageUuid, String packageName) {
   if (!explorerViewCenterPanel.showIfOpen("analysis" + packageUuid)) { // NON-NLS
     String m = constants.AnalysisForPackage(packageName);
     explorerViewCenterPanel.addTab(
         m,
         new AnalysisView(packageUuid, packageName, createEditEvent()),
         "analysis" + packageUuid);
   }
 }
Example #4
0
 private void openPerspectivesManager() {
   if (!explorerViewCenterPanel.showIfOpen(PERSPECTIVES_MANAGER)) {
     PerspectivesManagerView perspectivesManagerView = new PerspectivesManagerViewImpl();
     new PerspectivesManager(
         GWT.<ConfigurationServiceAsync>create(ConfigurationService.class),
         perspectivesManagerView);
     explorerViewCenterPanel.addTab(
         constants.PerspectivesConfiguration(), perspectivesManagerView, PERSPECTIVES_MANAGER);
   }
 }
Example #5
0
  public void openTestScenario(String packageUuid, String packageName) {

    if (!explorerViewCenterPanel.showIfOpen("scenarios" + packageUuid)) {
      String m = constants.ScenariosForPackage(packageName);
      explorerViewCenterPanel.addTab(
          m,
          new ScenarioPackageView(
              packageUuid, packageName, createEditEvent(), explorerViewCenterPanel),
          "scenarios" + packageUuid);
    }
  }
Example #6
0
  public void openSnapshotAssetList(
      final String name, final String uuid, final String[] assetTypes, String key) {
    if (!explorerViewCenterPanel.showIfOpen(key)) {
      AssetPagedTable table =
          new AssetPagedTable(uuid, Arrays.asList(assetTypes), null, createEditEvent());

      VerticalPanel vp = new VerticalPanel();
      vp.add(new HTML("<i><small>" + constants.SnapshotListingFor() + name + "</small></i>"));
      vp.add(table);
      explorerViewCenterPanel.addTab(constants.SnapshotItems(), vp, key);
    }
  }
Example #7
0
  /** Show the inbox of the given name. */
  public void openInbox(String title, final String inboxName) {
    if (!explorerViewCenterPanel.showIfOpen(inboxName)) {
      InboxPagedTable table;
      if (inboxName.equals(ExplorerNodeConfig.INCOMING_ID)) {
        table = new InboxIncomingPagedTable(inboxName, createEditEvent());

      } else {
        table = new InboxPagedTable(inboxName, createEditEvent());
      }
      explorerViewCenterPanel.addTab(title, table, inboxName);
    }
  }
Example #8
0
  /** Open a package editor if it is not already open. */
  public void openPackageEditor(final String uuid, final Command refPackageList) {

    if (!explorerViewCenterPanel.showIfOpen(uuid)) {
      LoadingPopup.showMessage(constants.LoadingPackageInformation());
      RepositoryServiceFactory.getPackageService()
          .loadPackageConfig(
              uuid,
              new GenericCallback<PackageConfigData>() {
                public void onSuccess(PackageConfigData conf) {
                  PackageEditorWrapper ed =
                      new PackageEditorWrapper(
                          conf,
                          new Command() {
                            public void execute() {
                              explorerViewCenterPanel.close(uuid);
                            }
                          },
                          refPackageList,
                          new OpenPackageCommand() {
                            public void open(String key, Command refreshPackageListCommand) {
                              openPackageEditor(key, refreshPackageListCommand);
                            }
                          });
                  explorerViewCenterPanel.addTab(conf.getName(), ed, conf.getUuid());
                  LoadingPopup.close();
                }
              });
    }
  }
Example #9
0
  public void openFind() {
    if (!explorerViewCenterPanel.showIfOpen("FIND")) { // NON-NLS
      explorerViewCenterPanel.addTab(
          constants.Find(),
          new QueryWidget(
              new OpenItemCommand() {

                public void open(String uuid) {
                  openAsset(uuid);
                }

                public void open(MultiViewRow[] rows) {
                  openAssetsToMultiView(rows);
                }
              }),
          "FIND"); // NON-NLS
    }
  }
Example #10
0
  public void openPackageViewAssets(
      final String packageUuid,
      final String packageName,
      String key,
      final List<String> formatInList,
      Boolean formatIsRegistered,
      final String itemName) {
    if (!explorerViewCenterPanel.showIfOpen(key)) {

      String feedUrl =
          GWT.getModuleBaseURL()
              + "feed/package?name="
              + packageName
              + "&viewUrl="
              + Util.getSelfURL()
              + "&status=*";
      final AssetPagedTable table =
          new AssetPagedTable(
              packageUuid, formatInList, formatIsRegistered, createEditEvent(), feedUrl);
      explorerViewCenterPanel.addTab(itemName + " [" + packageName + "]", table, key);

      final ServerPushNotification sub =
          new ServerPushNotification() {
            public void messageReceived(PushResponse response) {
              if (response.messageType.equals("packageChange")
                  && response.message.equals(packageName)) {
                table.refresh();
              }
            }
          };
      PushClient.instance().subscribe(sub);
      table.addUnloadListener(
          new Command() {
            public void execute() {
              PushClient.instance().unsubscribe(sub);
            }
          });
    }
  }
Example #11
0
  public void openAssetsToMultiView(MultiViewRow[] rows) {

    String blockingAssetName = null;
    final String[] uuids = new String[rows.length];
    final String[] names = new String[rows.length];

    for (int i = 0; i < rows.length; i++) {
      // Check if any of these assets are already opened.
      if (explorerViewCenterPanel.showIfOpen(rows[i].uuid)) {
        blockingAssetName = rows[i].name;
        break;
      }
      uuids[i] = rows[i].uuid;
      names[i] = rows[i].name;
    }

    if (blockingAssetName != null) {
      FormStylePopup popup =
          new FormStylePopup(
              images.information(),
              constants.Asset0IsAlreadyOpenPleaseCloseItBeforeOpeningMultiview(blockingAssetName));
      popup.show();
      return;
    }

    MultiViewEditor multiview = new MultiViewEditor(rows, createEditEvent());

    multiview.setCloseCommand(
        new Command() {
          public void execute() {
            explorerViewCenterPanel.close(Arrays.toString(uuids));
          }
        });

    explorerViewCenterPanel.addTab(Arrays.toString(names), multiview, uuids);
  }
Example #12
0
  /** Open an asset if it is not already open. */
  public void openAsset(final String uuid) {
    if (uuid.contains("<")) {
      return;
    }
    History.newItem("asset=" + uuid); // NON-NLS

    if (!explorerViewCenterPanel.showIfOpen(uuid)) {

      final boolean[] loading = {true};

      Timer t =
          new Timer() {
            public void run() {
              if (loading[0]) {
                LoadingPopup.showMessage(constants.LoadingAsset());
              }
            }
          };
      t.schedule(200);

      loadRuleAsset(uuid, loading);
    }
  }
Example #13
0
 public void openSnapshot(final SnapshotInfo snap) {
   if (!explorerViewCenterPanel.showIfOpen(snap.name + snap.uuid)) {
     LoadingPopup.showMessage(constants.LoadingSnapshot());
     RepositoryServiceFactory.getPackageService()
         .loadPackageConfig(
             snap.uuid,
             new GenericCallback<PackageConfigData>() {
               public void onSuccess(PackageConfigData conf) {
                 explorerViewCenterPanel.addTab(
                     constants.SnapshotLabel(snap.name),
                     new SnapshotView(
                         snap,
                         conf,
                         new Command() {
                           public void execute() {
                             explorerViewCenterPanel.close(snap.name + snap.uuid);
                           }
                         }),
                     snap.name + snap.uuid);
                 LoadingPopup.close();
               }
             });
   }
 }
Example #14
0
  public void openAdministrationSelection(int id) {

    switch (id) {
      case 0:
        if (!explorerViewCenterPanel.showIfOpen(CATMAN)) {
          explorerViewCenterPanel.addTab(
              constants.CategoryManager(), new CategoryManager(), CATMAN);
        }
        break;
      case 1:
        if (!explorerViewCenterPanel.showIfOpen(ARCHMAN)) {
          explorerViewCenterPanel.addTab(
              constants.ArchivedManager(), new ArchivedAssetManager(), ARCHMAN);
        }
        break;

      case 2:
        if (!explorerViewCenterPanel.showIfOpen(STATEMAN)) {
          explorerViewCenterPanel.addTab(constants.StateManager(), new StateManager(), STATEMAN);
        }
        break;
      case 3:
        if (!explorerViewCenterPanel.showIfOpen(BAKMAN)) {
          explorerViewCenterPanel.addTab(constants.ImportExport(), new BackupManager(), BAKMAN);
        }
        break;

      case 4:
        if (!explorerViewCenterPanel.showIfOpen(ERROR_LOG)) {
          explorerViewCenterPanel.addTab(constants.EventLog(), new LogViewer(), ERROR_LOG);
        }
        break;
      case 5:
        if (!explorerViewCenterPanel.showIfOpen(SECURITY_PERMISSIONS)) {
          explorerViewCenterPanel.addTab(
              constants.UserPermissionMappings(), new PermissionViewer(), SECURITY_PERMISSIONS);
        }
        break;
      case 6:
        Frame aboutInfoFrame = new Frame("../AboutInfo.html"); // NON-NLS

        FormStylePopup aboutPop = new FormStylePopup();
        aboutPop.setWidth(600 + "px");
        aboutPop.setTitle(constants.About());
        String hhurl = GWT.getModuleBaseURL() + "webdav";
        aboutPop.addAttribute(constants.WebDAVURL() + ":", new SmallLabel("<b>" + hhurl + "</b>"));
        aboutPop.addAttribute(constants.Version() + ":", aboutInfoFrame);
        aboutPop.show();
        break;

      case 7:
        if (!explorerViewCenterPanel.showIfOpen(RULE_VERIFIER_MANAGER)) {
          explorerViewCenterPanel.addTab(
              constants.RulesVerificationManager(),
              new RuleVerifierManager(),
              RULE_VERIFIER_MANAGER);
        }
        break;
      case 8:
        if (!explorerViewCenterPanel.showIfOpen(REPOCONFIG))
          explorerViewCenterPanel.addTab(
              constants.RepositoryConfig(), new RepoConfigManager(), REPOCONFIG);
        break;
      case 9:
        if (!explorerViewCenterPanel.showIfOpen(WORKSPACES))
          explorerViewCenterPanel.addTab(
              constants.Workspaces(), new WorkspaceManager(), WORKSPACES);
        break;
      case 10:
        openPerspectivesManager();
        break;
    }
  }