KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > properties > wizards > forms > ProfileSummaryForm


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.properties.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.boot.PropertyList;
32 import com.sslexplorer.policyframework.PolicyDatabaseFactory;
33 import com.sslexplorer.properties.wizards.actions.ProfileDetailsAction;
34 import com.sslexplorer.security.Constants;
35 import com.sslexplorer.security.User;
36 import com.sslexplorer.wizard.AbstractWizardSequence;
37 import com.sslexplorer.wizard.forms.DefaultWizardForm;
38
39 public class ProfileSummaryForm extends DefaultWizardForm {
40     
41     final static Log log = LogFactory.getLog(ProfileSummaryForm.class);
42
43     // Private statics for sequence attributes
44

45     // Private instance variables
46
private String JavaDoc scope;
47     private User user;
48     private String JavaDoc resourceName;
49     private List JavaDoc selectedPolicies;
50
51     public ProfileSummaryForm() {
52         super(false, true, "/WEB-INF/jsp/content/properties/profileWizard/profileSummary.jspf",
53             "", true, true, "profileSummary", "properties", "profileWizard.profileSummary", 3);
54     }
55
56     /*
57      * (non-Javadoc)
58      *
59      * @see com.sslexplorer.wizard.forms.AbstractWizardForm#init(com.sslexplorer.wizard.AbstractWizardSequence)
60      */

61     public void init(AbstractWizardSequence sequence, HttpServletRequest JavaDoc request) throws Exception JavaDoc {
62         resourceName = (String JavaDoc)sequence.getAttribute(ProfileDetailsForm.ATTR_RESOURCE_NAME, Constants.SCOPE_PERSONAL);
63         PropertyList l = (PropertyList)sequence.getAttribute(ProfilePolicySelectionForm.ATTR_SELECTED_POLICIES, null);
64         selectedPolicies = new ArrayList JavaDoc();
65         for(Iterator JavaDoc i = l.iterator(); i.hasNext(); ) {
66             selectedPolicies.add(PolicyDatabaseFactory.getInstance().getPolicy(Integer.parseInt(i.next().toString())).getResourceName());
67         }
68         scope = (String JavaDoc)sequence.getAttribute(ProfileDetailsAction.ATTR_PROFILE_SCOPE, Constants.SCOPE_PERSONAL);
69         user = sequence.getSession().getUser();
70     }
71
72     /**
73      * @return Returns the name.
74      */

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

82     public List JavaDoc getSelectedPolicies() {
83         return selectedPolicies;
84     }
85
86     /**
87      * @return Returns the scope.
88      */

89     public String JavaDoc getScope() {
90         return scope;
91     }
92
93     /**
94      * @return Returns the user.
95      */

96     public User getUser() {
97         return user;
98     }
99 }
100
Popular Tags