KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > cms > applications > managementtool > actions > ViewListSystemUserAction


1 /* ===============================================================================
2  *
3  * Part of the InfoGlue Content Management Platform (www.infoglue.org)
4  *
5  * ===============================================================================
6  *
7  * Copyright (C)
8  *
9  * This program is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License version 2, as published by the
11  * Free Software Foundation. See the file LICENSE.html for more information.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
19  * Place, Suite 330 / Boston, MA 02111-1307 / USA.
20  *
21  * ===============================================================================
22  */

23
24 package org.infoglue.cms.applications.managementtool.actions;
25
26 import java.util.List JavaDoc;
27
28 import org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction;
29 import org.infoglue.cms.controllers.kernel.impl.simple.RoleControllerProxy;
30 import org.infoglue.cms.controllers.kernel.impl.simple.UserControllerProxy;
31
32
33 /**
34  * @author Magnus Güvenal
35  * @author Mattias Bogeblad
36  *
37  * Action class for usecase ViewListSystemUserUCC
38  *
39  */

40
41 public class ViewListSystemUserAction extends InfoGlueAbstractAction
42 {
43     private static final long serialVersionUID = 1L;
44
45     private List JavaDoc infogluePrincipals;
46     
47     private String JavaDoc mode = null;
48     private String JavaDoc filterUserName = null;
49     private String JavaDoc filterFirstName = null;
50     private String JavaDoc filterLastName = null;
51     private String JavaDoc filterEmail = null;
52     private String JavaDoc[] filterRoleNames = null;
53     
54     protected String JavaDoc doExecute() throws Exception JavaDoc
55     {
56         this.filterRoleNames = this.getRequest().getParameterValues("filterRoleName");
57         if(filterFirstName == null && filterLastName == null && filterUserName == null && filterEmail == null && (filterRoleNames == null || filterRoleNames.length == 0 || (filterRoleNames.length == 1 && filterRoleNames[0].equals(""))))
58         {
59             this.infogluePrincipals = UserControllerProxy.getController().getAllUsers();
60         }
61         else
62         {
63             this.infogluePrincipals = UserControllerProxy.getController().getFilteredUsers(this.filterFirstName, this.filterLastName, this.filterUserName, this.filterEmail, filterRoleNames);
64         }
65
66         return "success";
67     }
68
69     public List JavaDoc getRoles() throws Exception JavaDoc
70     {
71         List JavaDoc roles = RoleControllerProxy.getController().getAllRoles();
72         
73         return roles;
74     }
75     
76     public List JavaDoc getInfogluePrincipals()
77     {
78         return this.infogluePrincipals;
79     }
80     
81     public String JavaDoc getFilterEmail()
82     {
83         return filterEmail;
84     }
85
86     public void setFilterEmail(String JavaDoc email)
87     {
88         if(email != null && !email.equals(""))
89             this.filterEmail = email;
90     }
91
92     public String JavaDoc getFilterFirstName()
93     {
94         return filterFirstName;
95     }
96
97     public void setFilterFirstName(String JavaDoc firstName)
98     {
99         if(firstName != null && !firstName.equals(""))
100             this.filterFirstName = firstName;
101     }
102
103     public String JavaDoc getFilterLastName()
104     {
105         return filterLastName;
106     }
107
108     public void setFilterLastName(String JavaDoc lastName)
109     {
110         if(lastName != null && !lastName.equals(""))
111             this.filterLastName = lastName;
112     }
113
114     public String JavaDoc getFilterUserName()
115     {
116         return filterUserName;
117     }
118
119     public void setFilterUserName(String JavaDoc userName)
120     {
121         if(userName != null && !userName.equals(""))
122             this.filterUserName = userName;
123     }
124
125     public String JavaDoc getMode()
126     {
127         return mode;
128     }
129
130     public void setMode(String JavaDoc mode)
131     {
132         this.mode = mode;
133     }
134
135     public String JavaDoc[] getFilterRoleNames()
136     {
137         return filterRoleNames;
138     }
139     
140 }
141
Popular Tags