KickJava   Java API By Example, From Geeks To Geeks.

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


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.ArrayList JavaDoc;
27 import java.util.List JavaDoc;
28
29 import org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction;
30 import org.infoglue.cms.controllers.kernel.impl.simple.ContentTypeDefinitionController;
31 import org.infoglue.cms.controllers.kernel.impl.simple.GroupControllerProxy;
32 import org.infoglue.cms.controllers.kernel.impl.simple.GroupPropertiesController;
33 import org.infoglue.cms.controllers.kernel.impl.simple.UserControllerProxy;
34 import org.infoglue.cms.entities.management.ContentTypeDefinitionVO;
35 import org.infoglue.cms.security.InfoGlueGroup;
36
37 public class ViewGroupAction extends InfoGlueAbstractAction
38 {
39     private static final long serialVersionUID = 1L;
40
41     private String JavaDoc groupName;
42     private boolean supportsUpdate = true;
43     private InfoGlueGroup infoGlueGroup;
44     private List JavaDoc infoGluePrincipals = new ArrayList JavaDoc();
45     private List JavaDoc assignedInfoGluePrincipals;
46     private List JavaDoc contentTypeDefinitionVOList;
47     private List JavaDoc assignedContentTypeDefinitionVOList;
48     
49     protected void initialize(String JavaDoc groupName) throws Exception JavaDoc
50     {
51         //this.supportsUpdate = GroupControllerProxy.getController().getSupportUpdate();
52
this.infoGlueGroup = GroupControllerProxy.getController().getGroup(groupName);
53         this.supportsUpdate = this.infoGlueGroup.getAutorizationModule().getSupportUpdate();
54         this.assignedInfoGluePrincipals = this.infoGlueGroup.getAutorizationModule().getGroupUsers(groupName);
55         if(this.supportsUpdate) //Only fetch if the user can edit.
56
this.infoGluePrincipals = this.infoGlueGroup.getAutorizationModule().getUsers();
57         
58         this.contentTypeDefinitionVOList = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOList(ContentTypeDefinitionVO.EXTRANET_GROUP_PROPERTIES);
59         this.assignedContentTypeDefinitionVOList = GroupPropertiesController.getController().getContentTypeDefinitionVOList(groupName);
60     }
61
62     public String JavaDoc doExecute() throws Exception JavaDoc
63     {
64         this.initialize(getGroupName());
65         
66         return "success";
67     }
68         
69     public String JavaDoc getGroupName()
70     {
71         return groupName;
72     }
73
74     public void setGroupName(String JavaDoc groupName)
75     {
76         this.groupName = groupName;
77     }
78             
79     public java.lang.String JavaDoc getDescription()
80     {
81         return this.infoGlueGroup.getDescription();
82     }
83         
84     public List JavaDoc getAllInfoGluePrincipals() throws Exception JavaDoc
85     {
86         return this.infoGluePrincipals;
87     }
88     
89     public List JavaDoc getAssignedInfoGluePrincipals() throws Exception JavaDoc
90     {
91         return this.assignedInfoGluePrincipals;
92     }
93
94     public List JavaDoc getAssignedContentTypeDefinitionVOList()
95     {
96         return assignedContentTypeDefinitionVOList;
97     }
98
99     public List JavaDoc getContentTypeDefinitionVOList()
100     {
101         return contentTypeDefinitionVOList;
102     }
103
104     public void setAssignedContentTypeDefinitionVOList(List JavaDoc list)
105     {
106         assignedContentTypeDefinitionVOList = list;
107     }
108
109     public void setContentTypeDefinitionVOList(List JavaDoc list)
110     {
111         contentTypeDefinitionVOList = list;
112     }
113
114     public boolean getSupportsUpdate()
115     {
116         return this.supportsUpdate;
117     }
118 }
119
Popular Tags