summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/cms/servlet/csadmin/ModulePanel.java
diff options
context:
space:
mode:
Diffstat (limited to 'pki/base/common/src/com/netscape/cms/servlet/csadmin/ModulePanel.java')
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/csadmin/ModulePanel.java89
1 files changed, 43 insertions, 46 deletions
diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/ModulePanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/ModulePanel.java
index 38185a33b..ef9255f30 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/ModulePanel.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/ModulePanel.java
@@ -17,7 +17,6 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cms.servlet.csadmin;
-
import java.io.IOException;
import java.util.Enumeration;
import java.util.Hashtable;
@@ -50,19 +49,20 @@ public class ModulePanel extends WizardPanelBase {
private Vector mOtherModules = null;
private Hashtable mCurrModTable = new Hashtable();
private WizardServlet mServlet = null;
- public ModulePanel() {}
+
+ public ModulePanel() {
+ }
/**
* Initializes this panel.
*/
- public void init(ServletConfig config, int panelno)
- throws ServletException {
+ public void init(ServletConfig config, int panelno) throws ServletException {
setPanelNo(panelno);
setName("Key Store");
}
- public void init(WizardServlet servlet, ServletConfig config, int panelno, String id)
- throws ServletException {
+ public void init(WizardServlet servlet, ServletConfig config, int panelno,
+ String id) throws ServletException {
setPanelNo(panelno);
setName("Key Store");
setId(id);
@@ -71,7 +71,7 @@ public class ModulePanel extends WizardPanelBase {
public void cleanUp() throws IOException {
IConfigStore cs = CMS.getConfigStore();
- cs.putBoolean("preop.ModulePanel.done",false);
+ cs.putBoolean("preop.ModulePanel.done", false);
}
public void loadCurrModTable() {
@@ -87,9 +87,8 @@ public class ModulePanel extends WizardPanelBase {
mCurrModTable.put(mod.getName(), mod);
} // while
} catch (Exception e) {
- CMS.debug(
- "ModulePanel: Exception caught in loadCurrModTable: "
- + e.toString());
+ CMS.debug("ModulePanel: Exception caught in loadCurrModTable: "
+ + e.toString());
System.err.println("Exception caught: " + e.toString());
}
}
@@ -141,15 +140,15 @@ public class ModulePanel extends WizardPanelBase {
CMS.debug("ModulePanel: token nick name=" + token.getName());
CMS.debug("ModulePanel: token logged in?" + token.isLoggedIn());
CMS.debug("ModulePanel: token is present?" + token.isPresent());
- if (!token.getName().equals("Internal Crypto Services Token") &&
- !token.getName().equals("NSS Generic Crypto Services")) {
+ if (!token.getName().equals("Internal Crypto Services Token")
+ && !token.getName().equals(
+ "NSS Generic Crypto Services")) {
module.addToken(token);
} else {
- CMS.debug(
- "ModulePanel: token " + token.getName()
+ CMS.debug("ModulePanel: token " + token.getName()
+ " not to be added");
}
-
+
} catch (TokenException ex) {
CMS.debug("ModulePanel:" + ex.toString());
}
@@ -181,11 +180,11 @@ public class ModulePanel extends WizardPanelBase {
if ((cn == null) || (cn.equals(""))) {
break;
}
-
+
CMS.debug("ModulePanel: got from config module: " + cn);
// create a Module object
Module module = new Module(cn, pn, img);
-
+
if (mCurrModTable.containsKey(cn)) {
CMS.debug("ModulePanel: module found: " + cn);
module.setFound(true);
@@ -194,7 +193,7 @@ public class ModulePanel extends WizardPanelBase {
loadModTokens(module, m);
}
-
+
CMS.debug("ModulePanel: adding module " + cn);
// add module to set
if (!mSupportedModules.contains(module)) {
@@ -203,39 +202,41 @@ public class ModulePanel extends WizardPanelBase {
}// for
} catch (Exception e) {
- CMS.debug(
- "ModulePanel: Exception caught in loadSupportedModules(): "
- + e.toString());
+ CMS.debug("ModulePanel: Exception caught in loadSupportedModules(): "
+ + e.toString());
System.err.println("Exception caught: " + e.toString());
}
}
public PropertySet getUsage() {
- // it a token choice. Available tokens are discovered dynamically so
+ // it a token choice. Available tokens are discovered dynamically so
// can't be a real CHOICE
PropertySet set = new PropertySet();
-
- Descriptor tokenDesc = new Descriptor(IDescriptor.STRING, null, /* no constraint */
- null, /* default parameter */
- "module token selection");
+
+ Descriptor tokenDesc = new Descriptor(IDescriptor.STRING, null, /*
+ * no
+ * constraint
+ */
+ null, /* default parameter */
+ "module token selection");
set.add("choice", tokenDesc);
-
+
return set;
}
public boolean isPanelDone() {
IConfigStore cs = CMS.getConfigStore();
try {
- boolean s = cs.getBoolean("preop.ModulePanel.done",
- false);
+ boolean s = cs.getBoolean("preop.ModulePanel.done", false);
if (s != true) {
return false;
} else {
return true;
}
- } catch (EBaseException e) {}
+ } catch (EBaseException e) {
+ }
return false;
}
@@ -248,8 +249,7 @@ public class ModulePanel extends WizardPanelBase {
* Display the panel.
*/
public void display(HttpServletRequest request,
- HttpServletResponse response,
- Context context) {
+ HttpServletResponse response, Context context) {
CMS.debug("ModulePanel: display()");
context.put("title", "Key Store");
@@ -272,8 +272,8 @@ public class ModulePanel extends WizardPanelBase {
context.put("oms", mOtherModules);
context.put("sms", mSupportedModules);
// context.put("status_token", "None");
- String subpanelno = String.valueOf(getPanelNo()+1);
- CMS.debug("ModulePanel subpanelno =" +subpanelno);
+ String subpanelno = String.valueOf(getPanelNo() + 1);
+ CMS.debug("ModulePanel subpanelno =" + subpanelno);
context.put("subpanelno", subpanelno);
context.put("panel", "admin/console/config/modulepanel.vm");
}
@@ -282,17 +282,15 @@ public class ModulePanel extends WizardPanelBase {
* Checks if the given parameters are valid.
*/
public void validate(HttpServletRequest request,
- HttpServletResponse response,
- Context context) throws IOException {
+ HttpServletResponse response, Context context) throws IOException {
}
/**
* Commit parameter changes
*/
public void update(HttpServletRequest request,
- HttpServletResponse response,
- Context context) throws IOException {
- boolean hasErr = false;
+ HttpServletResponse response, Context context) throws IOException {
+ boolean hasErr = false;
try {
// get the value of the choice
@@ -306,13 +304,13 @@ public class ModulePanel extends WizardPanelBase {
IConfigStore config = CMS.getConfigStore();
String oldtokenname = config.getString("preop.module.token", "");
- if (!oldtokenname.equals(select))
+ if (!oldtokenname.equals(select))
mServlet.cleanUpFromPanel(mServlet.getPanelNo(request));
- if (hasErr == false) {
- config.putString("preop.module.token", select);
- config.putBoolean("preop.ModulePanel.done", true);
- }
+ if (hasErr == false) {
+ config.putString("preop.module.token", select);
+ config.putBoolean("preop.ModulePanel.done", true);
+ }
config.commit(false);
context.put("updateStatus", "success");
} catch (Exception e) {
@@ -326,8 +324,7 @@ public class ModulePanel extends WizardPanelBase {
* If validiate() returns false, this method will be called.
*/
public void displayError(HttpServletRequest request,
- HttpServletResponse response,
- Context context) {
+ HttpServletResponse response, Context context) {
context.put("title", "Security Module");
context.put("panel", "admin/console/config/modulepanel.vm");
}