KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > applications > wizards > forms > ApplicationShortcutWizardSummaryForm


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.applications.wizards.forms;
21
22 import java.util.ArrayList JavaDoc;
23 import java.util.Iterator JavaDoc;
24 import java.util.List JavaDoc;
25
26 import javax.servlet.http.HttpServletRequest JavaDoc;
27
28 import org.apache.commons.logging.Log;
29 import org.apache.commons.logging.LogFactory;
30
31 import com.sslexplorer.applications.ApplicationsPlugin;
32 import com.sslexplorer.boot.PropertyList;
33 import com.sslexplorer.policyframework.PolicyDatabaseFactory;
34 import com.sslexplorer.wizard.AbstractWizardSequence;
35 import com.sslexplorer.wizard.forms.DefaultWizardForm;
36
37 /**
38  * <p>
39  * The form for the resource summary.
40  *
41  * @author James D Robinson <a HREF="mailto:james@3sp.com">&lt;james@3sp.com&gt;</a>
42  *
43  */

44 public class ApplicationShortcutWizardSummaryForm extends DefaultWizardForm {
45
46     final static Log log = LogFactory.getLog(ApplicationShortcutWizardSummaryForm.class);
47
48     private String JavaDoc resourceName;
49     private List JavaDoc selectedPolicies;
50
51     /**
52      * Construtor
53      */

54     public ApplicationShortcutWizardSummaryForm() {
55         super(false, true, "/WEB-INF/jsp/content/applications/applicationShortcutWizard/summary.jspf", "previous", true, true,
56                         "applicationShortcutSummary", ApplicationsPlugin.MESSAGE_RESOURCES_KEY, "applicationShortcutWizard.applicationShortcutSummary", 5);
57     }
58
59     /*
60      * (non-Javadoc)
61      *
62      * @see com.sslexplorer.wizard.forms.AbstractWizardForm#init(com.sslexplorer.wizard.AbstractWizardSequence)
63      */

64     public void init(AbstractWizardSequence sequence, HttpServletRequest JavaDoc request) throws Exception JavaDoc {
65         resourceName = (String JavaDoc) sequence.getAttribute(ApplicationShortcutWizardDetailsForm.ATTR_RESOURCE_NAME, null);
66         PropertyList l = (PropertyList) sequence.getAttribute(ApplicationShortcutWizardPolicySelectionForm.ATTR_SELECTED_POLICIES, null);
67         selectedPolicies = new ArrayList JavaDoc();
68         for (Iterator JavaDoc i = l.iterator(); i.hasNext();) {
69             selectedPolicies.add(PolicyDatabaseFactory.getInstance().getPolicy(Integer.parseInt(i.next().toString()))
70                             .getResourceName());
71         }
72     }
73
74     /**
75      * Get the resource name
76      *
77      * @return resource name
78      */

79     public String JavaDoc getResourceName() {
80         return resourceName;
81     }
82
83     /**
84      * Get the selected policies
85      *
86      * @return selected policies
87      */

88     public List JavaDoc getSelectedPolicies() {
89         return selectedPolicies;
90     }
91 }
92
Popular Tags