// --- BEGIN COPYRIGHT BLOCK --- // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // // (C) 2007 Red Hat, Inc. // All rights reserved. // --- END COPYRIGHT BLOCK --- package com.netscape.admin.certsrv.config.install; import java.awt.*; import java.util.*; import javax.swing.*; import javax.swing.text.*; import javax.swing.table.*; import com.netscape.admin.certsrv.*; import com.netscape.admin.certsrv.config.*; import com.netscape.admin.certsrv.connection.*; import com.netscape.admin.certsrv.wizard.*; import com.netscape.certsrv.common.*; import com.netscape.admin.certsrv.task.*; import com.netscape.management.client.console.*; /** * This panel asks for the information of the current internal database. * * @author Christine Ho * @version $Revision$, $Date$ * @see com.netscape.admin.certsrv.config.install */ class WILogonAllTokensPage extends WizardBasePanel implements IWizardPanel { private ProfileDataTable mTable; private static final String EMPTYSTR = " "; private static final String PANELNAME = "LOGONALLTOKENSWIZARD"; private static final String HELPINDEX = "install-internaldb-configuration-wizard-help"; WILogonAllTokensPage(JDialog parent) { super(PANELNAME); mParent = parent; init(); } WILogonAllTokensPage(JDialog parent, JFrame adminFrame) { super(PANELNAME); mParent = parent; mAdminFrame = adminFrame; init(); } public boolean isLastPage() { return false; } public boolean initializePanel(WizardInfo info) { setBorder(makeTitledBorder(PANELNAME)); InstallWizardInfo wizardInfo = (InstallWizardInfo)info; String tokenList = wizardInfo.getTokensList(); String tokenLoggedIn = wizardInfo.getTokensLogin(); String tokenInits = wizardInfo.getTokensInit(); StringTokenizer tokenizer = new StringTokenizer(tokenList, ":"); StringTokenizer tokenizerLoggedIn = new StringTokenizer(tokenLoggedIn, ":"); StringTokenizer tokenizerInits = new StringTokenizer(tokenInits, ":"); String loggedIn = ""; String inits = ""; boolean logon = false; Vector defcolNames = new Vector(); defcolNames.addElement("Token Name"); defcolNames.addElement("Password"); Vector defdata = new Vector(); while (tokenizer.hasMoreElements()) { String token = (String)tokenizer.nextElement(); loggedIn = (String)tokenizerLoggedIn.nextElement(); inits = (String)tokenizerInits.nextElement(); // if (loggedIn.equals("false")) { // always logon to the token. if (inits.equals("true")) { Vector v = new Vector(); v.addElement(new JLabel(token)); v.addElement(new JPasswordField()); defdata.addElement(v); logon = true; } //} } ProfilePolicyEditDataModel defmodel = new ProfilePolicyEditDataModel(); defmodel.setInfo(defdata, defcolNames); mTable.setModel(defmodel); return logon; } public boolean validatePanel() { for (int i=0; i