KickJava   Java API By Example, From Geeks To Geeks.

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


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 org.apache.commons.logging.Log;
25 import org.apache.commons.logging.LogFactory;
26 import org.apache.struts.upload.FormFile;
27
28 import com.sslexplorer.keystore.wizards.AbstractKeyStoreImportType;
29 import com.sslexplorer.keystore.wizards.KeyStoreImportTypeManager;
30 import com.sslexplorer.keystore.wizards.types.ReplyFromCAImportType;
31 import com.sslexplorer.wizard.AbstractWizardSequence;
32 import com.sslexplorer.wizard.forms.DefaultWizardForm;
33
34 /**
35  * Extension of {@link com.sslexplorer.wizard.forms.DefaultWizardForm}
36  * that provides summary information for the key store import wizard.
37  *
38  * @author Brett Smith <a HREF="mailto: brett@3sp.com">&lt;brett@3sp.com&gt;</a>
39  */

40 public class KeyStoreImportSummaryForm extends DefaultWizardForm {
41     
42     final static Log log = LogFactory.getLog(KeyStoreImportSummaryForm.class);
43     
44     // Private instance variables
45
private String JavaDoc type;
46     private String JavaDoc filename;
47     private String JavaDoc alias;
48     private AbstractKeyStoreImportType importType;
49
50     /**
51      * Constructor
52      */

53     public KeyStoreImportSummaryForm() {
54         super(false, true, "/WEB-INF/jsp/content/keystore/keyStoreImportWizard/summary.jspf",
55             "", true, true, "keyStoreImportSummary", "keystore", "keyStoreImportWizard.keyStoreImportSummary", 3);
56     }
57
58     /*
59      * (non-Javadoc)
60      *
61      * @see com.sslexplorer.wizard.forms.AbstractWizardForm#init(com.sslexplorer.wizard.AbstractWizardSequence)
62      */

63     public void init(AbstractWizardSequence sequence, HttpServletRequest JavaDoc request) throws Exception JavaDoc {
64         type = (String JavaDoc)sequence.getAttribute(KeyStoreImportTypeForm.ATTR_TYPE, "");
65         filename = ((FormFile)sequence.getAttribute(KeyStoreImportFileForm.ATTR_FILENAME, "")).getFileName();
66         alias = (String JavaDoc)sequence.getAttribute(KeyStoreImportFileForm.ATTR_ALIAS, "");
67         importType = KeyStoreImportTypeManager.getInstance().getType(
68             (String JavaDoc)sequence.getAttribute(KeyStoreImportTypeForm.ATTR_TYPE, ReplyFromCAImportType.REPLY_FROM_CA));
69     }
70
71     /**
72      * Get the filename upload
73      *
74      * @return uploaded filename
75      */

76     public String JavaDoc getFilename() {
77         return filename;
78     }
79
80     /**
81      * Get the type name of import.
82      *
83      * @return type of import
84      */

85     public String JavaDoc getType() {
86         return type;
87     }
88     
89     /**
90      * Get the alias of the certificate (if provided)
91      *
92      * @return alias
93      */

94     public String JavaDoc getAlias() {
95         return alias;
96     }
97     
98     /**
99      * Get the selected import type
100      *
101      * @return import type
102      */

103     public AbstractKeyStoreImportType getImportType() {
104         return importType;
105     }
106 }
107
Popular Tags