KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > keystore > wizards > forms > KeyStoreImportTypeForm


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.keystore.wizards.forms;
21
22 import javax.servlet.http.HttpServletRequest JavaDoc;
23
24 import com.sslexplorer.keystore.wizards.types.ReplyFromCAImportType;
25 import com.sslexplorer.wizard.AbstractWizardSequence;
26 import com.sslexplorer.wizard.forms.DefaultWizardForm;
27
28 /**
29  * Extension of {@link com.sslexplorer.wizard.forms.DefaultWizardForm} used
30  * in the key store import wizard. Here the administrator selects the type
31  * of import.
32  *
33  * @author Brett Smith <a HREF="mailto: brett@3sp.com">&lt;brett@3sp.com&gt;</a>
34  */

35
36 public class KeyStoreImportTypeForm extends DefaultWizardForm {
37     
38     // Statics for sequence attributes
39

40     /**
41      * Constant for import type wizard sequence attribute
42      */

43     public final static String JavaDoc ATTR_TYPE = "type";
44
45     // Private instance variables
46

47     private String JavaDoc type;
48
49     /**
50      * Constructor.
51      */

52     public KeyStoreImportTypeForm() {
53         super(true, false, "/WEB-INF/jsp/content/keystore/keyStoreImportWizard/type.jspf",
54             "rootServerCertificate", true, false, "keyStoreImportType", "keystore", "keyStoreImportWizard.keyStoreImportType", 1);
55     }
56
57     /* (non-Javadoc)
58      * @see com.sslexplorer.wizard.forms.AbstractWizardForm#init(com.sslexplorer.wizard.AbstractWizardSequence)
59      */

60     public void init(AbstractWizardSequence sequence, HttpServletRequest JavaDoc request) throws Exception JavaDoc {
61         setType((String JavaDoc)sequence.getAttribute(ATTR_TYPE, ReplyFromCAImportType.REPLY_FROM_CA));
62     }
63
64     /**
65      * Get the type of import.
66      *
67      * @return the type of import
68      */

69     public String JavaDoc getType() {
70         return type;
71     }
72
73     /**
74      * Set the type of import.
75      *
76      * @param type the type of import
77      */

78     public void setType(String JavaDoc type) {
79         this.type = type;
80     }
81
82     /* (non-Javadoc)
83      * @see com.sslexplorer.wizard.forms.AbstractWizardForm#apply(com.sslexplorer.wizard.AbstractWizardSequence)
84      */

85     public void apply(AbstractWizardSequence sequence) throws Exception JavaDoc {
86         sequence.putAttribute(ATTR_TYPE, getType());
87     }
88 }
89
Popular Tags