// --- 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.util.*; import java.awt.*; import javax.swing.*; import javax.swing.text.*; import javax.swing.table.*; import com.netscape.admin.certsrv.*; import com.netscape.admin.certsrv.connection.*; import com.netscape.admin.certsrv.wizard.*; import com.netscape.admin.certsrv.task.*; import com.netscape.certsrv.common.*; import com.netscape.management.client.console.*; /** * KRA Key recovery for installation wizard: specify the uid and password * for all the available agents * * @author Christine Ho * @version $Revision$, $Date$ * @see com.netscape.admin.certsrv.config.install */ class WIKRAScheme2Page extends WizardBasePanel implements IWizardPanel { private JTable mTable; private NewAgentModel mDataModel; private String mHelpIndex; private static final String PANELNAME = "KRASCHEME2WIZARD"; private static final String KRAHELPINDEX = "install-kra-scheme-usrpwds-wizard-help"; private static final String CAKRAHELPINDEX = "install-cakra-scheme-usrpwds-wizard-help"; private static final String RAKRAHELPINDEX = "install-rakra-scheme-usrpwds-wizard-help"; WIKRAScheme2Page(JDialog parent) { super(PANELNAME); mParent = parent; init(); } WIKRAScheme2Page(JDialog parent, JFrame adminFrame) { super(PANELNAME); mParent = parent; mAdminFrame = adminFrame; init(); } public boolean isLastPage() { return false; } public boolean initializePanel(WizardInfo info) { InstallWizardInfo wizardInfo = (InstallWizardInfo)info; if (!wizardInfo.doKeySplitting()) return false; if (wizardInfo.isCloning()) return false; if (!wizardInfo.isKRAInstalled() || wizardInfo.isKRANMSchemeDone()) return false; String val = wizardInfo.getTotalAgents(); int M = Integer.parseInt(val); mDataModel.removeAllRows(); Vector[] data = new Vector[M]; for (int i=0; i-1)&&(row>-1)) { String str = ((JTextComponent)component).getText(); mTable.setValueAt(str, row, col); } } if(!checkBlank()) { setErrorMessage("CANNOTBEBLANK"); return false; } if(!checkConfirm()) { setErrorMessage("PASSWORDERROR"); return false; } if (!checkDuplicate()) { setErrorMessage("DUPLICATEERROR"); return false; } return true; } private boolean checkBlank() { for (int i=0; i= 1) return true; return false; } }