Exemplo n.º 1
0
  public void display(HttpServletRequest request, HttpServletResponse response, Context context) {
    String errorString = "";
    context.put("title", "CA Information");
    context.put("panel", "admin/console/config/cainfopanel.vm");
    IConfigStore config = CMS.getConfigStore();

    if (isPanelDone()) {
      // TODO - put the selected URL in selection box.
      // String s = config.getString("preop.cainfo.select");
    }

    // get CA URLs
    Vector<String> v;
    try {
      v = null;
      v = ConfigurationUtils.getUrlListFromSecurityDomain(config, "CA", "SecurePort");
      if (v == null) {
        errorString =
            "No CA found.  CA, TKS and optionally DRM "
                + " must be installed prior to TPS installation";
        context.put("errorString", errorString);
        context.put("preop.cainfo.errorString", errorString);
        return;
      }

      config.putString("preop.ca.list", StringUtils.join(v, ","));
      config.commit(false);
    } catch (EBaseException | IOException | SAXException | ParserConfigurationException e) {
      e.printStackTrace();
      errorString = "Failed to get CA information from security domain. " + e;
      context.put("errorString", errorString);
      context.put("preop.cainfo.errorString", errorString);
      return;
    }

    context.put("urls", v);
    context.put("urls_size", v.size());
    context.put("errorString", "");
    context.put("preop.cainfo.errorString", "");
  }
Exemplo n.º 2
0
 public void cleanUp() throws IOException {
   IConfigStore cs = CMS.getConfigStore();
   cs.putString("preop.cainfo.select", "");
 }