KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > efs > openreports > actions > admin > ListGroupsAction


1 /*
2  * Copyright (C) 2002 Erik Swenson - eswenson@opensourcesoft.net
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */

19
20 package org.efs.openreports.actions.admin;
21
22 import java.util.List JavaDoc;
23
24 import com.opensymphony.xwork.ActionSupport;
25
26 import org.efs.openreports.providers.GroupProvider;
27 import org.efs.openreports.providers.GroupProviderAware;
28 import org.efs.openreports.providers.ProviderException;
29
30 public class ListGroupsAction extends ActionSupport implements GroupProviderAware
31 {
32     private List JavaDoc reportGroups;
33     
34     private GroupProvider groupProvider;
35     
36     public List JavaDoc getReportGroups()
37     {
38         return reportGroups;
39     }
40
41     public String JavaDoc execute()
42     {
43         try
44         {
45             reportGroups = groupProvider.getReportGroups();
46         }
47         catch(ProviderException pe)
48         {
49             addActionError(pe.getMessage());
50             return ERROR;
51         }
52         
53         return SUCCESS;
54     }
55     
56     public void setGroupProvider(GroupProvider groupProvider)
57     {
58         this.groupProvider = groupProvider;
59     }
60
61 }
Popular Tags