1 19 20 package com.sslexplorer.properties.forms; 21 22 import java.util.ArrayList ; 23 import java.util.Iterator ; 24 import java.util.List ; 25 26 import javax.servlet.http.HttpSession ; 27 28 import com.sslexplorer.policyframework.ResourceItemModel; 29 import com.sslexplorer.policyframework.forms.AbstractResourcesForm; 30 import com.sslexplorer.properties.PropertyProfile; 31 32 public class ProfilesForm extends AbstractResourcesForm { 33 34 private String profileScope; 35 private String selectedProfile; 36 37 public ProfilesForm() { 38 super("profiles"); 39 } 40 41 public void setProfileScope(String profileScope) { 42 this.profileScope = profileScope; 43 } 44 45 public String getProfileScope() { 46 return profileScope; 47 } 48 49 public void initialize(List globalResources, List personalResources, HttpSession session, int selectedProfile) { 50 super.initialize(globalResources, PropertyProfileItem.class, session, "name"); 51 if(personalResources != null) { 52 for(Iterator i = personalResources.iterator(); i.hasNext(); ) { 53 PropertyProfile p = (PropertyProfile)i.next(); 54 if(p.getOwnerUsername() != null){ 55 getModel().addItem(new PropertyProfileItem(p, new ArrayList ())); 56 } 57 } 58 } 59 this.selectedProfile = String.valueOf(selectedProfile); 60 checkSort(); 61 getPager().rebuild(getFilterText()); 62 } 63 64 public String getSelectedProfile() { 65 return selectedProfile; 66 } 67 68 public void setSelectedProfile(String selectedProfile) { 69 this.selectedProfile = selectedProfile; 70 } 71 72 class PersonalProfilesModel extends ResourceItemModel { 73 74 public PersonalProfilesModel() { 75 super("personalProfiles"); 76 } 77 78 } 79 } 80 | Popular Tags |