示例#1
0
  private void listAdmins() {
    this.getAdminsTable().clearTable();
    getProgressPanel().showProgress("Searching...");
    try {
      GridAdministrationClient client = getSessionPanel().getAdminClient();
      List<String> admins = client.getAdmins();

      for (int i = 0; i < admins.size(); i++) {
        this.getAdminsTable().addAdmin(admins.get(i));
      }
      loaded = true;
      getProgressPanel().stopProgress(admins.size() + " administrator(s) found.");

    } catch (PermissionDeniedFault pdf) {
      ErrorDialog.showError(pdf);
      getProgressPanel().stopProgress("Error");
      log.error(pdf, pdf);
    } catch (Exception e) {
      ErrorDialog.showError(e);
      getProgressPanel().stopProgress("Error");
      FaultUtil.logFault(log, e);
    } finally {
      enableAllButtons();
    }
  }
示例#2
0
  private void addUpdatePrivileges() {
    try {

      String id = Utils.clean(getIdentity().getText());
      if (id == null) {
        ErrorDialog.showError("Please enter a valid identity!!!");
      }
      boolean reload = false;
      StringBuffer sb = new StringBuffer();
      sb.append("Updating the privileges resulted in the following:\n");
      String s1 = addUpdateCreate();
      if (s1 != null) {
        reload = true;
        sb.append(s1 + "\n");
      }
      String s2 = addUpdateStem();
      if (s2 != null) {
        reload = true;
        sb.append(s2);
      }

      dispose();

      if (reload) {
        browser.loadPrivileges();
      }
      GridApplication.getContext().showMessage(sb.toString());
    } catch (Exception e) {
      ErrorDialog.showError(e);
      FaultUtil.logFault(log, e);
    }
  }
  private void findCertificates() {
    try {
      showProgess("Searching...");
      getUserCertificates().clearTable();
      UserCertificateFilter f = new UserCertificateFilter();
      f.setGridIdentity(Utils.clean(getGridIdentity().getText()));
      if (Utils.clean(getUserCertificateSerialNumber().getText()) != null) {
        try {
          f.setSerialNumber(Long.valueOf(Utils.clean(getUserCertificateSerialNumber().getText())));
        } catch (NumberFormatException e) {
          stopProgess("Error");
          enableButtons();
          ErrorDialog.showError("The serial number must be an integer.");
          return;
        }
      }
      if ((searchStartDate != null) && (searchEndDate != null)) {
        if (searchStartDate.after(searchEndDate)) {
          stopProgess("Error");
          enableButtons();
          ErrorDialog.showError("The start date cannot be after the end date.");
          return;
        } else {
          DateRange r = new DateRange();
          r.setStartDate(searchStartDate);
          r.setEndDate(searchEndDate);
          f.setDateRange(r);
        }
      } else if ((searchStartDate == null) && (searchEndDate != null)) {
        stopProgess("Error");
        enableButtons();
        ErrorDialog.showError("You must specify a start date!!!");
        return;
      } else if ((searchStartDate != null) && (searchEndDate == null)) {
        stopProgess("Error");
        enableButtons();
        ErrorDialog.showError("You must specify an end date!!!");
        return;
      }

      f.setNotes(Utils.clean(getNotes().getText()));
      if (getStatus().getSelectedUserStatus() != null) {
        f.setStatus(getStatus().getSelectedUserStatus());
      }
      GridAdministrationClient client = this.session.getAdminClient();
      List<UserCertificateRecord> records = client.findUserCertificateRecords(f);
      getUserCertificates().addUserCertificates(records);
      stopProgess(records.size() + " user certificate(s) found.");
    } catch (Exception e) {
      stopProgess("Error");
      ErrorDialog.showError(Utils.getExceptionMessage(e), e);
      log.error(Utils.getExceptionMessage(e), e);
    }
    enableButtons();
  }
  private void loadNodes() {
    if (node == null) {
      return;
    }

    String endMessage = null;

    if (node.loadedChildStems()) {
      return;
    }

    int id = tree.startEvent("Loading Stems.... ");

    Enumeration<?> children = node.children();
    try {
      while (children.hasMoreElements()) {
        Object child = children.nextElement();

        if (child instanceof StemTreeNode) {
          ((StemTreeNode) child).loadStem(0);
        }
      }
      node.setLoadedChildStems(true);
      endMessage = node.toString() + " Stems Successfully Loaded!!!";
    } catch (Exception e) {
      ErrorDialog.showError(e);
      endMessage = "Error loading stem!!!";
      FaultUtil.logFault(log, e);
    }
    tree.stopEvent(id, endMessage);
  }
  private void getAuthorities() {
    getProgressPanel().showProgress("Searching...");
    this.getAuthorityTable().clearTable();

    try {
      GTSPublicClient client = getSession().getSession().getUserClient();
      AuthorityGTS[] auth = client.getAuthorities();
      int length = 0;
      if (auth != null) {
        length = auth.length;
        for (int i = 0; i < auth.length; i++) {
          this.getAuthorityTable().addAuthority(auth[i]);
        }
      }
      searchDone = true;
      getProgressPanel().stopProgress(length + " authority(s) found.");

    } catch (Exception e) {
      ErrorDialog.showError(e);
      FaultUtil.logFault(log, e);
      getProgressPanel().stopProgress("Error.");
    } finally {
      enableAllActions();
    }
  }
示例#6
0
 public void showAdmin() {
   try {
     GridAdministrationClient client = getSessionPanel().getAdminClient();
     GridUserFilter f = new GridUserFilter();
     f.setGridId(getAdminsTable().getSelectedAdmin());
     List<GridUser> users = client.findUsers(f);
     if ((users == null) || (users.size() == 0)) {
       throw new Exception(
           "The administrator selected does not have an account with this Dorian.");
     } else {
       GridUser user = users.get(0);
       List<TrustedIdP> idps = client.getTrustedIdPs();
       TrustedIdP tidp = null;
       for (int i = 0; i < idps.size(); i++) {
         if (idps.get(i).getId() == user.getIdPId()) {
           tidp = idps.get(i);
           break;
         }
       }
       GridApplication.getContext()
           .addApplicationComponent(
               new UserWindow(getSessionPanel().getSession(), user, tidp), 700, 500);
     }
   } catch (Exception e) {
     ErrorDialog.showError(e);
     FaultUtil.logFault(log, e);
   }
 }
 private void removeAllCertificates() {
   try {
     int selection =
         JOptionPane.showConfirmDialog(
             this, "Are you sure you want to remove all of the listed certificates?");
     if (selection == JOptionPane.YES_OPTION) {
       GridAdministrationClient client = session.getAdminClient();
       int rowCount = getUserCertificates().getRowCount();
       for (int i = 0; i < rowCount; i++) {
         showProgess("Removing certificates...");
         UserCertificateRecord record =
             (UserCertificateRecord) getUserCertificates().getValueAt(0, 0);
         client.removeUserCertificate(record.getSerialNumber());
         getUserCertificates().removeRow(0);
       }
       stopProgess(rowCount + " certificate(s) removed.");
       GridApplication.getContext()
           .showMessage("The listed certificates were successfully removed!!!");
     }
   } catch (Exception e) {
     stopProgess("Error");
     ErrorDialog.showError(e);
     FaultUtil.logFault(log, e);
   }
   enableButtons();
 }
  private void removeCertificate() {
    try {
      int row = getUserCertificates().getSelectedRow();

      if ((row >= 0) && (row < getUserCertificates().getRowCount())) {
        UserCertificateRecord record =
            (UserCertificateRecord) getUserCertificates().getValueAt(row, 0);
        int selection =
            JOptionPane.showConfirmDialog(
                this, "Are you sure you want to remove the selected certificate?");
        if (selection == JOptionPane.YES_OPTION) {
          showProgess("Removing certificate...");
          GridAdministrationClient client = session.getAdminClient();
          client.removeUserCertificate(record.getSerialNumber());
          getUserCertificates().removeRow(row);
          GridApplication.getContext()
              .showMessage("The selected certificates was successfully removed!!!");
          stopProgess("Certificate successfully removed.");
        }
      } else {
        throw new Exception("Please select a certificate!!!");
      }
    } catch (Exception e) {
      ErrorDialog.showError(e);
      stopProgess("Error");
      FaultUtil.logFault(log, e);
    }
    enableButtons();
  }
 public void doubleClick() throws Exception {
   try {
     GridApplication.getContext()
         .addApplicationComponent(new IdentityProviderRecordWindow(getSelectedRecord()), 600, 400);
   } catch (Exception ex) {
     ErrorDialog.showError(ex.getMessage(), ex);
   }
 }
 private void createGallery() {
   String name = this.getGalleryNane().getText();
   if (Utils.clean(name) == null) {
     ErrorDialog.showError("You must specify a gallery name.");
     return;
   }
   try {
     getProgress().showProgress("Creating gallery...");
     PhotoSharingHandle handle = this.root.getServiceHandle();
     handle.createGallery(name);
     this.root.refresh();
     getProgress().stopProgress();
     dispose();
   } catch (Exception e) {
     ErrorDialog.showError(Utils.getExceptionMessage(e), e);
   }
 }
 public void addAuthority() {
   try {
     GridApplication.getContext()
         .addApplicationComponent(new AuthorityWindow(getSession().getSession(), this), 700, 375);
   } catch (Exception e) {
     ErrorDialog.showError(e);
     FaultUtil.logFault(log, e);
   }
 }
示例#12
0
 private void removeAdmin() {
   try {
     GridAdministrationClient client = getSessionPanel().getAdminClient();
     client.removeAdmin(getAdminsTable().getSelectedAdmin());
     getAdminsTable().removeSelectedAdmin();
   } catch (Exception e) {
     ErrorDialog.showError(e);
     FaultUtil.logFault(log, e);
   }
 }
示例#13
0
 public void addAdmin() {
   try {
     AddAdminWindow window = new AddAdminWindow(getSessionPanel());
     window.setModal(true);
     GridApplication.getContext().showDialog(window);
     if (loaded) {
       this.listAdmins();
     }
   } catch (Exception e) {
     ErrorDialog.showError(e);
     FaultUtil.logFault(log, e);
   }
 }
 private void removeAuthority() {
   try {
     getProgressPanel().showProgress("Removing authority...");
     GTSAdminClient client = getSession().getSession().getAdminClient();
     AuthorityGTS gts = this.getAuthorityTable().getSelectedAuthority();
     client.removeAuthority(gts.getServiceURI());
     getAuthorities();
     getProgressPanel().stopProgress("Authority successfully removed.");
   } catch (Exception e) {
     ErrorDialog.showError(e);
     getProgressPanel().stopProgress("Error");
     FaultUtil.logFault(log, e);
   }
 }
  private void updatePriorities() {
    try {

      disableAllActions();
      getProgressPanel().showProgress("Updating priorities...");
      GTSAdminClient client = getSession().getSession().getAdminClient();
      client.updateAuthorityPriorities(getAuthorityTable().getPriorityUpdate());
      getProgressPanel().stopProgress("Successfully updated the priorities.");
    } catch (Exception e) {
      ErrorDialog.showError(e);
      getProgressPanel().stopProgress("Error");
      FaultUtil.logFault(log, e);
    } finally {
      enableAllActions();
    }
  }