KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > webforwards > webforwardwizard > forms > WebForwardSummaryForm


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.webforwards.webforwardwizard.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 com.sslexplorer.boot.PropertyList;
29 import com.sslexplorer.policyframework.Policy;
30 import com.sslexplorer.policyframework.PolicyDatabaseFactory;
31 import com.sslexplorer.security.User;
32 import com.sslexplorer.webforwards.webforwardwizard.actions.WebForwardSpecificDetailsAction;
33 import com.sslexplorer.wizard.AbstractWizardSequence;
34 import com.sslexplorer.wizard.forms.DefaultWizardForm;
35
36 /**
37  * <p>
38  * The form for the resource summary.
39  *
40  * @author James D Robinson <a HREF="mailto:james@3sp.com">&lt;james@3sp.com&gt;</a>
41  *
42  */

43 public class WebForwardSummaryForm extends DefaultWizardForm {
44     private User user;
45     private String JavaDoc resourceName;
46     private List JavaDoc<String JavaDoc> selectedPolicies;
47 // private int type = -1;
48

49     /**
50      * Construtor
51      */

52     public WebForwardSummaryForm() {
53         super(false, true, "/WEB-INF/jsp/content/webforward/webforwardwizard/webForwardSummary.jspf", "previous", true, true, "webForwardSummary",
54                         "webForwards", "webForwardWizard.webForwardSummary", 6);
55     }
56
57     /*
58      * (non-Javadoc)
59      *
60      * @see com.sslexplorer.wizard.forms.AbstractWizardForm#init(com.sslexplorer.wizard.AbstractWizardSequence)
61      */

62     public void init(AbstractWizardSequence sequence, HttpServletRequest JavaDoc request) throws Exception JavaDoc {
63         resourceName = (String JavaDoc) sequence.getAttribute(WebForwardSpecificDetailsForm.ATTR_RESOURCE_NAME, null);
64         PropertyList l = (PropertyList) sequence.getAttribute(WebForwardPolicySelectionForm.ATTR_SELECTED_POLICIES, null);
65         selectedPolicies = new ArrayList JavaDoc<String JavaDoc>();
66         for (Iterator JavaDoc i = l.iterator(); i.hasNext();) {
67             int policyId = Integer.parseInt(i.next().toString());
68             Policy policy = PolicyDatabaseFactory.getInstance().getPolicy(policyId);
69             selectedPolicies.add(policy.getResourceName());
70         }
71         user = (User) sequence.getAttribute(WebForwardSpecificDetailsAction.ATTR_USER, null);
72     }
73
74     /**
75      * @return Returns the name.
76      */

77     public String JavaDoc getResourceName() {
78         return resourceName;
79     }
80
81     /**
82      * @return Returns the selectedPolicies.
83      */

84     public List JavaDoc getSelectedPolicies() {
85         return selectedPolicies;
86     }
87
88     /**
89      * @return Returns the user.
90      */

91     public User getUser() {
92         return user;
93     }
94 }
Popular Tags